From sabre at nondot.org Mon Apr 16 00:59:08 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 00:59:08 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/CBackend/2005-07-14-NegationToMinusMinus.ll Message-ID: <200704160559.l3G5x8hH016661@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/CBackend: 2005-07-14-NegationToMinusMinus.ll updated: 1.4 -> 1.5 --- Log message: fix incorrectly upgraded test, add PR# --- Diffs of the changes: (+2 -3) 2005-07-14-NegationToMinusMinus.ll | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/test/CodeGen/CBackend/2005-07-14-NegationToMinusMinus.ll diff -u llvm/test/CodeGen/CBackend/2005-07-14-NegationToMinusMinus.ll:1.4 llvm/test/CodeGen/CBackend/2005-07-14-NegationToMinusMinus.ll:1.5 --- llvm/test/CodeGen/CBackend/2005-07-14-NegationToMinusMinus.ll:1.4 Sun Apr 15 18:00:46 2007 +++ llvm/test/CodeGen/CBackend/2005-07-14-NegationToMinusMinus.ll Mon Apr 16 00:58:47 2007 @@ -1,7 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | not grep -- -65535 -; XFAIL: * +; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | not grep -- --65535 +; PR596 -; ModuleID = '' target endian = little target pointersize = 32 target triple = "i686-pc-linux-gnu" From sabre at nondot.org Mon Apr 16 01:04:23 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 01:04:23 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2003-07-22-ArrayAccessTypeSafety.c.tr Message-ID: <200704160604.l3G64Nhc016806@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2003-07-22-ArrayAccessTypeSafety.c.tr updated: 1.5 -> 1.6 --- Log message: update test --- Diffs of the changes: (+1 -2) 2003-07-22-ArrayAccessTypeSafety.c.tr | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/test/CFrontend/2003-07-22-ArrayAccessTypeSafety.c.tr diff -u llvm/test/CFrontend/2003-07-22-ArrayAccessTypeSafety.c.tr:1.5 llvm/test/CFrontend/2003-07-22-ArrayAccessTypeSafety.c.tr:1.6 --- llvm/test/CFrontend/2003-07-22-ArrayAccessTypeSafety.c.tr:1.5 Sun Apr 15 18:00:46 2007 +++ llvm/test/CFrontend/2003-07-22-ArrayAccessTypeSafety.c.tr Mon Apr 16 01:04:03 2007 @@ -1,5 +1,4 @@ -/* RUN: %llvmgcc -xc %s -c -o - | llvm-dis | not grep cast - XFAIL: * +/* RUN: %llvmgcc -xc %s -S -o - | grep -v alloca | not grep bitcast */ void test(int* array, long long N) { From lattner at cs.uiuc.edu Mon Apr 16 01:07:03 2007 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 16 Apr 2007 01:07:03 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2002-11-07-Redefinition.c Message-ID: <200704160607.l3G673rf016903@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2002-11-07-Redefinition.c (r1.3) removed --- Log message: remove a bogus test --- Diffs of the changes: (+0 -0) 0 files changed From sabre at nondot.org Mon Apr 16 01:11:08 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 01:11:08 -0500 Subject: [llvm-commits] CVS: llvm/test/C++Frontend/2007-04-11-InlineStorageClassC++.cpp Message-ID: <200704160611.l3G6B8qI017047@zion.cs.uiuc.edu> Changes in directory llvm/test/C++Frontend: 2007-04-11-InlineStorageClassC++.cpp updated: 1.3 -> 1.4 --- Log message: fix incorrectly upgraded test --- Diffs of the changes: (+1 -2) 2007-04-11-InlineStorageClassC++.cpp | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/test/C++Frontend/2007-04-11-InlineStorageClassC++.cpp diff -u llvm/test/C++Frontend/2007-04-11-InlineStorageClassC++.cpp:1.3 llvm/test/C++Frontend/2007-04-11-InlineStorageClassC++.cpp:1.4 --- llvm/test/C++Frontend/2007-04-11-InlineStorageClassC++.cpp:1.3 Sun Apr 15 18:00:46 2007 +++ llvm/test/C++Frontend/2007-04-11-InlineStorageClassC++.cpp Mon Apr 16 01:10:47 2007 @@ -6,13 +6,12 @@ // RUN: grep xWeaknoinline | grep weak | wc -l | grep 1 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \ // RUN: grep xWeakextnoinline | grep weak | wc -l | grep 1 -// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep declare | \ +// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \ // RUN: grep xglobnoWeak | grep linkonce | wc -l | grep 1 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \ // RUN: grep xstatnoWeak | grep internal | wc -l | grep 1 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \ // RUN: grep xextnoWeak | grep linkonce | wc -l | grep 1 -// XFAIL: * inline int xglobWeak(int) __attribute__((weak)); inline int xglobWeak (int i) { return i*2; From sabre at nondot.org Mon Apr 16 01:14:50 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 01:14:50 -0500 Subject: [llvm-commits] CVS: llvm/test/C++Frontend/2004-09-27-CompilerCrash.cpp Message-ID: <200704160614.l3G6EoiN017140@zion.cs.uiuc.edu> Changes in directory llvm/test/C++Frontend: 2004-09-27-CompilerCrash.cpp updated: 1.4 -> 1.5 --- Log message: make this test more portable. --- Diffs of the changes: (+1 -6) 2004-09-27-CompilerCrash.cpp | 7 +------ 1 files changed, 1 insertion(+), 6 deletions(-) Index: llvm/test/C++Frontend/2004-09-27-CompilerCrash.cpp diff -u llvm/test/C++Frontend/2004-09-27-CompilerCrash.cpp:1.4 llvm/test/C++Frontend/2004-09-27-CompilerCrash.cpp:1.5 --- llvm/test/C++Frontend/2004-09-27-CompilerCrash.cpp:1.4 Sun Apr 15 18:00:46 2007 +++ llvm/test/C++Frontend/2004-09-27-CompilerCrash.cpp Mon Apr 16 01:14:28 2007 @@ -1,5 +1,4 @@ // RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null -// XFAIL: * struct Pass {} ; template @@ -7,11 +6,7 @@ void foo(Pass *(*C)()); -#include -#include -#include -#include // For allocator. -#include +#include bool foo(std::string &X) { return X.empty(); From reid at x10sys.com Mon Apr 16 01:52:42 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 01:52:42 -0500 Subject: [llvm-commits] CVS: llvm/test/Assembler/2007-04-15-BadIntrinsic.ll Message-ID: <200704160652.l3G6qg1v017880@zion.cs.uiuc.edu> Changes in directory llvm/test/Assembler: 2007-04-15-BadIntrinsic.ll added (r1.1) --- Log message: Test case for PR1328: http://llvm.org/PR1328 . --- Diffs of the changes: (+9 -0) 2007-04-15-BadIntrinsic.ll | 9 +++++++++ 1 files changed, 9 insertions(+) Index: llvm/test/Assembler/2007-04-15-BadIntrinsic.ll diff -c /dev/null llvm/test/Assembler/2007-04-15-BadIntrinsic.ll:1.1 *** /dev/null Mon Apr 16 01:52:31 2007 --- llvm/test/Assembler/2007-04-15-BadIntrinsic.ll Mon Apr 16 01:52:21 2007 *************** *** 0 **** --- 1,9 ---- + ; RUN: llvm-as < %s -o /dev/null -f |& grep {Call to invalid LLVM intrinsic} + + declare i32 @llvm.foobar(i32 %foo) + + define i32 @test() { + %nada = call i32 @llvm.foobar(i32 0) + ret i32 %nada + } + From reid at x10sys.com Mon Apr 16 01:54:56 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 01:54:56 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Function.h Message-ID: <200704160654.l3G6suRv017938@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Function.h updated: 1.74 -> 1.75 --- Log message: For PR1328: http://llvm.org/PR1328 : Don't assert everytime an intrinsic name isn't recognized. Instead, make the assert optional when callin getIntrinsicID(). This allows the assembler to handle invalid intrinsic names gracefully. --- Diffs of the changes: (+1 -1) Function.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Function.h diff -u llvm/include/llvm/Function.h:1.74 llvm/include/llvm/Function.h:1.75 --- llvm/include/llvm/Function.h:1.74 Fri Apr 13 13:12:09 2007 +++ llvm/include/llvm/Function.h Mon Apr 16 01:54:34 2007 @@ -103,7 +103,7 @@ /// The particular intrinsic functions which correspond to this value are /// defined in llvm/Intrinsics.h. /// - unsigned getIntrinsicID() const; + unsigned getIntrinsicID(bool noAssert = false) const; bool isIntrinsic() const { return getIntrinsicID() != 0; } /// getCallingConv()/setCallingConv(uint) - These method get and set the From reid at x10sys.com Mon Apr 16 01:55:04 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 01:55:04 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/IntrinsicEmitter.cpp Message-ID: <200704160655.l3G6t4PN017950@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: IntrinsicEmitter.cpp updated: 1.30 -> 1.31 --- Log message: For PR1328: http://llvm.org/PR1328 : Don't assert everytime an intrinsic name isn't recognized. Instead, make the assert optional when callin getIntrinsicID(). This allows the assembler to handle invalid intrinsic names gracefully. --- Diffs of the changes: (+0 -2) IntrinsicEmitter.cpp | 2 -- 1 files changed, 2 deletions(-) Index: llvm/utils/TableGen/IntrinsicEmitter.cpp diff -u llvm/utils/TableGen/IntrinsicEmitter.cpp:1.30 llvm/utils/TableGen/IntrinsicEmitter.cpp:1.31 --- llvm/utils/TableGen/IntrinsicEmitter.cpp:1.30 Sun Apr 1 02:20:02 2007 +++ llvm/utils/TableGen/IntrinsicEmitter.cpp Mon Apr 16 01:54:34 2007 @@ -103,8 +103,6 @@ << Ints[I->second].EnumName << ";\n"; } OS << " }\n"; - OS << " // The 'llvm.' namespace is reserved!\n"; - OS << " assert(0 && \"Unknown LLVM intrinsic function!\");\n"; OS << "#endif\n\n"; } From reid at x10sys.com Mon Apr 16 01:55:05 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 01:55:05 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Message-ID: <200704160655.l3G6t5uT017955@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Function.cpp updated: 1.118 -> 1.119 --- Log message: For PR1328: http://llvm.org/PR1328 : Don't assert everytime an intrinsic name isn't recognized. Instead, make the assert optional when callin getIntrinsicID(). This allows the assembler to handle invalid intrinsic names gracefully. --- Diffs of the changes: (+4 -3) Function.cpp | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.118 llvm/lib/VMCore/Function.cpp:1.119 --- llvm/lib/VMCore/Function.cpp:1.118 Tue Apr 10 21:44:19 2007 +++ llvm/lib/VMCore/Function.cpp Mon Apr 16 01:54:34 2007 @@ -224,20 +224,21 @@ /// particular intrinsic functions which correspond to this value are defined in /// llvm/Intrinsics.h. /// -unsigned Function::getIntrinsicID() const { +unsigned Function::getIntrinsicID(bool noAssert) const { const ValueName *ValName = this->getValueName(); unsigned Len = ValName->getKeyLength(); const char *Name = ValName->getKeyData(); - if (Len < 5 || Name[4] != '.' || Name[0] != 'l' || Name[1] != 'l' + if (Len <= 5 || Name[4] != '.' || Name[0] != 'l' || Name[1] != 'l' || Name[2] != 'v' || Name[3] != 'm') return 0; // All intrinsics start with 'llvm.' - assert(Len != 5 && "'llvm.' is an invalid intrinsic name!"); + assert((Len != 5 || noAssert) && "'llvm.' is an invalid intrinsic name!"); #define GET_FUNCTION_RECOGNIZER #include "llvm/Intrinsics.gen" #undef GET_FUNCTION_RECOGNIZER + assert(noAssert && "Invalid LLVM intrinsic name"); return 0; } From reid at x10sys.com Mon Apr 16 01:56:03 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 01:56:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y Message-ID: <200704160656.l3G6u3KV017978@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.339 -> 1.340 --- Log message: For PR1328: http://llvm.org/PR1328 : Use the new parameter on Function::getIntrinsicID to identify cases where a function is being called with an "llvm." name but it isn't actually an intrinsic. In such cases generate an error. --- Diffs of the changes: (+8 -0) llvmAsmParser.y | 8 ++++++++ 1 files changed, 8 insertions(+) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.339 llvm/lib/AsmParser/llvmAsmParser.y:1.340 --- llvm/lib/AsmParser/llvmAsmParser.y:1.339 Thu Apr 12 13:32:50 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y Mon Apr 16 01:55:42 2007 @@ -2821,6 +2821,14 @@ Value *V = getVal(PFTy, $4); // Get the function we're calling... CHECK_FOR_ERROR + // Check for call to invalid intrinsic to avoid crashing later. + if (Function *theF = dyn_cast(V)) { + if (theF->hasName() && 0 == strncmp(theF->getName().c_str(), "llvm.", 5)&& + !theF->getIntrinsicID(true)) + GEN_ERROR("Call to invalid LLVM intrinsic function '" + + theF->getName() + "'"); + } + // Check the arguments ValueList Args; if ($6->empty()) { // Has no arguments? From reid at x10sys.com Mon Apr 16 01:56:28 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 01:56:28 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y.cvs Message-ID: <200704160656.l3G6uSUq018008@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp.cvs updated: 1.84 -> 1.85 llvmAsmParser.h.cvs updated: 1.65 -> 1.66 llvmAsmParser.y.cvs updated: 1.85 -> 1.86 --- Log message: Regenerate. --- Diffs of the changes: (+1048 -1206) llvmAsmParser.cpp.cvs | 2206 +++++++++++++++++++++++--------------------------- llvmAsmParser.h.cvs | 40 llvmAsmParser.y.cvs | 8 3 files changed, 1048 insertions(+), 1206 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.84 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.85 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.84 Thu Apr 12 13:32:50 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Mon Apr 16 01:56:07 2007 @@ -1,9 +1,7 @@ -/* A Bison parser, made by GNU Bison 2.3. */ +/* A Bison parser, made by GNU Bison 2.1. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,21 +18,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ +/* Written by Richard Stallman by simplifying the original so called + ``semantic'' parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local @@ -47,7 +37,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.3" +#define YYBISON_VERSION "2.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -346,7 +336,7 @@ /* Copy the first part of user declarations. */ -#line 14 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 14 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1289,10 +1279,9 @@ # define YYTOKEN_TABLE 0 #endif -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 938 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#line 938 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -1337,10 +1326,9 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} -/* Line 193 of yacc.c. */ -#line 1343 "llvmAsmParser.tab.c" - YYSTYPE; +} YYSTYPE; +/* Line 196 of yacc.c. */ +#line 1332 "llvmAsmParser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -1351,56 +1339,23 @@ /* Copy the second part of user declarations. */ -/* Line 216 of yacc.c. */ -#line 1356 "llvmAsmParser.tab.c" +/* Line 219 of yacc.c. */ +#line 1344 "llvmAsmParser.tab.c" -#ifdef short -# undef short +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ #endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t #endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; +#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t #endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int #endif -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS @@ -1413,32 +1368,7 @@ # endif #endif -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE +#if ! defined (yyoverflow) || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -1446,76 +1376,64 @@ # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif +# define YYINCLUDED_STDLIB_H # endif # endif # endif # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif +# ifdef __cplusplus +extern "C" { # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif +# ifdef __cplusplus +} +# endif # endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ +#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss; + short int yyss; YYSTYPE yyvs; }; @@ -1525,13 +1443,13 @@ /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ +# if defined (__GNUC__) && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else @@ -1542,7 +1460,7 @@ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif @@ -1560,22 +1478,28 @@ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ - while (YYID (0)) + while (0) #endif -/* YYFINAL -- State number of the termination state. */ +#if defined (__STDC__) || defined (__cplusplus) + typedef signed char yysigned_char; +#else + typedef short int yysigned_char; +#endif + +/* YYFINAL -- State number of the termination state. */ #define YYFINAL 39 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 1317 -/* YYNTOKENS -- Number of terminals. */ +/* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 149 -/* YYNNTS -- Number of nonterminals. */ +/* YYNNTS -- Number of nonterminals. */ #define YYNNTS 79 -/* YYNRULES -- Number of rules. */ +/* YYNRULES -- Number of rules. */ #define YYNRULES 288 -/* YYNRULES -- Number of states. */ +/* YYNRULES -- Number of states. */ #define YYNSTATES 563 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ @@ -1586,7 +1510,7 @@ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = +static const unsigned char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -1632,7 +1556,7 @@ #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const yytype_uint16 yyprhs[] = +static const unsigned short int yyprhs[] = { 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, @@ -1665,8 +1589,8 @@ 870, 871, 875, 882, 886, 893, 896, 901, 908 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const short int yyrhs[] = { 190, 0, -1, 68, -1, 69, -1, 70, -1, 71, -1, 72, -1, 73, -1, 74, -1, 75, -1, 76, @@ -1763,7 +1687,7 @@ }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = +static const unsigned short int yyrline[] = { 0, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1094, 1094, 1094, 1094, 1094, 1094, 1095, 1095, 1095, @@ -1792,14 +1716,14 @@ 2396, 2405, 2414, 2423, 2427, 2432, 2436, 2440, 2445, 2455, 2474, 2483, 2559, 2563, 2570, 2581, 2594, 2604, 2615, 2625, 2634, 2643, 2646, 2647, 2654, 2658, 2663, 2684, 2701, 2715, - 2729, 2741, 2749, 2756, 2762, 2768, 2774, 2789, 2861, 2866, - 2870, 2877, 2884, 2892, 2899, 2907, 2915, 2929, 2946 + 2729, 2741, 2749, 2756, 2762, 2768, 2774, 2789, 2869, 2874, + 2878, 2885, 2892, 2900, 2907, 2915, 2923, 2937, 2954 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL", @@ -1847,7 +1771,7 @@ # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = +static const unsigned short int yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, @@ -1868,7 +1792,7 @@ # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = +static const unsigned char yyr1[] = { 0, 149, 150, 150, 150, 150, 150, 150, 150, 150, 150, 151, 151, 151, 151, 151, 151, 152, 152, 152, @@ -1902,7 +1826,7 @@ }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = +static const unsigned char yyr2[] = { 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1938,7 +1862,7 @@ /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ -static const yytype_uint16 yydefact[] = +static const unsigned short int yydefact[] = { 67, 58, 64, 59, 65, 185, 183, 0, 0, 0, 0, 0, 0, 76, 0, 67, 181, 78, 81, 0, @@ -1999,8 +1923,8 @@ 254, 0, 251 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const short int yydefgoto[] = { -1, 239, 240, 241, 265, 282, 139, 140, 71, 480, 11, 72, 13, 36, 37, 38, 43, 49, 115, 304, @@ -2015,7 +1939,7 @@ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -476 -static const yytype_int16 yypact[] = +static const short int yypact[] = { 28, -476, -476, -476, -476, -476, -476, -10, -55, 8, -33, 97, 3, 55, 167, 394, -476, 172, 210, 86, @@ -2077,7 +2001,7 @@ }; /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = +static const short int yypgoto[] = { -476, 389, 392, 397, 292, 306, -153, -476, 0, 10, 435, 4, -476, -476, -476, 87, -476, -476, -145, -295, @@ -2094,7 +2018,7 @@ number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -181 -static const yytype_int16 yytable[] = +static const short int yytable[] = { 10, 74, 253, 242, 12, 96, 243, 311, 358, 252, 252, 254, 375, 352, 285, 10, 375, 147, 445, 12, @@ -2230,7 +2154,7 @@ 0, 0, 68, 0, 0, 69, 0, 324 }; -static const yytype_int16 yycheck[] = +static const short int yycheck[] = { 0, 25, 155, 141, 0, 4, 141, 215, 284, 11, 11, 156, 307, 254, 178, 15, 311, 24, 401, 15, @@ -2368,7 +2292,7 @@ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = +static const unsigned char yystos[] = { 0, 16, 17, 19, 20, 26, 27, 46, 49, 53, 157, 159, 160, 161, 190, 191, 192, 194, 193, 47, @@ -2454,7 +2378,7 @@ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ + YYPOPSTACK; \ goto yybackup; \ } \ else \ @@ -2462,7 +2386,7 @@ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ -while (YYID (0)) +while (0) #define YYTERROR 1 @@ -2477,7 +2401,7 @@ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ - if (YYID (N)) \ + if (N) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ @@ -2491,7 +2415,7 @@ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ - while (YYID (0)) + while (0) #endif @@ -2503,8 +2427,8 @@ # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif @@ -2531,96 +2455,36 @@ do { \ if (yydebug) \ YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); +} while (0) - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yysymprint (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +#if defined (__STDC__) || defined (__cplusplus) static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +yy_stack_print (short int *bottom, short int *top) #else static void yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; + short int *bottom; + short int *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) + for (/* Nothing. */; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -2629,45 +2493,37 @@ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +#if defined (__STDC__) || defined (__cplusplus) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +yy_reduce_print (int yyrule) #else static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; +yy_reduce_print (yyrule) int yyrule; #endif { - int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); - } + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", + yyrule - 1, yylno); + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) + yy_reduce_print (Rule); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -2701,44 +2557,42 @@ #if YYERROR_VERBOSE # ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H +# if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T +# if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) -#else -static YYSIZE_T +# else yystrlen (yystr) - const char *yystr; -#endif + const char *yystr; +# endif { - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) + const char *yys = yystr; + + while (*yys++ != '\0') continue; - return yylen; + + return yys - yystr - 1; } # endif # endif # ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * +# if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) -#else -static char * +# else yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif + char *yydest; + const char *yysrc; +# endif { char *yyd = yydest; const char *yys = yysrc; @@ -2764,7 +2618,7 @@ { if (*yystr == '"') { - YYSIZE_T yyn = 0; + size_t yyn = 0; char const *yyp = yystr; for (;;) @@ -2799,123 +2653,53 @@ } # endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; +#endif /* YYERROR_VERBOSE */ - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; + - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); +#if YYDEBUG +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } +#if defined (__STDC__) || defined (__cplusplus) +static void +yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) +#else +static void +yysymprint (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - if (yysize_overflow) - return YYSIZE_MAXIMUM; - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + switch (yytype) + { + default: + break; } + YYFPRINTF (yyoutput, ")"); } -#endif /* YYERROR_VERBOSE */ - +#endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +#if defined (__STDC__) || defined (__cplusplus) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else @@ -2926,7 +2710,8 @@ YYSTYPE *yyvaluep; #endif { - YYUSE (yyvaluep); + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; if (!yymsg) yymsg = "Deleting"; @@ -2936,7 +2721,7 @@ { default: - break; + break; } } @@ -2944,13 +2729,13 @@ /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus +# if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM); -#else +# else int yyparse (); -#endif +# endif #else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus +#if defined (__STDC__) || defined (__cplusplus) int yyparse (void); #else int yyparse (); @@ -2975,18 +2760,14 @@ `----------*/ #ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM) +# else +int yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +# endif #else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +#if defined (__STDC__) || defined (__cplusplus) int yyparse (void) #else @@ -3004,12 +2785,6 @@ int yyerrstatus; /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif /* Three stacks and their tools: `yyss': related to states, @@ -3020,9 +2795,9 @@ to reallocate them elsewhere. */ /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; + short int yyssa[YYINITDEPTH]; + short int *yyss = yyssa; + short int *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; @@ -3031,7 +2806,7 @@ -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) +#define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; @@ -3040,9 +2815,9 @@ YYSTYPE yyval; - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ + int yylen; YYDPRINTF ((stderr, "Starting parse\n")); @@ -3066,7 +2841,8 @@ `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ + have just been pushed. so pushing a state here evens the stacks. + */ yyssp++; yysetstate: @@ -3079,11 +2855,11 @@ #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of + /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; + short int *yyss1 = yyss; /* Each stack pointer address is followed by the size of the @@ -3111,7 +2887,7 @@ yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; + short int *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) @@ -3146,10 +2922,12 @@ `-----------*/ yybackup: - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ +/* Do appropriate processing given the current state. */ +/* Read a look-ahead token if we need one and don't already have one. */ +/* yyresume: */ /* First try to decide what to do without reference to look-ahead token. */ + yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; @@ -3191,21 +2969,22 @@ if (yyn == YYFINAL) YYACCEPT; - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token unless it is eof. */ + /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; - yystate = yyn; *++yyvsp = yylval; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + yystate = yyn; goto yynewstate; @@ -3241,150 +3020,150 @@ switch (yyn) { case 29: -#line 1099 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1099 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} break; case 30: -#line 1099 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1099 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} break; case 31: -#line 1100 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1100 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} break; case 32: -#line 1100 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1100 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} break; case 33: -#line 1101 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1101 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} break; case 34: -#line 1101 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1101 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} break; case 35: -#line 1102 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1102 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} break; case 36: -#line 1102 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1102 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} break; case 37: -#line 1103 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1103 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} break; case 38: -#line 1103 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1103 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} break; case 39: -#line 1107 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1107 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} break; case 40: -#line 1107 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1107 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} break; case 41: -#line 1108 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1108 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} break; case 42: -#line 1108 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1108 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} break; case 43: -#line 1109 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1109 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} break; case 44: -#line 1109 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1109 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} break; case 45: -#line 1110 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1110 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} break; case 46: -#line 1110 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1110 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} break; case 47: -#line 1111 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1111 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} break; case 48: -#line 1111 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1111 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} break; case 49: -#line 1112 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1112 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} break; case 50: -#line 1112 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1112 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} break; case 51: -#line 1113 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1113 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} break; case 52: -#line 1113 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1113 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} break; case 53: -#line 1114 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1114 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} break; case 54: -#line 1115 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1115 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} break; case 61: -#line 1124 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1124 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 62: -#line 1128 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1128 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); + (yyval.StrVal) = (yyvsp[-1].StrVal); CHECK_FOR_ERROR ;} break; case 63: -#line 1132 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1132 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3392,15 +3171,15 @@ break; case 66: -#line 1139 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1139 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); + (yyval.StrVal) = (yyvsp[-1].StrVal); CHECK_FOR_ERROR ;} break; case 67: -#line 1143 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1143 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3408,198 +3187,198 @@ break; case 68: -#line 1149 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 69: -#line 1150 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1150 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 70: -#line 1151 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1151 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 71: -#line 1152 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1152 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 72: -#line 1153 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1153 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 73: -#line 1157 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1157 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 74: -#line 1158 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1158 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 75: -#line 1159 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1159 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 76: -#line 1163 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1163 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 77: -#line 1164 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1164 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} break; case 78: -#line 1168 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1168 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 79: -#line 1169 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1169 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 80: -#line 1170 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1170 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 81: -#line 1174 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1174 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 82: -#line 1175 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1175 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 83: -#line 1176 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1176 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 84: -#line 1177 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1177 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 85: -#line 1178 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1178 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 86: -#line 1181 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1181 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 87: -#line 1182 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1182 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 88: -#line 1183 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1183 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Fast; ;} break; case 89: -#line 1184 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1184 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Cold; ;} break; case 90: -#line 1185 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1185 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} break; case 91: -#line 1186 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1186 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} break; case 92: -#line 1187 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1187 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) + if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) GEN_ERROR("Calling conv too large"); - (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); + (yyval.UIntVal) = (yyvsp[0].UInt64Val); CHECK_FOR_ERROR ;} break; case 93: -#line 1194 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1194 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 94: -#line 1195 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1195 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 95: -#line 1196 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1196 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::InReg; ;} break; case 96: -#line 1197 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1197 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} break; case 97: -#line 1200 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1200 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 98: -#line 1201 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1201 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); + (yyval.ParamAttrs) = (yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs); ;} break; case 99: -#line 1206 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1206 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} break; case 100: -#line 1207 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1207 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} break; case 102: -#line 1211 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1211 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 103: -#line 1212 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1212 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); + (yyval.ParamAttrs) = (yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs); ;} break; case 104: -#line 1219 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1219 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 105: -#line 1220 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1220 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); + (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) GEN_ERROR("Alignment must be a power of two"); CHECK_FOR_ERROR @@ -3607,14 +3386,14 @@ break; case 106: -#line 1226 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1226 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 107: -#line 1227 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1227 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); + (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) GEN_ERROR("Alignment must be a power of two"); CHECK_FOR_ERROR @@ -3622,57 +3401,57 @@ break; case 108: -#line 1235 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1235 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - for (unsigned i = 0, e = strlen((yyvsp[(2) - (2)].StrVal)); i != e; ++i) - if ((yyvsp[(2) - (2)].StrVal)[i] == '"' || (yyvsp[(2) - (2)].StrVal)[i] == '\\') + for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i) + if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\') GEN_ERROR("Invalid character in section name"); - (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); + (yyval.StrVal) = (yyvsp[0].StrVal); CHECK_FOR_ERROR ;} break; case 109: -#line 1243 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1243 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 110: -#line 1244 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} +#line 1244 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = (yyvsp[0].StrVal); ;} break; case 111: -#line 1249 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1249 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" {;} break; case 112: -#line 1250 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1250 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" {;} break; case 113: -#line 1251 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1251 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - CurGV->setSection((yyvsp[(1) - (1)].StrVal)); - free((yyvsp[(1) - (1)].StrVal)); + CurGV->setSection((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); CHECK_FOR_ERROR ;} break; case 114: -#line 1256 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1256 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) + if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val))) GEN_ERROR("Alignment must be a power of two"); - CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val)); + CurGV->setAlignment((yyvsp[0].UInt64Val)); CHECK_FOR_ERROR ;} break; case 119: -#line 1272 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1272 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR @@ -3680,39 +3459,39 @@ break; case 120: -#line 1276 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1276 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); + (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); CHECK_FOR_ERROR ;} break; case 121: -#line 1280 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1280 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Pointer type? - if (*(yyvsp[(1) - (2)].TypeVal) == Type::LabelTy) + if (*(yyvsp[-1].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (2)].TypeVal)))); - delete (yyvsp[(1) - (2)].TypeVal); + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[-1].TypeVal)))); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 122: -#line 1287 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1287 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... - const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); + const Type* tmp = getTypeVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR (yyval.TypeVal) = new PATypeHolder(tmp); ;} break; case 123: -#line 1292 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1292 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Type UpReference - if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); + if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder - UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector... + UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[0].UInt64Val), OT)); // Add to vector... (yyval.TypeVal) = new PATypeHolder(OT); UR_OUT("New Upreference!\n"); CHECK_FOR_ERROR @@ -3720,14 +3499,14 @@ break; case 124: -#line 1300 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1300 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { std::vector Params; ParamAttrsList Attrs; - if ((yyvsp[(5) - (5)].ParamAttrs) != ParamAttr::None) - Attrs.addAttributes(0, (yyvsp[(5) - (5)].ParamAttrs)); + if ((yyvsp[0].ParamAttrs) != ParamAttr::None) + Attrs.addAttributes(0, (yyvsp[0].ParamAttrs)); unsigned index = 1; - TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end(); + TypeWithAttrsList::iterator I = (yyvsp[-2].TypeWithAttrsList)->begin(), E = (yyvsp[-2].TypeWithAttrsList)->end(); for (; I != E; ++I, ++index) { const Type *Ty = I->Ty->get(); Params.push_back(Ty); @@ -3741,22 +3520,22 @@ ParamAttrsList *ActualAttrs = 0; if (!Attrs.empty()) ActualAttrs = new ParamAttrsList(Attrs); - FunctionType *FT = FunctionType::get(*(yyvsp[(1) - (5)].TypeVal), Params, isVarArg, ActualAttrs); - delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list - delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle + FunctionType *FT = FunctionType::get(*(yyvsp[-4].TypeVal), Params, isVarArg, ActualAttrs); + delete (yyvsp[-2].TypeWithAttrsList); // Delete the argument list + delete (yyvsp[-4].TypeVal); // Delete the return type handle (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); CHECK_FOR_ERROR ;} break; case 125: -#line 1326 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1326 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { std::vector Params; ParamAttrsList Attrs; - if ((yyvsp[(5) - (5)].ParamAttrs) != ParamAttr::None) - Attrs.addAttributes(0, (yyvsp[(5) - (5)].ParamAttrs)); - TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end(); + if ((yyvsp[0].ParamAttrs) != ParamAttr::None) + Attrs.addAttributes(0, (yyvsp[0].ParamAttrs)); + TypeWithAttrsList::iterator I = (yyvsp[-2].TypeWithAttrsList)->begin(), E = (yyvsp[-2].TypeWithAttrsList)->end(); unsigned index = 1; for ( ; I != E; ++I, ++index) { const Type* Ty = I->Ty->get(); @@ -3772,54 +3551,54 @@ if (!Attrs.empty()) ActualAttrs = new ParamAttrsList(Attrs); - FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg, ActualAttrs); - delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list + FunctionType *FT = FunctionType::get((yyvsp[-4].PrimType), Params, isVarArg, ActualAttrs); + delete (yyvsp[-2].TypeWithAttrsList); // Delete the argument list (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); CHECK_FOR_ERROR ;} break; case 126: -#line 1353 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1353 "/proj/llvm/llvm-2/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); + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val)))); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 127: -#line 1358 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1358 "/proj/llvm/llvm-2/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)) + const llvm::Type* ElemTy = (yyvsp[-1].TypeVal)->get(); + if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) GEN_ERROR("Unsigned result not equal to signed result"); if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger()) GEN_ERROR("Element type of a VectorType must be primitive"); - if (!isPowerOf2_32((yyvsp[(2) - (5)].UInt64Val))) + if (!isPowerOf2_32((yyvsp[-3].UInt64Val))) GEN_ERROR("Vector length should be a power of 2"); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); - delete (yyvsp[(4) - (5)].TypeVal); + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val)))); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 128: -#line 1370 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1370 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector Elements; - for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), - E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I) + for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(), + E = (yyvsp[-1].TypeList)->end(); I != E; ++I) Elements.push_back(*I); (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); - delete (yyvsp[(2) - (3)].TypeList); + delete (yyvsp[-1].TypeList); CHECK_FOR_ERROR ;} break; case 129: -#line 1380 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1380 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); CHECK_FOR_ERROR @@ -3827,21 +3606,21 @@ break; case 130: -#line 1384 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1384 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { std::vector Elements; - for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), - E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I) + for (std::list::iterator I = (yyvsp[-2].TypeList)->begin(), + E = (yyvsp[-2].TypeList)->end(); I != E; ++I) Elements.push_back(*I); (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); - delete (yyvsp[(3) - (5)].TypeList); + delete (yyvsp[-2].TypeList); CHECK_FOR_ERROR ;} break; case 131: -#line 1394 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1394 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); CHECK_FOR_ERROR @@ -3849,52 +3628,52 @@ break; case 132: -#line 1401 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1401 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal); - (yyval.TypeWithAttrs).Attrs = (yyvsp[(2) - (2)].ParamAttrs); + (yyval.TypeWithAttrs).Ty = (yyvsp[-1].TypeVal); + (yyval.TypeWithAttrs).Attrs = (yyvsp[0].ParamAttrs); ;} break; case 133: -#line 1408 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1408 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); - if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType()) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); + if (!(*(yyvsp[0].TypeVal))->isFirstClassType()) GEN_ERROR("LLVM functions cannot return aggregate types"); - (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal); + (yyval.TypeVal) = (yyvsp[0].TypeVal); ;} break; case 134: -#line 1415 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1415 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); ;} break; case 135: -#line 1420 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1420 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); - (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); + (yyval.TypeWithAttrsList)->push_back((yyvsp[0].TypeWithAttrs)); CHECK_FOR_ERROR ;} break; case 136: -#line 1425 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1425 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); + ((yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList))->push_back((yyvsp[0].TypeWithAttrs)); CHECK_FOR_ERROR ;} break; case 138: -#line 1433 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1433 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); + (yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); (yyval.TypeWithAttrsList)->push_back(TWA); @@ -3903,7 +3682,7 @@ break; case 139: -#line 1440 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1440 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; @@ -3914,7 +3693,7 @@ break; case 140: -#line 1447 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1447 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR @@ -3922,155 +3701,155 @@ break; case 141: -#line 1455 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1455 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); - (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); - delete (yyvsp[(1) - (1)].TypeVal); + (yyval.TypeList)->push_back(*(yyvsp[0].TypeVal)); + delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR ;} break; case 142: -#line 1461 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1461 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); - delete (yyvsp[(3) - (3)].TypeVal); + ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(*(yyvsp[0].TypeVal)); + delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR ;} break; case 143: -#line 1473 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1473 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); + const ArrayType *ATy = dyn_cast((yyvsp[-3].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'"); + (*(yyvsp[-3].TypeVal))->getDescription() + "'"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size()) + if (NumElements != -1 && NumElements != (int)(yyvsp[-1].ConstVector)->size()) GEN_ERROR("Type mismatch: constant sized array initialized with " + - utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " + + utostr((yyvsp[-1].ConstVector)->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()) + for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { + if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'."); + (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); } - (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector)); - delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); + (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[-1].ConstVector)); + delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR ;} break; case 144: -#line 1501 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1501 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'"); + (*(yyvsp[-2].TypeVal))->getDescription() + "'"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) GEN_ERROR("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +""); (yyval.ConstVal) = ConstantArray::get(ATy, std::vector()); - delete (yyvsp[(1) - (3)].TypeVal); + delete (yyvsp[-2].TypeVal); CHECK_FOR_ERROR ;} break; case 145: -#line 1517 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1517 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'"); + (*(yyvsp[-2].TypeVal))->getDescription() + "'"); int NumElements = ATy->getNumElements(); const Type *ETy = ATy->getElementType(); - char *EndStr = UnEscapeLexed((yyvsp[(3) - (3)].StrVal), true); - if (NumElements != -1 && NumElements != (EndStr-(yyvsp[(3) - (3)].StrVal))) + char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); + if (NumElements != -1 && NumElements != (EndStr-(yyvsp[0].StrVal))) GEN_ERROR("Can't build string constant of size " + - itostr((int)(EndStr-(yyvsp[(3) - (3)].StrVal))) + + itostr((int)(EndStr-(yyvsp[0].StrVal))) + " when array has size " + itostr(NumElements) + ""); std::vector Vals; if (ETy == Type::Int8Ty) { - for (unsigned char *C = (unsigned char *)(yyvsp[(3) - (3)].StrVal); + for (unsigned char *C = (unsigned char *)(yyvsp[0].StrVal); C != (unsigned char*)EndStr; ++C) Vals.push_back(ConstantInt::get(ETy, *C)); } else { - free((yyvsp[(3) - (3)].StrVal)); + free((yyvsp[0].StrVal)); GEN_ERROR("Cannot build string arrays of non byte sized elements"); } - free((yyvsp[(3) - (3)].StrVal)); + free((yyvsp[0].StrVal)); (yyval.ConstVal) = ConstantArray::get(ATy, Vals); - delete (yyvsp[(1) - (3)].TypeVal); + delete (yyvsp[-2].TypeVal); CHECK_FOR_ERROR ;} break; case 146: -#line 1546 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1546 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); - const VectorType *PTy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); + const VectorType *PTy = dyn_cast((yyvsp[-3].TypeVal)->get()); if (PTy == 0) GEN_ERROR("Cannot make packed constant with type: '" + - (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'"); + (*(yyvsp[-3].TypeVal))->getDescription() + "'"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size()) + if (NumElements != -1 && NumElements != (int)(yyvsp[-1].ConstVector)->size()) GEN_ERROR("Type mismatch: constant sized packed initialized with " + - utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " + + utostr((yyvsp[-1].ConstVector)->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()) + for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { + if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'."); + (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); } - (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector)); - delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); + (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[-1].ConstVector)); + delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR ;} break; case 147: -#line 1574 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1574 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); + const StructType *STy = dyn_cast((yyvsp[-3].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'"); + (*(yyvsp[-3].TypeVal))->getDescription() + "'"); - if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes()) + if ((yyvsp[-1].ConstVector)->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i) - if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = (yyvsp[-1].ConstVector)->size(); i != e; ++i) + if ((*(yyvsp[-1].ConstVector))[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -4080,21 +3859,21 @@ if (STy->isPacked()) GEN_ERROR("Unpacked Initializer to vector type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector)); - delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); + (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[-1].ConstVector)); + delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR ;} break; case 148: -#line 1599 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1599 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - const StructType *STy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + const StructType *STy = dyn_cast((yyvsp[-2].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'"); + (*(yyvsp[-2].TypeVal))->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type"); @@ -4104,25 +3883,25 @@ GEN_ERROR("Unpacked Initializer to vector type '" + STy->getDescription() + "'"); (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); - delete (yyvsp[(1) - (3)].TypeVal); + delete (yyvsp[-2].TypeVal); CHECK_FOR_ERROR ;} break; case 149: -#line 1618 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1618 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); + const StructType *STy = dyn_cast((yyvsp[-5].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'"); + (*(yyvsp[-5].TypeVal))->getDescription() + "'"); - if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes()) + if ((yyvsp[-2].ConstVector)->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i) - if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = (yyvsp[-2].ConstVector)->size(); i != e; ++i) + if ((*(yyvsp[-2].ConstVector))[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -4133,21 +3912,21 @@ GEN_ERROR("Vector initializer to non-vector type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector)); - delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector); + (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[-2].ConstVector)); + delete (yyvsp[-5].TypeVal); delete (yyvsp[-2].ConstVector); CHECK_FOR_ERROR ;} break; case 150: -#line 1644 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1644 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription()); - const StructType *STy = dyn_cast((yyvsp[(1) - (5)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); + const StructType *STy = dyn_cast((yyvsp[-4].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'"); + (*(yyvsp[-4].TypeVal))->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type"); @@ -4158,44 +3937,44 @@ STy->getDescription() + "'"); (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); - delete (yyvsp[(1) - (5)].TypeVal); + delete (yyvsp[-4].TypeVal); CHECK_FOR_ERROR ;} break; case 151: -#line 1664 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1664 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - const PointerType *PTy = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal)->get()); if (PTy == 0) GEN_ERROR("Cannot make null pointer constant with type: '" + - (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'"); + (*(yyvsp[-1].TypeVal))->getDescription() + "'"); (yyval.ConstVal) = ConstantPointerNull::get(PTy); - delete (yyvsp[(1) - (2)].TypeVal); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 152: -#line 1676 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1676 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get()); - delete (yyvsp[(1) - (2)].TypeVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + (yyval.ConstVal) = UndefValue::get((yyvsp[-1].TypeVal)->get()); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 153: -#line 1683 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1683 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - const PointerType *Ty = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + const PointerType *Ty = dyn_cast((yyvsp[-1].TypeVal)->get()); if (Ty == 0) GEN_ERROR("Global const reference must be a pointer type"); @@ -4209,7 +3988,7 @@ Function *SavedCurFn = CurFun.CurrentFunction; CurFun.CurrentFunction = 0; - Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal)); + Value *V = getExistingVal(Ty, (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR CurFun.CurrentFunction = SavedCurFn; @@ -4224,16 +4003,16 @@ // First check to see if the forward references value is already created! PerModuleInfo::GlobalRefsType::iterator I = - CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal))); + CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[0].ValIDVal))); if (I != CurModule.GlobalRefs.end()) { V = I->second; // Placeholder already exists, use it... - (yyvsp[(2) - (2)].ValIDVal).destroy(); + (yyvsp[0].ValIDVal).destroy(); } else { std::string Name; - if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName) - Name = (yyvsp[(2) - (2)].ValIDVal).Name; - else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID) + if ((yyvsp[0].ValIDVal).Type == ValID::GlobalName) + Name = (yyvsp[0].ValIDVal).Name; + else if ((yyvsp[0].ValIDVal).Type != ValID::GlobalID) GEN_ERROR("Invalid reference to global"); // Create the forward referenced global. @@ -4249,287 +4028,287 @@ } // Keep track of the fact that we have a forward ref to recycle it - CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV)); + CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[0].ValIDVal)), GV)); V = GV; } } (yyval.ConstVal) = cast(V); - delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle + delete (yyvsp[-1].TypeVal); // Free the type handle CHECK_FOR_ERROR ;} break; case 154: -#line 1749 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1749 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType()) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + if ((yyvsp[-1].TypeVal)->get() != (yyvsp[0].ConstVal)->getType()) GEN_ERROR("Mismatched types for constant expression: " + - (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription()); - (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal); - delete (yyvsp[(1) - (2)].TypeVal); + (*(yyvsp[-1].TypeVal))->getDescription() + " and " + (yyvsp[0].ConstVal)->getType()->getDescription()); + (yyval.ConstVal) = (yyvsp[0].ConstVal); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 155: -#line 1759 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1759 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get(); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + const Type *Ty = (yyvsp[-1].TypeVal)->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) GEN_ERROR("Cannot create a null initialized value of this type"); (yyval.ConstVal) = Constant::getNullValue(Ty); - delete (yyvsp[(1) - (2)].TypeVal); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 156: -#line 1769 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1769 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) + if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); - (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true); + (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val), true); CHECK_FOR_ERROR ;} break; case 157: -#line 1775 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1775 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants - uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); - if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { + uint32_t BitWidth = cast((yyvsp[-1].PrimType))->getBitWidth(); + if ((yyvsp[0].APIntVal)->getBitWidth() > BitWidth) { GEN_ERROR("Constant value does not fit in type"); } - (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth); - (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal)); - delete (yyvsp[(2) - (2)].APIntVal); + (yyvsp[0].APIntVal)->sextOrTrunc(BitWidth); + (yyval.ConstVal) = ConstantInt::get(*(yyvsp[0].APIntVal)); + delete (yyvsp[0].APIntVal); CHECK_FOR_ERROR ;} break; case 158: -#line 1785 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1785 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) + if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); - (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false); + (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val), false); CHECK_FOR_ERROR ;} break; case 159: -#line 1791 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1791 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants - uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); - if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { + uint32_t BitWidth = cast((yyvsp[-1].PrimType))->getBitWidth(); + if ((yyvsp[0].APIntVal)->getBitWidth() > BitWidth) { GEN_ERROR("Constant value does not fit in type"); } - (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth); - (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal)); - delete (yyvsp[(2) - (2)].APIntVal); + (yyvsp[0].APIntVal)->zextOrTrunc(BitWidth); + (yyval.ConstVal) = ConstantInt::get(*(yyvsp[0].APIntVal)); + delete (yyvsp[0].APIntVal); CHECK_FOR_ERROR ;} break; case 160: -#line 1801 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1801 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Boolean constants - assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); + assert(cast((yyvsp[-1].PrimType))->getBitWidth() == 1 && "Not Bool?"); (yyval.ConstVal) = ConstantInt::getTrue(); CHECK_FOR_ERROR ;} break; case 161: -#line 1806 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1806 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Boolean constants - assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); + assert(cast((yyvsp[-1].PrimType))->getBitWidth() == 1 && "Not Bool?"); (yyval.ConstVal) = ConstantInt::getFalse(); CHECK_FOR_ERROR ;} break; case 162: -#line 1811 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1811 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Float & Double constants - if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].FPVal))) + if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].FPVal))) GEN_ERROR("Floating point constant invalid for type"); - (yyval.ConstVal) = ConstantFP::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].FPVal)); + (yyval.ConstVal) = ConstantFP::get((yyvsp[-1].PrimType), (yyvsp[0].FPVal)); CHECK_FOR_ERROR ;} break; case 163: -#line 1819 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1819 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); - Constant *Val = (yyvsp[(3) - (6)].ConstVal); - const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); - if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + Constant *Val = (yyvsp[-3].ConstVal); + const Type *DestTy = (yyvsp[-1].TypeVal)->get(); + if (!CastInst::castIsValid((yyvsp[-5].CastOpVal), (yyvsp[-3].ConstVal), DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'"); - (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy); - delete (yyvsp[(5) - (6)].TypeVal); + (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[-5].CastOpVal), (yyvsp[-3].ConstVal), DestTy); + delete (yyvsp[-1].TypeVal); ;} break; case 164: -#line 1831 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1831 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) + if (!isa((yyvsp[-2].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); const Type *IdxTy = - GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), &(*(yyvsp[(4) - (5)].ValueList))[0], (yyvsp[(4) - (5)].ValueList)->size(), + GetElementPtrInst::getIndexedType((yyvsp[-2].ConstVal)->getType(), &(*(yyvsp[-1].ValueList))[0], (yyvsp[-1].ValueList)->size(), true); if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr"); SmallVector IdxVec; - for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i) - if (Constant *C = dyn_cast((*(yyvsp[(4) - (5)].ValueList))[i])) + for (unsigned i = 0, e = (yyvsp[-1].ValueList)->size(); i != e; ++i) + if (Constant *C = dyn_cast((*(yyvsp[-1].ValueList))[i])) IdxVec.push_back(C); else GEN_ERROR("Indices to constant getelementptr must be constants"); - delete (yyvsp[(4) - (5)].ValueList); + delete (yyvsp[-1].ValueList); - (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size()); + (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[-2].ConstVal), &IdxVec[0], IdxVec.size()); CHECK_FOR_ERROR ;} break; case 165: -#line 1853 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1853 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) + if ((yyvsp[-5].ConstVal)->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); - if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType()) + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("Select operand types must match"); - (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; case 166: -#line 1861 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1861 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("Binary operator types must match"); CHECK_FOR_ERROR; - (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); ;} break; case 167: -#line 1867 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1867 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("Logical operator types must match"); - if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) { - if (Instruction::isShift((yyvsp[(1) - (6)].BinaryOpVal)) || !isa((yyvsp[(3) - (6)].ConstVal)->getType()) || - !cast((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger()) + if (!(yyvsp[-3].ConstVal)->getType()->isInteger()) { + if (Instruction::isShift((yyvsp[-5].BinaryOpVal)) || !isa((yyvsp[-3].ConstVal)->getType()) || + !cast((yyvsp[-3].ConstVal)->getType())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } - (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; case 168: -#line 1878 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1878 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("icmp operand types must match"); - (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[-5].IPredicate), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); ;} break; case 169: -#line 1883 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1883 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("fcmp operand types must match"); - (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[-5].FPredicate), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); ;} break; case 170: -#line 1888 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1888 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) + if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid extractelement operands"); - (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; case 171: -#line 1894 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1894 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) + if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid insertelement operands"); - (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; case 172: -#line 1900 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1900 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) + if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid shufflevector operands"); - (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); + (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; case 173: -#line 1909 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1909 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); + ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); CHECK_FOR_ERROR ;} break; case 174: -#line 1913 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1913 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector) = new std::vector(); - (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); + (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); CHECK_FOR_ERROR ;} break; case 175: -#line 1921 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1921 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 176: -#line 1921 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1921 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 177: -#line 1924 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1924 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 178: -#line 1924 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1924 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 179: -#line 1935 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1935 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -4538,7 +4317,7 @@ break; case 180: -#line 1940 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1940 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -4547,12 +4326,12 @@ break; case 183: -#line 1953 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1953 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = false; ;} break; case 184: -#line 1953 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1953 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { CurFun.FunctionDone(); CHECK_FOR_ERROR @@ -4560,29 +4339,29 @@ break; case 185: -#line 1957 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1957 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; case 186: -#line 1957 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1957 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 187: -#line 1960 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1960 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 188: -#line 1963 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1963 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: // @@ -4592,84 +4371,84 @@ // If types are not resolved eagerly, then the two types will not be // determined to be the same type! // - ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal)); + ResolveTypeTo((yyvsp[-2].StrVal), *(yyvsp[0].TypeVal)); - if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) { + if (!setTypeName(*(yyvsp[0].TypeVal), (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal)); + CurModule.Types.push_back(*(yyvsp[0].TypeVal)); } - delete (yyvsp[(3) - (3)].TypeVal); + delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR ;} break; case 189: -#line 1987 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1987 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); + ResolveTypeTo((yyvsp[-2].StrVal), (yyvsp[0].PrimType)); - if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) { + if (!setTypeName((yyvsp[0].PrimType), (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType)); + CurModule.Types.push_back((yyvsp[0].PrimType)); } CHECK_FOR_ERROR ;} break; case 190: -#line 1998 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1998 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { /* "Externally Visible" Linkage */ - if ((yyvsp[(5) - (5)].ConstVal) == 0) + if ((yyvsp[0].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable((yyvsp[(1) - (5)].StrVal), GlobalValue::ExternalLinkage, - (yyvsp[(2) - (5)].Visibility), (yyvsp[(4) - (5)].BoolVal), (yyvsp[(5) - (5)].ConstVal)->getType(), (yyvsp[(5) - (5)].ConstVal), (yyvsp[(3) - (5)].BoolVal)); + CurGV = ParseGlobalVariable((yyvsp[-4].StrVal), GlobalValue::ExternalLinkage, + (yyvsp[-3].Visibility), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal), (yyvsp[-2].BoolVal)); CHECK_FOR_ERROR ;} break; case 191: -#line 2005 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2005 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 192: -#line 2008 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2008 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(6) - (6)].ConstVal) == 0) + if ((yyvsp[0].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), (yyvsp[(2) - (6)].Linkage), (yyvsp[(3) - (6)].Visibility), (yyvsp[(5) - (6)].BoolVal), (yyvsp[(6) - (6)].ConstVal)->getType(), (yyvsp[(6) - (6)].ConstVal), (yyvsp[(4) - (6)].BoolVal)); + CurGV = ParseGlobalVariable((yyvsp[-5].StrVal), (yyvsp[-4].Linkage), (yyvsp[-3].Visibility), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal), (yyvsp[-2].BoolVal)); CHECK_FOR_ERROR ;} break; case 193: -#line 2013 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2013 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 194: -#line 2016 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2016 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (6)].TypeVal))->getDescription()); - CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), (yyvsp[(2) - (6)].Linkage), (yyvsp[(3) - (6)].Visibility), (yyvsp[(5) - (6)].BoolVal), *(yyvsp[(6) - (6)].TypeVal), 0, (yyvsp[(4) - (6)].BoolVal)); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); + CurGV = ParseGlobalVariable((yyvsp[-5].StrVal), (yyvsp[-4].Linkage), (yyvsp[-3].Visibility), (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0, (yyvsp[-2].BoolVal)); CHECK_FOR_ERROR - delete (yyvsp[(6) - (6)].TypeVal); + delete (yyvsp[0].TypeVal); ;} break; case 195: -#line 2022 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2022 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR @@ -4677,26 +4456,26 @@ break; case 196: -#line 2026 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2026 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 197: -#line 2029 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2029 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 198: -#line 2035 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2035 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); - char *EndStr = UnEscapeLexed((yyvsp[(1) - (1)].StrVal), true); - std::string NewAsm((yyvsp[(1) - (1)].StrVal), EndStr); - free((yyvsp[(1) - (1)].StrVal)); + char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); + std::string NewAsm((yyvsp[0].StrVal), EndStr); + free((yyvsp[0].StrVal)); if (AsmSoFar.empty()) CurModule.CurrentModule->setModuleInlineAsm(NewAsm); @@ -4707,68 +4486,68 @@ break; case 199: -#line 2048 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2048 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - CurModule.CurrentModule->setTargetTriple((yyvsp[(3) - (3)].StrVal)); - free((yyvsp[(3) - (3)].StrVal)); + CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); ;} break; case 200: -#line 2052 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2052 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - CurModule.CurrentModule->setDataLayout((yyvsp[(3) - (3)].StrVal)); - free((yyvsp[(3) - (3)].StrVal)); + CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); ;} break; case 202: -#line 2059 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2059 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - CurModule.CurrentModule->addLibrary((yyvsp[(3) - (3)].StrVal)); - free((yyvsp[(3) - (3)].StrVal)); + CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); CHECK_FOR_ERROR ;} break; case 203: -#line 2064 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2064 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - CurModule.CurrentModule->addLibrary((yyvsp[(1) - (1)].StrVal)); - free((yyvsp[(1) - (1)].StrVal)); + CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); CHECK_FOR_ERROR ;} break; case 204: -#line 2069 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2069 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 205: -#line 2078 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2078 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); - if (*(yyvsp[(3) - (5)].TypeVal) == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + if (*(yyvsp[-2].TypeVal) == Type::VoidTy) GEN_ERROR("void typed arguments are invalid"); - ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal); - (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList); - (yyvsp[(1) - (5)].ArgList)->push_back(E); + ArgListEntry E; E.Attrs = (yyvsp[-1].ParamAttrs); E.Ty = (yyvsp[-2].TypeVal); E.Name = (yyvsp[0].StrVal); + (yyval.ArgList) = (yyvsp[-4].ArgList); + (yyvsp[-4].ArgList)->push_back(E); CHECK_FOR_ERROR ;} break; case 206: -#line 2088 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2088 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - if (*(yyvsp[(1) - (3)].TypeVal) == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + if (*(yyvsp[-2].TypeVal) == Type::VoidTy) GEN_ERROR("void typed arguments are invalid"); - ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal); + ArgListEntry E; E.Attrs = (yyvsp[-1].ParamAttrs); E.Ty = (yyvsp[-2].TypeVal); E.Name = (yyvsp[0].StrVal); (yyval.ArgList) = new ArgListType; (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR @@ -4776,17 +4555,17 @@ break; case 207: -#line 2099 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2099 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); + (yyval.ArgList) = (yyvsp[0].ArgList); CHECK_FOR_ERROR ;} break; case 208: -#line 2103 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2103 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); + (yyval.ArgList) = (yyvsp[-2].ArgList); struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; @@ -4797,7 +4576,7 @@ break; case 209: -#line 2112 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2112 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new ArgListType; struct ArgListEntry E; @@ -4810,7 +4589,7 @@ break; case 210: -#line 2121 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2121 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR @@ -4818,24 +4597,24 @@ break; case 211: -#line 2127 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2127 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - UnEscapeLexed((yyvsp[(3) - (9)].StrVal)); - std::string FunctionName((yyvsp[(3) - (9)].StrVal)); - free((yyvsp[(3) - (9)].StrVal)); // Free strdup'd memory! + UnEscapeLexed((yyvsp[-6].StrVal)); + std::string FunctionName((yyvsp[-6].StrVal)); + free((yyvsp[-6].StrVal)); // Free strdup'd memory! // Check the function result for abstractness if this is a define. We should // have no abstract types at this point - if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (9)].TypeVal))) - GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (9)].TypeVal)->get()->getDescription()); + if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[-7].TypeVal))) + GEN_ERROR("Reference to abstract result: "+ (yyvsp[-7].TypeVal)->get()->getDescription()); std::vector ParamTypeList; ParamAttrsList ParamAttrs; - if ((yyvsp[(7) - (9)].ParamAttrs) != ParamAttr::None) - ParamAttrs.addAttributes(0, (yyvsp[(7) - (9)].ParamAttrs)); - if ((yyvsp[(5) - (9)].ArgList)) { // If there are arguments... + if ((yyvsp[-2].ParamAttrs) != ParamAttr::None) + ParamAttrs.addAttributes(0, (yyvsp[-2].ParamAttrs)); + if ((yyvsp[-4].ArgList)) { // If there are arguments... unsigned index = 1; - for (ArgListType::iterator I = (yyvsp[(5) - (9)].ArgList)->begin(); I != (yyvsp[(5) - (9)].ArgList)->end(); ++I, ++index) { + for (ArgListType::iterator I = (yyvsp[-4].ArgList)->begin(); I != (yyvsp[-4].ArgList)->end(); ++I, ++index) { const Type* Ty = I->Ty->get(); if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty)) GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); @@ -4853,10 +4632,10 @@ if (!ParamAttrs.empty()) ActualAttrs = new ParamAttrsList(ParamAttrs); - FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (9)].TypeVal), ParamTypeList, isVarArg, + FunctionType *FT = FunctionType::get(*(yyvsp[-7].TypeVal), ParamTypeList, isVarArg, ActualAttrs); const PointerType *PFT = PointerType::get(FT); - delete (yyvsp[(2) - (9)].TypeVal); + delete (yyvsp[-7].TypeVal); ValID ID; if (!FunctionName.empty()) { @@ -4905,26 +4684,26 @@ Fn->setLinkage(CurFun.Linkage); Fn->setVisibility(CurFun.Visibility); } - Fn->setCallingConv((yyvsp[(1) - (9)].UIntVal)); - Fn->setAlignment((yyvsp[(9) - (9)].UIntVal)); - if ((yyvsp[(8) - (9)].StrVal)) { - Fn->setSection((yyvsp[(8) - (9)].StrVal)); - free((yyvsp[(8) - (9)].StrVal)); + Fn->setCallingConv((yyvsp[-8].UIntVal)); + Fn->setAlignment((yyvsp[0].UIntVal)); + if ((yyvsp[-1].StrVal)) { + Fn->setSection((yyvsp[-1].StrVal)); + free((yyvsp[-1].StrVal)); } // Add all of the arguments we parsed to the function... - if ((yyvsp[(5) - (9)].ArgList)) { // Is null if empty... + if ((yyvsp[-4].ArgList)) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert((yyvsp[(5) - (9)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (9)].ArgList)->back().Name == 0 && + assert((yyvsp[-4].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[-4].ArgList)->back().Name == 0 && "Not a varargs marker!"); - delete (yyvsp[(5) - (9)].ArgList)->back().Ty; - (yyvsp[(5) - (9)].ArgList)->pop_back(); // Delete the last entry + delete (yyvsp[-4].ArgList)->back().Ty; + (yyvsp[-4].ArgList)->pop_back(); // Delete the last entry } Function::arg_iterator ArgIt = Fn->arg_begin(); Function::arg_iterator ArgEnd = Fn->arg_end(); unsigned Idx = 1; - for (ArgListType::iterator I = (yyvsp[(5) - (9)].ArgList)->begin(); - I != (yyvsp[(5) - (9)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { + for (ArgListType::iterator I = (yyvsp[-4].ArgList)->begin(); + I != (yyvsp[-4].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { delete I->Ty; // Delete the typeholder... setValueName(ArgIt, I->Name); // Insert arg into symtab... CHECK_FOR_ERROR @@ -4932,37 +4711,37 @@ Idx++; } - delete (yyvsp[(5) - (9)].ArgList); // We're now done with the argument list + delete (yyvsp[-4].ArgList); // We're now done with the argument list } CHECK_FOR_ERROR ;} break; case 214: -#line 2247 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2247 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; // Make sure that we keep track of the linkage type even if there was a // previous "declare". - (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage)); - (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility)); + (yyval.FunctionVal)->setLinkage((yyvsp[-3].Linkage)); + (yyval.FunctionVal)->setVisibility((yyvsp[-2].Visibility)); ;} break; case 217: -#line 2258 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2258 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR ;} break; case 218: -#line 2263 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2263 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); - CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); + CurFun.CurrentFunction->setLinkage((yyvsp[-2].Linkage)); + CurFun.CurrentFunction->setVisibility((yyvsp[-1].Visibility)); (yyval.FunctionVal) = CurFun.CurrentFunction; CurFun.FunctionDone(); CHECK_FOR_ERROR @@ -4970,7 +4749,7 @@ break; case 219: -#line 2275 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2275 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -4978,7 +4757,7 @@ break; case 220: -#line 2279 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2279 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -4986,31 +4765,31 @@ break; case 221: -#line 2284 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2284 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); + (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); CHECK_FOR_ERROR ;} break; case 222: -#line 2288 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2288 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); + (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); CHECK_FOR_ERROR ;} break; case 223: -#line 2292 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2292 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); + (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); CHECK_FOR_ERROR ;} break; case 224: -#line 2296 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2296 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR @@ -5018,7 +4797,7 @@ break; case 225: -#line 2300 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2300 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR @@ -5026,7 +4805,7 @@ break; case 226: -#line 2304 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2304 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR @@ -5034,7 +4813,7 @@ break; case 227: -#line 2308 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2308 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR @@ -5042,7 +4821,7 @@ break; case 228: -#line 2312 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2312 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR @@ -5050,10 +4829,10 @@ break; case 229: -#line 2316 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2316 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector - const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); - int NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); + const Type *ETy = (*(yyvsp[-1].ConstVector))[0]->getType(); + int NumElements = (yyvsp[-1].ConstVector)->size(); VectorType* pt = VectorType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( @@ -5065,127 +4844,127 @@ ); // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()) + for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { + if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '" + - (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'."); + (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); } - (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector))); - delete PTy; delete (yyvsp[(2) - (3)].ConstVector); + (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[-1].ConstVector))); + delete PTy; delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR ;} break; case 230: -#line 2341 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2341 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); + (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal)); CHECK_FOR_ERROR ;} break; case 231: -#line 2345 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2345 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - char *End = UnEscapeLexed((yyvsp[(3) - (5)].StrVal), true); - std::string AsmStr = std::string((yyvsp[(3) - (5)].StrVal), End); - End = UnEscapeLexed((yyvsp[(5) - (5)].StrVal), true); - std::string Constraints = std::string((yyvsp[(5) - (5)].StrVal), End); - (yyval.ValIDVal) = ValID::createInlineAsm(AsmStr, Constraints, (yyvsp[(2) - (5)].BoolVal)); - free((yyvsp[(3) - (5)].StrVal)); - free((yyvsp[(5) - (5)].StrVal)); + char *End = UnEscapeLexed((yyvsp[-2].StrVal), true); + std::string AsmStr = std::string((yyvsp[-2].StrVal), End); + End = UnEscapeLexed((yyvsp[0].StrVal), true); + std::string Constraints = std::string((yyvsp[0].StrVal), End); + (yyval.ValIDVal) = ValID::createInlineAsm(AsmStr, Constraints, (yyvsp[-3].BoolVal)); + free((yyvsp[-2].StrVal)); + free((yyvsp[0].StrVal)); CHECK_FOR_ERROR ;} break; case 232: -#line 2359 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2359 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? - (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); + (yyval.ValIDVal) = ValID::createLocalID((yyvsp[0].UIntVal)); CHECK_FOR_ERROR ;} break; case 233: -#line 2363 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2363 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); + (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[0].UIntVal)); CHECK_FOR_ERROR ;} break; case 234: -#line 2367 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2367 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? - (yyval.ValIDVal) = ValID::createLocalName((yyvsp[(1) - (1)].StrVal)); + (yyval.ValIDVal) = ValID::createLocalName((yyvsp[0].StrVal)); CHECK_FOR_ERROR ;} break; case 235: -#line 2371 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2371 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? - (yyval.ValIDVal) = ValID::createGlobalName((yyvsp[(1) - (1)].StrVal)); + (yyval.ValIDVal) = ValID::createGlobalName((yyvsp[0].StrVal)); CHECK_FOR_ERROR ;} break; case 238: -#line 2383 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2383 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal)); - delete (yyvsp[(1) - (2)].TypeVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + (yyval.ValueVal) = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 239: -#line 2392 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2392 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR ;} break; case 240: -#line 2396 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2396 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR ;} break; case 241: -#line 2405 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2405 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); + setValueName((yyvsp[0].TermInstVal), (yyvsp[-1].StrVal)); CHECK_FOR_ERROR - InsertValue((yyvsp[(3) - (3)].TermInstVal)); - (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal)); - (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal); + InsertValue((yyvsp[0].TermInstVal)); + (yyvsp[-2].BasicBlockVal)->getInstList().push_back((yyvsp[0].TermInstVal)); + (yyval.BasicBlockVal) = (yyvsp[-2].BasicBlockVal); CHECK_FOR_ERROR ;} break; case 242: -#line 2414 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2414 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal))) + if (CastInst *CI1 = dyn_cast((yyvsp[0].InstVal))) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) if (CI2->getParent() == 0) - (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2); - (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal)); - (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal); + (yyvsp[-1].BasicBlockVal)->getInstList().push_back(CI2); + (yyvsp[-1].BasicBlockVal)->getInstList().push_back((yyvsp[0].InstVal)); + (yyval.BasicBlockVal) = (yyvsp[-1].BasicBlockVal); CHECK_FOR_ERROR ;} break; case 243: -#line 2423 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2423 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Empty space between instruction lists (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); CHECK_FOR_ERROR @@ -5193,23 +4972,23 @@ break; case 244: -#line 2427 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2427 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Labelled (named) basic block - (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName((yyvsp[(1) - (1)].StrVal))); + (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName((yyvsp[0].StrVal))); CHECK_FOR_ERROR ;} break; case 245: -#line 2432 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2432 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Return with a result... - (yyval.TermInstVal) = new ReturnInst((yyvsp[(2) - (2)].ValueVal)); + (yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; case 246: -#line 2436 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2436 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = new ReturnInst(); CHECK_FOR_ERROR @@ -5217,57 +4996,57 @@ break; case 247: -#line 2440 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2440 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... - BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR (yyval.TermInstVal) = new BranchInst(tmpBB); ;} break; case 248: -#line 2445 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2445 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - assert(cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?"); - BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal)); + assert(cast((yyvsp[-7].PrimType))->getBitWidth() == 1 && "Not Bool?"); + BasicBlock* tmpBBA = getBBVal((yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal)); + BasicBlock* tmpBBB = getBBVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal)); + Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[-6].ValIDVal)); CHECK_FOR_ERROR (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal); ;} break; case 249: -#line 2455 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2455 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); + Value* tmpVal = getVal((yyvsp[-7].PrimType), (yyvsp[-6].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR - SwitchInst *S = new SwitchInst(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size()); + SwitchInst *S = new SwitchInst(tmpVal, tmpBB, (yyvsp[-1].JumpTable)->size()); (yyval.TermInstVal) = S; - std::vector >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(), - E = (yyvsp[(8) - (9)].JumpTable)->end(); + std::vector >::iterator I = (yyvsp[-1].JumpTable)->begin(), + E = (yyvsp[-1].JumpTable)->end(); for (; I != E; ++I) { if (ConstantInt *CI = dyn_cast(I->first)) S->addCase(CI, I->second); else GEN_ERROR("Switch case is constant, but not a simple integer"); } - delete (yyvsp[(8) - (9)].JumpTable); + delete (yyvsp[-1].JumpTable); CHECK_FOR_ERROR ;} break; case 250: -#line 2474 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2474 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); + Value* tmpVal = getVal((yyvsp[-6].PrimType), (yyvsp[-5].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[-2].ValIDVal)); CHECK_FOR_ERROR SwitchInst *S = new SwitchInst(tmpVal, tmpBB, 0); (yyval.TermInstVal) = S; @@ -5276,20 +5055,20 @@ break; case 251: -#line 2484 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2484 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast((yyvsp[(3) - (14)].TypeVal)->get())) || + if (!(PFTy = dyn_cast((yyvsp[-11].TypeVal)->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; ParamAttrsList ParamAttrs; - if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None) - ParamAttrs.addAttributes(0, (yyvsp[(8) - (14)].ParamAttrs)); - ValueRefList::iterator I = (yyvsp[(6) - (14)].ValueRefList)->begin(), E = (yyvsp[(6) - (14)].ValueRefList)->end(); + if ((yyvsp[-6].ParamAttrs) != ParamAttr::None) + ParamAttrs.addAttributes(0, (yyvsp[-6].ParamAttrs)); + ValueRefList::iterator I = (yyvsp[-8].ValueRefList)->begin(), E = (yyvsp[-8].ValueRefList)->end(); unsigned index = 1; for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); @@ -5303,22 +5082,22 @@ ParamAttrsList *Attrs = 0; if (!ParamAttrs.empty()) Attrs = new ParamAttrsList(ParamAttrs); - Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false, Attrs); + Ty = FunctionType::get((yyvsp[-11].TypeVal)->get(), ParamTypes, false, Attrs); PFTy = PointerType::get(Ty); } - delete (yyvsp[(3) - (14)].TypeVal); + delete (yyvsp[-11].TypeVal); - Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling... + Value *V = getVal(PFTy, (yyvsp[-10].ValIDVal)); // Get the function we're calling... CHECK_FOR_ERROR - BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal)); + BasicBlock *Normal = getBBVal((yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR - BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal)); + BasicBlock *Except = getBBVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR // Check the arguments ValueList Args; - if ((yyvsp[(6) - (14)].ValueRefList)->empty()) { // Has no arguments? + if ((yyvsp[-8].ValueRefList)->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -5328,7 +5107,7 @@ // correctly! FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = (yyvsp[(6) - (14)].ValueRefList)->begin(), ArgE = (yyvsp[(6) - (14)].ValueRefList)->end(); + ValueRefList::iterator ArgI = (yyvsp[-8].ValueRefList)->begin(), ArgE = (yyvsp[-8].ValueRefList)->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -5347,15 +5126,15 @@ // Create the InvokeInst InvokeInst *II = new InvokeInst(V, Normal, Except, &Args[0], Args.size()); - II->setCallingConv((yyvsp[(2) - (14)].UIntVal)); + II->setCallingConv((yyvsp[-12].UIntVal)); (yyval.TermInstVal) = II; - delete (yyvsp[(6) - (14)].ValueRefList); + delete (yyvsp[-8].ValueRefList); CHECK_FOR_ERROR ;} break; case 252: -#line 2559 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2559 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR @@ -5363,7 +5142,7 @@ break; case 253: -#line 2563 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2563 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR @@ -5371,122 +5150,122 @@ break; case 254: -#line 2570 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2570 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); - Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); + (yyval.JumpTable) = (yyvsp[-5].JumpTable); + Constant *V = cast(getExistingVal((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value"); - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); ;} break; case 255: -#line 2581 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2581 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector >(); - Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); + Constant *V = cast(getExistingVal((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value"); - BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); ;} break; case 256: -#line 2594 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2594 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... - setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal)); + setValueName((yyvsp[0].InstVal), (yyvsp[-1].StrVal)); CHECK_FOR_ERROR - InsertValue((yyvsp[(2) - (2)].InstVal)); - (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal); + InsertValue((yyvsp[0].InstVal)); + (yyval.InstVal) = (yyvsp[0].InstVal); CHECK_FOR_ERROR ;} break; case 257: -#line 2604 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2604 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-5].TypeVal))->getDescription()); (yyval.PHIList) = new std::list >(); - Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal)); + Value* tmpVal = getVal(*(yyvsp[-5].TypeVal), (yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); - delete (yyvsp[(1) - (6)].TypeVal); + delete (yyvsp[-5].TypeVal); ;} break; case 258: -#line 2615 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2615 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); - Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); + (yyval.PHIList) = (yyvsp[-6].PHIList); + Value* tmpVal = getVal((yyvsp[-6].PHIList)->front().first->getType(), (yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR - (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); + (yyvsp[-6].PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); ;} break; case 259: -#line 2625 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2625 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); // Used for call and invoke instructions (yyval.ValueRefList) = new ValueRefList(); - ValueRefListEntry E; E.Attrs = (yyvsp[(3) - (3)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (3)].TypeVal)->get(), (yyvsp[(2) - (3)].ValIDVal)); + ValueRefListEntry E; E.Attrs = (yyvsp[0].ParamAttrs); E.Val = getVal((yyvsp[-2].TypeVal)->get(), (yyvsp[-1].ValIDVal)); (yyval.ValueRefList)->push_back(E); - delete (yyvsp[(1) - (3)].TypeVal); + delete (yyvsp[-2].TypeVal); ;} break; case 260: -#line 2634 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2634 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); - (yyval.ValueRefList) = (yyvsp[(1) - (5)].ValueRefList); - ValueRefListEntry E; E.Attrs = (yyvsp[(5) - (5)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (5)].TypeVal)->get(), (yyvsp[(4) - (5)].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + (yyval.ValueRefList) = (yyvsp[-4].ValueRefList); + ValueRefListEntry E; E.Attrs = (yyvsp[0].ParamAttrs); E.Val = getVal((yyvsp[-2].TypeVal)->get(), (yyvsp[-1].ValIDVal)); (yyval.ValueRefList)->push_back(E); - delete (yyvsp[(3) - (5)].TypeVal); + delete (yyvsp[-2].TypeVal); CHECK_FOR_ERROR ;} break; case 261: -#line 2643 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2643 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueRefList) = new ValueRefList(); ;} break; case 262: -#line 2646 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2646 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); ;} break; case 263: -#line 2647 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2647 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); - (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); + (yyval.ValueList) = (yyvsp[-2].ValueList); + (yyval.ValueList)->push_back((yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; case 264: -#line 2654 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2654 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -5494,7 +5273,7 @@ break; case 265: -#line 2658 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2658 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -5502,191 +5281,191 @@ break; case 266: -#line 2663 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2663 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); - if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() && - !isa((*(yyvsp[(2) - (5)].TypeVal)).get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); + if (!(*(yyvsp[-3].TypeVal))->isInteger() && !(*(yyvsp[-3].TypeVal))->isFloatingPoint() && + !isa((*(yyvsp[-3].TypeVal)).get())) GEN_ERROR( "Arithmetic operator requires integer, FP, or packed operands"); - if (isa((*(yyvsp[(2) - (5)].TypeVal)).get()) && - ((yyvsp[(1) - (5)].BinaryOpVal) == Instruction::URem || - (yyvsp[(1) - (5)].BinaryOpVal) == Instruction::SRem || - (yyvsp[(1) - (5)].BinaryOpVal) == Instruction::FRem)) + if (isa((*(yyvsp[-3].TypeVal)).get()) && + ((yyvsp[-4].BinaryOpVal) == Instruction::URem || + (yyvsp[-4].BinaryOpVal) == Instruction::SRem || + (yyvsp[-4].BinaryOpVal) == Instruction::FRem)) GEN_ERROR("Remainder not supported on vector types"); - Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal)); + Value* val1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); CHECK_FOR_ERROR - Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal)); + Value* val2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2); + (yyval.InstVal) = BinaryOperator::create((yyvsp[-4].BinaryOpVal), val1, val2); if ((yyval.InstVal) == 0) GEN_ERROR("binary operator returned null"); - delete (yyvsp[(2) - (5)].TypeVal); + delete (yyvsp[-3].TypeVal); ;} break; case 267: -#line 2684 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2684 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); - if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) { - if (Instruction::isShift((yyvsp[(1) - (5)].BinaryOpVal)) || !isa((yyvsp[(2) - (5)].TypeVal)->get()) || - !cast((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger()) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); + if (!(*(yyvsp[-3].TypeVal))->isInteger()) { + if (Instruction::isShift((yyvsp[-4].BinaryOpVal)) || !isa((yyvsp[-3].TypeVal)->get()) || + !cast((yyvsp[-3].TypeVal)->get())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } - Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal)); + Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal)); + Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2); + (yyval.InstVal) = BinaryOperator::create((yyvsp[-4].BinaryOpVal), tmpVal1, tmpVal2); if ((yyval.InstVal) == 0) GEN_ERROR("binary operator returned null"); - delete (yyvsp[(2) - (5)].TypeVal); + delete (yyvsp[-3].TypeVal); ;} break; case 268: -#line 2701 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2701 "/proj/llvm/llvm-2/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("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); + if (isa((*(yyvsp[-3].TypeVal)).get())) GEN_ERROR("Vector types not supported by icmp instruction"); - Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal)); + Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); + Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2); + (yyval.InstVal) = CmpInst::create((yyvsp[-5].OtherOpVal), (yyvsp[-4].IPredicate), tmpVal1, tmpVal2); if ((yyval.InstVal) == 0) GEN_ERROR("icmp operator returned null"); - delete (yyvsp[(3) - (6)].TypeVal); + delete (yyvsp[-3].TypeVal); ;} break; case 269: -#line 2715 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2715 "/proj/llvm/llvm-2/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("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); + if (isa((*(yyvsp[-3].TypeVal)).get())) GEN_ERROR("Vector types not supported by fcmp instruction"); - Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal)); + Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); + Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2); + (yyval.InstVal) = CmpInst::create((yyvsp[-5].OtherOpVal), (yyvsp[-4].FPredicate), tmpVal1, tmpVal2); if ((yyval.InstVal) == 0) GEN_ERROR("fcmp operator returned null"); - delete (yyvsp[(3) - (6)].TypeVal); + delete (yyvsp[-3].TypeVal); ;} break; case 270: -#line 2729 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2729 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); - Value* Val = (yyvsp[(2) - (4)].ValueVal); - const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get(); - if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); + Value* Val = (yyvsp[-2].ValueVal); + const Type* DestTy = (yyvsp[0].TypeVal)->get(); + if (!CastInst::castIsValid((yyvsp[-3].CastOpVal), Val, DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'"); - (yyval.InstVal) = CastInst::create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy); - delete (yyvsp[(4) - (4)].TypeVal); + (yyval.InstVal) = CastInst::create((yyvsp[-3].CastOpVal), Val, DestTy); + delete (yyvsp[0].TypeVal); ;} break; case 271: -#line 2741 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2741 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty) + if ((yyvsp[-4].ValueVal)->getType() != Type::Int1Ty) GEN_ERROR("select condition must be boolean"); - if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType()) + if ((yyvsp[-2].ValueVal)->getType() != (yyvsp[0].ValueVal)->getType()) GEN_ERROR("select value types should match"); - (yyval.InstVal) = new SelectInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); + (yyval.InstVal) = new SelectInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; case 272: -#line 2749 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2749 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); - (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal)); - delete (yyvsp[(4) - (4)].TypeVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); + (yyval.InstVal) = new VAArgInst((yyvsp[-2].ValueVal), *(yyvsp[0].TypeVal)); + delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR ;} break; case 273: -#line 2756 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2756 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) + if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) GEN_ERROR("Invalid extractelement operands"); - (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)); + (yyval.InstVal) = new ExtractElementInst((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; case 274: -#line 2762 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2762 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) + if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) GEN_ERROR("Invalid insertelement operands"); - (yyval.InstVal) = new InsertElementInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); + (yyval.InstVal) = new InsertElementInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; case 275: -#line 2768 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2768 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) + if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) GEN_ERROR("Invalid shufflevector operands"); - (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); + (yyval.InstVal) = new ShuffleVectorInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; case 276: -#line 2774 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2774 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType(); + const Type *Ty = (yyvsp[0].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) GEN_ERROR("PHI node operands must be of first class type"); (yyval.InstVal) = new PHINode(Ty); - ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size()); - while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) { - if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty) + ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[0].PHIList)->size()); + while ((yyvsp[0].PHIList)->begin() != (yyvsp[0].PHIList)->end()) { + if ((yyvsp[0].PHIList)->front().first->getType() != Ty) GEN_ERROR("All elements of a PHI node must be of the same type"); - cast((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second); - (yyvsp[(2) - (2)].PHIList)->pop_front(); + cast((yyval.InstVal))->addIncoming((yyvsp[0].PHIList)->front().first, (yyvsp[0].PHIList)->front().second); + (yyvsp[0].PHIList)->pop_front(); } - delete (yyvsp[(2) - (2)].PHIList); // Free the list... + delete (yyvsp[0].PHIList); // Free the list... CHECK_FOR_ERROR ;} break; case 277: -#line 2790 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2790 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast((yyvsp[(3) - (8)].TypeVal)->get())) || + if (!(PFTy = dyn_cast((yyvsp[-5].TypeVal)->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; ParamAttrsList ParamAttrs; - if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None) - ParamAttrs.addAttributes(0, (yyvsp[(8) - (8)].ParamAttrs)); + if ((yyvsp[0].ParamAttrs) != ParamAttr::None) + ParamAttrs.addAttributes(0, (yyvsp[0].ParamAttrs)); unsigned index = 1; - ValueRefList::iterator I = (yyvsp[(6) - (8)].ValueRefList)->begin(), E = (yyvsp[(6) - (8)].ValueRefList)->end(); + ValueRefList::iterator I = (yyvsp[-2].ValueRefList)->begin(), E = (yyvsp[-2].ValueRefList)->end(); for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) @@ -5700,16 +5479,24 @@ if (!ParamAttrs.empty()) Attrs = new ParamAttrsList(ParamAttrs); - Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false, Attrs); + Ty = FunctionType::get((yyvsp[-5].TypeVal)->get(), ParamTypes, false, Attrs); PFTy = PointerType::get(Ty); } - Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling... + Value *V = getVal(PFTy, (yyvsp[-4].ValIDVal)); // Get the function we're calling... CHECK_FOR_ERROR + // Check for call to invalid intrinsic to avoid crashing later. + if (Function *theF = dyn_cast(V)) { + if (theF->hasName() && 0 == strncmp(theF->getName().c_str(), "llvm.", 5)&& + !theF->getIntrinsicID(true)) + GEN_ERROR("Call to invalid LLVM intrinsic function '" + + theF->getName() + "'"); + } + // Check the arguments ValueList Args; - if ((yyvsp[(6) - (8)].ValueRefList)->empty()) { // Has no arguments? + if ((yyvsp[-2].ValueRefList)->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -5720,7 +5507,7 @@ // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = (yyvsp[(6) - (8)].ValueRefList)->begin(), ArgE = (yyvsp[(6) - (8)].ValueRefList)->end(); + ValueRefList::iterator ArgI = (yyvsp[-2].ValueRefList)->begin(), ArgE = (yyvsp[-2].ValueRefList)->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -5737,25 +5524,25 @@ } // Create the call node CallInst *CI = new CallInst(V, &Args[0], Args.size()); - CI->setTailCall((yyvsp[(1) - (8)].BoolVal)); - CI->setCallingConv((yyvsp[(2) - (8)].UIntVal)); + CI->setTailCall((yyvsp[-7].BoolVal)); + CI->setCallingConv((yyvsp[-6].UIntVal)); (yyval.InstVal) = CI; - delete (yyvsp[(6) - (8)].ValueRefList); - delete (yyvsp[(3) - (8)].TypeVal); + delete (yyvsp[-2].ValueRefList); + delete (yyvsp[-5].TypeVal); CHECK_FOR_ERROR ;} break; case 278: -#line 2861 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2869 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); + (yyval.InstVal) = (yyvsp[0].InstVal); CHECK_FOR_ERROR ;} break; case 279: -#line 2866 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2874 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -5763,7 +5550,7 @@ break; case 280: -#line 2870 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2878 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -5771,129 +5558,131 @@ break; case 281: -#line 2877 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2885 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); - (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal)); - delete (yyvsp[(2) - (3)].TypeVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + (yyval.InstVal) = new MallocInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal)); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 282: -#line 2884 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2892 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); - Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); + Value* tmpVal = getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal)); - delete (yyvsp[(2) - (6)].TypeVal); + (yyval.InstVal) = new MallocInst(*(yyvsp[-4].TypeVal), tmpVal, (yyvsp[0].UIntVal)); + delete (yyvsp[-4].TypeVal); ;} break; case 283: -#line 2892 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2900 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); - (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal)); - delete (yyvsp[(2) - (3)].TypeVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + (yyval.InstVal) = new AllocaInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal)); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; case 284: -#line 2899 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2907 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); - Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); + Value* tmpVal = getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal)); - delete (yyvsp[(2) - (6)].TypeVal); + (yyval.InstVal) = new AllocaInst(*(yyvsp[-4].TypeVal), tmpVal, (yyvsp[0].UIntVal)); + delete (yyvsp[-4].TypeVal); ;} break; case 285: -#line 2907 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2915 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { - if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) + if (!isa((yyvsp[0].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + - (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + ""); - (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal)); + (yyvsp[0].ValueVal)->getType()->getDescription() + ""); + (yyval.InstVal) = new FreeInst((yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; case 286: -#line 2915 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2923 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (4)].TypeVal))->getDescription()); - if (!isa((yyvsp[(3) - (4)].TypeVal)->get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + if (!isa((yyvsp[-1].TypeVal)->get())) GEN_ERROR("Can't load from nonpointer type: " + - (*(yyvsp[(3) - (4)].TypeVal))->getDescription()); - if (!cast((yyvsp[(3) - (4)].TypeVal)->get())->getElementType()->isFirstClassType()) + (*(yyvsp[-1].TypeVal))->getDescription()); + if (!cast((yyvsp[-1].TypeVal)->get())->getElementType()->isFirstClassType()) GEN_ERROR("Can't load from pointer of non-first-class type: " + - (*(yyvsp[(3) - (4)].TypeVal))->getDescription()); - Value* tmpVal = getVal(*(yyvsp[(3) - (4)].TypeVal), (yyvsp[(4) - (4)].ValIDVal)); + (*(yyvsp[-1].TypeVal))->getDescription()); + Value* tmpVal = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (4)].BoolVal)); - delete (yyvsp[(3) - (4)].TypeVal); + (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[-3].BoolVal)); + delete (yyvsp[-1].TypeVal); ;} break; case 287: -#line 2929 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2937 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); - const PointerType *PT = dyn_cast((yyvsp[(5) - (6)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + const PointerType *PT = dyn_cast((yyvsp[-1].TypeVal)->get()); if (!PT) GEN_ERROR("Can't store to a nonpointer type: " + - (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); + (*(yyvsp[-1].TypeVal))->getDescription()); const Type *ElTy = PT->getElementType(); - if (ElTy != (yyvsp[(3) - (6)].ValueVal)->getType()) - GEN_ERROR("Can't store '" + (yyvsp[(3) - (6)].ValueVal)->getType()->getDescription() + + if (ElTy != (yyvsp[-3].ValueVal)->getType()) + GEN_ERROR("Can't store '" + (yyvsp[-3].ValueVal)->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'"); - Value* tmpVal = getVal(*(yyvsp[(5) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); + Value* tmpVal = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new StoreInst((yyvsp[(3) - (6)].ValueVal), tmpVal, (yyvsp[(1) - (6)].BoolVal)); - delete (yyvsp[(5) - (6)].TypeVal); + (yyval.InstVal) = new StoreInst((yyvsp[-3].ValueVal), tmpVal, (yyvsp[-5].BoolVal)); + delete (yyvsp[-1].TypeVal); ;} break; case 288: -#line 2946 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2954 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); - if (!isa((yyvsp[(2) - (4)].TypeVal)->get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + if (!isa((yyvsp[-2].TypeVal)->get())) GEN_ERROR("getelementptr insn requires pointer operand"); - if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), &(*(yyvsp[(4) - (4)].ValueList))[0], (yyvsp[(4) - (4)].ValueList)->size(), true)) + if (!GetElementPtrInst::getIndexedType(*(yyvsp[-2].TypeVal), &(*(yyvsp[0].ValueList))[0], (yyvsp[0].ValueList)->size(), true)) GEN_ERROR("Invalid getelementptr indices for type '" + - (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'"); - Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal)); + (*(yyvsp[-2].TypeVal))->getDescription()+ "'"); + Value* tmpVal = getVal(*(yyvsp[-2].TypeVal), (yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new GetElementPtrInst(tmpVal, &(*(yyvsp[(4) - (4)].ValueList))[0], (yyvsp[(4) - (4)].ValueList)->size()); - delete (yyvsp[(2) - (4)].TypeVal); - delete (yyvsp[(4) - (4)].ValueList); + (yyval.InstVal) = new GetElementPtrInst(tmpVal, &(*(yyvsp[0].ValueList))[0], (yyvsp[0].ValueList)->size()); + delete (yyvsp[-2].TypeVal); + delete (yyvsp[0].ValueList); ;} break; -/* Line 1267 of yacc.c. */ -#line 5891 "llvmAsmParser.tab.c" default: break; } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - YYPOPSTACK (yylen); - yylen = 0; +/* Line 1126 of yacc.c. */ +#line 5681 "llvmAsmParser.tab.c" + + yyvsp -= yylen; + yyssp -= yylen; + + YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -5922,41 +5711,110 @@ if (!yyerrstatus) { ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else +#if YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (YYPACT_NINF < yyn && yyn < YYLAST) + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + char *yymsg = 0; +# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +#if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +#endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= yysize1 < yysize; + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; } - } - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= yysize1 < yysize; + yysize = yysize1; + + if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yymsg; + int yyi = 0; + while ((*yyp = *yyf)) + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + yyerror (yymsg); + YYSTACK_FREE (yymsg); + } + else + { + yyerror (YY_("syntax error")); goto yyexhaustedlab; - } - } -#endif + } + } + else +#endif /* YYERROR_VERBOSE */ + yyerror (YY_("syntax error")); } @@ -5967,15 +5825,14 @@ error, discard it. */ if (yychar <= YYEOF) - { + { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; - } + } else { - yydestruct ("Error: discarding", - yytoken, &yylval); + yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } @@ -5993,14 +5850,11 @@ /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ - if (/*CONSTCOND*/ 0) + if (0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); +yyvsp -= yylen; + yyssp -= yylen; yystate = *yyssp; goto yyerrlab1; @@ -6030,9 +5884,8 @@ YYABORT; - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); + yydestruct ("Error: popping", yystos[yystate], yyvsp); + YYPOPSTACK; yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } @@ -6043,7 +5896,7 @@ *++yyvsp = yylval; - /* Shift the error token. */ + /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; @@ -6078,30 +5931,21 @@ if (yychar != YYEOF && yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); - YYPOPSTACK (1); + YYPOPSTACK; } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } -#line 2963 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2971 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions Index: llvm/lib/AsmParser/llvmAsmParser.h.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.65 llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.66 --- llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.65 Thu Apr 12 13:32:50 2007 +++ llvm/lib/AsmParser/llvmAsmParser.h.cvs Mon Apr 16 01:56:07 2007 @@ -1,9 +1,7 @@ -/* A Bison parser, made by GNU Bison 2.3. */ +/* A Bison parser, made by GNU Bison 2.1. */ -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,18 +18,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE @@ -310,10 +300,9 @@ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 938 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#line 938 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -358,10 +347,9 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} -/* Line 1529 of yacc.c. */ -#line 364 "llvmAsmParser.tab.h" - YYSTYPE; +} YYSTYPE; +/* Line 1447 of yacc.c. */ +#line 353 "llvmAsmParser.tab.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -369,3 +357,5 @@ extern YYSTYPE llvmAsmlval; + + Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.85 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.86 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.85 Thu Apr 12 13:32:50 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Mon Apr 16 01:56:07 2007 @@ -2821,6 +2821,14 @@ Value *V = getVal(PFTy, $4); // Get the function we're calling... CHECK_FOR_ERROR + // Check for call to invalid intrinsic to avoid crashing later. + if (Function *theF = dyn_cast(V)) { + if (theF->hasName() && 0 == strncmp(theF->getName().c_str(), "llvm.", 5)&& + !theF->getIntrinsicID(true)) + GEN_ERROR("Call to invalid LLVM intrinsic function '" + + theF->getName() + "'"); + } + // Check the arguments ValueList Args; if ($6->empty()) { // Has no arguments? From reid at x10sys.com Mon Apr 16 02:09:05 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 02:09:05 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Message-ID: <200704160709.l3G795o4018931@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Function.cpp updated: 1.119 -> 1.120 --- Log message: Fix test/CodeGen/Generic/vector-constantexpr.ll --- Diffs of the changes: (+2 -0) Function.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.119 llvm/lib/VMCore/Function.cpp:1.120 --- llvm/lib/VMCore/Function.cpp:1.119 Mon Apr 16 01:54:34 2007 +++ llvm/lib/VMCore/Function.cpp Mon Apr 16 02:08:44 2007 @@ -226,6 +226,8 @@ /// unsigned Function::getIntrinsicID(bool noAssert) const { const ValueName *ValName = this->getValueName(); + if (!ValName) + return 0; unsigned Len = ValName->getKeyLength(); const char *Name = ValName->getKeyData(); From baldrick at free.fr Mon Apr 16 08:02:48 2007 From: baldrick at free.fr (Duncan Sands) Date: Mon, 16 Apr 2007 08:02:48 -0500 Subject: [llvm-commits] CVS: llvm/docs/ExceptionHandling.html Message-ID: <200704161302.l3GD2mux002618@zion.cs.uiuc.edu> Changes in directory llvm/docs: ExceptionHandling.html updated: 1.3 -> 1.4 --- Log message: Fix typos. --- Diffs of the changes: (+4 -4) ExceptionHandling.html | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/docs/ExceptionHandling.html diff -u llvm/docs/ExceptionHandling.html:1.3 llvm/docs/ExceptionHandling.html:1.4 --- llvm/docs/ExceptionHandling.html:1.3 Sat Apr 14 07:30:27 2007 +++ llvm/docs/ExceptionHandling.html Mon Apr 16 08:02:27 2007 @@ -121,8 +121,8 @@ personalities. An exception handling personality is defined by way of a personality function (ex. for C++ __gxx_personality_v0) which receives the context of the exception, an exception structure containing -the exception object type and value, and a reference the exception table for the -current function. The personality function for the current compile unit is +the exception object type and value, and a reference to the exception table for +the current function. The personality function for the current compile unit is specified in a common exception frame.

The organization of an exception table is language dependent. For C++, an @@ -195,7 +195,7 @@

The term used to define a the place where an invoke continues after an exception is called a landing pad. LLVM landing pads are conceptually -alternative entry points into where a exception structure reference and a type +alternative function entry points where a exception structure reference and a type info index are passed in as arguments. The landing pad saves the exception structure reference and then proceeds to select the catch block that corresponds to the type info of the exception object.

@@ -453,7 +453,7 @@ Chris Lattner
LLVM Compiler Infrastructure
- Last modified: $Date: 2007/04/14 12:30:27 $ + Last modified: $Date: 2007/04/16 13:02:27 $ From reid at x10sys.com Mon Apr 16 09:06:41 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 09:06:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/Alpha.td Message-ID: <200704161406.l3GE6fbC004104@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: Alpha.td updated: 1.12 -> 1.13 --- Log message: For PR1336: http://llvm.org/PR1336 : Subtarget option names must be given in lower case in order to be recognized. Fixes test/CodeGen/Alpha/ctlz.ll --- Diffs of the changes: (+1 -1) Alpha.td | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/Alpha/Alpha.td diff -u llvm/lib/Target/Alpha/Alpha.td:1.12 llvm/lib/Target/Alpha/Alpha.td:1.13 --- llvm/lib/Target/Alpha/Alpha.td:1.12 Wed Jan 24 15:09:16 2007 +++ llvm/lib/Target/Alpha/Alpha.td Mon Apr 16 09:06:19 2007 @@ -20,7 +20,7 @@ // Subtarget Features //===----------------------------------------------------------------------===// -def FeatureCIX : SubtargetFeature<"CIX", "HasCT", "true", +def FeatureCIX : SubtargetFeature<"cix", "HasCT", "true", "Enable CIX extentions">; //===----------------------------------------------------------------------===// From reid at x10sys.com Mon Apr 16 09:08:14 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 09:08:14 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Alpha/ctlz.ll Message-ID: <200704161408.l3GE8EL4004213@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Alpha: ctlz.ll updated: 1.8 -> 1.9 --- Log message: For PR1336: http://llvm.org/PR1336 : Un-XFAIL as Alpha feature now specified in lower case. --- Diffs of the changes: (+0 -1) ctlz.ll | 1 - 1 files changed, 1 deletion(-) Index: llvm/test/CodeGen/Alpha/ctlz.ll diff -u llvm/test/CodeGen/Alpha/ctlz.ll:1.8 llvm/test/CodeGen/Alpha/ctlz.ll:1.9 --- llvm/test/CodeGen/Alpha/ctlz.ll:1.8 Sun Apr 15 18:00:46 2007 +++ llvm/test/CodeGen/Alpha/ctlz.ll Mon Apr 16 09:07:53 2007 @@ -4,7 +4,6 @@ ; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev6 | not grep -i ctlz ; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev56 | not grep -i ctlz ; RUN: llvm-as < %s | llc -march=alpha -mattr=-CIX | not grep -i ctlz -; XFAIL: * declare i32 @llvm.ctlz.i8(i8) From reid at x10sys.com Mon Apr 16 09:14:52 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 09:14:52 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/2004-02-14-InefficientStackPointer.llx Message-ID: <200704161414.l3GEEqYH004398@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: 2004-02-14-InefficientStackPointer.llx updated: 1.3 -> 1.4 --- Log message: For PR1336: http://llvm.org/PR1336 : Ignore case for register name compare. --- Diffs of the changes: (+1 -2) 2004-02-14-InefficientStackPointer.llx | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/test/CodeGen/X86/2004-02-14-InefficientStackPointer.llx diff -u llvm/test/CodeGen/X86/2004-02-14-InefficientStackPointer.llx:1.3 llvm/test/CodeGen/X86/2004-02-14-InefficientStackPointer.llx:1.4 --- llvm/test/CodeGen/X86/2004-02-14-InefficientStackPointer.llx:1.3 Sun Apr 15 18:00:46 2007 +++ llvm/test/CodeGen/X86/2004-02-14-InefficientStackPointer.llx Mon Apr 16 09:14:31 2007 @@ -1,5 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep ESP | not grep sub -; XFAIL: * +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep -i ESP | not grep sub int %test(int %X) { ret int %X From reid at x10sys.com Mon Apr 16 09:17:25 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 09:17:25 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/fp-stack-ret.ll Message-ID: <200704161417.l3GEHP7T004444@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: fp-stack-ret.ll updated: 1.3 -> 1.4 --- Log message: Wrap long line. --- Diffs of the changes: (+2 -1) fp-stack-ret.ll | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/test/CodeGen/X86/fp-stack-ret.ll diff -u llvm/test/CodeGen/X86/fp-stack-ret.ll:1.3 llvm/test/CodeGen/X86/fp-stack-ret.ll:1.4 --- llvm/test/CodeGen/X86/fp-stack-ret.ll:1.3 Sun Apr 15 18:00:46 2007 +++ llvm/test/CodeGen/X86/fp-stack-ret.ll Mon Apr 16 09:17:04 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin8 -mcpu=yonah -march=x86 > %t +; RUN: llvm-as < %s | \ +; RUN: llc -mtriple=i686-apple-darwin8 -mcpu=yonah -march=x86 > %t ; RUN: grep fldl %t | wc -l | grep 1 ; RUN: not grep xmm %t && ; RUN: grep {sub.*esp} %t | wc -l | grep 1 From reid at x10sys.com Mon Apr 16 09:18:58 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 09:18:58 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/fp_constant_op.llx Message-ID: <200704161418.l3GEIwcN004486@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: fp_constant_op.llx updated: 1.5 -> 1.6 --- Log message: For PR1336: http://llvm.org/PR1336 : Ignore case for instruction mnemonic comparison. --- Diffs of the changes: (+1 -2) fp_constant_op.llx | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/test/CodeGen/X86/fp_constant_op.llx diff -u llvm/test/CodeGen/X86/fp_constant_op.llx:1.5 llvm/test/CodeGen/X86/fp_constant_op.llx:1.6 --- llvm/test/CodeGen/X86/fp_constant_op.llx:1.5 Sun Apr 15 18:00:46 2007 +++ llvm/test/CodeGen/X86/fp_constant_op.llx Mon Apr 16 09:18:37 2007 @@ -1,6 +1,5 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | \ -; RUN: grep ST | not grep {fadd\\|fsub\\|fdiv\\|fmul} -; XFAIL: * +; RUN: grep -i ST | not grep {fadd\\|fsub\\|fdiv\\|fmul} ; Test that the load of the constant is folded into the operation. From reid at x10sys.com Mon Apr 16 09:20:49 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 09:20:49 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/fp_load_fold.llx Message-ID: <200704161420.l3GEKnic004534@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: fp_load_fold.llx updated: 1.5 -> 1.6 --- Log message: For PR1336: http://llvm.org/PR1336 : Ignore case for instruction mnemonic comparison. --- Diffs of the changes: (+1 -2) fp_load_fold.llx | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/test/CodeGen/X86/fp_load_fold.llx diff -u llvm/test/CodeGen/X86/fp_load_fold.llx:1.5 llvm/test/CodeGen/X86/fp_load_fold.llx:1.6 --- llvm/test/CodeGen/X86/fp_load_fold.llx:1.5 Sun Apr 15 18:00:46 2007 +++ llvm/test/CodeGen/X86/fp_load_fold.llx Mon Apr 16 09:20:28 2007 @@ -1,6 +1,5 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | \ -; RUN: grep ST | not grep {fadd\\|fsub\\|fdiv\\|fmul} -; XFAIL: * +; RUN: grep -i ST | not grep {fadd\\|fsub\\|fdiv\\|fmul} ; Test that the load of the memory location is folded into the operation. From reid at x10sys.com Mon Apr 16 09:23:28 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 09:23:28 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/sse-fcopysign.ll Message-ID: <200704161423.l3GENSGQ004580@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: sse-fcopysign.ll updated: 1.6 -> 1.7 --- Log message: For PR1336: http://llvm.org/PR1336 : Rename test functions to not conflict with an instruction mnemonic. --- Diffs of the changes: (+2 -3) sse-fcopysign.ll | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/test/CodeGen/X86/sse-fcopysign.ll diff -u llvm/test/CodeGen/X86/sse-fcopysign.ll:1.6 llvm/test/CodeGen/X86/sse-fcopysign.ll:1.7 --- llvm/test/CodeGen/X86/sse-fcopysign.ll:1.6 Sun Apr 15 18:00:46 2007 +++ llvm/test/CodeGen/X86/sse-fcopysign.ll Mon Apr 16 09:23:07 2007 @@ -1,12 +1,11 @@ ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep test -; XFAIL: * -define float @test1(float %a, float %b) { +define float @tst1(float %a, float %b) { %tmp = tail call float @copysignf( float %b, float %a ) ret float %tmp } -define double @test2(double %a, float %b, float %c) { +define double @tst2(double %a, float %b, float %c) { %tmp1 = add float %b, %c %tmp2 = fpext float %tmp1 to double %tmp = tail call double @copysign( double %a, double %tmp2 ) From llvm at cs.uiuc.edu Mon Apr 16 09:39:47 2007 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 16 Apr 2007 09:39:47 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Threads/ Message-ID: <200704161439.l3GEdlZG004952@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Threads: --- Log message: Directory /var/cvs/llvm/llvm-test/SingleSource/UnitTests/Threads added to the repository --- Diffs of the changes: (+0 -0) 0 files changed From reid at x10sys.com Mon Apr 16 09:46:39 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 09:46:39 -0500 Subject: [llvm-commits] CVS: llvm/test/Assembler/2003-11-24-SymbolTableCrash.llx Message-ID: <200704161446.l3GEkdcb005096@zion.cs.uiuc.edu> Changes in directory llvm/test/Assembler: 2003-11-24-SymbolTableCrash.llx updated: 1.1 -> 1.2 --- Log message: Syntax upgrade and fix for PR1336: http://llvm.org/PR1336 . --- Diffs of the changes: (+5 -4) 2003-11-24-SymbolTableCrash.llx | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) Index: llvm/test/Assembler/2003-11-24-SymbolTableCrash.llx diff -u llvm/test/Assembler/2003-11-24-SymbolTableCrash.llx:1.1 llvm/test/Assembler/2003-11-24-SymbolTableCrash.llx:1.2 --- llvm/test/Assembler/2003-11-24-SymbolTableCrash.llx:1.1 Mon Nov 24 21:58:49 2003 +++ llvm/test/Assembler/2003-11-24-SymbolTableCrash.llx Mon Apr 16 09:46:17 2007 @@ -1,10 +1,11 @@ -; RUN: llvm-as < %s 2>&1 | not grep Asserti +; RUN: llvm-as < %s |& not grep Asserti +; RUN: llvm-as < %s |& grep Redefinition -void %test() { - %tmp.1 = add int 0, 1 +define void @test() { + %tmp.1 = add i32 0, 1 br label %return return: - %tmp.1 = add int 0, 1 + %tmp.1 = add i32 0, 1 ret void } From reid at x10sys.com Mon Apr 16 10:01:02 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:01:02 -0500 Subject: [llvm-commits] CVS: llvm/test/Assembler/2002-07-25-ParserAssertionFailure.llx 2002-12-15-GlobalResolve.ll 2003-04-15-ConstantInitAssertion.llx 2003-05-21-MalformedShiftCrash.llx 2003-05-21-MalformedStructCrash.llx 2003-12-30-TypeMapInvalidMemory.llx 2004-03-30-UnclosedFunctionCrash.llx 2005-01-31-CallingAggregateFunction.ll 2006-09-28-CrashOnInvalid.ll 2007-01-02-Undefined-Arg-Type.ll 2007-01-16-CrashOnBadCast.ll 2007-01-16-CrashOnBadCast2.ll 2007-01-21-UpgradeNoArgs.ll 2007-01-22-UpgradeMalformedShift.ll 2007-01-22-UpgradeMalformedStruct.ll 2007-01-22-UpgradeTypeMapInvalidMemory.ll 2007-03-18-InvalidNumberedVar.ll Message-ID: <200704161501.l3GF12GG005439@zion.cs.uiuc.edu> Changes in directory llvm/test/Assembler: 2002-07-25-ParserAssertionFailure.llx updated: 1.4 -> 1.5 2002-12-15-GlobalResolve.ll updated: 1.5 -> 1.6 2003-04-15-ConstantInitAssertion.llx updated: 1.4 -> 1.5 2003-05-21-MalformedShiftCrash.llx updated: 1.6 -> 1.7 2003-05-21-MalformedStructCrash.llx updated: 1.5 -> 1.6 2003-12-30-TypeMapInvalidMemory.llx updated: 1.9 -> 1.10 2004-03-30-UnclosedFunctionCrash.llx updated: 1.1 -> 1.2 2005-01-31-CallingAggregateFunction.ll updated: 1.4 -> 1.5 2006-09-28-CrashOnInvalid.ll updated: 1.3 -> 1.4 2007-01-02-Undefined-Arg-Type.ll updated: 1.4 -> 1.5 2007-01-16-CrashOnBadCast.ll updated: 1.3 -> 1.4 2007-01-16-CrashOnBadCast2.ll updated: 1.3 -> 1.4 2007-01-21-UpgradeNoArgs.ll updated: 1.1 -> 1.2 2007-01-22-UpgradeMalformedShift.ll updated: 1.1 -> 1.2 2007-01-22-UpgradeMalformedStruct.ll updated: 1.1 -> 1.2 2007-01-22-UpgradeTypeMapInvalidMemory.ll updated: 1.1 -> 1.2 2007-03-18-InvalidNumberedVar.ll updated: 1.1 -> 1.2 --- Log message: Fix the syntax for these tests. Noticed by Duncan Sands. --- Diffs of the changes: (+20 -18) 2002-07-25-ParserAssertionFailure.llx | 2 +- 2002-12-15-GlobalResolve.ll | 4 ++-- 2003-04-15-ConstantInitAssertion.llx | 2 +- 2003-05-21-MalformedShiftCrash.llx | 2 +- 2003-05-21-MalformedStructCrash.llx | 2 +- 2003-12-30-TypeMapInvalidMemory.llx | 3 ++- 2004-03-30-UnclosedFunctionCrash.llx | 2 +- 2005-01-31-CallingAggregateFunction.ll | 2 +- 2006-09-28-CrashOnInvalid.ll | 2 +- 2007-01-02-Undefined-Arg-Type.ll | 2 +- 2007-01-16-CrashOnBadCast.ll | 2 +- 2007-01-16-CrashOnBadCast2.ll | 2 +- 2007-01-21-UpgradeNoArgs.ll | 2 +- 2007-01-22-UpgradeMalformedShift.ll | 2 +- 2007-01-22-UpgradeMalformedStruct.ll | 2 +- 2007-01-22-UpgradeTypeMapInvalidMemory.ll | 3 ++- 2007-03-18-InvalidNumberedVar.ll | 2 +- 17 files changed, 20 insertions(+), 18 deletions(-) Index: llvm/test/Assembler/2002-07-25-ParserAssertionFailure.llx diff -u llvm/test/Assembler/2002-07-25-ParserAssertionFailure.llx:1.4 llvm/test/Assembler/2002-07-25-ParserAssertionFailure.llx:1.5 --- llvm/test/Assembler/2002-07-25-ParserAssertionFailure.llx:1.4 Fri Jan 26 02:25:05 2007 +++ llvm/test/Assembler/2002-07-25-ParserAssertionFailure.llx Mon Apr 16 10:00:39 2007 @@ -1,6 +1,6 @@ ; Make sure we don't get an assertion failure, even though this is a parse ; error -; RUN: llvm-as 2>&1 < %s -o /dev/null -f | grep 'No arguments' +; RUN: llvm-as < %s -o /dev/null -f |& grep 'No arguments' %ty = type void (i32) Index: llvm/test/Assembler/2002-12-15-GlobalResolve.ll diff -u llvm/test/Assembler/2002-12-15-GlobalResolve.ll:1.5 llvm/test/Assembler/2002-12-15-GlobalResolve.ll:1.6 --- llvm/test/Assembler/2002-12-15-GlobalResolve.ll:1.5 Fri Jan 26 02:25:05 2007 +++ llvm/test/Assembler/2002-12-15-GlobalResolve.ll Mon Apr 16 10:00:39 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-upgrade < %s 2>/dev/null | llvm-as -o /dev/null -f && -; RUN: llvm-upgrade < %s 2>&1 | grep "Renaming global variable 'X' to" +; RUN: llvm-upgrade < %s 2>/dev/null | llvm-as -o /dev/null -f +; RUN: llvm-upgrade < %s |& grep {Renaming global variable 'X' to} %X = external global uint * %X = external global %T* Index: llvm/test/Assembler/2003-04-15-ConstantInitAssertion.llx diff -u llvm/test/Assembler/2003-04-15-ConstantInitAssertion.llx:1.4 llvm/test/Assembler/2003-04-15-ConstantInitAssertion.llx:1.5 --- llvm/test/Assembler/2003-04-15-ConstantInitAssertion.llx:1.4 Fri Jan 26 02:25:05 2007 +++ llvm/test/Assembler/2003-04-15-ConstantInitAssertion.llx Mon Apr 16 10:00:39 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-as 2>&1 < %s >/dev/null | grep "Expected type 'i32' for element #0" +; RUN: llvm-as < %s >/dev/null |& grep "Expected type 'i32' for element #0" ; Test the case of a misformed constant initializer ; This should cause an assembler error, not an assertion failure! constant { i32 } { float 1.0 } Index: llvm/test/Assembler/2003-05-21-MalformedShiftCrash.llx diff -u llvm/test/Assembler/2003-05-21-MalformedShiftCrash.llx:1.6 llvm/test/Assembler/2003-05-21-MalformedShiftCrash.llx:1.7 --- llvm/test/Assembler/2003-05-21-MalformedShiftCrash.llx:1.6 Thu Feb 1 20:16:22 2007 +++ llvm/test/Assembler/2003-05-21-MalformedShiftCrash.llx Mon Apr 16 10:00:39 2007 @@ -1,4 +1,4 @@ ; Found by inspection of the code -; RUN: llvm-as 2>&1 < %s > /dev/null | grep "Logical operator requires integral" +; RUN: llvm-as < %s > /dev/null |& grep "Logical operator requires integral" global i32 ashr (float 1.0, float 2.0) Index: llvm/test/Assembler/2003-05-21-MalformedStructCrash.llx diff -u llvm/test/Assembler/2003-05-21-MalformedStructCrash.llx:1.5 llvm/test/Assembler/2003-05-21-MalformedStructCrash.llx:1.6 --- llvm/test/Assembler/2003-05-21-MalformedStructCrash.llx:1.5 Fri Jan 26 02:25:05 2007 +++ llvm/test/Assembler/2003-05-21-MalformedStructCrash.llx Mon Apr 16 10:00:39 2007 @@ -1,4 +1,4 @@ ; Found by inspection of the code -; RUN: llvm-as 2>&1 < %s > /dev/null | grep "Illegal number of init" +; RUN: llvm-as < %s > /dev/null |& grep "Illegal number of init" global {} { i32 7, float 1.0, i32 7, i32 8 } Index: llvm/test/Assembler/2003-12-30-TypeMapInvalidMemory.llx diff -u llvm/test/Assembler/2003-12-30-TypeMapInvalidMemory.llx:1.9 llvm/test/Assembler/2003-12-30-TypeMapInvalidMemory.llx:1.10 --- llvm/test/Assembler/2003-12-30-TypeMapInvalidMemory.llx:1.9 Thu Mar 29 20:35:32 2007 +++ llvm/test/Assembler/2003-12-30-TypeMapInvalidMemory.llx Mon Apr 16 10:00:39 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-as 2>&1 < %s -o /dev/null -f | grep 'Undefined type remains' +; RUN: llvm-as < %s -o /dev/null -f |& grep 'Undefined type remains' +; END. @d_reduction_0_dparser_gram = global { i32 (i8*, i8**, i32, i32, { Index: llvm/test/Assembler/2004-03-30-UnclosedFunctionCrash.llx diff -u llvm/test/Assembler/2004-03-30-UnclosedFunctionCrash.llx:1.1 llvm/test/Assembler/2004-03-30-UnclosedFunctionCrash.llx:1.2 --- llvm/test/Assembler/2004-03-30-UnclosedFunctionCrash.llx:1.1 Tue Mar 30 14:58:00 2004 +++ llvm/test/Assembler/2004-03-30-UnclosedFunctionCrash.llx Mon Apr 16 10:00:39 2007 @@ -1,3 +1,3 @@ -; RUN: llvm-as %s 2>&1 | grep error +; RUN: llvm-as %s |& grep error void %foo() { Index: llvm/test/Assembler/2005-01-31-CallingAggregateFunction.ll diff -u llvm/test/Assembler/2005-01-31-CallingAggregateFunction.ll:1.4 llvm/test/Assembler/2005-01-31-CallingAggregateFunction.ll:1.5 --- llvm/test/Assembler/2005-01-31-CallingAggregateFunction.ll:1.4 Sun Apr 15 05:07:55 2007 +++ llvm/test/Assembler/2005-01-31-CallingAggregateFunction.ll Mon Apr 16 10:00:39 2007 @@ -1,5 +1,5 @@ ; RUN: ignore llvm-as < %s -o /dev/null -f |& \ -; RUN: grep "LLVM functions cannot return aggregate types" +; RUN: grep {LLVM functions cannot return aggregate types} define void @test() { call {} @foo() Index: llvm/test/Assembler/2006-09-28-CrashOnInvalid.ll diff -u llvm/test/Assembler/2006-09-28-CrashOnInvalid.ll:1.3 llvm/test/Assembler/2006-09-28-CrashOnInvalid.ll:1.4 --- llvm/test/Assembler/2006-09-28-CrashOnInvalid.ll:1.3 Fri Jan 26 02:25:05 2007 +++ llvm/test/Assembler/2006-09-28-CrashOnInvalid.ll Mon Apr 16 10:00:39 2007 @@ -1,6 +1,6 @@ ; Test for PR902. This program is erroneous, but should not crash llvm-as. ; This tests that a simple error is caught and processed correctly. -; RUN: llvm-as < %s 2>&1 >/dev/null | grep 'FP constant invalid for type' +; RUN: llvm-as < %s >/dev/null |& grep {FP constant invalid for type} define void @test() { add i32 1, 2.0 Index: llvm/test/Assembler/2007-01-02-Undefined-Arg-Type.ll diff -u llvm/test/Assembler/2007-01-02-Undefined-Arg-Type.ll:1.4 llvm/test/Assembler/2007-01-02-Undefined-Arg-Type.ll:1.5 --- llvm/test/Assembler/2007-01-02-Undefined-Arg-Type.ll:1.4 Tue Mar 27 21:38:26 2007 +++ llvm/test/Assembler/2007-01-02-Undefined-Arg-Type.ll Mon Apr 16 10:00:39 2007 @@ -1,5 +1,5 @@ ; The assembler should catch an undefined argument type . -; RUN: llvm-as < %s -o /dev/null -f 2>&1 | grep "Reference to abstract argument" +; RUN: llvm-as < %s -o /dev/null -f |& grep {Reference to abstract argument} ; %typedef.bc_struct = type opaque Index: llvm/test/Assembler/2007-01-16-CrashOnBadCast.ll diff -u llvm/test/Assembler/2007-01-16-CrashOnBadCast.ll:1.3 llvm/test/Assembler/2007-01-16-CrashOnBadCast.ll:1.4 --- llvm/test/Assembler/2007-01-16-CrashOnBadCast.ll:1.3 Sun Apr 15 05:07:55 2007 +++ llvm/test/Assembler/2007-01-16-CrashOnBadCast.ll Mon Apr 16 10:00:39 2007 @@ -1,5 +1,5 @@ ; PR1117 -; RUN: llvm-as < %s -o /dev/null -f |& grep "invalid cast opcode for cast from" +; RUN: llvm-as < %s -o /dev/null -f |& grep {invalid cast opcode for cast from} define i8* @nada(i64 %X) { %result = trunc i64 %X to i8* Index: llvm/test/Assembler/2007-01-16-CrashOnBadCast2.ll diff -u llvm/test/Assembler/2007-01-16-CrashOnBadCast2.ll:1.3 llvm/test/Assembler/2007-01-16-CrashOnBadCast2.ll:1.4 --- llvm/test/Assembler/2007-01-16-CrashOnBadCast2.ll:1.3 Sun Apr 15 05:07:55 2007 +++ llvm/test/Assembler/2007-01-16-CrashOnBadCast2.ll Mon Apr 16 10:00:39 2007 @@ -1,4 +1,4 @@ ; PR1117 -; RUN: llvm-as < %s -o /dev/null -f |& grep "invalid cast opcode for cast from" +; RUN: llvm-as < %s -o /dev/null -f |& grep {invalid cast opcode for cast from} @X = constant i8* trunc (i64 0 to i8*) Index: llvm/test/Assembler/2007-01-21-UpgradeNoArgs.ll diff -u llvm/test/Assembler/2007-01-21-UpgradeNoArgs.ll:1.1 llvm/test/Assembler/2007-01-21-UpgradeNoArgs.ll:1.2 --- llvm/test/Assembler/2007-01-21-UpgradeNoArgs.ll:1.1 Fri Jan 26 02:25:05 2007 +++ llvm/test/Assembler/2007-01-21-UpgradeNoArgs.ll Mon Apr 16 10:00:39 2007 @@ -1,6 +1,6 @@ ; Make sure we don't get an assertion failure, even though this is a parse ; error -; RUN: llvm-upgrade 2>&1 < %s > /dev/null | grep 'No arguments passed to a ' +; RUN: llvm-upgrade < %s > /dev/null |& grep {No arguments passed to a } %ty = type void (int) Index: llvm/test/Assembler/2007-01-22-UpgradeMalformedShift.ll diff -u llvm/test/Assembler/2007-01-22-UpgradeMalformedShift.ll:1.1 llvm/test/Assembler/2007-01-22-UpgradeMalformedShift.ll:1.2 --- llvm/test/Assembler/2007-01-22-UpgradeMalformedShift.ll:1.1 Fri Jan 26 02:25:05 2007 +++ llvm/test/Assembler/2007-01-22-UpgradeMalformedShift.ll Mon Apr 16 10:00:39 2007 @@ -1,4 +1,4 @@ ; Found by inspection of the code -; RUN: llvm-upgrade 2>&1 < %s > /dev/null | grep "Shift constant expression" +; RUN: llvm-upgrade < %s > /dev/null |& grep {Shift constant expression} global int shr (float 1.0, ubyte 2) Index: llvm/test/Assembler/2007-01-22-UpgradeMalformedStruct.ll diff -u llvm/test/Assembler/2007-01-22-UpgradeMalformedStruct.ll:1.1 llvm/test/Assembler/2007-01-22-UpgradeMalformedStruct.ll:1.2 --- llvm/test/Assembler/2007-01-22-UpgradeMalformedStruct.ll:1.1 Fri Jan 26 02:25:05 2007 +++ llvm/test/Assembler/2007-01-22-UpgradeMalformedStruct.ll Mon Apr 16 10:00:39 2007 @@ -1,4 +1,4 @@ ; Found by inspection of the code -; RUN: llvm-upgrade 2>&1 < %s > /dev/null | grep "Illegal number of init" +; RUN: llvm-upgrade < %s > /dev/null |& grep {Illegal number of init} global {} { int 7, float 1.0, int 7, int 8 } Index: llvm/test/Assembler/2007-01-22-UpgradeTypeMapInvalidMemory.ll diff -u llvm/test/Assembler/2007-01-22-UpgradeTypeMapInvalidMemory.ll:1.1 llvm/test/Assembler/2007-01-22-UpgradeTypeMapInvalidMemory.ll:1.2 --- llvm/test/Assembler/2007-01-22-UpgradeTypeMapInvalidMemory.ll:1.1 Fri Jan 26 02:25:05 2007 +++ llvm/test/Assembler/2007-01-22-UpgradeTypeMapInvalidMemory.ll Mon Apr 16 10:00:39 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade 2>&1 < %s -o /dev/null -f | grep 'Reference to an undef' +; RUN: llvm-upgrade < %s -o /dev/null -f |& grep {Reference to an undef} +; END. %d_reduction_0_dparser_gram = global { int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)*, int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyt! e*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)** } { int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, i! nt, int }*)* null, int (sbyte*, sbyte**, int, int, { %struct.G! rammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)** null } Index: llvm/test/Assembler/2007-03-18-InvalidNumberedVar.ll diff -u llvm/test/Assembler/2007-03-18-InvalidNumberedVar.ll:1.1 llvm/test/Assembler/2007-03-18-InvalidNumberedVar.ll:1.2 --- llvm/test/Assembler/2007-03-18-InvalidNumberedVar.ll:1.1 Mon Mar 19 13:41:37 2007 +++ llvm/test/Assembler/2007-03-18-InvalidNumberedVar.ll Mon Apr 16 10:00:39 2007 @@ -1,5 +1,5 @@ ; PR 1258 -; RUN: llvm-as < %s 2>&1 >/dev/null -f | grep "Numbered.*does not match" +; RUN: llvm-as < %s >/dev/null -f |& grep {Numbered.*does not match} define i32 @test1(i32 %a, i32 %b) { entry: From reid at x10sys.com Mon Apr 16 10:16:27 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:16:27 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2003-11-19-AddressOfRegister.c.tr 2005-01-02-VAArgError-ICE.c 2006-09-21-IncompleteElementType.c 2006-09-25-DebugFilename.c.tr Message-ID: <200704161516.l3GFGRAh005766@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2003-11-19-AddressOfRegister.c.tr updated: 1.1 -> 1.2 2005-01-02-VAArgError-ICE.c updated: 1.1 -> 1.2 2006-09-21-IncompleteElementType.c updated: 1.1 -> 1.2 2006-09-25-DebugFilename.c.tr updated: 1.1 -> 1.2 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix test syntax per new rules. --- Diffs of the changes: (+6 -5) 2003-11-19-AddressOfRegister.c.tr | 2 +- 2005-01-02-VAArgError-ICE.c | 2 +- 2006-09-21-IncompleteElementType.c | 2 +- 2006-09-25-DebugFilename.c.tr | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) Index: llvm/test/CFrontend/2003-11-19-AddressOfRegister.c.tr diff -u llvm/test/CFrontend/2003-11-19-AddressOfRegister.c.tr:1.1 llvm/test/CFrontend/2003-11-19-AddressOfRegister.c.tr:1.2 --- llvm/test/CFrontend/2003-11-19-AddressOfRegister.c.tr:1.1 Wed Nov 19 15:37:52 2003 +++ llvm/test/CFrontend/2003-11-19-AddressOfRegister.c.tr Mon Apr 16 10:15:51 2007 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -xc %s -S -o /dev/null 2>&1 | not grep 'warning' +// RUN: %llvmgcc -xc %s -S -o /dev/null |& not grep 'warning' struct item { short delta[4]; Index: llvm/test/CFrontend/2005-01-02-VAArgError-ICE.c diff -u llvm/test/CFrontend/2005-01-02-VAArgError-ICE.c:1.1 llvm/test/CFrontend/2005-01-02-VAArgError-ICE.c:1.2 --- llvm/test/CFrontend/2005-01-02-VAArgError-ICE.c:1.1 Sun Jan 2 22:39:16 2005 +++ llvm/test/CFrontend/2005-01-02-VAArgError-ICE.c Mon Apr 16 10:15:51 2007 @@ -1,6 +1,6 @@ // This file is erroneous, but should not cause the compiler to ICE. // PR481 -// RUN: %llvmgcc %s -S -o /dev/null 2>&1 | not grep 'internal compiler error' +// RUN: %llvmgcc %s -S -o /dev/null |& not grep {internal compiler error} #include int flags(int a, int b, ...) { Index: llvm/test/CFrontend/2006-09-21-IncompleteElementType.c diff -u llvm/test/CFrontend/2006-09-21-IncompleteElementType.c:1.1 llvm/test/CFrontend/2006-09-21-IncompleteElementType.c:1.2 --- llvm/test/CFrontend/2006-09-21-IncompleteElementType.c:1.1 Fri Sep 22 00:34:25 2006 +++ llvm/test/CFrontend/2006-09-21-IncompleteElementType.c Mon Apr 16 10:15:51 2007 @@ -1,3 +1,3 @@ -// RUN: %llvmgcc %s -S -o /dev/null 2>&1 | not grep 'internal compiler error' +// RUN: %llvmgcc %s -S -o /dev/null |& not grep {internal compiler error} struct A X[(927 - 37) / sizeof(struct A)]; Index: llvm/test/CFrontend/2006-09-25-DebugFilename.c.tr diff -u llvm/test/CFrontend/2006-09-25-DebugFilename.c.tr:1.1 llvm/test/CFrontend/2006-09-25-DebugFilename.c.tr:1.2 --- llvm/test/CFrontend/2006-09-25-DebugFilename.c.tr:1.1 Mon Sep 25 14:12:01 2006 +++ llvm/test/CFrontend/2006-09-25-DebugFilename.c.tr Mon Apr 16 10:15:51 2007 @@ -1,5 +1,6 @@ -// RUN: %llvmgcc -xc %s -S -o /dev/null 2>&1 | grep fluffy | grep '2006-09-25-DebugFilename.c.tr' +// RUN: %llvmgcc -xc %s -S -o /dev/null |& \ +// RUN: grep fluffy | grep 2006-09-25-DebugFilename.c.tr #include "2006-09-25-DebugFilename.h" int func1() { return hfunc1(); } -int func2() { fluffy; return hfunc1(); } +int func2() { int fluffy; return hfunc1(); } From reid at x10sys.com Mon Apr 16 10:16:36 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:16:36 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/2007-03-13-InstrSched.ll addrmode.ll iabs.ll lsr-code-insertion.ll Message-ID: <200704161516.l3GFGakp005782@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: 2007-03-13-InstrSched.ll updated: 1.4 -> 1.5 addrmode.ll updated: 1.1 -> 1.2 iabs.ll updated: 1.1 -> 1.2 lsr-code-insertion.ll updated: 1.1 -> 1.2 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix test syntax per new rules. --- Diffs of the changes: (+11 -9) 2007-03-13-InstrSched.ll | 3 ++- addrmode.ll | 3 +-- iabs.ll | 6 ++++-- lsr-code-insertion.ll | 8 ++++---- 4 files changed, 11 insertions(+), 9 deletions(-) Index: llvm/test/CodeGen/ARM/2007-03-13-InstrSched.ll diff -u llvm/test/CodeGen/ARM/2007-03-13-InstrSched.ll:1.4 llvm/test/CodeGen/ARM/2007-03-13-InstrSched.ll:1.5 --- llvm/test/CodeGen/ARM/2007-03-13-InstrSched.ll:1.4 Wed Apr 4 03:49:10 2007 +++ llvm/test/CodeGen/ARM/2007-03-13-InstrSched.ll Mon Apr 16 10:15:51 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -relocation-model=pic -mattr=+v6 -stats 2>&1 | grep 'asm-printer' | grep 41 +; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -relocation-model=pic \ +; RUN: -mattr=+v6 -stats |& grep asm-printer | grep 41 define void @test(i32 %tmp56222, i32 %tmp36224, i32 %tmp46223, i32 %i.0196.0.ph, i32 %tmp8, i32* %tmp1011, i32** %tmp1, i32* %d2.1.out, i32* %d3.1.out, i32* %d0.1.out, i32* %d1.1.out) { newFuncRoot: Index: llvm/test/CodeGen/ARM/addrmode.ll diff -u llvm/test/CodeGen/ARM/addrmode.ll:1.1 llvm/test/CodeGen/ARM/addrmode.ll:1.2 --- llvm/test/CodeGen/ARM/addrmode.ll:1.1 Wed Mar 14 18:26:40 2007 +++ llvm/test/CodeGen/ARM/addrmode.ll Mon Apr 16 10:15:51 2007 @@ -1,5 +1,4 @@ -; RUN: llvm-as < %s | llc -march=arm && -; RUN: llvm-as < %s | llc -march=arm -stats 2>&1 | grep 'asm-printer' | grep 4 +; RUN: llvm-as < %s | llc -march=arm -stats |& grep asm-printer | grep 4 define i32 @t1(i32 %a) { %b = mul i32 %a, 9 Index: llvm/test/CodeGen/ARM/iabs.ll diff -u llvm/test/CodeGen/ARM/iabs.ll:1.1 llvm/test/CodeGen/ARM/iabs.ll:1.2 --- llvm/test/CodeGen/ARM/iabs.ll:1.1 Wed Apr 11 00:02:57 2007 +++ llvm/test/CodeGen/ARM/iabs.ll Mon Apr 16 10:15:51 2007 @@ -1,5 +1,7 @@ -; RUN: llvm-as < %s | llc -march=arm -stats 2>&1 | grep '3 .*Number of machine instrs printed' && -; RUN: llvm-as < %s | llc -march=thumb -stats 2>&1 | grep '4 .*Number of machine instrs printed' +; RUN: llvm-as < %s | llc -march=arm -stats |& \ +; RUN: grep {3 .*Number of machine instrs printed} +; RUN: llvm-as < %s | llc -march=thumb -stats |& \ +; RUN: grep {4 .*Number of machine instrs printed} ;; Integer absolute value, should produce something as good as: ARM: ;; add r3, r0, r0, asr #31 Index: llvm/test/CodeGen/ARM/lsr-code-insertion.ll diff -u llvm/test/CodeGen/ARM/lsr-code-insertion.ll:1.1 llvm/test/CodeGen/ARM/lsr-code-insertion.ll:1.2 --- llvm/test/CodeGen/ARM/lsr-code-insertion.ll:1.1 Fri Apr 13 15:38:14 2007 +++ llvm/test/CodeGen/ARM/lsr-code-insertion.ll Mon Apr 16 10:15:51 2007 @@ -1,7 +1,7 @@ -; RUN: llvm-as < %s | llc -stats 2>&1 | grep '40.*Number of machine instrs printed' -; This test really wants to check that the resultant "cond_true" block only has a single -; store in it, and that cond_true55 only has code to materialize the constant and do -; a store. We do *not* want something like this: +; RUN: llvm-as < %s | llc -stats |& grep {40.*Number of machine instrs printed} +; This test really wants to check that the resultant "cond_true" block only +; has a single store in it, and that cond_true55 only has code to materialize +; the constant and do a store. We do *not* want something like this: ; ;LBB1_3: @cond_true ; add r8, r0, r6 From reid at x10sys.com Mon Apr 16 10:16:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:16:37 -0500 Subject: [llvm-commits] CVS: llvm/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll 2003-12-11-ConstExprGEP.ll 2006-03-03-BadArraySubscript.ll modref.ll Message-ID: <200704161516.l3GFGbXw005810@zion.cs.uiuc.edu> Changes in directory llvm/test/Analysis/BasicAA: 2003-11-04-SimpleCases.ll updated: 1.3 -> 1.4 2003-12-11-ConstExprGEP.ll updated: 1.4 -> 1.5 2006-03-03-BadArraySubscript.ll updated: 1.2 -> 1.3 modref.ll updated: 1.4 -> 1.5 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix test syntax per new rules. --- Diffs of the changes: (+9 -5) 2003-11-04-SimpleCases.ll | 3 ++- 2003-12-11-ConstExprGEP.ll | 3 ++- 2006-03-03-BadArraySubscript.ll | 3 ++- modref.ll | 5 +++-- 4 files changed, 9 insertions(+), 5 deletions(-) Index: llvm/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll diff -u llvm/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll:1.3 llvm/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll:1.4 --- llvm/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll:1.3 Fri Dec 1 22:23:07 2006 +++ llvm/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll Mon Apr 16 10:15:51 2007 @@ -1,7 +1,8 @@ ; This testcase consists of alias relations which should be completely ; resolvable by basicaa. -; RUN: llvm-upgrade < %s | llvm-as | opt -aa-eval -print-may-aliases 2>&1 -disable-output | not grep May: +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: opt -aa-eval -print-may-aliases -disable-output |& not grep May: %T = type { uint, [10 x ubyte] } Index: llvm/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll diff -u llvm/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll:1.4 llvm/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll:1.5 --- llvm/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll:1.4 Fri Dec 1 22:23:07 2006 +++ llvm/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll Mon Apr 16 10:15:51 2007 @@ -1,7 +1,8 @@ ; This testcase consists of alias relations which should be completely ; resolvable by basicaa, but require analysis of getelementptr constant exprs. -; RUN: llvm-upgrade < %s | llvm-as | opt -aa-eval -print-may-aliases 2>&1 -disable-output | not grep May: +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: opt -aa-eval -print-may-aliases -disable-output |& not grep May: %T = type { uint, [10 x ubyte] } Index: llvm/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll diff -u llvm/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll:1.2 llvm/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll:1.3 --- llvm/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll:1.2 Fri Dec 1 22:23:07 2006 +++ llvm/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll Mon Apr 16 10:15:51 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -aa-eval -disable-output 2>&1 | grep '2 no alias respon' +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: opt -aa-eval -disable-output |& grep '2 no alias respon' ;; TEST that A[1][0] may alias A[0][i]. Index: llvm/test/Analysis/BasicAA/modref.ll diff -u llvm/test/Analysis/BasicAA/modref.ll:1.4 llvm/test/Analysis/BasicAA/modref.ll:1.5 --- llvm/test/Analysis/BasicAA/modref.ll:1.4 Fri Dec 1 22:23:07 2006 +++ llvm/test/Analysis/BasicAA/modref.ll Mon Apr 16 10:15:51 2007 @@ -1,6 +1,7 @@ ; A very rudimentary test on AliasAnalysis::getModRefInfo. -; RUN: llvm-upgrade < %s | llvm-as | opt -print-all-alias-modref-info -aa-eval -disable-output && -; RUN: llvm-upgrade < %s | llvm-as | opt -print-all-alias-modref-info -aa-eval -disable-output 2>&1 | not grep NoModRef +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: opt -print-all-alias-modref-info -aa-eval -disable-output |& +; RUN: not grep NoModRef int %callee() { %X = alloca { int, int } From reid at x10sys.com Mon Apr 16 10:16:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:16:37 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/TailCallElim/ackermann.ll Message-ID: <200704161516.l3GFGbU6005802@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/TailCallElim: ackermann.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix test syntax per new rules. --- Diffs of the changes: (+2 -1) ackermann.ll | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/test/Transforms/TailCallElim/ackermann.ll diff -u llvm/test/Transforms/TailCallElim/ackermann.ll:1.2 llvm/test/Transforms/TailCallElim/ackermann.ll:1.3 --- llvm/test/Transforms/TailCallElim/ackermann.ll:1.2 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/TailCallElim/ackermann.ll Mon Apr 16 10:15:52 2007 @@ -1,5 +1,6 @@ ; This function contains two tail calls, which should be eliminated -; RUN: llvm-upgrade < %s | llvm-as | opt -tailcallelim -stats -disable-output 2>&1 | grep '2 tailcallelim' +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: opt -tailcallelim -stats -disable-output |& grep {2 tailcallelim} int %Ack(int %M.1, int %N.1) { entry: From reid at x10sys.com Mon Apr 16 10:16:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:16:37 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/LICM/scalar_promote.ll Message-ID: <200704161516.l3GFGbfj005791@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/LICM: scalar_promote.ll updated: 1.4 -> 1.5 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix test syntax per new rules. --- Diffs of the changes: (+2 -1) scalar_promote.ll | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/test/Transforms/LICM/scalar_promote.ll diff -u llvm/test/Transforms/LICM/scalar_promote.ll:1.4 llvm/test/Transforms/LICM/scalar_promote.ll:1.5 --- llvm/test/Transforms/LICM/scalar_promote.ll:1.4 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/LICM/scalar_promote.ll Mon Apr 16 10:15:52 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -licm -stats 2>&1 | grep "memory locations promoted to register" +; RUN: llvm-upgrade < %s | llvm-as | opt -licm -stats |& \ +; RUN: grep {memory locations promoted to register} %X = global int 7 From reid at x10sys.com Mon Apr 16 10:16:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:16:37 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.llx 2006-03-02-InstrSchedBug.ll 2006-05-01-SchedCausingSpills.ll 2006-05-02-InstrSched1.ll 2006-05-02-InstrSched2.ll iabs.ll Message-ID: <200704161516.l3GFGbBT005812@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: 2003-08-03-CallArgLiveRanges.llx updated: 1.4 -> 1.5 2006-03-02-InstrSchedBug.ll updated: 1.2 -> 1.3 2006-05-01-SchedCausingSpills.ll updated: 1.2 -> 1.3 2006-05-02-InstrSched1.ll updated: 1.4 -> 1.5 2006-05-02-InstrSched2.ll updated: 1.4 -> 1.5 iabs.ll updated: 1.1 -> 1.2 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix test syntax per new rules. --- Diffs of the changes: (+13 -6) 2003-08-03-CallArgLiveRanges.llx | 2 +- 2006-03-02-InstrSchedBug.ll | 3 ++- 2006-05-01-SchedCausingSpills.ll | 3 ++- 2006-05-02-InstrSched1.ll | 5 ++++- 2006-05-02-InstrSched2.ll | 3 ++- iabs.ll | 3 ++- 6 files changed, 13 insertions(+), 6 deletions(-) Index: llvm/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.llx diff -u llvm/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.llx:1.4 llvm/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.llx:1.5 --- llvm/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.llx:1.4 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.llx Mon Apr 16 10:15:51 2007 @@ -3,7 +3,7 @@ ; it makes a ton of annoying overlapping live ranges. This code should not ; cause spills! ; -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -stats 2>&1 | not grep spilled +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -stats |& not grep spilled target endian = little target pointersize = 32 Index: llvm/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll diff -u llvm/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll:1.2 llvm/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll:1.3 --- llvm/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll Mon Apr 16 10:15:51 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -stats 2>&1 | grep 'asm-printer' | grep 7 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -stats |& \ +; RUN: grep asm-printer | grep 7 int %g(int %a, int %b) { %tmp.1 = shl int %b, ubyte 1 Index: llvm/test/CodeGen/X86/2006-05-01-SchedCausingSpills.ll diff -u llvm/test/CodeGen/X86/2006-05-01-SchedCausingSpills.ll:1.2 llvm/test/CodeGen/X86/2006-05-01-SchedCausingSpills.ll:1.3 --- llvm/test/CodeGen/X86/2006-05-01-SchedCausingSpills.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/2006-05-01-SchedCausingSpills.ll Mon Apr 16 10:15:51 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah -stats 2>&1 | not grep 'Number of register spills' +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah -stats |& \ +; RUN: not grep {Number of register spills} int %foo(<4 x float>* %a, <4 x float>* %b, <4 x float>* %c, <4 x float>* %d) { %tmp44 = load <4 x float>* %a ; <<4 x float>> [#uses=9] Index: llvm/test/CodeGen/X86/2006-05-02-InstrSched1.ll diff -u llvm/test/CodeGen/X86/2006-05-02-InstrSched1.ll:1.4 llvm/test/CodeGen/X86/2006-05-02-InstrSched1.ll:1.5 --- llvm/test/CodeGen/X86/2006-05-02-InstrSched1.ll:1.4 Mon Jan 1 23:53:06 2007 +++ llvm/test/CodeGen/X86/2006-05-02-InstrSched1.ll Mon Apr 16 10:15:51 2007 @@ -1,4 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -relocation-model=static -stats 2>&1 | grep "asm-printer" | grep 14 +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: llc -march=x86 -relocation-model=static -stats |& \ +; RUN: grep asm-printer | grep 14 +; %size20 = external global uint ; [#uses=1] %in5 = external global ubyte* ; [#uses=1] Index: llvm/test/CodeGen/X86/2006-05-02-InstrSched2.ll diff -u llvm/test/CodeGen/X86/2006-05-02-InstrSched2.ll:1.4 llvm/test/CodeGen/X86/2006-05-02-InstrSched2.ll:1.5 --- llvm/test/CodeGen/X86/2006-05-02-InstrSched2.ll:1.4 Mon Jan 8 17:57:40 2007 +++ llvm/test/CodeGen/X86/2006-05-02-InstrSched2.ll Mon Apr 16 10:15:51 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -stats 2>&1 | grep "asm-printer" | grep 18 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -stats |& \ +; RUN: grep asm-printer | grep 18 void %_ZN9__gnu_cxx9hashtableISt4pairIKPKciES3_NS_4hashIS3_EESt10_Select1stIS5_E5eqstrSaIiEE14find_or_insertERKS5__cond_true456.i(sbyte* %tmp435.i, uint* %tmp449.i.out) { newFuncRoot: Index: llvm/test/CodeGen/X86/iabs.ll diff -u llvm/test/CodeGen/X86/iabs.ll:1.1 llvm/test/CodeGen/X86/iabs.ll:1.2 --- llvm/test/CodeGen/X86/iabs.ll:1.1 Wed Apr 11 00:02:57 2007 +++ llvm/test/CodeGen/X86/iabs.ll Mon Apr 16 10:15:51 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-as < %s | llc -march=x86-64 -stats 2>&1 | grep '6 .*Number of machine instrs printed' +; RUN: llvm-as < %s | llc -march=x86-64 -stats |& \ +; RUN: grep {6 .*Number of machine instrs printed} ;; Integer absolute value, should produce something at least as good as: ;; movl %edi, %eax From reid at x10sys.com Mon Apr 16 10:16:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:16:37 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/PowerPC/iabs.ll rlwimi3.ll Message-ID: <200704161516.l3GFGbN7005825@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/PowerPC: iabs.ll updated: 1.1 -> 1.2 rlwimi3.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix test syntax per new rules. --- Diffs of the changes: (+4 -2) iabs.ll | 3 ++- rlwimi3.ll | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/test/CodeGen/PowerPC/iabs.ll diff -u llvm/test/CodeGen/PowerPC/iabs.ll:1.1 llvm/test/CodeGen/PowerPC/iabs.ll:1.2 --- llvm/test/CodeGen/PowerPC/iabs.ll:1.1 Wed Apr 11 00:02:57 2007 +++ llvm/test/CodeGen/PowerPC/iabs.ll Mon Apr 16 10:15:51 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-as < %s | llc -march=ppc32 -stats 2>&1 | grep '4 .*Number of machine instrs printed' +; RUN: llvm-as < %s | llc -march=ppc32 -stats |& \ +; RUN: grep {4 .*Number of machine instrs printed} ;; Integer absolute value, should produce something as good as: ;; srawi r2, r3, 31 Index: llvm/test/CodeGen/PowerPC/rlwimi3.ll diff -u llvm/test/CodeGen/PowerPC/rlwimi3.ll:1.2 llvm/test/CodeGen/PowerPC/rlwimi3.ll:1.3 --- llvm/test/CodeGen/PowerPC/rlwimi3.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/rlwimi3.ll Mon Apr 16 10:15:51 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -stats 2>&1 | grep 'Number of machine instrs printed' | grep 12 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -stats |& \ +; RUN: grep {Number of machine instrs printed} | grep 12 ushort %Trans16Bit(uint %srcA, uint %srcB, uint %alpha) { %tmp1 = shl uint %srcA, ubyte 15 ; [#uses=1] From reid at x10sys.com Mon Apr 16 10:16:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:16:37 -0500 Subject: [llvm-commits] CVS: llvm/test/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr Message-ID: <200704161516.l3GFGba9005830@zion.cs.uiuc.edu> Changes in directory llvm/test/C++Frontend: 2003-08-29-ArgPassingBug.cpp.tr updated: 1.3 -> 1.4 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix test syntax per new rules. --- Diffs of the changes: (+1 -1) 2003-08-29-ArgPassingBug.cpp.tr | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr diff -u llvm/test/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr:1.3 llvm/test/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr:1.4 --- llvm/test/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr:1.3 Tue Sep 30 14:56:36 2003 +++ llvm/test/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr Mon Apr 16 10:15:51 2007 @@ -1,5 +1,5 @@ -// RUN: %llvmgcc -xc++ -c -o /dev/null %s 2>&1 | not grep WARNING +// RUN: %llvmgcc -xc++ -c -o /dev/null %s |& not grep WARNING struct iterator { iterator(); From reid at x10sys.com Mon Apr 16 10:32:49 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:32:49 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2003-11-19-AddressOfRegister.c.tr 2005-05-06-CountBuiltins.c Message-ID: <200704161532.l3GFWnpl006237@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2003-11-19-AddressOfRegister.c.tr updated: 1.2 -> 1.3 2005-05-06-CountBuiltins.c updated: 1.1 -> 1.2 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix syntax of tests to ensure grep pattern is properly quoted. --- Diffs of the changes: (+2 -2) 2003-11-19-AddressOfRegister.c.tr | 2 +- 2005-05-06-CountBuiltins.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/CFrontend/2003-11-19-AddressOfRegister.c.tr diff -u llvm/test/CFrontend/2003-11-19-AddressOfRegister.c.tr:1.2 llvm/test/CFrontend/2003-11-19-AddressOfRegister.c.tr:1.3 --- llvm/test/CFrontend/2003-11-19-AddressOfRegister.c.tr:1.2 Mon Apr 16 10:15:51 2007 +++ llvm/test/CFrontend/2003-11-19-AddressOfRegister.c.tr Mon Apr 16 10:31:48 2007 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -xc %s -S -o /dev/null |& not grep 'warning' +// RUN: %llvmgcc -xc %s -S -o /dev/null |& not grep warning struct item { short delta[4]; Index: llvm/test/CFrontend/2005-05-06-CountBuiltins.c diff -u llvm/test/CFrontend/2005-05-06-CountBuiltins.c:1.1 llvm/test/CFrontend/2005-05-06-CountBuiltins.c:1.2 --- llvm/test/CFrontend/2005-05-06-CountBuiltins.c:1.1 Fri May 6 21:16:08 2005 +++ llvm/test/CFrontend/2005-05-06-CountBuiltins.c Mon Apr 16 10:31:48 2007 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc %s -S -o - | llvm-as | llvm-dis | not grep 'call.*__builtin' +// RUN: %llvmgcc %s -S -o - | llvm-as | llvm-dis | not grep call.*__builtin int G, H, I; void foo(int P) { From reid at x10sys.com Mon Apr 16 10:32:49 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:32:49 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll Message-ID: <200704161532.l3GFWnes006243@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: 2007-04-14-BitTestsBadMask.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix syntax of tests to ensure grep pattern is properly quoted. --- Diffs of the changes: (+2 -2) 2007-04-14-BitTestsBadMask.ll | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll diff -u llvm/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll:1.2 llvm/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll:1.3 --- llvm/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll:1.2 Sat Apr 14 18:40:49 2007 +++ llvm/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll Mon Apr 16 10:31:48 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | llc -march=x86 | grep '8388635' && -; RUN: llvm-as < %s | llc -march=x86-64 | grep '4294981120' +; RUN: llvm-as < %s | llc -march=x86 | grep 8388635 && +; RUN: llvm-as < %s | llc -march=x86-64 | grep 4294981120 ; PR 1325 ; FIXME: this is xfailed until we figure out ppc bootstrap From reid at x10sys.com Mon Apr 16 10:32:49 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:32:49 -0500 Subject: [llvm-commits] CVS: llvm/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll Message-ID: <200704161532.l3GFWnAu006248@zion.cs.uiuc.edu> Changes in directory llvm/test/Analysis/BasicAA: 2006-03-03-BadArraySubscript.ll updated: 1.3 -> 1.4 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix syntax of tests to ensure grep pattern is properly quoted. --- Diffs of the changes: (+1 -1) 2006-03-03-BadArraySubscript.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll diff -u llvm/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll:1.3 llvm/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll:1.4 --- llvm/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll:1.3 Mon Apr 16 10:15:51 2007 +++ llvm/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll Mon Apr 16 10:31:48 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-upgrade < %s | llvm-as | \ -; RUN: opt -aa-eval -disable-output |& grep '2 no alias respon' +; RUN: opt -aa-eval -disable-output |& grep {2 no alias respon} ;; TEST that A[1][0] may alias A[0][i]. From reid at x10sys.com Mon Apr 16 10:32:50 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:32:50 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/Reassociate/inverses.ll Message-ID: <200704161532.l3GFWo7J006253@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/Reassociate: inverses.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix syntax of tests to ensure grep pattern is properly quoted. --- Diffs of the changes: (+2 -1) inverses.ll | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/test/Transforms/Reassociate/inverses.ll diff -u llvm/test/Transforms/Reassociate/inverses.ll:1.2 llvm/test/Transforms/Reassociate/inverses.ll:1.3 --- llvm/test/Transforms/Reassociate/inverses.ll:1.2 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/Reassociate/inverses.ll Mon Apr 16 10:31:49 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -dce | llvm-dis | not grep '\(and\|sub\)' +; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -dce | llvm-dis | \ +; RUN: not grep {\\(and\\|sub\\)} int %test1(int %a, int %b) { %tmp.2 = and int %b, %a From reid at x10sys.com Mon Apr 16 10:32:55 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:32:55 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/CBackend/2004-12-03-ExternStatics.ll Message-ID: <200704161532.l3GFWtOo006258@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/CBackend: 2004-12-03-ExternStatics.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix syntax of tests to ensure grep pattern is properly quoted. --- Diffs of the changes: (+1 -1) 2004-12-03-ExternStatics.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CodeGen/CBackend/2004-12-03-ExternStatics.ll diff -u llvm/test/CodeGen/CBackend/2004-12-03-ExternStatics.ll:1.2 llvm/test/CodeGen/CBackend/2004-12-03-ExternStatics.ll:1.3 --- llvm/test/CodeGen/CBackend/2004-12-03-ExternStatics.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/CBackend/2004-12-03-ExternStatics.ll Mon Apr 16 10:31:48 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | not grep 'extern.*msg' +; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | not grep extern.*msg ; This is PR472 From reid at x10sys.com Mon Apr 16 10:32:56 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:32:56 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/Mem2Reg/PromoteMemToRegister.ll Message-ID: <200704161532.l3GFWuKY006263@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/Mem2Reg: PromoteMemToRegister.ll updated: 1.4 -> 1.5 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix syntax of tests to ensure grep pattern is properly quoted. --- Diffs of the changes: (+1 -1) PromoteMemToRegister.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Transforms/Mem2Reg/PromoteMemToRegister.ll diff -u llvm/test/Transforms/Mem2Reg/PromoteMemToRegister.ll:1.4 llvm/test/Transforms/Mem2Reg/PromoteMemToRegister.ll:1.5 --- llvm/test/Transforms/Mem2Reg/PromoteMemToRegister.ll:1.4 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/Mem2Reg/PromoteMemToRegister.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,5 @@ ; Simple sanity check testcase. Both alloca's should be eliminated. -; RUN: llvm-upgrade < %s | llvm-as | opt -mem2reg | llvm-dis | not grep 'alloca' +; RUN: llvm-upgrade < %s | llvm-as | opt -mem2reg | llvm-dis | not grep alloca implementation From reid at x10sys.com Mon Apr 16 10:32:56 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:32:56 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/SimplifyLibCalls/FFS.ll FPrintF.ll MemCpy.ll MemMove.ll Printf.ll Puts.ll SPrintF.ll StrCat.ll StrChr.ll StrCmp.ll StrCpy.ll StrLen.ll StrNCmp.ll ToAscii.ll memcmp.ll Message-ID: <200704161532.l3GFWuur006296@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/SimplifyLibCalls: FFS.ll updated: 1.5 -> 1.6 FPrintF.ll updated: 1.2 -> 1.3 MemCpy.ll updated: 1.4 -> 1.5 MemMove.ll updated: 1.4 -> 1.5 Printf.ll updated: 1.1 -> 1.2 Puts.ll updated: 1.4 -> 1.5 SPrintF.ll updated: 1.3 -> 1.4 StrCat.ll updated: 1.2 -> 1.3 StrChr.ll updated: 1.3 -> 1.4 StrCmp.ll updated: 1.2 -> 1.3 StrCpy.ll updated: 1.3 -> 1.4 StrLen.ll updated: 1.6 -> 1.7 StrNCmp.ll updated: 1.3 -> 1.4 ToAscii.ll updated: 1.2 -> 1.3 memcmp.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix syntax of tests to ensure grep pattern is properly quoted. --- Diffs of the changes: (+30 -19) FFS.ll | 3 ++- FPrintF.ll | 3 ++- MemCpy.ll | 4 ++-- MemMove.ll | 4 ++-- Printf.ll | 5 +++-- Puts.ll | 3 ++- SPrintF.ll | 4 ++-- StrCat.ll | 3 ++- StrChr.ll | 3 ++- StrCmp.ll | 3 ++- StrCpy.ll | 3 ++- StrLen.ll | 2 +- StrNCmp.ll | 3 ++- ToAscii.ll | 3 ++- memcmp.ll | 3 ++- 15 files changed, 30 insertions(+), 19 deletions(-) Index: llvm/test/Transforms/SimplifyLibCalls/FFS.ll diff -u llvm/test/Transforms/SimplifyLibCalls/FFS.ll:1.5 llvm/test/Transforms/SimplifyLibCalls/FFS.ll:1.6 --- llvm/test/Transforms/SimplifyLibCalls/FFS.ll:1.5 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/SimplifyLibCalls/FFS.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,6 @@ ; Test that the ToAsciiOptimizer works correctly -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*%ffs' +; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ +; RUN: not grep {call.*%ffs} declare int %ffs(int) declare int %ffsl(int) Index: llvm/test/Transforms/SimplifyLibCalls/FPrintF.ll diff -u llvm/test/Transforms/SimplifyLibCalls/FPrintF.ll:1.2 llvm/test/Transforms/SimplifyLibCalls/FPrintF.ll:1.3 --- llvm/test/Transforms/SimplifyLibCalls/FPrintF.ll:1.2 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/SimplifyLibCalls/FPrintF.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,6 @@ ; Test that the FPrintFOptimizer works correctly -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*fprintf' +; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ +; RUN: not grep {call.*fprintf} ; %struct._IO_FILE = type { int, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, %struct._IO_marker*, %struct._IO_FILE*, int, int, int, ushort, sbyte, [1 x sbyte], sbyte*, long, sbyte*, sbyte*, int, [52 x sbyte] } Index: llvm/test/Transforms/SimplifyLibCalls/MemCpy.ll diff -u llvm/test/Transforms/SimplifyLibCalls/MemCpy.ll:1.4 llvm/test/Transforms/SimplifyLibCalls/MemCpy.ll:1.5 --- llvm/test/Transforms/SimplifyLibCalls/MemCpy.ll:1.4 Sat Dec 2 14:41:53 2006 +++ llvm/test/Transforms/SimplifyLibCalls/MemCpy.ll Mon Apr 16 10:31:49 2007 @@ -1,6 +1,6 @@ ; Test that the StrCatOptimizer works correctly -; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls -disable-output && -; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls | llvm-dis | not grep 'call.*llvm.memcpy.i32' +; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls | \ +; RUN: llvm-dis | not grep {call.*llvm.memcpy.i32} declare void %llvm.memcpy.i32(sbyte*,sbyte*,uint,uint) %h = constant [2 x sbyte] c"h\00" Index: llvm/test/Transforms/SimplifyLibCalls/MemMove.ll diff -u llvm/test/Transforms/SimplifyLibCalls/MemMove.ll:1.4 llvm/test/Transforms/SimplifyLibCalls/MemMove.ll:1.5 --- llvm/test/Transforms/SimplifyLibCalls/MemMove.ll:1.4 Sat Dec 2 14:41:53 2006 +++ llvm/test/Transforms/SimplifyLibCalls/MemMove.ll Mon Apr 16 10:31:49 2007 @@ -1,6 +1,6 @@ ; Test that the StrCatOptimizer works correctly -; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls -disable-output && -; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls | llvm-dis | not grep 'call.*llvm.memmove.i32' +; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls | \ +; RUN: llvm-dis | not grep {call.*llvm.memmove.i32} declare void %llvm.memmove.i32(sbyte*,sbyte*,uint,uint) %h = constant [2 x sbyte] c"h\00" Index: llvm/test/Transforms/SimplifyLibCalls/Printf.ll diff -u llvm/test/Transforms/SimplifyLibCalls/Printf.ll:1.1 llvm/test/Transforms/SimplifyLibCalls/Printf.ll:1.2 --- llvm/test/Transforms/SimplifyLibCalls/Printf.ll:1.1 Fri Apr 13 20:17:38 2007 +++ llvm/test/Transforms/SimplifyLibCalls/Printf.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,6 @@ -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep putchar && -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call.*printf' +; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep putchar +; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: not grep {call.*printf} @str = internal constant [13 x i8] c"hello world\0A\00" ; <[13 x i8]*> [#uses=1] @str1 = internal constant [2 x i8] c"h\00" ; <[2 x i8]*> [#uses=1] Index: llvm/test/Transforms/SimplifyLibCalls/Puts.ll diff -u llvm/test/Transforms/SimplifyLibCalls/Puts.ll:1.4 llvm/test/Transforms/SimplifyLibCalls/Puts.ll:1.5 --- llvm/test/Transforms/SimplifyLibCalls/Puts.ll:1.4 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/SimplifyLibCalls/Puts.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,6 @@ ; Test that the PutsCatOptimizer works correctly -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*fputs' +; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ +; RUN: not grep {call.*fputs} ; %struct._IO_FILE = type { int, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, %struct._IO_marker*, %struct._IO_FILE*, int, int, int, ushort, sbyte, [1 x sbyte], sbyte*, long, sbyte*, sbyte*, int, [52 x sbyte] } %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, int } Index: llvm/test/Transforms/SimplifyLibCalls/SPrintF.ll diff -u llvm/test/Transforms/SimplifyLibCalls/SPrintF.ll:1.3 llvm/test/Transforms/SimplifyLibCalls/SPrintF.ll:1.4 --- llvm/test/Transforms/SimplifyLibCalls/SPrintF.ll:1.3 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/SimplifyLibCalls/SPrintF.ll Mon Apr 16 10:31:49 2007 @@ -1,6 +1,6 @@ ; Test that the SPrintFOptimizer works correctly -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls -disable-output && -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*sprintf' +; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ +; RUN: not grep {call.*sprintf} declare int %sprintf(sbyte*,sbyte*,...) declare int %puts(sbyte*) Index: llvm/test/Transforms/SimplifyLibCalls/StrCat.ll diff -u llvm/test/Transforms/SimplifyLibCalls/StrCat.ll:1.2 llvm/test/Transforms/SimplifyLibCalls/StrCat.ll:1.3 --- llvm/test/Transforms/SimplifyLibCalls/StrCat.ll:1.2 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/SimplifyLibCalls/StrCat.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,6 @@ ; Test that the StrCatOptimizer works correctly -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*strcat' +; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ +; RUN: not grep {call.*strcat} declare sbyte* %strcat(sbyte*,sbyte*) declare int %puts(sbyte*) Index: llvm/test/Transforms/SimplifyLibCalls/StrChr.ll diff -u llvm/test/Transforms/SimplifyLibCalls/StrChr.ll:1.3 llvm/test/Transforms/SimplifyLibCalls/StrChr.ll:1.4 --- llvm/test/Transforms/SimplifyLibCalls/StrChr.ll:1.3 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/SimplifyLibCalls/StrChr.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,6 @@ ; Test that the StrChrOptimizer works correctly -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*%strchr' +; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ +; RUN: not grep {call.*%strchr} declare sbyte* %strchr(sbyte*,int) declare int %puts(sbyte*) Index: llvm/test/Transforms/SimplifyLibCalls/StrCmp.ll diff -u llvm/test/Transforms/SimplifyLibCalls/StrCmp.ll:1.2 llvm/test/Transforms/SimplifyLibCalls/StrCmp.ll:1.3 --- llvm/test/Transforms/SimplifyLibCalls/StrCmp.ll:1.2 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/SimplifyLibCalls/StrCmp.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,6 @@ ; Test that the StrCmpOptimizer works correctly -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*strcmp' +; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ +; RUN: not grep {call.*strcmp} declare int %strcmp(sbyte*,sbyte*) declare int %puts(sbyte*) Index: llvm/test/Transforms/SimplifyLibCalls/StrCpy.ll diff -u llvm/test/Transforms/SimplifyLibCalls/StrCpy.ll:1.3 llvm/test/Transforms/SimplifyLibCalls/StrCpy.ll:1.4 --- llvm/test/Transforms/SimplifyLibCalls/StrCpy.ll:1.3 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/SimplifyLibCalls/StrCpy.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,6 @@ ; Test that the StrCpyOptimizer works correctly -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*strcpy' +; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ +; RUN: not grep {call.*strcpy} declare sbyte* %strcpy(sbyte*,sbyte*) declare int %puts(sbyte*) Index: llvm/test/Transforms/SimplifyLibCalls/StrLen.ll diff -u llvm/test/Transforms/SimplifyLibCalls/StrLen.ll:1.6 llvm/test/Transforms/SimplifyLibCalls/StrLen.ll:1.7 --- llvm/test/Transforms/SimplifyLibCalls/StrLen.ll:1.6 Fri Jan 26 02:25:06 2007 +++ llvm/test/Transforms/SimplifyLibCalls/StrLen.ll Mon Apr 16 10:31:49 2007 @@ -1,6 +1,6 @@ ; Test that the StrCatOptimizer works correctly ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ -; RUN: not grep 'call.*strlen' +; RUN: not grep {call.*strlen} target datalayout = "e-p:32:32" Index: llvm/test/Transforms/SimplifyLibCalls/StrNCmp.ll diff -u llvm/test/Transforms/SimplifyLibCalls/StrNCmp.ll:1.3 llvm/test/Transforms/SimplifyLibCalls/StrNCmp.ll:1.4 --- llvm/test/Transforms/SimplifyLibCalls/StrNCmp.ll:1.3 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/SimplifyLibCalls/StrNCmp.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,6 @@ ; Test that the StrNCmpOptimizer works correctly -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*strncmp' +; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ +; RUN: not grep {call.*strncmp} declare int %strncmp(sbyte*,sbyte*,int) declare int %puts(sbyte*) Index: llvm/test/Transforms/SimplifyLibCalls/ToAscii.ll diff -u llvm/test/Transforms/SimplifyLibCalls/ToAscii.ll:1.2 llvm/test/Transforms/SimplifyLibCalls/ToAscii.ll:1.3 --- llvm/test/Transforms/SimplifyLibCalls/ToAscii.ll:1.2 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/SimplifyLibCalls/ToAscii.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,6 @@ ; Test that the ToAsciiOptimizer works correctly -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*toascii' +; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ +; RUN: not grep {call.*toascii} declare int %toascii(int) Index: llvm/test/Transforms/SimplifyLibCalls/memcmp.ll diff -u llvm/test/Transforms/SimplifyLibCalls/memcmp.ll:1.2 llvm/test/Transforms/SimplifyLibCalls/memcmp.ll:1.3 --- llvm/test/Transforms/SimplifyLibCalls/memcmp.ll:1.2 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/SimplifyLibCalls/memcmp.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,6 @@ ; Test that the memcmpOptimizer works correctly -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*memcmp' && +; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ +; RUN: not grep {call.*memcmp} ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls -disable-output declare int %memcmp(sbyte*,sbyte*,int) From reid at x10sys.com Mon Apr 16 10:32:58 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:32:58 -0500 Subject: [llvm-commits] CVS: llvm/test/TableGen/DagDefSubst.ll DagIntSubst.ll Message-ID: <200704161532.l3GFWwJh006309@zion.cs.uiuc.edu> Changes in directory llvm/test/TableGen: DagDefSubst.ll updated: 1.1 -> 1.2 DagIntSubst.ll updated: 1.1 -> 1.2 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix syntax of tests to ensure grep pattern is properly quoted. --- Diffs of the changes: (+3 -3) DagDefSubst.ll | 4 ++-- DagIntSubst.ll | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/test/TableGen/DagDefSubst.ll diff -u llvm/test/TableGen/DagDefSubst.ll:1.1 llvm/test/TableGen/DagDefSubst.ll:1.2 --- llvm/test/TableGen/DagDefSubst.ll:1.1 Thu Mar 30 16:49:59 2006 +++ llvm/test/TableGen/DagDefSubst.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,5 @@ -// RUN: tblgen %s | grep 'dag d = (X Y)' && -// RUN: tblgen %s | grep 'dag e = (Y X)' +// RUN: tblgen %s | grep {dag d = (X Y)} +// RUN: tblgen %s | grep {dag e = (Y X)} def X; class yclass; Index: llvm/test/TableGen/DagIntSubst.ll diff -u llvm/test/TableGen/DagIntSubst.ll:1.1 llvm/test/TableGen/DagIntSubst.ll:1.2 --- llvm/test/TableGen/DagIntSubst.ll:1.1 Tue Jan 31 00:01:40 2006 +++ llvm/test/TableGen/DagIntSubst.ll Mon Apr 16 10:31:49 2007 @@ -1,4 +1,4 @@ -// RUN: tblgen %s | grep 'dag d = (X 13)' +// RUN: tblgen %s | grep {dag d = (X 13)} def X; class C { From reid at x10sys.com Mon Apr 16 10:32:58 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:32:58 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/2005-01-17-CycleInDAG.ll 2005-12-03-IndirectTailCall.ll 2006-03-01-InstrSchedBug.ll 2006-05-08-InstrSched.ll 2007-01-13-StackPtrIndex.ll 2007-02-04-OrAddrMode.ll overlap-add.ll setuge.ll shift-one.ll trunc-to-bool.ll vec_shuffle-10.ll Message-ID: <200704161532.l3GFWwMK006328@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: 2005-01-17-CycleInDAG.ll updated: 1.3 -> 1.4 2005-12-03-IndirectTailCall.ll updated: 1.5 -> 1.6 2006-03-01-InstrSchedBug.ll updated: 1.2 -> 1.3 2006-05-08-InstrSched.ll updated: 1.5 -> 1.6 2007-01-13-StackPtrIndex.ll updated: 1.5 -> 1.6 2007-02-04-OrAddrMode.ll updated: 1.3 -> 1.4 overlap-add.ll updated: 1.6 -> 1.7 setuge.ll updated: 1.2 -> 1.3 shift-one.ll updated: 1.2 -> 1.3 trunc-to-bool.ll updated: 1.10 -> 1.11 vec_shuffle-10.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix syntax of tests to ensure grep pattern is properly quoted. --- Diffs of the changes: (+18 -16) 2005-01-17-CycleInDAG.ll | 2 +- 2005-12-03-IndirectTailCall.ll | 2 +- 2006-03-01-InstrSchedBug.ll | 2 +- 2006-05-08-InstrSched.ll | 3 ++- 2007-01-13-StackPtrIndex.ll | 4 ++-- 2007-02-04-OrAddrMode.ll | 2 +- overlap-add.ll | 2 +- setuge.ll | 2 +- shift-one.ll | 2 +- trunc-to-bool.ll | 3 +-- vec_shuffle-10.ll | 10 ++++++---- 11 files changed, 18 insertions(+), 16 deletions(-) Index: llvm/test/CodeGen/X86/2005-01-17-CycleInDAG.ll diff -u llvm/test/CodeGen/X86/2005-01-17-CycleInDAG.ll:1.3 llvm/test/CodeGen/X86/2005-01-17-CycleInDAG.ll:1.4 --- llvm/test/CodeGen/X86/2005-01-17-CycleInDAG.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/2005-01-17-CycleInDAG.ll Mon Apr 16 10:31:49 2007 @@ -3,7 +3,7 @@ ; is invalid code (there is no correct way to order the instruction). Check ; that we do not fold the load into the sub. -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep 'sub.*GLOBAL' +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep sub.*GLOBAL %GLOBAL = external global int Index: llvm/test/CodeGen/X86/2005-12-03-IndirectTailCall.ll diff -u llvm/test/CodeGen/X86/2005-12-03-IndirectTailCall.ll:1.5 llvm/test/CodeGen/X86/2005-12-03-IndirectTailCall.ll:1.6 --- llvm/test/CodeGen/X86/2005-12-03-IndirectTailCall.ll:1.5 Wed Feb 28 12:38:58 2007 +++ llvm/test/CodeGen/X86/2005-12-03-IndirectTailCall.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,5 @@ ; XFAIL: * -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep 'jmp \*ecx' +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep {jmp \\*ecx} declare int %putchar(int) int %main(){ Index: llvm/test/CodeGen/X86/2006-03-01-InstrSchedBug.ll diff -u llvm/test/CodeGen/X86/2006-03-01-InstrSchedBug.ll:1.2 llvm/test/CodeGen/X86/2006-03-01-InstrSchedBug.ll:1.3 --- llvm/test/CodeGen/X86/2006-03-01-InstrSchedBug.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/2006-03-01-InstrSchedBug.ll Mon Apr 16 10:31:49 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep 'subl.*%esp' +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep {subl.*%esp} int %f(int %a, int %b) { %tmp.2 = mul int %a, %a Index: llvm/test/CodeGen/X86/2006-05-08-InstrSched.ll diff -u llvm/test/CodeGen/X86/2006-05-08-InstrSched.ll:1.5 llvm/test/CodeGen/X86/2006-05-08-InstrSched.ll:1.6 --- llvm/test/CodeGen/X86/2006-05-08-InstrSched.ll:1.5 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/2006-05-08-InstrSched.ll Mon Apr 16 10:31:49 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -relocation-model=static | not grep 'subl.*%esp' +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: llc -march=x86 -relocation-model=static | not grep {subl.*%esp} %A = external global ushort* %B = external global uint Index: llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll diff -u llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll:1.5 llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll:1.6 --- llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll:1.5 Tue Mar 27 21:38:26 2007 +++ llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | llc -march=x86-64 -sched=none | grep leaq && -; RUN: llvm-as < %s | llc -march=x86-64 -sched=none | not grep ',%rsp)' +; RUN: llvm-as < %s | llc -march=x86-64 -sched=none | grep leaq +; RUN: llvm-as < %s | llc -march=x86-64 -sched=none | not grep {,%rsp)} ; PR1103 target datalayout = "e-p:64:64" Index: llvm/test/CodeGen/X86/2007-02-04-OrAddrMode.ll diff -u llvm/test/CodeGen/X86/2007-02-04-OrAddrMode.ll:1.3 llvm/test/CodeGen/X86/2007-02-04-OrAddrMode.ll:1.4 --- llvm/test/CodeGen/X86/2007-02-04-OrAddrMode.ll:1.3 Sun Apr 15 17:16:46 2007 +++ llvm/test/CodeGen/X86/2007-02-04-OrAddrMode.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -march=x86 | grep {orl \$1, %eax} -; RUN: llvm-as < %s | llc -march=x86 | grep {leal 3(,%eax,8)' +; RUN: llvm-as < %s | llc -march=x86 | grep {leal 3(,%eax,8)} ;; This example can't fold the or into an LEA. define i32 @test(float ** %tmp2, i32 %tmp12) { Index: llvm/test/CodeGen/X86/overlap-add.ll diff -u llvm/test/CodeGen/X86/overlap-add.ll:1.6 llvm/test/CodeGen/X86/overlap-add.ll:1.7 --- llvm/test/CodeGen/X86/overlap-add.ll:1.6 Mon Feb 5 04:09:41 2007 +++ llvm/test/CodeGen/X86/overlap-add.ll Mon Apr 16 10:31:49 2007 @@ -7,7 +7,7 @@ ; Check that the shift gets turned into an LEA. ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | \ -; RUN: not grep 'mov E.X, E.X' +; RUN: not grep {mov E.X, E.X} ; FIXME: We need live variable information about flags to do this xform safely. :( ; XFAIL: * Index: llvm/test/CodeGen/X86/setuge.ll diff -u llvm/test/CodeGen/X86/setuge.ll:1.2 llvm/test/CodeGen/X86/setuge.ll:1.3 --- llvm/test/CodeGen/X86/setuge.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/setuge.ll Mon Apr 16 10:31:49 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep 'set' +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep set declare bool %llvm.isunordered.f32(float, float) Index: llvm/test/CodeGen/X86/shift-one.ll diff -u llvm/test/CodeGen/X86/shift-one.ll:1.2 llvm/test/CodeGen/X86/shift-one.ll:1.3 --- llvm/test/CodeGen/X86/shift-one.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/shift-one.ll Mon Apr 16 10:31:49 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep 'leal' +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep leal %x = external global int Index: llvm/test/CodeGen/X86/trunc-to-bool.ll diff -u llvm/test/CodeGen/X86/trunc-to-bool.ll:1.10 llvm/test/CodeGen/X86/trunc-to-bool.ll:1.11 --- llvm/test/CodeGen/X86/trunc-to-bool.ll:1.10 Thu Feb 1 20:16:22 2007 +++ llvm/test/CodeGen/X86/trunc-to-bool.ll Mon Apr 16 10:31:49 2007 @@ -1,8 +1,7 @@ ; An integer truncation to i1 should be done with an and instruction to make ; sure only the LSBit survives. Test that this is the case both for a returned ; value and as the operand of a branch. -; RUN: llvm-as < %s | llc -march=x86 && -; RUN: llvm-as < %s | llc -march=x86 | grep '\(and\)\|\(test.*\$1\)' | \ +; RUN: llvm-as < %s | llc -march=x86 | grep {\\(and\\)\\|\\(test.*\\\$1\\)} | \ ; RUN: wc -l | grep 6 define i1 @test1(i32 %X) zext { Index: llvm/test/CodeGen/X86/vec_shuffle-10.ll diff -u llvm/test/CodeGen/X86/vec_shuffle-10.ll:1.2 llvm/test/CodeGen/X86/vec_shuffle-10.ll:1.3 --- llvm/test/CodeGen/X86/vec_shuffle-10.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_shuffle-10.ll Mon Apr 16 10:31:49 2007 @@ -1,7 +1,9 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep unpcklps | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep unpckhps | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | not grep 'sub.*esp' +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \ +; RUN: grep unpcklps | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \ +; RUN: grep unpckhps | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \ +; RUN: not grep {sub.*esp} void %test(<4 x float>* %res, <4 x float>* %A, <4 x float>* %B) { %tmp = load <4 x float>* %B ; <<4 x float>> [#uses=2] From reid at x10sys.com Mon Apr 16 10:32:58 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:32:58 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll logicaltest.ll Message-ID: <200704161532.l3GFWwbG006335@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/ConstProp: 2002-09-03-SetCC-Bools.ll updated: 1.4 -> 1.5 logicaltest.ll updated: 1.5 -> 1.6 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix syntax of tests to ensure grep pattern is properly quoted. --- Diffs of the changes: (+4 -2) 2002-09-03-SetCC-Bools.ll | 3 ++- logicaltest.ll | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll diff -u llvm/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll:1.4 llvm/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll:1.5 --- llvm/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll:1.4 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll Mon Apr 16 10:31:49 2007 @@ -1,6 +1,7 @@ ; SetCC on boolean values was not implemented! -; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -die | llvm-dis | not grep 'set' +; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -die | llvm-dis | \ +; RUN: not grep set bool "test1"() { %A = setle bool true, false Index: llvm/test/Transforms/ConstProp/logicaltest.ll diff -u llvm/test/Transforms/ConstProp/logicaltest.ll:1.5 llvm/test/Transforms/ConstProp/logicaltest.ll:1.6 --- llvm/test/Transforms/ConstProp/logicaltest.ll:1.5 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/ConstProp/logicaltest.ll Mon Apr 16 10:31:49 2007 @@ -1,6 +1,7 @@ ; Ensure constant propogation of logical instructions is working correctly. -; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -die | llvm-dis | not egrep 'and|or|xor' +; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -die | llvm-dis | \ +; RUN: not egrep {and|or|xor} int "test1"() { %R = and int 4,1234 ret int %R } From reid at x10sys.com Mon Apr 16 10:32:59 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:32:59 -0500 Subject: [llvm-commits] CVS: llvm/test/Assembler/2002-07-25-ParserAssertionFailure.llx 2003-04-15-ConstantInitAssertion.llx 2003-12-30-TypeMapInvalidMemory.llx ConstantExprFold.llx Message-ID: <200704161532.l3GFWxAE006357@zion.cs.uiuc.edu> Changes in directory llvm/test/Assembler: 2002-07-25-ParserAssertionFailure.llx updated: 1.5 -> 1.6 2003-04-15-ConstantInitAssertion.llx updated: 1.5 -> 1.6 2003-12-30-TypeMapInvalidMemory.llx updated: 1.10 -> 1.11 ConstantExprFold.llx updated: 1.6 -> 1.7 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix syntax of tests to ensure grep pattern is properly quoted. --- Diffs of the changes: (+4 -5) 2002-07-25-ParserAssertionFailure.llx | 2 +- 2003-04-15-ConstantInitAssertion.llx | 2 +- 2003-12-30-TypeMapInvalidMemory.llx | 2 +- ConstantExprFold.llx | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) Index: llvm/test/Assembler/2002-07-25-ParserAssertionFailure.llx diff -u llvm/test/Assembler/2002-07-25-ParserAssertionFailure.llx:1.5 llvm/test/Assembler/2002-07-25-ParserAssertionFailure.llx:1.6 --- llvm/test/Assembler/2002-07-25-ParserAssertionFailure.llx:1.5 Mon Apr 16 10:00:39 2007 +++ llvm/test/Assembler/2002-07-25-ParserAssertionFailure.llx Mon Apr 16 10:31:48 2007 @@ -1,6 +1,6 @@ ; Make sure we don't get an assertion failure, even though this is a parse ; error -; RUN: llvm-as < %s -o /dev/null -f |& grep 'No arguments' +; RUN: llvm-as < %s -o /dev/null -f |& grep {No arguments} %ty = type void (i32) Index: llvm/test/Assembler/2003-04-15-ConstantInitAssertion.llx diff -u llvm/test/Assembler/2003-04-15-ConstantInitAssertion.llx:1.5 llvm/test/Assembler/2003-04-15-ConstantInitAssertion.llx:1.6 --- llvm/test/Assembler/2003-04-15-ConstantInitAssertion.llx:1.5 Mon Apr 16 10:00:39 2007 +++ llvm/test/Assembler/2003-04-15-ConstantInitAssertion.llx Mon Apr 16 10:31:48 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s >/dev/null |& grep "Expected type 'i32' for element #0" +; RUN: llvm-as < %s >/dev/null |& grep {Expected type 'i32' for element #0} ; Test the case of a misformed constant initializer ; This should cause an assembler error, not an assertion failure! constant { i32 } { float 1.0 } Index: llvm/test/Assembler/2003-12-30-TypeMapInvalidMemory.llx diff -u llvm/test/Assembler/2003-12-30-TypeMapInvalidMemory.llx:1.10 llvm/test/Assembler/2003-12-30-TypeMapInvalidMemory.llx:1.11 --- llvm/test/Assembler/2003-12-30-TypeMapInvalidMemory.llx:1.10 Mon Apr 16 10:00:39 2007 +++ llvm/test/Assembler/2003-12-30-TypeMapInvalidMemory.llx Mon Apr 16 10:31:48 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s -o /dev/null -f |& grep 'Undefined type remains' +; RUN: llvm-as < %s -o /dev/null -f |& grep {Undefined type remains} ; END. @d_reduction_0_dparser_gram = global { Index: llvm/test/Assembler/ConstantExprFold.llx diff -u llvm/test/Assembler/ConstantExprFold.llx:1.6 llvm/test/Assembler/ConstantExprFold.llx:1.7 --- llvm/test/Assembler/ConstantExprFold.llx:1.6 Sat Dec 2 14:34:08 2006 +++ llvm/test/Assembler/ConstantExprFold.llx Mon Apr 16 10:31:48 2007 @@ -1,8 +1,7 @@ ; This test checks to make sure that constant exprs fold in some simple ; situations -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | not grep '(' && -; RUN: llvm-upgrade < %s | llvm-as +; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | not grep {(} %A = global long 0 From reid at x10sys.com Mon Apr 16 10:32:59 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:32:59 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Alpha/ctpop.ll Message-ID: <200704161532.l3GFWxvI006349@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Alpha: ctpop.ll updated: 1.10 -> 1.11 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix syntax of tests to ensure grep pattern is properly quoted. --- Diffs of the changes: (+1 -1) ctpop.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CodeGen/Alpha/ctpop.ll diff -u llvm/test/CodeGen/Alpha/ctpop.ll:1.10 llvm/test/CodeGen/Alpha/ctpop.ll:1.11 --- llvm/test/CodeGen/Alpha/ctpop.ll:1.10 Sun Apr 15 22:18:25 2007 +++ llvm/test/CodeGen/Alpha/ctpop.ll Mon Apr 16 10:31:48 2007 @@ -7,7 +7,7 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha -mcpu=ev56 | \ ; RUN: not grep -i ctpop ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha -mattr=-CIX | \ -; RUN: not grep -i 'ctpop' +; RUN: not grep -i ctpop ; XFAIL: * declare long %llvm.ctpop.i64(long) From reid at x10sys.com Mon Apr 16 10:33:00 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:33:00 -0500 Subject: [llvm-commits] CVS: llvm/test/C++Frontend/2005-01-03-StaticInitializers.cpp 2007-01-06-ELF-Thunk-Sections.cpp Message-ID: <200704161533.l3GFX0is006381@zion.cs.uiuc.edu> Changes in directory llvm/test/C++Frontend: 2005-01-03-StaticInitializers.cpp updated: 1.2 -> 1.3 2007-01-06-ELF-Thunk-Sections.cpp updated: 1.3 -> 1.4 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix syntax of tests to ensure grep pattern is properly quoted. --- Diffs of the changes: (+2 -3) 2005-01-03-StaticInitializers.cpp | 2 +- 2007-01-06-ELF-Thunk-Sections.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/test/C++Frontend/2005-01-03-StaticInitializers.cpp diff -u llvm/test/C++Frontend/2005-01-03-StaticInitializers.cpp:1.2 llvm/test/C++Frontend/2005-01-03-StaticInitializers.cpp:1.3 --- llvm/test/C++Frontend/2005-01-03-StaticInitializers.cpp:1.2 Sat Feb 19 01:31:54 2005 +++ llvm/test/C++Frontend/2005-01-03-StaticInitializers.cpp Mon Apr 16 10:31:48 2007 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx %s -S -o - | not grep 'llvm.global_ctor' +// RUN: %llvmgxx %s -S -o - | not grep llvm.global_ctor struct S { int A[2]; Index: llvm/test/C++Frontend/2007-01-06-ELF-Thunk-Sections.cpp diff -u llvm/test/C++Frontend/2007-01-06-ELF-Thunk-Sections.cpp:1.3 llvm/test/C++Frontend/2007-01-06-ELF-Thunk-Sections.cpp:1.4 --- llvm/test/C++Frontend/2007-01-06-ELF-Thunk-Sections.cpp:1.3 Mon Jan 8 18:05:55 2007 +++ llvm/test/C++Frontend/2007-01-06-ELF-Thunk-Sections.cpp Mon Apr 16 10:31:48 2007 @@ -1,5 +1,4 @@ -// RUN: %llvmgxx %s -emit-llvm -S -o - && -// RUN: %llvmgxx %s -emit-llvm -S -o - | not grep 'gnu.linkonce.' +// RUN: %llvmgxx %s -emit-llvm -S -o - | not grep gnu.linkonce. // PR1085 class From reid at x10sys.com Mon Apr 16 10:32:59 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:32:59 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/PowerPC/2004-12-12-ZeroSizeCommon.ll and-imm.ll small-arguments.ll Message-ID: <200704161532.l3GFWxBH006371@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/PowerPC: 2004-12-12-ZeroSizeCommon.ll updated: 1.2 -> 1.3 and-imm.ll updated: 1.3 -> 1.4 small-arguments.ll updated: 1.9 -> 1.10 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix syntax of tests to ensure grep pattern is properly quoted. --- Diffs of the changes: (+3 -4) 2004-12-12-ZeroSizeCommon.ll | 2 +- and-imm.ll | 2 +- small-arguments.ll | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) Index: llvm/test/CodeGen/PowerPC/2004-12-12-ZeroSizeCommon.ll diff -u llvm/test/CodeGen/PowerPC/2004-12-12-ZeroSizeCommon.ll:1.2 llvm/test/CodeGen/PowerPC/2004-12-12-ZeroSizeCommon.ll:1.3 --- llvm/test/CodeGen/PowerPC/2004-12-12-ZeroSizeCommon.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/2004-12-12-ZeroSizeCommon.ll Mon Apr 16 10:31:49 2007 @@ -1,3 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep '.comm.*X,0' +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep .comm.*X,0 %X = linkonce global {} {} Index: llvm/test/CodeGen/PowerPC/and-imm.ll diff -u llvm/test/CodeGen/PowerPC/and-imm.ll:1.3 llvm/test/CodeGen/PowerPC/and-imm.ll:1.4 --- llvm/test/CodeGen/PowerPC/and-imm.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/and-imm.ll Mon Apr 16 10:31:49 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep 'ori\|lis' +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep {ori\\|lis} int %test(int %X) { %Y = and int %X, 32769 ; andi. r3, r3, 32769 Index: llvm/test/CodeGen/PowerPC/small-arguments.ll diff -u llvm/test/CodeGen/PowerPC/small-arguments.ll:1.9 llvm/test/CodeGen/PowerPC/small-arguments.ll:1.10 --- llvm/test/CodeGen/PowerPC/small-arguments.ll:1.9 Fri Jan 26 02:25:06 2007 +++ llvm/test/CodeGen/PowerPC/small-arguments.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,4 @@ -; RUN: llvm-as < %s | llc -march=ppc32 && -; RUN: llvm-as < %s | llc -march=ppc32 | not grep 'extsh\|rlwinm' +; RUN: llvm-as < %s | llc -march=ppc32 | not grep {extsh\\|rlwinm} declare i16 @foo() sext From reid at x10sys.com Mon Apr 16 10:32:59 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:32:59 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/IndVarsSimplify/2003-12-10-IndVarDeadCode.ll Message-ID: <200704161532.l3GFWxNP006368@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/IndVarsSimplify: 2003-12-10-IndVarDeadCode.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix syntax of tests to ensure grep pattern is properly quoted. --- Diffs of the changes: (+2 -1) 2003-12-10-IndVarDeadCode.ll | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/test/Transforms/IndVarsSimplify/2003-12-10-IndVarDeadCode.ll diff -u llvm/test/Transforms/IndVarsSimplify/2003-12-10-IndVarDeadCode.ll:1.2 llvm/test/Transforms/IndVarsSimplify/2003-12-10-IndVarDeadCode.ll:1.3 --- llvm/test/Transforms/IndVarsSimplify/2003-12-10-IndVarDeadCode.ll:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/IndVarsSimplify/2003-12-10-IndVarDeadCode.ll Mon Apr 16 10:31:49 2007 @@ -1,7 +1,8 @@ ; The induction variable canonicalization pass shouldn't leave dead ; instructions laying around! ; -; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | not grep '#uses=0' +; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | \ +; RUN: not grep {#uses=0} int %mul(int %x, int %y) { entry: From reid at x10sys.com Mon Apr 16 10:32:59 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 10:32:59 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/LoopStrengthReduce/invariant_value_first.ll invariant_value_first_arg.ll variable_stride.ll Message-ID: <200704161532.l3GFWxqi006344@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/LoopStrengthReduce: invariant_value_first.ll updated: 1.2 -> 1.3 invariant_value_first_arg.ll updated: 1.2 -> 1.3 variable_stride.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Fix syntax of tests to ensure grep pattern is properly quoted. --- Diffs of the changes: (+5 -3) invariant_value_first.ll | 3 ++- invariant_value_first_arg.ll | 3 ++- variable_stride.ll | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/test/Transforms/LoopStrengthReduce/invariant_value_first.ll diff -u llvm/test/Transforms/LoopStrengthReduce/invariant_value_first.ll:1.2 llvm/test/Transforms/LoopStrengthReduce/invariant_value_first.ll:1.3 --- llvm/test/Transforms/LoopStrengthReduce/invariant_value_first.ll:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/LoopStrengthReduce/invariant_value_first.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,6 @@ ; Check that the index of 'P[outer]' is pulled out of the loop. -; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | not grep 'getelementptr.*%outer.*%INDVAR' +; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | \ +; RUN: not grep {getelementptr.*%outer.*%INDVAR} declare bool %pred() declare int %foo() Index: llvm/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll diff -u llvm/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll:1.2 llvm/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll:1.3 --- llvm/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,6 @@ ; Check that the index of 'P[outer]' is pulled out of the loop. -; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | not grep 'getelementptr.*%outer.*%INDVAR' +; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | \ +; RUN: not grep {getelementptr.*%outer.*%INDVAR} declare bool %pred() Index: llvm/test/Transforms/LoopStrengthReduce/variable_stride.ll diff -u llvm/test/Transforms/LoopStrengthReduce/variable_stride.ll:1.2 llvm/test/Transforms/LoopStrengthReduce/variable_stride.ll:1.3 --- llvm/test/Transforms/LoopStrengthReduce/variable_stride.ll:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/LoopStrengthReduce/variable_stride.ll Mon Apr 16 10:31:49 2007 @@ -1,5 +1,5 @@ ; Check that variable strides are reduced to adds instead of multiplies. -; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | not grep 'mul' +; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | not grep mul declare bool %pred(int) From baldrick at free.fr Mon Apr 16 10:37:21 2007 From: baldrick at free.fr (Duncan Sands) Date: Mon, 16 Apr 2007 10:37:21 -0500 Subject: [llvm-commits] CVS: llvm/test/lib/llvm.exp Message-ID: <200704161537.l3GFbL9f006478@zion.cs.uiuc.edu> Changes in directory llvm/test/lib: llvm.exp updated: 1.13 -> 1.14 --- Log message: Change ne into !=. --- Diffs of the changes: (+1 -1) llvm.exp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/lib/llvm.exp diff -u llvm/test/lib/llvm.exp:1.13 llvm/test/lib/llvm.exp:1.14 --- llvm/test/lib/llvm.exp:1.13 Sun Apr 15 15:43:36 2007 +++ llvm/test/lib/llvm.exp Mon Apr 16 10:37:00 2007 @@ -12,7 +12,7 @@ switch "$code" { CHILDSTATUS { set status [lindex $::errorCode 2] - if { $status ne 0 } { + if { $status != 0 } { set resultmsg "$test: exit($status)$errmsg" } } From clattner at apple.com Mon Apr 16 11:00:44 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 16 Apr 2007 09:00:44 -0700 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Function.cpp In-Reply-To: <200704160655.l3G6t5uT017955@zion.cs.uiuc.edu> References: <200704160655.l3G6t5uT017955@zion.cs.uiuc.edu> Message-ID: <25B9A059-E8D6-443A-9755-894A5D5950EC@apple.com> > -unsigned Function::getIntrinsicID() const { > +unsigned Function::getIntrinsicID(bool noAssert) const { > const ValueName *ValName = this->getValueName(); > unsigned Len = ValName->getKeyLength(); > const char *Name = ValName->getKeyData(); > > - if (Len < 5 || Name[4] != '.' || Name[0] != 'l' || Name[1] != 'l' > + if (Len <= 5 || Name[4] != '.' || Name[0] != 'l' || Name[1] != 'l' I don't think this is right. It will incorrectly return 0 for "llvm." even if noAssert is false. -Chris > || Name[2] != 'v' || Name[3] != 'm') > return 0; // All intrinsics start with 'llvm.' > > - assert(Len != 5 && "'llvm.' is an invalid intrinsic name!"); > + assert((Len != 5 || noAssert) && "'llvm.' is an invalid > intrinsic name!"); > > #define GET_FUNCTION_RECOGNIZER > #include "llvm/Intrinsics.gen" > #undef GET_FUNCTION_RECOGNIZER > + assert(noAssert && "Invalid LLVM intrinsic name"); > return 0; > } > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From clattner at apple.com Mon Apr 16 11:02:06 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 16 Apr 2007 09:02:06 -0700 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y In-Reply-To: <200704160656.l3G6u3KV017978@zion.cs.uiuc.edu> References: <200704160656.l3G6u3KV017978@zion.cs.uiuc.edu> Message-ID: <4A69B547-A9B7-4E19-B29B-1BC6DB6F6068@apple.com> > + // Check for call to invalid intrinsic to avoid crashing later. > + if (Function *theF = dyn_cast(V)) { > + if (theF->hasName() && 0 == strncmp(theF->getName().c_str(), > "llvm.", 5)&& Please don't use getName().c_str(). This requires construction of a temporary std::string (i.e. heap traffic). Instead, plz use Value::getValueName() etc. -Chris > + !theF->getIntrinsicID(true)) > + GEN_ERROR("Call to invalid LLVM intrinsic function '" + > + theF->getName() + "'"); > + } > + > // Check the arguments > ValueList Args; > if ($6->empty()) { // Has no > arguments? > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From baldrick at free.fr Mon Apr 16 11:06:39 2007 From: baldrick at free.fr (Duncan Sands) Date: Mon, 16 Apr 2007 11:06:39 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2004-11-27-StaticFunctionRedeclare.c Message-ID: <200704161606.l3GG6dYS007204@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2004-11-27-StaticFunctionRedeclare.c updated: 1.2 -> 1.3 --- Log message: Use %s, not explicit name. --- Diffs of the changes: (+1 -1) 2004-11-27-StaticFunctionRedeclare.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CFrontend/2004-11-27-StaticFunctionRedeclare.c diff -u llvm/test/CFrontend/2004-11-27-StaticFunctionRedeclare.c:1.2 llvm/test/CFrontend/2004-11-27-StaticFunctionRedeclare.c:1.3 --- llvm/test/CFrontend/2004-11-27-StaticFunctionRedeclare.c:1.2 Sun Apr 15 15:08:37 2007 +++ llvm/test/CFrontend/2004-11-27-StaticFunctionRedeclare.c Mon Apr 16 11:06:17 2007 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -c -emit-llvm 2004-11-27-StaticFunctionRedeclare.c -o - | \ +// RUN: %llvmgcc -c -emit-llvm %s -o - | \ // RUN: opt -std-compile-opts | llvm-dis | not grep {declare int.*func} // There should not be an unresolved reference to func here. Believe it or not, From lauro.venancio at gmail.com Mon Apr 16 11:39:03 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Mon, 16 Apr 2007 11:39:03 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Threads/Makefile tls.c Message-ID: <200704161639.l3GGd3KI008369@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Threads: Makefile added (r1.1) tls.c added (r1.1) --- Log message: Move TLS test to Threads directory. --- Diffs of the changes: (+27 -0) Makefile | 7 +++++++ tls.c | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) Index: llvm-test/SingleSource/UnitTests/Threads/Makefile diff -c /dev/null llvm-test/SingleSource/UnitTests/Threads/Makefile:1.1 *** /dev/null Mon Apr 16 11:38:41 2007 --- llvm-test/SingleSource/UnitTests/Threads/Makefile Mon Apr 16 11:38:31 2007 *************** *** 0 **** --- 1,7 ---- + # SingleSource/UnitTests/Threads/Makefile + LEVEL = ../../.. + + include $(LEVEL)/Makefile.config + LDFLAGS += -lpthread + + include $(LEVEL)/SingleSource/Makefile.singlesrc Index: llvm-test/SingleSource/UnitTests/Threads/tls.c diff -c /dev/null llvm-test/SingleSource/UnitTests/Threads/tls.c:1.1 *** /dev/null Mon Apr 16 11:39:03 2007 --- llvm-test/SingleSource/UnitTests/Threads/tls.c Mon Apr 16 11:38:31 2007 *************** *** 0 **** --- 1,20 ---- + #include + #include + + void *f(void *a){ + static __thread int i = 1; + i++; + return (void *)i; + } + + int main() { + pthread_t t; + int ret; + pthread_create(&t, NULL, f, NULL); + pthread_join(t, (void **) &ret); + printf("Thread 1: %d\n",ret); + pthread_create(&t, NULL, f, NULL); + pthread_join(t, (void **) &ret); + printf("Thread 2: %d\n",ret); + return 0; + } From lauro.venancio at gmail.com Mon Apr 16 11:39:03 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Mon, 16 Apr 2007 11:39:03 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Makefile tls.c Message-ID: <200704161639.l3GGd3lR008375@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests: Makefile updated: 1.15 -> 1.16 tls.c (r1.1) removed --- Log message: Move TLS test to Threads directory. --- Diffs of the changes: (+1 -2) Makefile | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm-test/SingleSource/UnitTests/Makefile diff -u llvm-test/SingleSource/UnitTests/Makefile:1.15 llvm-test/SingleSource/UnitTests/Makefile:1.16 --- llvm-test/SingleSource/UnitTests/Makefile:1.15 Wed Apr 11 13:56:46 2007 +++ llvm-test/SingleSource/UnitTests/Makefile Mon Apr 16 11:38:31 2007 @@ -13,8 +13,7 @@ DIRS += Vector endif -DIRS += SignlessTypes +DIRS += SignlessTypes Threads -LDFLAGS += -lpthread PROGRAM_REQUIRED_TO_EXIT_OK := 1 include $(LEVEL)/SingleSource/Makefile.singlesrc From clattner at apple.com Mon Apr 16 11:42:59 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 16 Apr 2007 09:42:59 -0700 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Threads/Makefile tls.c In-Reply-To: <200704161639.l3GGd3KI008369@zion.cs.uiuc.edu> References: <200704161639.l3GGd3KI008369@zion.cs.uiuc.edu> Message-ID: <8291BD0F-48E3-44CE-88A7-E4BC92541A81@apple.com> Thanks Lauro! -Chris On Apr 16, 2007, at 9:39 AM, Lauro Ramos Venancio wrote: > > > Changes in directory llvm-test/SingleSource/UnitTests/Threads: > > Makefile added (r1.1) > tls.c added (r1.1) > --- > Log message: > > Move TLS test to Threads directory. > > > --- > Diffs of the changes: (+27 -0) > > Makefile | 7 +++++++ > tls.c | 20 ++++++++++++++++++++ > 2 files changed, 27 insertions(+) > > > Index: llvm-test/SingleSource/UnitTests/Threads/Makefile > diff -c /dev/null llvm-test/SingleSource/UnitTests/Threads/Makefile: > 1.1 > *** /dev/null Mon Apr 16 11:38:41 2007 > --- llvm-test/SingleSource/UnitTests/Threads/Makefile Mon Apr 16 > 11:38:31 2007 > *************** > *** 0 **** > --- 1,7 ---- > + # SingleSource/UnitTests/Threads/Makefile > + LEVEL = ../../.. > + > + include $(LEVEL)/Makefile.config > + LDFLAGS += -lpthread > + > + include $(LEVEL)/SingleSource/Makefile.singlesrc > > > Index: llvm-test/SingleSource/UnitTests/Threads/tls.c > diff -c /dev/null llvm-test/SingleSource/UnitTests/Threads/tls.c:1.1 > *** /dev/null Mon Apr 16 11:39:03 2007 > --- llvm-test/SingleSource/UnitTests/Threads/tls.c Mon Apr 16 > 11:38:31 2007 > *************** > *** 0 **** > --- 1,20 ---- > + #include > + #include > + > + void *f(void *a){ > + static __thread int i = 1; > + i++; > + return (void *)i; > + } > + > + int main() { > + pthread_t t; > + int ret; > + pthread_create(&t, NULL, f, NULL); > + pthread_join(t, (void **) &ret); > + printf("Thread 1: %d\n",ret); > + pthread_create(&t, NULL, f, NULL); > + pthread_join(t, (void **) &ret); > + printf("Thread 2: %d\n",ret); > + return 0; > + } > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From baldrick at free.fr Mon Apr 16 11:45:33 2007 From: baldrick at free.fr (Duncan Sands) Date: Mon, 16 Apr 2007 11:45:33 -0500 Subject: [llvm-commits] CVS: llvm/test/Makefile Message-ID: <200704161645.l3GGjXcK008520@zion.cs.uiuc.edu> Changes in directory llvm/test: Makefile updated: 1.99 -> 1.100 --- Log message: Look for site.exp in the build directory, not the source directory. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Makefile diff -u llvm/test/Makefile:1.99 llvm/test/Makefile:1.100 --- llvm/test/Makefile:1.99 Sun Apr 15 14:27:27 2007 +++ llvm/test/Makefile Mon Apr 16 11:45:12 2007 @@ -48,7 +48,7 @@ SUBDIR := $(shell dirname $(CLEANED_TESTONE)) TESTPATH := $(LLVM_SRC_ROOT)/test/$(CLEANED_TESTONE) check-one: site.exp $(TCLSH) - $(Verb)( echo "source $(LLVM_SRC_ROOT)/test/site.exp" ; \ + $(Verb)( echo "source $(LLVM_OBJ_ROOT)/test/site.exp" ; \ echo "set subdir $(SUBDIR)" ; \ echo "proc pass { msg } { puts \"PASS: \$$msg\" } "; \ echo "proc fail { msg } { puts \"FAIL: \$$msg\" }" ; \ From reid at x10sys.com Mon Apr 16 11:57:15 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 11:57:15 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Message-ID: <200704161657.l3GGvFdC008922@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Function.cpp updated: 1.120 -> 1.121 --- Log message: Don't return 0 if the len == 5, let the assert handle that case. Thanks, Chris. --- Diffs of the changes: (+1 -1) Function.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.120 llvm/lib/VMCore/Function.cpp:1.121 --- llvm/lib/VMCore/Function.cpp:1.120 Mon Apr 16 02:08:44 2007 +++ llvm/lib/VMCore/Function.cpp Mon Apr 16 11:56:54 2007 @@ -231,7 +231,7 @@ unsigned Len = ValName->getKeyLength(); const char *Name = ValName->getKeyData(); - if (Len <= 5 || Name[4] != '.' || Name[0] != 'l' || Name[1] != 'l' + if (Len < 5 || Name[4] != '.' || Name[0] != 'l' || Name[1] != 'l' || Name[2] != 'v' || Name[3] != 'm') return 0; // All intrinsics start with 'llvm.' From lauro.venancio at gmail.com Mon Apr 16 11:58:08 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Mon, 16 Apr 2007 11:58:08 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/align.ll Message-ID: <200704161658.l3GGw81j008947@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: align.ll updated: 1.4 -> 1.5 --- Log message: Fix align test. --- Diffs of the changes: (+2 -3) align.ll | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/test/CodeGen/ARM/align.ll diff -u llvm/test/CodeGen/ARM/align.ll:1.4 llvm/test/CodeGen/ARM/align.ll:1.5 --- llvm/test/CodeGen/ARM/align.ll:1.4 Sun Apr 15 18:00:46 2007 +++ llvm/test/CodeGen/ARM/align.ll Mon Apr 16 11:57:47 2007 @@ -1,12 +1,11 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \ ; RUN: grep align.*1 | wc | grep 1 -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | \ +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux-gnueabi | \ ; RUN: grep align.*2 | wc | grep 2 -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | \ +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux-gnueabi | \ ; RUN: grep align.*3 | wc | grep 2 ; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin | \ ; RUN: grep align.*2 | wc | grep 4 -; XFAIL: * %a = global bool true %b = global sbyte 1 From reid at x10sys.com Mon Apr 16 12:00:52 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:00:52 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704161700.l3GH0qYS009088@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.109 -> 1.110 --- Log message: Add Raju Subbian. --- Diffs of the changes: (+4 -4) DevMtgMay2007.html | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.109 llvm-www/DevMtgMay2007.html:1.110 --- llvm-www/DevMtgMay2007.html:1.109 Fri Apr 13 22:59:36 2007 +++ llvm-www/DevMtgMay2007.html Mon Apr 16 12:00:32 2007 @@ -327,6 +327,7 @@ Alex RosenbergSony Mark SchimmelWind River Reid SpencerIndependent + Raju SubbianWind River Mark ThomasAerospace Sarah ThompsonNASA, Ames Research Center Bill WendlingApple Inc. @@ -335,16 +336,15 @@ -

Total confirmed: 36

+

Total confirmed: 37

-
Unconfirmed Attendees
NameOrganization
Lang HamesUniversity of Sydney
Michael McCrackenUCSD, Ph.D. Candidate
Unconfirmed 1Wind River
Unconfirmed 1NASA, Ames
-

Total unconfirmed: 4

+

Total unconfirmed: 3

@@ -354,6 +354,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
Last modified: $Date: 2007/04/14 03:59:36 $ +
Last modified: $Date: 2007/04/16 17:00:32 $ From lauro.venancio at gmail.com Mon Apr 16 12:08:27 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Mon, 16 Apr 2007 12:08:27 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/hello.ll Message-ID: <200704161708.l3GH8R8k009311@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: hello.ll updated: 1.6 -> 1.7 --- Log message: Fix hello.ll test. --- Diffs of the changes: (+3 -3) hello.ll | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/test/CodeGen/ARM/hello.ll diff -u llvm/test/CodeGen/ARM/hello.ll:1.6 llvm/test/CodeGen/ARM/hello.ll:1.7 --- llvm/test/CodeGen/ARM/hello.ll:1.6 Sun Apr 15 18:00:46 2007 +++ llvm/test/CodeGen/ARM/hello.ll Mon Apr 16 12:08:00 2007 @@ -1,8 +1,8 @@ ; RUN: llvm-as < %s | llc -march=arm && -; RUN: llvm-as < %s | llc -mtriple=arm-linux | grep mov | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -mtriple=arm-linux --disable-fp-elim | grep mov | wc -l | grep 2 +; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | grep mov | wc -l | grep 1 +; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnu --disable-fp-elim | grep mov \ +; RUN: | wc -l | grep 3 ; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep mov | wc -l | grep 2 -; XFAIL: * @str = internal constant [12 x i8] c"Hello World\00" From reid at x10sys.com Mon Apr 16 12:38:07 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:07 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2006-01-13-Includes.c Message-ID: <200704161738.l3GHc7fm010238@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2006-01-13-Includes.c updated: 1.7 -> 1.8 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+1 -1) 2006-01-13-Includes.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CFrontend/2006-01-13-Includes.c diff -u llvm/test/CFrontend/2006-01-13-Includes.c:1.7 llvm/test/CFrontend/2006-01-13-Includes.c:1.8 --- llvm/test/CFrontend/2006-01-13-Includes.c:1.7 Fri Feb 9 09:15:21 2007 +++ llvm/test/CFrontend/2006-01-13-Includes.c Mon Apr 16 12:36:06 2007 @@ -1,5 +1,5 @@ // RUN: %llvmgcc %s -g -S -o - | llvm-as | opt -std-compile-opts | \ -// RUN: llvm-dis | grep "test/CFrontend" +// RUN: llvm-dis | grep {test/CFrontend} // PR676 #include From reid at x10sys.com Mon Apr 16 12:38:08 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:08 -0500 Subject: [llvm-commits] CVS: llvm/test/Assembler/2003-05-21-MalformedShiftCrash.llx 2003-05-21-MalformedStructCrash.llx Message-ID: <200704161738.l3GHc8ZD010245@zion.cs.uiuc.edu> Changes in directory llvm/test/Assembler: 2003-05-21-MalformedShiftCrash.llx updated: 1.7 -> 1.8 2003-05-21-MalformedStructCrash.llx updated: 1.6 -> 1.7 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+2 -2) 2003-05-21-MalformedShiftCrash.llx | 2 +- 2003-05-21-MalformedStructCrash.llx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/Assembler/2003-05-21-MalformedShiftCrash.llx diff -u llvm/test/Assembler/2003-05-21-MalformedShiftCrash.llx:1.7 llvm/test/Assembler/2003-05-21-MalformedShiftCrash.llx:1.8 --- llvm/test/Assembler/2003-05-21-MalformedShiftCrash.llx:1.7 Mon Apr 16 10:00:39 2007 +++ llvm/test/Assembler/2003-05-21-MalformedShiftCrash.llx Mon Apr 16 12:36:06 2007 @@ -1,4 +1,4 @@ ; Found by inspection of the code -; RUN: llvm-as < %s > /dev/null |& grep "Logical operator requires integral" +; RUN: llvm-as < %s > /dev/null |& grep {Logical operator requires integral} global i32 ashr (float 1.0, float 2.0) Index: llvm/test/Assembler/2003-05-21-MalformedStructCrash.llx diff -u llvm/test/Assembler/2003-05-21-MalformedStructCrash.llx:1.6 llvm/test/Assembler/2003-05-21-MalformedStructCrash.llx:1.7 --- llvm/test/Assembler/2003-05-21-MalformedStructCrash.llx:1.6 Mon Apr 16 10:00:39 2007 +++ llvm/test/Assembler/2003-05-21-MalformedStructCrash.llx Mon Apr 16 12:36:06 2007 @@ -1,4 +1,4 @@ ; Found by inspection of the code -; RUN: llvm-as < %s > /dev/null |& grep "Illegal number of init" +; RUN: llvm-as < %s > /dev/null |& grep {Illegal number of init} global {} { i32 7, float 1.0, i32 7, i32 8 } From reid at x10sys.com Mon Apr 16 12:38:09 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:09 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/GCSE/vectorops.ll Message-ID: <200704161738.l3GHc9mi010254@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/GCSE: vectorops.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+2 -2) vectorops.ll | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/Transforms/GCSE/vectorops.ll diff -u llvm/test/Transforms/GCSE/vectorops.ll:1.2 llvm/test/Transforms/GCSE/vectorops.ll:1.3 --- llvm/test/Transforms/GCSE/vectorops.ll:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/GCSE/vectorops.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -gcse -instcombine -disable-output && -; RUN: llvm-upgrade < %s | llvm-as | opt -gcse -instcombine | llvm-dis | not grep sub +; RUN: llvm-upgrade < %s | llvm-as | opt -gcse -instcombine | \ +; RUN: llvm-dis | not grep sub uint %test_extractelement(<4 x uint> %V) { %R = extractelement <4 x uint> %V, uint 1 From reid at x10sys.com Mon Apr 16 12:38:09 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:09 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/2006-07-03-schedulers.ll 2006-11-06-MemIntrinsicExpand.ll 2007-04-14-BitTestsBadMask.ll fpowi-promote.ll switch-lower-feature-2.ll switch-lower-feature.ll vector-identity-shuffle.ll vector.ll Message-ID: <200704161738.l3GHc9oj010269@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: 2006-07-03-schedulers.ll updated: 1.3 -> 1.4 2006-11-06-MemIntrinsicExpand.ll updated: 1.3 -> 1.4 2007-04-14-BitTestsBadMask.ll updated: 1.3 -> 1.4 fpowi-promote.ll updated: 1.1 -> 1.2 switch-lower-feature-2.ll updated: 1.2 -> 1.3 switch-lower-feature.ll updated: 1.3 -> 1.4 vector-identity-shuffle.ll updated: 1.4 -> 1.5 vector.ll updated: 1.12 -> 1.13 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+29 -29) 2006-07-03-schedulers.ll | 12 ++++++------ 2006-11-06-MemIntrinsicExpand.ll | 1 - 2007-04-14-BitTestsBadMask.ll | 2 +- fpowi-promote.ll | 2 +- switch-lower-feature-2.ll | 19 ++++++++++--------- switch-lower-feature.ll | 8 ++++---- vector-identity-shuffle.ll | 4 ++-- vector.ll | 10 +++++----- 8 files changed, 29 insertions(+), 29 deletions(-) Index: llvm/test/CodeGen/Generic/2006-07-03-schedulers.ll diff -u llvm/test/CodeGen/Generic/2006-07-03-schedulers.ll:1.3 llvm/test/CodeGen/Generic/2006-07-03-schedulers.ll:1.4 --- llvm/test/CodeGen/Generic/2006-07-03-schedulers.ll:1.3 Sat Dec 2 14:38:10 2006 +++ llvm/test/CodeGen/Generic/2006-07-03-schedulers.ll Mon Apr 16 12:36:06 2007 @@ -1,9 +1,9 @@ -; RUN: llvm-upgrade %s | llvm-as | llc -sched=none && -; RUN: llvm-upgrade %s | llvm-as | llc -sched=default && -; RUN: llvm-upgrade %s | llvm-as | llc -sched=simple && -; RUN: llvm-upgrade %s | llvm-as | llc -sched=simple-noitin && -; RUN: llvm-upgrade %s | llvm-as | llc -sched=list-td && -; RUN: llvm-upgrade %s | llvm-as | llc -sched=list-tdrr && +; RUN: llvm-upgrade %s | llvm-as | llc -sched=none +; RUN: llvm-upgrade %s | llvm-as | llc -sched=default +; RUN: llvm-upgrade %s | llvm-as | llc -sched=simple +; RUN: llvm-upgrade %s | llvm-as | llc -sched=simple-noitin +; RUN: llvm-upgrade %s | llvm-as | llc -sched=list-td +; RUN: llvm-upgrade %s | llvm-as | llc -sched=list-tdrr ; RUN: llvm-upgrade %s | llvm-as | llc -sched=list-burr ; PR859 Index: llvm/test/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll diff -u llvm/test/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll:1.3 llvm/test/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll:1.4 --- llvm/test/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep adc ; PR987 Index: llvm/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll diff -u llvm/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll:1.3 llvm/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll:1.4 --- llvm/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll:1.3 Mon Apr 16 10:31:48 2007 +++ llvm/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 | grep 8388635 && +; RUN: llvm-as < %s | llc -march=x86 | grep 8388635 ; RUN: llvm-as < %s | llc -march=x86-64 | grep 4294981120 ; PR 1325 Index: llvm/test/CodeGen/Generic/fpowi-promote.ll diff -u llvm/test/CodeGen/Generic/fpowi-promote.ll:1.1 llvm/test/CodeGen/Generic/fpowi-promote.ll:1.2 --- llvm/test/CodeGen/Generic/fpowi-promote.ll:1.1 Sat Mar 3 17:42:50 2007 +++ llvm/test/CodeGen/Generic/fpowi-promote.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc && +; RUN: llvm-as < %s | llc ; RUN: llvm-as < %s | llc -march=x86 -mcpu=i386 ; PR1239 Index: llvm/test/CodeGen/Generic/switch-lower-feature-2.ll diff -u llvm/test/CodeGen/Generic/switch-lower-feature-2.ll:1.2 llvm/test/CodeGen/Generic/switch-lower-feature-2.ll:1.3 --- llvm/test/CodeGen/Generic/switch-lower-feature-2.ll:1.2 Thu Apr 5 11:43:09 2007 +++ llvm/test/CodeGen/Generic/switch-lower-feature-2.ll Mon Apr 16 12:36:06 2007 @@ -1,12 +1,13 @@ -; RUN: llvm-as < %s | llc -march=x86 -o - | grep jb | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$6 | wc -l | grep 2 && -; RUN: llvm-as < %s | llc -march=x86 -o - | grep 1024 | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=x86 -o - | grep 1023 | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=x86 -o - | grep 119 | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=x86 -o - | grep JTI | wc -l | grep 2 && -; RUN: llvm-as < %s | llc -march=x86 -o - | grep jg | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=x86 -o - | grep ja | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=x86 -o - | grep js | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=x86 -o %t -f +; RUN: grep jb %t | wc -l | grep 1 +; RUN: grep \\\$6 %t | wc -l | grep 2 +; RUN: grep 1024 %t | wc -l | grep 1 +; RUN: grep 1023 %t | wc -l | grep 1 +; RUN: grep 119 %t | wc -l | grep 1 +; RUN: grep JTI %t | wc -l | grep 2 +; RUN: grep jg %t | wc -l | grep 1 +; RUN: grep ja %t | wc -l | grep 1 +; RUN: grep js %t | wc -l | grep 1 target triple = "i686-pc-linux-gnu" Index: llvm/test/CodeGen/Generic/switch-lower-feature.ll diff -u llvm/test/CodeGen/Generic/switch-lower-feature.ll:1.3 llvm/test/CodeGen/Generic/switch-lower-feature.ll:1.4 --- llvm/test/CodeGen/Generic/switch-lower-feature.ll:1.3 Mon Apr 9 07:31:58 2007 +++ llvm/test/CodeGen/Generic/switch-lower-feature.ll Mon Apr 16 12:36:06 2007 @@ -1,7 +1,7 @@ -; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$7 | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$6 | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=x86 -o - | grep 1024 | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=x86 -o - | grep jb | wc -l | grep 2 && +; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$7 | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$6 | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=x86 -o - | grep 1024 | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=x86 -o - | grep jb | wc -l | grep 2 ; RUN: llvm-as < %s | llc -march=x86 -o - | grep je | wc -l | grep 1 define i32 @main(i32 %tmp158) { Index: llvm/test/CodeGen/Generic/vector-identity-shuffle.ll diff -u llvm/test/CodeGen/Generic/vector-identity-shuffle.ll:1.4 llvm/test/CodeGen/Generic/vector-identity-shuffle.ll:1.5 --- llvm/test/CodeGen/Generic/vector-identity-shuffle.ll:1.4 Fri Dec 22 16:48:44 2006 +++ llvm/test/CodeGen/Generic/vector-identity-shuffle.ll Mon Apr 16 12:36:06 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep test: && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep vperm && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep test: +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep vperm ; RUN: llvm-upgrade < %s | llvm-as | llc void %test(<4 x float> *%tmp2.i) { Index: llvm/test/CodeGen/Generic/vector.ll diff -u llvm/test/CodeGen/Generic/vector.ll:1.12 llvm/test/CodeGen/Generic/vector.ll:1.13 --- llvm/test/CodeGen/Generic/vector.ll:1.12 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/Generic/vector.ll Mon Apr 16 12:36:06 2007 @@ -1,9 +1,9 @@ ; Test that vectors are scalarized/lowered correctly. -; RUN: llvm-upgrade < %s | llvm-as | llc && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple a-b-c && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g3 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=i386 && +; RUN: llvm-upgrade < %s | llvm-as | llc +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple a-b-c +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g3 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=i386 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah %f1 = type <1 x float> From reid at x10sys.com Mon Apr 16 12:38:10 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:10 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/LoopStrengthReduce/nested-reduce.ll Message-ID: <200704161738.l3GHcAFR010274@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/LoopStrengthReduce: nested-reduce.ll updated: 1.3 -> 1.4 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+0 -1) nested-reduce.ll | 1 - 1 files changed, 1 deletion(-) Index: llvm/test/Transforms/LoopStrengthReduce/nested-reduce.ll diff -u llvm/test/Transforms/LoopStrengthReduce/nested-reduce.ll:1.3 llvm/test/Transforms/LoopStrengthReduce/nested-reduce.ll:1.4 --- llvm/test/Transforms/LoopStrengthReduce/nested-reduce.ll:1.3 Sun Dec 31 00:01:59 2006 +++ llvm/test/Transforms/LoopStrengthReduce/nested-reduce.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce && ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | not grep mul ; Make sure we don't get a multiply by 6 in this loop. From reid at x10sys.com Mon Apr 16 12:38:11 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:11 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/LoopRotate/PhiRename-1.ll Message-ID: <200704161738.l3GHcBW4010279@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/LoopRotate: PhiRename-1.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+2 -2) PhiRename-1.ll | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/Transforms/LoopRotate/PhiRename-1.ll diff -u llvm/test/Transforms/LoopRotate/PhiRename-1.ll:1.2 llvm/test/Transforms/LoopRotate/PhiRename-1.ll:1.3 --- llvm/test/Transforms/LoopRotate/PhiRename-1.ll:1.2 Mon Apr 9 18:40:15 2007 +++ llvm/test/Transforms/LoopRotate/PhiRename-1.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -loop-rotate -disable-output && -; RUN: llvm-as < %s | opt -loop-rotate | llvm-dis | not grep "\[ .tmp224" +; RUN: llvm-as < %s | opt -loop-rotate | llvm-dis | not grep {\\\[ .tmp224} +; END. 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" %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 } From reid at x10sys.com Mon Apr 16 12:38:11 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:11 -0500 Subject: [llvm-commits] CVS: llvm/test/Feature/fold-fpcast.ll forwardreftest.ll inlineasm.ll Message-ID: <200704161738.l3GHcBks010293@zion.cs.uiuc.edu> Changes in directory llvm/test/Feature: fold-fpcast.ll updated: 1.3 -> 1.4 forwardreftest.ll updated: 1.10 -> 1.11 inlineasm.ll updated: 1.4 -> 1.5 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+3 -5) fold-fpcast.ll | 1 - forwardreftest.ll | 1 - inlineasm.ll | 6 +++--- 3 files changed, 3 insertions(+), 5 deletions(-) Index: llvm/test/Feature/fold-fpcast.ll diff -u llvm/test/Feature/fold-fpcast.ll:1.3 llvm/test/Feature/fold-fpcast.ll:1.4 --- llvm/test/Feature/fold-fpcast.ll:1.3 Sat Apr 14 04:45:16 2007 +++ llvm/test/Feature/fold-fpcast.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis -o /dev/null -f && ; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | not grep bitcast int %test1() { Index: llvm/test/Feature/forwardreftest.ll diff -u llvm/test/Feature/forwardreftest.ll:1.10 llvm/test/Feature/forwardreftest.ll:1.11 --- llvm/test/Feature/forwardreftest.ll:1.10 Wed Apr 11 17:40:46 2007 +++ llvm/test/Feature/forwardreftest.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis -o /dev/null -f && ; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll Index: llvm/test/Feature/inlineasm.ll diff -u llvm/test/Feature/inlineasm.ll:1.4 llvm/test/Feature/inlineasm.ll:1.5 --- llvm/test/Feature/inlineasm.ll:1.4 Fri Dec 1 22:23:07 2006 +++ llvm/test/Feature/inlineasm.ll Mon Apr 16 12:36:07 2007 @@ -1,6 +1,6 @@ -; RUN: llvm-upgrade %s -o - | llvm-as -o /dev/null -f && -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > Output/t1.ll && -; RUN: llvm-as Output/t1.ll -o - | llvm-dis > Output/t2.ll && +; RUN: llvm-upgrade %s -o - | llvm-as -o /dev/null -f +; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > Output/t1.ll +; RUN: llvm-as Output/t1.ll -o - | llvm-dis > Output/t2.ll ; RUN: diff Output/t1.ll Output/t2.ll From reid at x10sys.com Mon Apr 16 12:38:11 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:11 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll add.ll add2.ll Message-ID: <200704161738.l3GHcBcA010301@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/InstCombine: 2007-04-04-BadFoldBitcastIntoMalloc.ll updated: 1.4 -> 1.5 add.ll updated: 1.38 -> 1.39 add2.ll updated: 1.1 -> 1.2 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+0 -3) 2007-04-04-BadFoldBitcastIntoMalloc.ll | 1 - add.ll | 1 - add2.ll | 1 - 3 files changed, 3 deletions(-) Index: llvm/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll diff -u llvm/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll:1.4 llvm/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll:1.5 --- llvm/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll:1.4 Sat Apr 14 15:13:02 2007 +++ llvm/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll Mon Apr 16 12:36:07 2007 @@ -2,7 +2,6 @@ ; a malloc messes up the element count, causing an extra 4GB to be allocated on ; 64-bit targets. ; -; RUN: llvm-as < %s | opt -instcombine -disable-output && ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {= add } target datalayout = "e-p:64:64:64-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" Index: llvm/test/Transforms/InstCombine/add.ll diff -u llvm/test/Transforms/InstCombine/add.ll:1.38 llvm/test/Transforms/InstCombine/add.ll:1.39 --- llvm/test/Transforms/InstCombine/add.ll:1.38 Sun Apr 15 02:38:21 2007 +++ llvm/test/Transforms/InstCombine/add.ll Mon Apr 16 12:36:07 2007 @@ -1,6 +1,5 @@ ; This test makes sure that add instructions are properly eliminated. -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output && ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \ ; RUN: grep -v OK | not grep add ; END. Index: llvm/test/Transforms/InstCombine/add2.ll diff -u llvm/test/Transforms/InstCombine/add2.ll:1.1 llvm/test/Transforms/InstCombine/add2.ll:1.2 --- llvm/test/Transforms/InstCombine/add2.ll:1.1 Sun Mar 4 18:01:38 2007 +++ llvm/test/Transforms/InstCombine/add2.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output && ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ ; RUN: grep -v OK | not grep add From reid at x10sys.com Mon Apr 16 12:38:11 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:11 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/PredicateSimplifier/2006-10-22-IntOr.ll 2006-10-25-AddSetCC.ll predsimplify.ll Message-ID: <200704161738.l3GHcBN5010285@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/PredicateSimplifier: 2006-10-22-IntOr.ll updated: 1.4 -> 1.5 2006-10-25-AddSetCC.ll updated: 1.2 -> 1.3 predsimplify.ll updated: 1.4 -> 1.5 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+11 -7) 2006-10-22-IntOr.ll | 7 ++++--- 2006-10-25-AddSetCC.ll | 5 +++-- predsimplify.ll | 6 ++++-- 3 files changed, 11 insertions(+), 7 deletions(-) Index: llvm/test/Transforms/PredicateSimplifier/2006-10-22-IntOr.ll diff -u llvm/test/Transforms/PredicateSimplifier/2006-10-22-IntOr.ll:1.4 llvm/test/Transforms/PredicateSimplifier/2006-10-22-IntOr.ll:1.5 --- llvm/test/Transforms/PredicateSimplifier/2006-10-22-IntOr.ll:1.4 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/PredicateSimplifier/2006-10-22-IntOr.ll Mon Apr 16 12:36:08 2007 @@ -1,6 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -predsimplify -instcombine -simplifycfg -disable-output && -; RUN: llvm-upgrade < %s | llvm-as | opt -predsimplify -instcombine -simplifycfg | llvm-dis | grep -v declare | not grep fail && -; RUN: llvm-upgrade < %s | llvm-as | opt -predsimplify -instcombine -simplifycfg | llvm-dis | grep -v declare | grep -c pass | grep 3 +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: opt -predsimplify -instcombine -simplifycfg -o %t -f +; RUN: grep -v declare %t | not grep fail +; RUN: grep -v declare %t | grep -c pass | grep 3 int %test1(int %x, int %y) { entry: Index: llvm/test/Transforms/PredicateSimplifier/2006-10-25-AddSetCC.ll diff -u llvm/test/Transforms/PredicateSimplifier/2006-10-25-AddSetCC.ll:1.2 llvm/test/Transforms/PredicateSimplifier/2006-10-25-AddSetCC.ll:1.3 --- llvm/test/Transforms/PredicateSimplifier/2006-10-25-AddSetCC.ll:1.2 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/PredicateSimplifier/2006-10-25-AddSetCC.ll Mon Apr 16 12:36:08 2007 @@ -1,5 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -predsimplify -instcombine -simplifycfg -disable-output && -; RUN: llvm-upgrade < %s | llvm-as | opt -predsimplify -instcombine -simplifycfg | llvm-dis | grep -v declare | grep -c pass | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: opt -predsimplify -instcombine -simplifycfg | llvm-dis | \ +; RUN: grep -v declare | grep -c pass | grep 2 int %test(int %x, int %y) { entry: Index: llvm/test/Transforms/PredicateSimplifier/predsimplify.ll diff -u llvm/test/Transforms/PredicateSimplifier/predsimplify.ll:1.4 llvm/test/Transforms/PredicateSimplifier/predsimplify.ll:1.5 --- llvm/test/Transforms/PredicateSimplifier/predsimplify.ll:1.4 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/PredicateSimplifier/predsimplify.ll Mon Apr 16 12:36:08 2007 @@ -1,5 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -predsimplify -instcombine -simplifycfg | llvm-dis | grep -v declare | not grep fail && -; RUN: llvm-upgrade < %s | llvm-as | opt -predsimplify -instcombine -simplifycfg | llvm-dis | grep -v declare | grep -c pass | grep 4 +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: opt -predsimplify -instcombine -simplifycfg | llvm-dis > %t +; RUN: grep -v declare %t | not grep fail +; RUN: grep -v declare %t | grep -c pass | grep 4 void %test1(int %x) { entry: From reid at x10sys.com Mon Apr 16 12:38:11 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:11 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/TailCallElim/return-undef.ll Message-ID: <200704161738.l3GHcBDr010305@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/TailCallElim: return-undef.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+3 -2) return-undef.ll | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/test/Transforms/TailCallElim/return-undef.ll diff -u llvm/test/Transforms/TailCallElim/return-undef.ll:1.2 llvm/test/Transforms/TailCallElim/return-undef.ll:1.3 --- llvm/test/Transforms/TailCallElim/return-undef.ll:1.2 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/TailCallElim/return-undef.ll Mon Apr 16 12:36:08 2007 @@ -1,5 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -tailcallelim | llvm-dis | grep sub && -; RUN: llvm-upgrade < %s | llvm-as | opt -tailcallelim | llvm-dis | not grep call +; RUN: llvm-upgrade < %s | llvm-as | opt -tailcallelim | llvm-dis > %t +; RUN: grep sub %t +; RUN: not grep call %t int %test(int %X) { %Y = sub int %X, 1 From reid at x10sys.com Mon Apr 16 12:38:13 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:13 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/ConstProp/bitcast.ll Message-ID: <200704161738.l3GHcDpk010347@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/ConstProp: bitcast.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+0 -1) bitcast.ll | 1 - 1 files changed, 1 deletion(-) Index: llvm/test/Transforms/ConstProp/bitcast.ll diff -u llvm/test/Transforms/ConstProp/bitcast.ll:1.2 llvm/test/Transforms/ConstProp/bitcast.ll:1.3 --- llvm/test/Transforms/ConstProp/bitcast.ll:1.2 Sun Dec 31 00:01:59 2006 +++ llvm/test/Transforms/ConstProp/bitcast.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis && ; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | grep 0x36A0000000000000 %A = global float bitcast (int 1 to float) From reid at x10sys.com Mon Apr 16 12:38:14 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:14 -0500 Subject: [llvm-commits] CVS: llvm/test/Analysis/BasicAA/modref.ll Message-ID: <200704161738.l3GHcEnq010368@zion.cs.uiuc.edu> Changes in directory llvm/test/Analysis/BasicAA: modref.ll updated: 1.5 -> 1.6 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+1 -1) modref.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Analysis/BasicAA/modref.ll diff -u llvm/test/Analysis/BasicAA/modref.ll:1.5 llvm/test/Analysis/BasicAA/modref.ll:1.6 --- llvm/test/Analysis/BasicAA/modref.ll:1.5 Mon Apr 16 10:15:51 2007 +++ llvm/test/Analysis/BasicAA/modref.ll Mon Apr 16 12:36:06 2007 @@ -1,6 +1,6 @@ ; A very rudimentary test on AliasAnalysis::getModRefInfo. ; RUN: llvm-upgrade < %s | llvm-as | \ -; RUN: opt -print-all-alias-modref-info -aa-eval -disable-output |& +; RUN: opt -print-all-alias-modref-info -aa-eval -disable-output |& \ ; RUN: not grep NoModRef int %callee() { From reid at x10sys.com Mon Apr 16 12:38:14 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:14 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Alpha/weak.ll Message-ID: <200704161738.l3GHcEx1010381@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Alpha: weak.ll updated: 1.1 -> 1.2 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+1 -2) weak.ll | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/test/CodeGen/Alpha/weak.ll diff -u llvm/test/CodeGen/Alpha/weak.ll:1.1 llvm/test/CodeGen/Alpha/weak.ll:1.2 --- llvm/test/CodeGen/Alpha/weak.ll:1.1 Thu Dec 7 11:37:54 2006 +++ llvm/test/CodeGen/Alpha/weak.ll Mon Apr 16 12:36:06 2007 @@ -1,5 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep .weak.*f && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep .weak.*f ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep .weak.*h implementation ; Functions: From reid at x10sys.com Mon Apr 16 12:38:15 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:15 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/2007-04-03-PEIBug.ll 2007-04-03-UndefinedSymbol.ll alloca.ll arguments.ll bits.ll branch.ll call_nolink.ll clz.ll compare-call.ll constants.ll div.ll dyn-stackalloc.ll fcopysign.ll fp.ll fparith.ll fpcmp.ll fpcmp_ueq.ll fpconv.ll fpmem.ll hello.ll imm.ll insn-sched1.ll ldm.ll ldr_ext.ll ldr_frame.ll ldr_pre.ll load.ll long-setcc.ll long_shift.ll pack.ll section.ll vfp.ll Message-ID: <200704161738.l3GHcF3C010427@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: 2007-04-03-PEIBug.ll updated: 1.1 -> 1.2 2007-04-03-UndefinedSymbol.ll updated: 1.1 -> 1.2 alloca.ll updated: 1.5 -> 1.6 arguments.ll updated: 1.2 -> 1.3 bits.ll updated: 1.3 -> 1.4 branch.ll updated: 1.5 -> 1.6 call_nolink.ll updated: 1.2 -> 1.3 clz.ll updated: 1.1 -> 1.2 compare-call.ll updated: 1.1 -> 1.2 constants.ll updated: 1.10 -> 1.11 div.ll updated: 1.2 -> 1.3 dyn-stackalloc.ll updated: 1.3 -> 1.4 fcopysign.ll updated: 1.7 -> 1.8 fp.ll updated: 1.15 -> 1.16 fparith.ll updated: 1.7 -> 1.8 fpcmp.ll updated: 1.7 -> 1.8 fpcmp_ueq.ll updated: 1.4 -> 1.5 fpconv.ll updated: 1.6 -> 1.7 fpmem.ll updated: 1.5 -> 1.6 hello.ll updated: 1.7 -> 1.8 imm.ll updated: 1.1 -> 1.2 insn-sched1.ll updated: 1.5 -> 1.6 ldm.ll updated: 1.5 -> 1.6 ldr_ext.ll updated: 1.4 -> 1.5 ldr_frame.ll updated: 1.3 -> 1.4 ldr_pre.ll updated: 1.1 -> 1.2 load.ll updated: 1.2 -> 1.3 long-setcc.ll updated: 1.3 -> 1.4 long_shift.ll updated: 1.4 -> 1.5 pack.ll updated: 1.2 -> 1.3 section.ll updated: 1.9 -> 1.10 vfp.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+137 -140) 2007-04-03-PEIBug.ll | 2 +- 2007-04-03-UndefinedSymbol.ll | 3 ++- alloca.ll | 7 ++++--- arguments.ll | 9 +++++---- bits.ll | 12 ++++++------ branch.ll | 10 +++++----- call_nolink.ll | 4 ++-- clz.ll | 3 +-- compare-call.ll | 4 ++-- constants.ll | 22 ++++++++++++++-------- div.ll | 10 +++++----- dyn-stackalloc.ll | 8 ++++---- fcopysign.ll | 7 +++---- fp.ll | 30 ++++++++++++------------------ fparith.ll | 19 +++++++++---------- fpcmp.ll | 16 ++++++++-------- fpcmp_ueq.ll | 3 +-- fpconv.ll | 22 +++++++++++----------- fpmem.ll | 10 ++++++---- hello.ll | 6 +++--- imm.ll | 1 - insn-sched1.ll | 5 +++-- ldm.ll | 10 ++++++---- ldr_ext.ll | 17 ++++++++--------- ldr_frame.ll | 4 +--- ldr_pre.ll | 4 ++-- load.ll | 10 +++++----- long-setcc.ll | 4 +--- long_shift.ll | 10 +++++----- pack.ll | 2 +- section.ll | 1 - vfp.ll | 2 +- 32 files changed, 137 insertions(+), 140 deletions(-) Index: llvm/test/CodeGen/ARM/2007-04-03-PEIBug.ll diff -u llvm/test/CodeGen/ARM/2007-04-03-PEIBug.ll:1.1 llvm/test/CodeGen/ARM/2007-04-03-PEIBug.ll:1.2 --- llvm/test/CodeGen/ARM/2007-04-03-PEIBug.ll:1.1 Tue Apr 3 16:38:03 2007 +++ llvm/test/CodeGen/ARM/2007-04-03-PEIBug.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=arm | not grep "add.*#0" +; RUN: llvm-as < %s | llc -march=arm | not grep {add.*#0} define i32 @foo() { entry: Index: llvm/test/CodeGen/ARM/2007-04-03-UndefinedSymbol.ll diff -u llvm/test/CodeGen/ARM/2007-04-03-UndefinedSymbol.ll:1.1 llvm/test/CodeGen/ARM/2007-04-03-UndefinedSymbol.ll:1.2 --- llvm/test/CodeGen/ARM/2007-04-03-UndefinedSymbol.ll:1.1 Tue Apr 3 18:40:54 2007 +++ llvm/test/CodeGen/ARM/2007-04-03-UndefinedSymbol.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -relocation-model=pic | not grep "LPC9" +; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -relocation-model=pic | \ +; RUN: not grep LPC9 %struct.B = type { i32 } %struct.anon = type { void (%struct.B*)*, i32 } Index: llvm/test/CodeGen/ARM/alloca.ll diff -u llvm/test/CodeGen/ARM/alloca.ll:1.5 llvm/test/CodeGen/ARM/alloca.ll:1.6 --- llvm/test/CodeGen/ARM/alloca.ll:1.5 Fri Feb 2 18:16:21 2007 +++ llvm/test/CodeGen/ARM/alloca.ll Mon Apr 16 12:36:06 2007 @@ -1,6 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mtriple=arm-linux-gnu | grep "mov r11, sp" && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mtriple=arm-linux-gnu | grep "mov sp, r11" +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mtriple=arm-linux-gnu | \ +; RUN: grep {mov r11, sp} +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mtriple=arm-linux-gnu | \ +; RUN: grep {mov sp, r11} void %f(uint %a) { entry: Index: llvm/test/CodeGen/ARM/arguments.ll diff -u llvm/test/CodeGen/ARM/arguments.ll:1.2 llvm/test/CodeGen/ARM/arguments.ll:1.3 --- llvm/test/CodeGen/ARM/arguments.ll:1.2 Tue Feb 13 13:52:28 2007 +++ llvm/test/CodeGen/ARM/arguments.ll Mon Apr 16 12:36:06 2007 @@ -1,10 +1,11 @@ -; RUN: llvm-as < %s | llc -march=arm && -; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | grep "mov r0, r2" | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep "mov r0, r1" | wc -l | grep 1 +; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | \ +; RUN: grep {mov r0, r2} | wc -l | grep 1 +; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | \ +; RUN: grep {mov r0, r1} | wc -l | grep 1 define i32 @f(i32 %a, i64 %b) { %tmp = call i32 @g(i64 %b) ret i32 %tmp } -declare i32 @g(i64) \ No newline at end of file +declare i32 @g(i64) Index: llvm/test/CodeGen/ARM/bits.ll diff -u llvm/test/CodeGen/ARM/bits.ll:1.3 llvm/test/CodeGen/ARM/bits.ll:1.4 --- llvm/test/CodeGen/ARM/bits.ll:1.3 Thu Feb 1 20:16:22 2007 +++ llvm/test/CodeGen/ARM/bits.ll Mon Apr 16 12:36:06 2007 @@ -1,9 +1,9 @@ -; RUN: llvm-as < %s | llc -march=arm && -; RUN: llvm-as < %s | llc -march=arm | grep and | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=arm | grep orr | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=arm | grep eor | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=arm | grep mov.*lsl | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=arm | grep mov.*asr | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=arm > %t +; RUN: grep and %t | wc -l | grep 1 +; RUN: grep orr %t | wc -l | grep 1 +; RUN: grep eor %t | wc -l | grep 1 +; RUN: grep mov.*lsl %t | wc -l | grep 1 +; RUN: grep mov.*asr %t | wc -l | grep 1 define i32 @f1(i32 %a, i32 %b) { entry: Index: llvm/test/CodeGen/ARM/branch.ll diff -u llvm/test/CodeGen/ARM/branch.ll:1.5 llvm/test/CodeGen/ARM/branch.ll:1.6 --- llvm/test/CodeGen/ARM/branch.ll:1.5 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/branch.ll Mon Apr 16 12:36:06 2007 @@ -1,8 +1,8 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep bne && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep bge && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep bhs && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep blo +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm > %t +; RUN: grep bne %t +; RUN: grep bge %t +; RUN: grep bhs %t +; RUN: grep blo %t void %f1(int %a, int %b, int* %v) { entry: Index: llvm/test/CodeGen/ARM/call_nolink.ll diff -u llvm/test/CodeGen/ARM/call_nolink.ll:1.2 llvm/test/CodeGen/ARM/call_nolink.ll:1.3 --- llvm/test/CodeGen/ARM/call_nolink.ll:1.2 Tue Mar 27 21:38:26 2007 +++ llvm/test/CodeGen/ARM/call_nolink.ll Mon Apr 16 12:36:06 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | llc -march=arm && -; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi | not grep "bx lr" +; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi | \ +; RUN: not grep {bx lr} %struct.anon = type { i32 (i32, i32, i32)*, i32, i32, [3 x i32], i8*, i8*, i8* } @r = external global [14 x i32] ; <[14 x i32]*> [#uses=4] Index: llvm/test/CodeGen/ARM/clz.ll diff -u llvm/test/CodeGen/ARM/clz.ll:1.1 llvm/test/CodeGen/ARM/clz.ll:1.2 --- llvm/test/CodeGen/ARM/clz.ll:1.1 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/clz.ll Mon Apr 16 12:36:06 2007 @@ -1,5 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v5t | grep "clz" +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v5t | grep clz declare uint %llvm.ctlz.i32(uint) Index: llvm/test/CodeGen/ARM/compare-call.ll diff -u llvm/test/CodeGen/ARM/compare-call.ll:1.1 llvm/test/CodeGen/ARM/compare-call.ll:1.2 --- llvm/test/CodeGen/ARM/compare-call.ll:1.1 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/compare-call.ll Mon Apr 16 12:36:06 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6,+vfp2 | grep fcmpes +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6,+vfp2 | \ +; RUN: grep fcmpes void %test3(float* %glob, int %X) { entry: Index: llvm/test/CodeGen/ARM/constants.ll diff -u llvm/test/CodeGen/ARM/constants.ll:1.10 llvm/test/CodeGen/ARM/constants.ll:1.11 --- llvm/test/CodeGen/ARM/constants.ll:1.10 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/constants.ll Mon Apr 16 12:36:06 2007 @@ -1,11 +1,17 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "mov r0, #0" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "mov r0, #255$" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "mov r0.*256" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "orr.*256" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "mov r0, .*-1073741761" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "mov r0, .*1008" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "cmp r0, #1, 16" | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \ +; RUN: grep {mov r0, #0} | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \ +; RUN: grep {mov r0, #255$} | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \ +; RUN: grep {mov r0.*256} | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \ +; RUN: grep {orr.*256} | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \ +; RUN: grep {mov r0, .*-1073741761} | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \ +; RUN: grep {mov r0, .*1008} | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \ +; RUN: grep {cmp r0, #1, 16} | wc -l | grep 1 uint %f1() { ret uint 0 Index: llvm/test/CodeGen/ARM/div.ll diff -u llvm/test/CodeGen/ARM/div.ll:1.2 llvm/test/CodeGen/ARM/div.ll:1.3 --- llvm/test/CodeGen/ARM/div.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/ARM/div.ll Mon Apr 16 12:36:06 2007 @@ -1,8 +1,8 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep __divsi3 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep __udivsi3 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep __modsi3 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep __umodsi3 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm > %t +; RUN: grep __divsi3 %t +; RUN: grep __udivsi3 %t +; RUN: grep __modsi3 %t +; RUN: grep __umodsi3 %t int %f1(int %a, int %b) { entry: Index: llvm/test/CodeGen/ARM/dyn-stackalloc.ll diff -u llvm/test/CodeGen/ARM/dyn-stackalloc.ll:1.3 llvm/test/CodeGen/ARM/dyn-stackalloc.ll:1.4 --- llvm/test/CodeGen/ARM/dyn-stackalloc.ll:1.3 Thu Feb 22 21:15:39 2007 +++ llvm/test/CodeGen/ARM/dyn-stackalloc.ll Mon Apr 16 12:36:06 2007 @@ -1,7 +1,7 @@ -; RUN: llvm-as < %s | llc -march=arm && -; RUN: llvm-as < %s | llc -march=thumb && -; RUN: llvm-as < %s | llc -march=thumb | not grep "ldr sp" && -; RUN: llvm-as < %s | llc -mtriple=thumb-apple-darwin | not grep "sub.*r7" && +; RUN: llvm-as < %s | llc -march=arm +; RUN: llvm-as < %s | llc -march=thumb | not grep {ldr sp} +; RUN: llvm-as < %s | llc -mtriple=thumb-apple-darwin | \ +; RUN: not grep {sub.*r7} ; RUN: llvm-as < %s | llc -march=thumb | grep 4294967280 %struct.state = type { i32, %struct.info*, float**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i8* } Index: llvm/test/CodeGen/ARM/fcopysign.ll diff -u llvm/test/CodeGen/ARM/fcopysign.ll:1.7 llvm/test/CodeGen/ARM/fcopysign.ll:1.8 --- llvm/test/CodeGen/ARM/fcopysign.ll:1.7 Tue Jan 30 10:16:01 2007 +++ llvm/test/CodeGen/ARM/fcopysign.ll Mon Apr 16 12:36:06 2007 @@ -1,7 +1,6 @@ -; RUN: llvm-as < %s | llc -march=arm && -; RUN: llvm-as < %s | llc -march=arm | grep bic | wc -l | grep 2 && -; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 && -; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | grep fneg | wc -l | grep 2 +; RUN: llvm-as < %s | llc -march=arm | grep bic | wc -l | grep 2 +; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | \ +; RUN: grep fneg | wc -l | grep 2 define float @test1(float %x, double %y) { %tmp = fpext float %x to double Index: llvm/test/CodeGen/ARM/fp.ll diff -u llvm/test/CodeGen/ARM/fp.ll:1.15 llvm/test/CodeGen/ARM/fp.ll:1.16 --- llvm/test/CodeGen/ARM/fp.ll:1.15 Sun Apr 15 14:11:47 2007 +++ llvm/test/CodeGen/ARM/fp.ll Mon Apr 16 12:36:06 2007 @@ -1,21 +1,15 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \ -; RUN: grep fmsr | wc -l | grep 4 -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \ -; RUN: grep fsitos -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \ -; RUN: grep fmrs -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \ -; RUN: grep fsitod -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \ -; RUN: grep fmrrd | wc -l | grep 5 -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \ -; RUN: grep fmdrr | wc -l | grep 2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fldd -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep flds -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fuitod -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fuitos -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \ -; RUN: grep 1065353216 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 > %t +; RUN: grep fmsr %t | wc -l | grep 4 +; RUN: grep fsitos %t +; RUN: grep fmrs %t +; RUN: grep fsitod %t +; RUN: grep fmrrd %t | wc -l | grep 5 +; RUN: grep fmdrr %t | wc -l | grep 2 +; RUN: grep fldd %t +; RUN: grep flds %t +; RUN: grep fuitod %t +; RUN: grep fuitos %t +; RUN: grep 1065353216 %t float %f(int %a) { entry: Index: llvm/test/CodeGen/ARM/fparith.ll diff -u llvm/test/CodeGen/ARM/fparith.ll:1.7 llvm/test/CodeGen/ARM/fparith.ll:1.8 --- llvm/test/CodeGen/ARM/fparith.ll:1.7 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/fparith.ll Mon Apr 16 12:36:06 2007 @@ -1,13 +1,12 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fadds && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep faddd && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fmuls && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fmuld && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fnegs && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fnegd && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fdivs && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fdivd +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 > %t +; RUN: grep fadds %t +; RUN: grep faddd %t +; RUN: grep fmuls %t +; RUN: grep fmuld %t +; RUN: grep fnegs %t +; RUN: grep fnegd %t +; RUN: grep fdivs %t +; RUN: grep fdivd %t float %f1(float %a, float %b) { Index: llvm/test/CodeGen/ARM/fpcmp.ll diff -u llvm/test/CodeGen/ARM/fpcmp.ll:1.7 llvm/test/CodeGen/ARM/fpcmp.ll:1.8 --- llvm/test/CodeGen/ARM/fpcmp.ll:1.7 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/fpcmp.ll Mon Apr 16 12:36:06 2007 @@ -1,11 +1,11 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep movmi && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep moveq && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep movgt && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep movge && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep movne && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fcmped | wc -l | grep 1 -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fcmpes | wc -l | grep 6 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 > %t +; RUN: grep movmi %t +; RUN: grep moveq %t +; RUN: grep movgt %t +; RUN: grep movge %t +; RUN: grep movne %t +; RUN: grep fcmped %t | wc -l | grep 1 +; RUN: grep fcmpes %t | wc -l | grep 6 int %f1(float %a) { entry: Index: llvm/test/CodeGen/ARM/fpcmp_ueq.ll diff -u llvm/test/CodeGen/ARM/fpcmp_ueq.ll:1.4 llvm/test/CodeGen/ARM/fpcmp_ueq.ll:1.5 --- llvm/test/CodeGen/ARM/fpcmp_ueq.ll:1.4 Fri Jan 26 02:25:05 2007 +++ llvm/test/CodeGen/ARM/fpcmp_ueq.ll Mon Apr 16 12:36:06 2007 @@ -1,5 +1,4 @@ -; RUN: llvm-as < %s | llc -march=arm && -; RUN: llvm-as < %s | llc -march=arm | grep moveq && +; RUN: llvm-as < %s | llc -march=arm | grep moveq ; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | grep movvs define i32 @f7(float %a, float %b) { Index: llvm/test/CodeGen/ARM/fpconv.ll diff -u llvm/test/CodeGen/ARM/fpconv.ll:1.6 llvm/test/CodeGen/ARM/fpconv.ll:1.7 --- llvm/test/CodeGen/ARM/fpconv.ll:1.6 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/fpconv.ll Mon Apr 16 12:36:06 2007 @@ -1,14 +1,14 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fcvtsd && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fcvtds && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep ftosizs && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep ftouizs && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep ftosizd && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep ftouizd && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fsitos && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fsitod && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fuitos && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep fuitod +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 > %t +; RUN: grep fcvtsd %t +; RUN: grep fcvtds %t +; RUN: grep ftosizs %t +; RUN: grep ftouizs %t +; RUN: grep ftosizd %t +; RUN: grep ftouizd %t +; RUN: grep fsitos %t +; RUN: grep fsitod %t +; RUN: grep fuitos %t +; RUN: grep fuitod %t float %f1(double %x) { entry: Index: llvm/test/CodeGen/ARM/fpmem.ll diff -u llvm/test/CodeGen/ARM/fpmem.ll:1.5 llvm/test/CodeGen/ARM/fpmem.ll:1.6 --- llvm/test/CodeGen/ARM/fpmem.ll:1.5 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/fpmem.ll Mon Apr 16 12:36:06 2007 @@ -1,7 +1,9 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "mov r0, #0" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep "flds.*\[" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | grep "fsts.*\[" | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \ +; RUN: grep {mov r0, #0} | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \ +; RUN: grep {flds.*\\\[} | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \ +; RUN: grep {fsts.*\\\[} | wc -l | grep 1 float %f1(float %a) { entry: Index: llvm/test/CodeGen/ARM/hello.ll diff -u llvm/test/CodeGen/ARM/hello.ll:1.7 llvm/test/CodeGen/ARM/hello.ll:1.8 --- llvm/test/CodeGen/ARM/hello.ll:1.7 Mon Apr 16 12:08:00 2007 +++ llvm/test/CodeGen/ARM/hello.ll Mon Apr 16 12:36:06 2007 @@ -1,7 +1,7 @@ -; RUN: llvm-as < %s | llc -march=arm && +; RUN: llvm-as < %s | llc -march=arm ; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | grep mov | wc -l | grep 1 -; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnu --disable-fp-elim | grep mov \ -; RUN: | wc -l | grep 3 +; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnu --disable-fp-elim | \ +; RUN: grep mov | wc -l | grep 3 ; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep mov | wc -l | grep 2 @str = internal constant [12 x i8] c"Hello World\00" Index: llvm/test/CodeGen/ARM/imm.ll diff -u llvm/test/CodeGen/ARM/imm.ll:1.1 llvm/test/CodeGen/ARM/imm.ll:1.2 --- llvm/test/CodeGen/ARM/imm.ll:1.1 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/imm.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | not grep CPI int %test1(int %A) { Index: llvm/test/CodeGen/ARM/insn-sched1.ll diff -u llvm/test/CodeGen/ARM/insn-sched1.ll:1.5 llvm/test/CodeGen/ARM/insn-sched1.ll:1.6 --- llvm/test/CodeGen/ARM/insn-sched1.ll:1.5 Thu Mar 8 13:27:32 2007 +++ llvm/test/CodeGen/ARM/insn-sched1.ll Mon Apr 16 12:36:06 2007 @@ -1,5 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin -mattr=+v6 | grep mov | wc -l | grep 3 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin -mattr=+v6 |\ +; RUN: grep mov | wc -l | grep 3 int %test(int %x) { %tmp = cast int %x to short Index: llvm/test/CodeGen/ARM/ldm.ll diff -u llvm/test/CodeGen/ARM/ldm.ll:1.5 llvm/test/CodeGen/ARM/ldm.ll:1.6 --- llvm/test/CodeGen/ARM/ldm.ll:1.5 Wed Jan 31 16:27:07 2007 +++ llvm/test/CodeGen/ARM/ldm.ll Mon Apr 16 12:36:06 2007 @@ -1,7 +1,9 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmia" | wc -l | grep 2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmib" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin | grep "ldmfd sp\!" | wc -l | grep 3 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \ +; RUN: grep ldmia | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \ +; RUN: grep ldmib | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin | \ +; RUN: grep {ldmfd sp\!} | wc -l | grep 3 %X = external global [0 x int] Index: llvm/test/CodeGen/ARM/ldr_ext.ll diff -u llvm/test/CodeGen/ARM/ldr_ext.ll:1.4 llvm/test/CodeGen/ARM/ldr_ext.ll:1.5 --- llvm/test/CodeGen/ARM/ldr_ext.ll:1.4 Thu Feb 22 21:15:39 2007 +++ llvm/test/CodeGen/ARM/ldr_ext.ll Mon Apr 16 12:36:06 2007 @@ -1,12 +1,11 @@ -; RUN: llvm-as < %s | llc -march=arm && -; RUN: llvm-as < %s | llc -march=arm | grep "ldrb" | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=arm | grep "ldrh" | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=arm | grep "ldrsb" | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=arm | grep "ldrsh" | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=thumb | grep "ldrb" | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=thumb | grep "ldrh" | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=thumb | grep "ldrsb" | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=thumb | grep "ldrsh" | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=arm | grep ldrb | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=arm | grep ldrh | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=arm | grep ldrsb | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=arm | grep ldrsh | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=thumb | grep ldrb | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=thumb | grep ldrh | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=thumb | grep ldrsb | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=thumb | grep ldrsh | wc -l | grep 1 define i32 @test1(i8* %v.pntr.s0.u1) { %tmp.u = load i8* %v.pntr.s0.u1 Index: llvm/test/CodeGen/ARM/ldr_frame.ll diff -u llvm/test/CodeGen/ARM/ldr_frame.ll:1.3 llvm/test/CodeGen/ARM/ldr_frame.ll:1.4 --- llvm/test/CodeGen/ARM/ldr_frame.ll:1.3 Thu Feb 22 21:15:39 2007 +++ llvm/test/CodeGen/ARM/ldr_frame.ll Mon Apr 16 12:36:06 2007 @@ -1,6 +1,4 @@ -; RUN: llvm-as < %s | llc -march=arm && -; RUN: llvm-as < %s | llc -march=arm | not grep mov && -; RUN: llvm-as < %s | llc -march=thumb && +; RUN: llvm-as < %s | llc -march=arm | not grep mov ; RUN: llvm-as < %s | llc -march=thumb | grep cpy | wc -l | grep 2 define i32 @f1() { Index: llvm/test/CodeGen/ARM/ldr_pre.ll diff -u llvm/test/CodeGen/ARM/ldr_pre.ll:1.1 llvm/test/CodeGen/ARM/ldr_pre.ll:1.2 --- llvm/test/CodeGen/ARM/ldr_pre.ll:1.1 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/ldr_pre.ll Mon Apr 16 12:36:06 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldr.*\!" | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \ +; RUN: grep {ldr.*\\!} | wc -l | grep 2 int *%test1(int *%X, int *%dest) { %Y = getelementptr int* %X, int 4 Index: llvm/test/CodeGen/ARM/load.ll diff -u llvm/test/CodeGen/ARM/load.ll:1.2 llvm/test/CodeGen/ARM/load.ll:1.3 --- llvm/test/CodeGen/ARM/load.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/ARM/load.ll Mon Apr 16 12:36:06 2007 @@ -1,8 +1,8 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep ldrsb && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep ldrb && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep ldrsh && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep ldrh +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm > %t +; RUN: grep ldrsb %t +; RUN: grep ldrb %t +; RUN: grep ldrsh %t +; RUN: grep ldrh %t int %f1(sbyte* %p) { entry: Index: llvm/test/CodeGen/ARM/long-setcc.ll diff -u llvm/test/CodeGen/ARM/long-setcc.ll:1.3 llvm/test/CodeGen/ARM/long-setcc.ll:1.4 --- llvm/test/CodeGen/ARM/long-setcc.ll:1.3 Wed Apr 11 11:12:27 2007 +++ llvm/test/CodeGen/ARM/long-setcc.ll Mon Apr 16 12:36:06 2007 @@ -1,6 +1,4 @@ -; RUN: llvm-as < %s | llc -march=arm && -; RUN: llvm-as < %s | llc -march=arm | grep cmp | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=thumb && +; RUN: llvm-as < %s | llc -march=arm | grep cmp | wc -l | grep 1 ; RUN: llvm-as < %s | llc -march=thumb | grep cmp | wc -l | grep 1 Index: llvm/test/CodeGen/ARM/long_shift.ll diff -u llvm/test/CodeGen/ARM/long_shift.ll:1.4 llvm/test/CodeGen/ARM/long_shift.ll:1.5 --- llvm/test/CodeGen/ARM/long_shift.ll:1.4 Thu Feb 22 21:15:39 2007 +++ llvm/test/CodeGen/ARM/long_shift.ll Mon Apr 16 12:36:06 2007 @@ -1,9 +1,9 @@ -; RUN: llvm-as < %s | llc -march=arm && -; RUN: llvm-as < %s | llc -march=arm | grep rrx | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=arm | grep __ashldi3 && -; RUN: llvm-as < %s | llc -march=arm | grep __ashrdi3 && -; RUN: llvm-as < %s | llc -march=arm | grep __lshrdi3 && ; RUN: llvm-as < %s | llc -march=thumb +; RUN: llvm-as < %s | llc -march=arm > %t +; RUN: grep rrx %t | wc -l | grep 1 +; RUN: grep __ashldi3 %t +; RUN: grep __ashrdi3 %t +; RUN: grep __lshrdi3 %t define i64 @f0(i64 %A, i64 %B) { %tmp = bitcast i64 %A to i64 Index: llvm/test/CodeGen/ARM/pack.ll diff -u llvm/test/CodeGen/ARM/pack.ll:1.2 llvm/test/CodeGen/ARM/pack.ll:1.3 --- llvm/test/CodeGen/ARM/pack.ll:1.2 Sun Apr 15 14:11:47 2007 +++ llvm/test/CodeGen/ARM/pack.ll Mon Apr 16 12:36:06 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 | \ -; RUN: grep pkhbt | wc -l | grep 5 && +; RUN: grep pkhbt | wc -l | grep 5 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 | \ ; RUN: grep pkhtb | wc -l | grep 4 ; END. Index: llvm/test/CodeGen/ARM/section.ll diff -u llvm/test/CodeGen/ARM/section.ll:1.9 llvm/test/CodeGen/ARM/section.ll:1.10 --- llvm/test/CodeGen/ARM/section.ll:1.9 Sun Apr 15 14:11:47 2007 +++ llvm/test/CodeGen/ARM/section.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux ; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | \ ; RUN: grep {__DTOR_END__:} ; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | \ Index: llvm/test/CodeGen/ARM/vfp.ll diff -u llvm/test/CodeGen/ARM/vfp.ll:1.2 llvm/test/CodeGen/ARM/vfp.ll:1.3 --- llvm/test/CodeGen/ARM/vfp.ll:1.2 Sun Apr 15 14:11:47 2007 +++ llvm/test/CodeGen/ARM/vfp.ll Mon Apr 16 12:36:06 2007 @@ -7,7 +7,7 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \ ; RUN: grep fuito | wc -l | grep 2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \ -; RUN: grep fto.i | wc -l | grep 4 && +; RUN: grep fto.i | wc -l | grep 4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \ ; RUN: grep bmi | wc -l | grep 1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \ From reid at x10sys.com Mon Apr 16 12:38:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:16 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/IndVarsSimplify/loop_evaluate_2.ll Message-ID: <200704161738.l3GHcGWL010439@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/IndVarsSimplify: loop_evaluate_2.ll updated: 1.1 -> 1.2 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+1 -1) loop_evaluate_2.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Transforms/IndVarsSimplify/loop_evaluate_2.ll diff -u llvm/test/Transforms/IndVarsSimplify/loop_evaluate_2.ll:1.1 llvm/test/Transforms/IndVarsSimplify/loop_evaluate_2.ll:1.2 --- llvm/test/Transforms/IndVarsSimplify/loop_evaluate_2.ll:1.1 Sat Mar 3 18:54:06 2007 +++ llvm/test/Transforms/IndVarsSimplify/loop_evaluate_2.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -adce -simplifycfg | llvm-dis | grep select && +; RUN: llvm-as < %s | opt -indvars -adce -simplifycfg | llvm-dis | grep select ; RUN: llvm-as < %s | opt -indvars -adce -simplifycfg | llvm-dis | not grep br ; PR1179 From reid at x10sys.com Mon Apr 16 12:38:12 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:12 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/SimplifyLibCalls/floor.ll Message-ID: <200704161738.l3GHcCHZ010315@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/SimplifyLibCalls: floor.ll updated: 1.5 -> 1.6 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+7 -12) floor.ll | 19 +++++++------------ 1 files changed, 7 insertions(+), 12 deletions(-) Index: llvm/test/Transforms/SimplifyLibCalls/floor.ll diff -u llvm/test/Transforms/SimplifyLibCalls/floor.ll:1.5 llvm/test/Transforms/SimplifyLibCalls/floor.ll:1.6 --- llvm/test/Transforms/SimplifyLibCalls/floor.ll:1.5 Sun Apr 15 00:16:38 2007 +++ llvm/test/Transforms/SimplifyLibCalls/floor.ll Mon Apr 16 12:36:08 2007 @@ -1,15 +1,10 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ -; RUN: not grep {call.*floor(} && -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ -; RUN: grep {call.*floorf(} -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ -; RUN: not grep {call.*ceil(} && -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ -; RUN: grep {call.*ceilf(} -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ -; RUN: not grep {call.*nearbyint(} && -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \ -; RUN: grep {call.*nearbyintf(} +; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis > %t +; RUN: not grep {call.*floor(} %t +; RUN: grep {call.*floorf(} %t +; RUN: not grep {call.*ceil(} %t +; RUN: grep {call.*ceilf(} %t +; RUN: not grep {call.*nearbyint(} %t +; RUN: grep {call.*nearbyintf(} %t ; XFAIL: sparc declare double %floor(double) From reid at x10sys.com Mon Apr 16 12:38:12 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:12 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/DeadArgElim/dead_vaargs.ll Message-ID: <200704161738.l3GHcCTF010318@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/DeadArgElim: dead_vaargs.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+1 -2) dead_vaargs.ll | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/test/Transforms/DeadArgElim/dead_vaargs.ll diff -u llvm/test/Transforms/DeadArgElim/dead_vaargs.ll:1.2 llvm/test/Transforms/DeadArgElim/dead_vaargs.ll:1.3 --- llvm/test/Transforms/DeadArgElim/dead_vaargs.ll:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/DeadArgElim/dead_vaargs.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -deadargelim -disable-output && -; RUN: llvm-upgrade < %s | llvm-as | opt -deadargelim | llvm-dis | not grep 47 && +; RUN: llvm-upgrade < %s | llvm-as | opt -deadargelim | llvm-dis | not grep 47 ; RUN: llvm-upgrade < %s | llvm-as | opt -deadargelim | llvm-dis | not grep 1.0 int %bar(int %A) { From reid at x10sys.com Mon Apr 16 12:38:12 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:12 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/LowerInvoke/basictest.ll Message-ID: <200704161738.l3GHcCVn010322@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/LowerInvoke: basictest.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+0 -1) basictest.ll | 1 - 1 files changed, 1 deletion(-) Index: llvm/test/Transforms/LowerInvoke/basictest.ll diff -u llvm/test/Transforms/LowerInvoke/basictest.ll:1.2 llvm/test/Transforms/LowerInvoke/basictest.ll:1.3 --- llvm/test/Transforms/LowerInvoke/basictest.ll:1.2 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/LowerInvoke/basictest.ll Mon Apr 16 12:36:08 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -lowerinvoke -disable-output && ; RUN: llvm-upgrade < %s | llvm-as | opt -lowerinvoke -disable-output -enable-correct-eh-support implementation From reid at x10sys.com Mon Apr 16 12:38:17 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:17 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/SPARC/ctpop.ll xnor.ll Message-ID: <200704161738.l3GHcHUw010554@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/SPARC: ctpop.ll updated: 1.2 -> 1.3 xnor.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+8 -6) ctpop.ll | 10 ++++++---- xnor.ll | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) Index: llvm/test/CodeGen/SPARC/ctpop.ll diff -u llvm/test/CodeGen/SPARC/ctpop.ll:1.2 llvm/test/CodeGen/SPARC/ctpop.ll:1.3 --- llvm/test/CodeGen/SPARC/ctpop.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/SPARC/ctpop.ll Mon Apr 16 12:36:07 2007 @@ -1,7 +1,9 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc -mattr=-v9 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc -mattr=v9 -enable-sparc-v9-insts && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc -mattr=-v9 | not grep popc && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc -mattr=v9 -enable-sparc-v9-insts | grep popc +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: llc -march=sparc -mattr=v9 -enable-sparc-v9-insts +; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc -mattr=-v9 | \ +; RUN: not grep popc +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: llc -march=sparc -mattr=v9 -enable-sparc-v9-insts | grep popc declare uint %llvm.ctpop.i32(uint) uint %test(uint %X) { Index: llvm/test/CodeGen/SPARC/xnor.ll diff -u llvm/test/CodeGen/SPARC/xnor.ll:1.2 llvm/test/CodeGen/SPARC/xnor.ll:1.3 --- llvm/test/CodeGen/SPARC/xnor.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/SPARC/xnor.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc | grep xnor | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc | \ +; RUN: grep xnor | wc -l | grep 2 int %test1(int %X, int %Y) { %A = xor int %X, %Y From reid at x10sys.com Mon Apr 16 12:38:13 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:13 -0500 Subject: [llvm-commits] CVS: llvm/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll Message-ID: <200704161738.l3GHcDkC010352@zion.cs.uiuc.edu> Changes in directory llvm/test/Analysis/LoopInfo: 2003-05-15-NestingProblem.ll updated: 1.5 -> 1.6 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+2 -1) 2003-05-15-NestingProblem.ll | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll diff -u llvm/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll:1.5 llvm/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll:1.6 --- llvm/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll:1.5 Fri Dec 1 22:23:08 2006 +++ llvm/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll Mon Apr 16 12:36:06 2007 @@ -1,7 +1,8 @@ ; This testcase was incorrectly computing that the loopentry.7 loop was ; not a child of the loopentry.6 loop. ; -; RUN: llvm-upgrade < %s | llvm-as | opt -analyze -loops | grep "^ Loop Containing: %loopentry.7" +; RUN: llvm-upgrade < %s | llvm-as | opt -analyze -loops | \ +; RUN: grep {^ Loop Containing: %loopentry.7} void %getAndMoveToFrontDecode() { ; No predecessors! br label %endif.2 From reid at x10sys.com Mon Apr 16 12:38:15 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:15 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/Inline/dynamic_alloca_test.ll Message-ID: <200704161738.l3GHcFbx010411@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/Inline: dynamic_alloca_test.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+2 -2) dynamic_alloca_test.ll | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/Transforms/Inline/dynamic_alloca_test.ll diff -u llvm/test/Transforms/Inline/dynamic_alloca_test.ll:1.2 llvm/test/Transforms/Inline/dynamic_alloca_test.ll:1.3 --- llvm/test/Transforms/Inline/dynamic_alloca_test.ll:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/Inline/dynamic_alloca_test.ll Mon Apr 16 12:36:07 2007 @@ -1,8 +1,8 @@ ; Test that functions with dynamic allocas get inlined in a case where ; naively inlining it would result in a miscompilation. -; RUN: llvm-upgrade < %s | llvm-as | opt -inline && -; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | grep llvm.stacksave && +; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | \ +; RUN: grep llvm.stacksave ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | not grep callee declare void %ext(int*) From reid at x10sys.com Mon Apr 16 12:38:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:16 -0500 Subject: [llvm-commits] CVS: llvm/test/C++Frontend/2003-10-21-InnerClass.cpp.tr Message-ID: <200704161738.l3GHcGvY010452@zion.cs.uiuc.edu> Changes in directory llvm/test/C++Frontend: 2003-10-21-InnerClass.cpp.tr updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+1 -1) 2003-10-21-InnerClass.cpp.tr | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/C++Frontend/2003-10-21-InnerClass.cpp.tr diff -u llvm/test/C++Frontend/2003-10-21-InnerClass.cpp.tr:1.2 llvm/test/C++Frontend/2003-10-21-InnerClass.cpp.tr:1.3 --- llvm/test/C++Frontend/2003-10-21-InnerClass.cpp.tr:1.2 Sun Apr 15 15:41:31 2007 +++ llvm/test/C++Frontend/2003-10-21-InnerClass.cpp.tr Mon Apr 16 12:36:06 2007 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -xc++ -S -o - %s | grep "struct.X::Y" +// RUN: %llvmgcc -xc++ -S -o - %s | grep {struct.X::Y} struct X { struct Y { From reid at x10sys.com Mon Apr 16 12:38:14 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:14 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll 2006-06-12-MultipleExitsSameBlock.ll basictest.ll Message-ID: <200704161738.l3GHcEj4010387@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/LCSSA: 2006-06-03-IncorrectIDFPhis.ll updated: 1.5 -> 1.6 2006-06-12-MultipleExitsSameBlock.ll updated: 1.4 -> 1.5 basictest.ll updated: 1.8 -> 1.9 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+6 -6) 2006-06-03-IncorrectIDFPhis.ll | 4 ++-- 2006-06-12-MultipleExitsSameBlock.ll | 4 ++-- basictest.ll | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll diff -u llvm/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll:1.5 llvm/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll:1.6 --- llvm/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll:1.5 Fri Jan 26 02:25:06 2007 +++ llvm/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll Mon Apr 16 12:36:07 2007 @@ -1,7 +1,7 @@ ; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | \ -; RUN: grep "%SJE.0.0.lcssa = phi .struct.SetJmpMapEntry" && +; RUN: grep {%SJE.0.0.lcssa = phi .struct.SetJmpMapEntry} ; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | \ -; RUN: grep "%SJE.0.0.lcssa1 = phi .struct.SetJmpMapEntry" +; RUN: grep {%SJE.0.0.lcssa1 = phi .struct.SetJmpMapEntry} %struct.SetJmpMapEntry = type { sbyte*, uint, %struct.SetJmpMapEntry* } Index: llvm/test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll diff -u llvm/test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll:1.4 llvm/test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll:1.5 --- llvm/test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll:1.4 Fri Jan 26 02:25:06 2007 +++ llvm/test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll Mon Apr 16 12:36:07 2007 @@ -1,7 +1,7 @@ ; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | \ -; RUN: grep "%X.1.lcssa" && +; RUN: grep {%X.1.lcssa} ; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | \ -; RUN: not grep "%X.1.lcssa1" +; RUN: not grep {%X.1.lcssa1} declare bool %c1() declare bool %c2() Index: llvm/test/Transforms/LCSSA/basictest.ll diff -u llvm/test/Transforms/LCSSA/basictest.ll:1.8 llvm/test/Transforms/LCSSA/basictest.ll:1.9 --- llvm/test/Transforms/LCSSA/basictest.ll:1.8 Fri Jan 26 02:25:06 2007 +++ llvm/test/Transforms/LCSSA/basictest.ll Mon Apr 16 12:36:07 2007 @@ -1,7 +1,7 @@ ; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | \ -; RUN: grep "X3.lcssa = phi i32" && +; RUN: grep {X3.lcssa = phi i32} ; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | \ -; RUN: grep "X4 = add i32 3, %X3.lcssa" +; RUN: grep {X4 = add i32 3, %X3.lcssa} void %lcssa(bool %S2) { entry: From reid at x10sys.com Mon Apr 16 12:38:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:16 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/Reassociate/mul-factor3.ll mulfactor2.ll shift-factor.ll Message-ID: <200704161738.l3GHcGsv010479@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/Reassociate: mul-factor3.ll updated: 1.2 -> 1.3 mulfactor2.ll updated: 1.3 -> 1.4 shift-factor.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+13 -6) mul-factor3.ll | 6 ++++-- mulfactor2.ll | 7 +++++-- shift-factor.ll | 6 ++++-- 3 files changed, 13 insertions(+), 6 deletions(-) Index: llvm/test/Transforms/Reassociate/mul-factor3.ll diff -u llvm/test/Transforms/Reassociate/mul-factor3.ll:1.2 llvm/test/Transforms/Reassociate/mul-factor3.ll:1.3 --- llvm/test/Transforms/Reassociate/mul-factor3.ll:1.2 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/Reassociate/mul-factor3.ll Mon Apr 16 12:36:08 2007 @@ -1,7 +1,9 @@ ; This should be one add and two multiplies. -; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep mul | wc -l | grep 2 && -; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep add | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: opt -reassociate -instcombine | llvm-dis > %t +; RUN: grep mul %t | wc -l | grep 2 +; RUN: grep add %t | wc -l | grep 1 int %test(int %A, int %B, int %C) { %aa = mul int %A, %A Index: llvm/test/Transforms/Reassociate/mulfactor2.ll diff -u llvm/test/Transforms/Reassociate/mulfactor2.ll:1.3 llvm/test/Transforms/Reassociate/mulfactor2.ll:1.4 --- llvm/test/Transforms/Reassociate/mulfactor2.ll:1.3 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/Reassociate/mulfactor2.ll Mon Apr 16 12:36:08 2007 @@ -1,7 +1,10 @@ ; This should turn into one multiply and one add. -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -reassociate -instcombine | llvm-dis | grep mul | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -reassociate -instcombine | llvm-dis | grep add | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: opt -instcombine -reassociate -instcombine | llvm-dis -o %t +; RUN: grep mul %t | wc -l | grep 1 +; RUN: grep add %t | wc -l | grep 1 + int %main(int %t) { %tmp.3 = mul int %t, 12 ; [#uses=1] %tmp.4 = add int %tmp.3, 5 ; [#uses=1] Index: llvm/test/Transforms/Reassociate/shift-factor.ll diff -u llvm/test/Transforms/Reassociate/shift-factor.ll:1.2 llvm/test/Transforms/Reassociate/shift-factor.ll:1.3 --- llvm/test/Transforms/Reassociate/shift-factor.ll:1.2 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/Reassociate/shift-factor.ll Mon Apr 16 12:36:08 2007 @@ -1,6 +1,8 @@ ; There should be exactly one shift and one add left. -; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep shl | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep add | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: opt -reassociate -instcombine | llvm-dis > %t +; RUN: grep shl %t | wc -l | grep 1 +; RUN: grep add %t | wc -l | grep 1 int %test(int %X, int %Y) { %tmp.2 = shl int %X, ubyte 1 ; [#uses=1] From reid at x10sys.com Mon Apr 16 12:38:17 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:17 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/TailDup/if-tail-dup.ll Message-ID: <200704161738.l3GHcHJm010560@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/TailDup: if-tail-dup.ll updated: 1.3 -> 1.4 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+4 -4) if-tail-dup.ll | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/test/Transforms/TailDup/if-tail-dup.ll diff -u llvm/test/Transforms/TailDup/if-tail-dup.ll:1.3 llvm/test/Transforms/TailDup/if-tail-dup.ll:1.4 --- llvm/test/Transforms/TailDup/if-tail-dup.ll:1.3 Sat Apr 14 23:59:55 2007 +++ llvm/test/Transforms/TailDup/if-tail-dup.ll Mon Apr 16 12:36:08 2007 @@ -1,7 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -tailduplicate | llc -march=x86 | \ -; RUN: grep {je } && -; RUN: llvm-upgrade < %s | llvm-as | opt -tailduplicate | llc -march=x86 | \ -; RUN: not grep jmp +; RUN: llvm-upgrade < %s | llvm-as | opt -tailduplicate | \ +; RUN: llc -march=x86 -o %t -f +; RUN: grep {je } %t +; RUN: not grep jmp %t ; END. ; This should have no unconditional jumps in it. The C source is: From reid at x10sys.com Mon Apr 16 12:38:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:16 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/ScalarRepl/AggregatePromote.ll vector_promote.ll Message-ID: <200704161738.l3GHcGsJ010520@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/ScalarRepl: AggregatePromote.ll updated: 1.2 -> 1.3 vector_promote.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+4 -5) AggregatePromote.ll | 4 ++-- vector_promote.ll | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) Index: llvm/test/Transforms/ScalarRepl/AggregatePromote.ll diff -u llvm/test/Transforms/ScalarRepl/AggregatePromote.ll:1.2 llvm/test/Transforms/ScalarRepl/AggregatePromote.ll:1.3 --- llvm/test/Transforms/ScalarRepl/AggregatePromote.ll:1.2 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/ScalarRepl/AggregatePromote.ll Mon Apr 16 12:36:08 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | not grep alloca && -; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl -disable-output +; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | \ +; RUN: not grep alloca target endian = big target pointersize = 32 Index: llvm/test/Transforms/ScalarRepl/vector_promote.ll diff -u llvm/test/Transforms/ScalarRepl/vector_promote.ll:1.2 llvm/test/Transforms/ScalarRepl/vector_promote.ll:1.3 --- llvm/test/Transforms/ScalarRepl/vector_promote.ll:1.2 Fri Dec 1 22:23:10 2006 +++ llvm/test/Transforms/ScalarRepl/vector_promote.ll Mon Apr 16 12:36:08 2007 @@ -1,6 +1,5 @@ - -; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl -disable-output && -; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | not grep alloca +; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | \ +; RUN: not grep alloca void %test(<4 x float>* %F, float %f) { entry: From reid at x10sys.com Mon Apr 16 12:38:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:16 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll Message-ID: <200704161738.l3GHcG9O010526@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/LoopUnroll: 2006-08-24-MultiBlockLoop.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+1 -1) 2006-08-24-MultiBlockLoop.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll diff -u llvm/test/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll:1.2 llvm/test/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll:1.3 --- llvm/test/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -loop-unroll | llvm-dis | grep "bb72.2" +; RUN: llvm-upgrade < %s | llvm-as | opt -loop-unroll | llvm-dis | grep bb72.2 void %vorbis_encode_noisebias_setup() { entry: From reid at x10sys.com Mon Apr 16 12:38:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:16 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/GlobalOpt/ctor-list-opt.ll Message-ID: <200704161738.l3GHcGN7010471@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/GlobalOpt: ctor-list-opt.ll updated: 1.9 -> 1.10 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+0 -1) ctor-list-opt.ll | 1 - 1 files changed, 1 deletion(-) Index: llvm/test/Transforms/GlobalOpt/ctor-list-opt.ll diff -u llvm/test/Transforms/GlobalOpt/ctor-list-opt.ll:1.9 llvm/test/Transforms/GlobalOpt/ctor-list-opt.ll:1.10 --- llvm/test/Transforms/GlobalOpt/ctor-list-opt.ll:1.9 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/GlobalOpt/ctor-list-opt.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt -disable-output && ; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep CTOR %llvm.global_ctors = appending global [10 x { int, void ()* }] [ From reid at x10sys.com Mon Apr 16 12:38:17 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:17 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/LowerSwitch/feature.ll Message-ID: <200704161738.l3GHcHp7010662@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/LowerSwitch: feature.ll updated: 1.1 -> 1.2 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+4 -3) feature.ll | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/test/Transforms/LowerSwitch/feature.ll diff -u llvm/test/Transforms/LowerSwitch/feature.ll:1.1 llvm/test/Transforms/LowerSwitch/feature.ll:1.2 --- llvm/test/Transforms/LowerSwitch/feature.ll:1.1 Sat Mar 10 10:46:28 2007 +++ llvm/test/Transforms/LowerSwitch/feature.ll Mon Apr 16 12:36:08 2007 @@ -1,6 +1,7 @@ -; RUN: llvm-as %s -o - | opt -lowerswitch | llvm-dis | grep slt | wc -l | grep 10 && -; RUN: llvm-as %s -o - | opt -lowerswitch | llvm-dis | grep ule | wc -l | grep 3 && -; RUN: llvm-as %s -o - | opt -lowerswitch | llvm-dis | grep eq | wc -l | grep 9 +; RUN: llvm-as %s -o - | opt -lowerswitch | llvm-dis > %t +; RUN: grep slt %t | wc -l | grep 10 +; RUN: grep ule %t | wc -l | grep 3 +; RUN: grep eq %t | wc -l | grep 9 define i32 @main(i32 %tmp158) { entry: From reid at x10sys.com Mon Apr 16 12:38:17 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:17 -0500 Subject: [llvm-commits] CVS: llvm/test/Linker/basiclink.ll Message-ID: <200704161738.l3GHcHn1010602@zion.cs.uiuc.edu> Changes in directory llvm/test/Linker: basiclink.ll updated: 1.3 -> 1.4 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+2 -2) basiclink.ll | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/Linker/basiclink.ll diff -u llvm/test/Linker/basiclink.ll:1.3 llvm/test/Linker/basiclink.ll:1.4 --- llvm/test/Linker/basiclink.ll:1.3 Tue Jan 30 10:16:01 2007 +++ llvm/test/Linker/basiclink.ll Mon Apr 16 12:36:07 2007 @@ -1,8 +1,8 @@ ; Test linking two functions with different prototypes and two globals ; in different modules. This is for PR411 ; RUN: llvm-as %s -o %t.bar.bc -f -; RUN: echo "define i32* @foo(i32 %x) { ret i32* @baz } @baz = external global i32" | \ -; RUN: llvm-as -o %t.foo.bc -f +; RUN: echo {define i32* @foo(i32 %x) \{ ret i32* @baz \} \ +; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc -f ; RUN: llvm-link %t.bar.bc %t.foo.bc -o %t.bc -f ; RUN: llvm-link %t.foo.bc %t.bar.bc -o %t.bc -f declare i32* @foo(...) From reid at x10sys.com Mon Apr 16 12:38:17 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:17 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/PowerPC/2006-08-11-RetVector.ll 2006-10-13-Miscompile.ll 2006-12-07-LargeAlloca.ll 2006-12-07-SelectCrash.ll 2007-01-04-ArgExtension.ll 2007-01-29-lbrx-asm.ll 2007-01-31-InlineAsmAddrMode.ll addc.ll addi-reassoc.ll align.ll and-branch.ll and-elim.ll and_add.ll and_sext.ll buildvec_canonicalize.ll cmp-cmp.ll div-2.ll eqv-andc-orc-nor.ll fold-li.ll fp-int-fp.ll fpcopy.ll inlineasm-copy.ll inverted-bool-compares.ll load-constant-addr.ll mem_update.ll mul-neg-power-2.ll mulhs.ll or-addressing-mode.ll reg-coalesce-simple.ll rlwimi.ll rlwimi2.ll rlwinm.ll rlwinm2.ll rotl-2.ll rotl.ll stfiwx.ll store-load-fwd.ll subc.ll unsafe-math.ll vec_br_cmp.ll vec_constants.ll vec_mul.ll vec_perf_shuffle.ll vec_shuffle.ll vec_spat.ll vec_vrsave.ll Message-ID: <200704161738.l3GHcHlR010668@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/PowerPC: 2006-08-11-RetVector.ll updated: 1.2 -> 1.3 2006-10-13-Miscompile.ll updated: 1.2 -> 1.3 2006-12-07-LargeAlloca.ll updated: 1.2 -> 1.3 2006-12-07-SelectCrash.ll updated: 1.2 -> 1.3 2007-01-04-ArgExtension.ll updated: 1.3 -> 1.4 2007-01-29-lbrx-asm.ll updated: 1.2 -> 1.3 2007-01-31-InlineAsmAddrMode.ll updated: 1.2 -> 1.3 addc.ll updated: 1.3 -> 1.4 addi-reassoc.ll updated: 1.2 -> 1.3 align.ll updated: 1.2 -> 1.3 and-branch.ll updated: 1.2 -> 1.3 and-elim.ll updated: 1.7 -> 1.8 and_add.ll updated: 1.2 -> 1.3 and_sext.ll updated: 1.8 -> 1.9 buildvec_canonicalize.ll updated: 1.3 -> 1.4 cmp-cmp.ll updated: 1.2 -> 1.3 div-2.ll updated: 1.5 -> 1.6 eqv-andc-orc-nor.ll updated: 1.5 -> 1.6 fold-li.ll updated: 1.2 -> 1.3 fp-int-fp.ll updated: 1.2 -> 1.3 fpcopy.ll updated: 1.2 -> 1.3 inlineasm-copy.ll updated: 1.2 -> 1.3 inverted-bool-compares.ll updated: 1.2 -> 1.3 load-constant-addr.ll updated: 1.2 -> 1.3 mem_update.ll updated: 1.5 -> 1.6 mul-neg-power-2.ll updated: 1.2 -> 1.3 mulhs.ll updated: 1.3 -> 1.4 or-addressing-mode.ll updated: 1.2 -> 1.3 reg-coalesce-simple.ll updated: 1.2 -> 1.3 rlwimi.ll updated: 1.5 -> 1.6 rlwimi2.ll updated: 1.3 -> 1.4 rlwinm.ll updated: 1.5 -> 1.6 rlwinm2.ll updated: 1.3 -> 1.4 rotl-2.ll updated: 1.1 -> 1.2 rotl.ll updated: 1.6 -> 1.7 stfiwx.ll updated: 1.3 -> 1.4 store-load-fwd.ll updated: 1.2 -> 1.3 subc.ll updated: 1.3 -> 1.4 unsafe-math.ll updated: 1.2 -> 1.3 vec_br_cmp.ll updated: 1.2 -> 1.3 vec_constants.ll updated: 1.6 -> 1.7 vec_mul.ll updated: 1.3 -> 1.4 vec_perf_shuffle.ll updated: 1.2 -> 1.3 vec_shuffle.ll updated: 1.8 -> 1.9 vec_spat.ll updated: 1.6 -> 1.7 vec_vrsave.ll updated: 1.3 -> 1.4 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+117 -104) 2006-08-11-RetVector.ll | 2 +- 2006-10-13-Miscompile.ll | 1 - 2006-12-07-LargeAlloca.ll | 4 ++-- 2006-12-07-SelectCrash.ll | 4 ++-- 2007-01-04-ArgExtension.ll | 2 +- 2007-01-29-lbrx-asm.ll | 2 +- 2007-01-31-InlineAsmAddrMode.ll | 2 +- addc.ll | 11 ++++++----- addi-reassoc.ll | 1 - align.ll | 9 ++++++--- and-branch.ll | 1 - and-elim.ll | 1 - and_add.ll | 7 ++++--- and_sext.ll | 3 +-- buildvec_canonicalize.ll | 8 ++++++-- cmp-cmp.ll | 1 - div-2.ll | 2 +- eqv-andc-orc-nor.ll | 15 ++++++++++----- fold-li.ll | 4 ++-- fp-int-fp.ll | 1 - fpcopy.ll | 1 - inlineasm-copy.ll | 1 - inverted-bool-compares.ll | 3 +-- load-constant-addr.ll | 2 +- mem_update.ll | 8 ++++---- mul-neg-power-2.ll | 1 - mulhs.ll | 9 +++++---- or-addressing-mode.ll | 3 +-- reg-coalesce-simple.ll | 1 - rlwimi.ll | 2 +- rlwimi2.ll | 7 ++++--- rlwinm.ll | 11 ++++++----- rlwinm2.ll | 13 +++++++------ rotl-2.ll | 4 ++-- rotl.ll | 3 +-- stfiwx.ll | 13 +++++++++---- store-load-fwd.ll | 1 - subc.ll | 11 ++++++----- unsafe-math.ll | 5 +++-- vec_br_cmp.ll | 5 +++-- vec_constants.ll | 1 - vec_mul.ll | 3 +-- vec_perf_shuffle.ll | 1 - vec_shuffle.ll | 14 ++++++++------ vec_spat.ll | 10 ++++++---- vec_vrsave.ll | 7 ++++--- 46 files changed, 117 insertions(+), 104 deletions(-) Index: llvm/test/CodeGen/PowerPC/2006-08-11-RetVector.ll diff -u llvm/test/CodeGen/PowerPC/2006-08-11-RetVector.ll:1.2 llvm/test/CodeGen/PowerPC/2006-08-11-RetVector.ll:1.3 --- llvm/test/CodeGen/PowerPC/2006-08-11-RetVector.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/2006-08-11-RetVector.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vsldoi && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vsldoi ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep vor <4 x float> %func(<4 x float> %fp0, <4 x float> %fp1) { Index: llvm/test/CodeGen/PowerPC/2006-10-13-Miscompile.ll diff -u llvm/test/CodeGen/PowerPC/2006-10-13-Miscompile.ll:1.2 llvm/test/CodeGen/PowerPC/2006-10-13-Miscompile.ll:1.3 --- llvm/test/CodeGen/PowerPC/2006-10-13-Miscompile.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/2006-10-13-Miscompile.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep IMPLICIT_DEF void %foo(long %X) { Index: llvm/test/CodeGen/PowerPC/2006-12-07-LargeAlloca.ll diff -u llvm/test/CodeGen/PowerPC/2006-12-07-LargeAlloca.ll:1.2 llvm/test/CodeGen/PowerPC/2006-12-07-LargeAlloca.ll:1.3 --- llvm/test/CodeGen/PowerPC/2006-12-07-LargeAlloca.ll:1.2 Fri Dec 29 14:01:32 2006 +++ llvm/test/CodeGen/PowerPC/2006-12-07-LargeAlloca.ll Mon Apr 16 12:36:06 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 ; RUN: llvm-upgrade < %s | llvm-as | llc void %bitap() { Index: llvm/test/CodeGen/PowerPC/2006-12-07-SelectCrash.ll diff -u llvm/test/CodeGen/PowerPC/2006-12-07-SelectCrash.ll:1.2 llvm/test/CodeGen/PowerPC/2006-12-07-SelectCrash.ll:1.3 --- llvm/test/CodeGen/PowerPC/2006-12-07-SelectCrash.ll:1.2 Mon Dec 18 20:03:04 2006 +++ llvm/test/CodeGen/PowerPC/2006-12-07-SelectCrash.ll Mon Apr 16 12:36:06 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 ; RUN: llvm-upgrade < %s | llvm-as | llc %qsz.b = external global bool ; [#uses=1] Index: llvm/test/CodeGen/PowerPC/2007-01-04-ArgExtension.ll diff -u llvm/test/CodeGen/PowerPC/2007-01-04-ArgExtension.ll:1.3 llvm/test/CodeGen/PowerPC/2007-01-04-ArgExtension.ll:1.4 --- llvm/test/CodeGen/PowerPC/2007-01-04-ArgExtension.ll:1.3 Fri Jan 26 02:25:06 2007 +++ llvm/test/CodeGen/PowerPC/2007-01-04-ArgExtension.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=ppc32 | grep extsb && +; RUN: llvm-as < %s | llc -march=ppc32 | grep extsb ; RUN: llvm-as < %s | llc -march=ppc32 | grep extsh define i32 @p1(i8 %c, i16 %s) { Index: llvm/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll diff -u llvm/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll:1.2 llvm/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll:1.3 --- llvm/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll:1.2 Tue Jan 30 00:32:25 2007 +++ llvm/test/CodeGen/PowerPC/2007-01-29-lbrx-asm.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=ppc32 && +; RUN: llvm-as < %s | llc -march=ppc32 ; RUN: llvm-as < %s | llc -march=ppc64 define i16 @test(i8* %d1, i16* %d2) { Index: llvm/test/CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll diff -u llvm/test/CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll:1.2 llvm/test/CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll:1.3 --- llvm/test/CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll:1.2 Tue Mar 27 21:38:26 2007 +++ llvm/test/CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=ppc32 && +; RUN: llvm-as < %s | llc -march=ppc32 ; RUN: llvm-as < %s | llc -march=ppc64 ; Test two things: 1) that a frameidx can be rewritten in an inline asm Index: llvm/test/CodeGen/PowerPC/addc.ll diff -u llvm/test/CodeGen/PowerPC/addc.ll:1.3 llvm/test/CodeGen/PowerPC/addc.ll:1.4 --- llvm/test/CodeGen/PowerPC/addc.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/addc.ll Mon Apr 16 12:36:06 2007 @@ -1,9 +1,10 @@ ; All of these should be codegen'd without loading immediates -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep addc | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep adde | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep addze | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep addme | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep addic | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f +; RUN: grep addc %t | wc -l | grep 1 +; RUN: grep adde %t | wc -l | grep 1 +; RUN: grep addze %t | wc -l | grep 1 +; RUN: grep addme %t | wc -l | grep 1 +; RUN: grep addic %t | wc -l | grep 2 implementation ; Functions: Index: llvm/test/CodeGen/PowerPC/addi-reassoc.ll diff -u llvm/test/CodeGen/PowerPC/addi-reassoc.ll:1.2 llvm/test/CodeGen/PowerPC/addi-reassoc.ll:1.3 --- llvm/test/CodeGen/PowerPC/addi-reassoc.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/addi-reassoc.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep addi %struct.X = type { [5 x sbyte] } Index: llvm/test/CodeGen/PowerPC/align.ll diff -u llvm/test/CodeGen/PowerPC/align.ll:1.2 llvm/test/CodeGen/PowerPC/align.ll:1.3 --- llvm/test/CodeGen/PowerPC/align.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/align.ll Mon Apr 16 12:36:06 2007 @@ -1,6 +1,9 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep "align.4" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep "align.2" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep "align.3" | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \ +; RUN: grep align.4 | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \ +; RUN: grep align.2 | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \ +; RUN: grep align.3 | wc -l | grep 1 %A = global <4 x uint> < uint 10, uint 20, uint 30, uint 40 > Index: llvm/test/CodeGen/PowerPC/and-branch.ll diff -u llvm/test/CodeGen/PowerPC/and-branch.ll:1.2 llvm/test/CodeGen/PowerPC/and-branch.ll:1.3 --- llvm/test/CodeGen/PowerPC/and-branch.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/and-branch.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep mfcr void %foo(int %X, int %Y, int %Z) { Index: llvm/test/CodeGen/PowerPC/and-elim.ll diff -u llvm/test/CodeGen/PowerPC/and-elim.ll:1.7 llvm/test/CodeGen/PowerPC/and-elim.ll:1.8 --- llvm/test/CodeGen/PowerPC/and-elim.ll:1.7 Thu Feb 1 20:16:22 2007 +++ llvm/test/CodeGen/PowerPC/and-elim.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-as < %s | llc -march=ppc32 && ; RUN: llvm-as < %s | llc -march=ppc32 | not grep rlwin define void @test(i8* %P) { Index: llvm/test/CodeGen/PowerPC/and_add.ll diff -u llvm/test/CodeGen/PowerPC/and_add.ll:1.2 llvm/test/CodeGen/PowerPC/and_add.ll:1.3 --- llvm/test/CodeGen/PowerPC/and_add.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/and_add.ll Mon Apr 16 12:36:06 2007 @@ -1,6 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep slwi && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep addi && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep rlwinm +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f +; RUN: grep slwi %t +; RUN: not grep addi %t +; RUN: not grep rlwinm %t int %test(int %A) { %B = mul int %A, 8 ;; shift Index: llvm/test/CodeGen/PowerPC/and_sext.ll diff -u llvm/test/CodeGen/PowerPC/and_sext.ll:1.8 llvm/test/CodeGen/PowerPC/and_sext.ll:1.9 --- llvm/test/CodeGen/PowerPC/and_sext.ll:1.8 Thu Feb 1 20:16:22 2007 +++ llvm/test/CodeGen/PowerPC/and_sext.ll Mon Apr 16 12:36:06 2007 @@ -1,6 +1,5 @@ ; These tests should not contain a sign extend. -; RUN: llvm-as < %s | llc -march=ppc32 && -; RUN: llvm-as < %s | llc -march=ppc32 | not grep extsh && +; RUN: llvm-as < %s | llc -march=ppc32 | not grep extsh ; RUN: llvm-as < %s | llc -march=ppc32 | not grep extsb define i32 @test1(i32 %mode.0.i.0) { Index: llvm/test/CodeGen/PowerPC/buildvec_canonicalize.ll diff -u llvm/test/CodeGen/PowerPC/buildvec_canonicalize.ll:1.3 llvm/test/CodeGen/PowerPC/buildvec_canonicalize.ll:1.4 --- llvm/test/CodeGen/PowerPC/buildvec_canonicalize.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/buildvec_canonicalize.ll Mon Apr 16 12:36:06 2007 @@ -1,8 +1,12 @@ ; There should be exactly one vxor here. -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 --enable-unsafe-fp-math | grep vxor | wc -l | grep 1 && +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: llc -march=ppc32 -mcpu=g5 --enable-unsafe-fp-math | \ +; RUN: grep vxor | wc -l | grep 1 ; There should be exactly one vsplti here. -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 --enable-unsafe-fp-math | grep vsplti | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: llc -march=ppc32 -mcpu=g5 --enable-unsafe-fp-math | \ +; RUN: grep vsplti | wc -l | grep 1 void %VXOR(<4 x float>* %P1, <4 x int>* %P2, <4 x float>* %P3) { Index: llvm/test/CodeGen/PowerPC/cmp-cmp.ll diff -u llvm/test/CodeGen/PowerPC/cmp-cmp.ll:1.2 llvm/test/CodeGen/PowerPC/cmp-cmp.ll:1.3 --- llvm/test/CodeGen/PowerPC/cmp-cmp.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/cmp-cmp.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep mfcr void %test(long %X) { Index: llvm/test/CodeGen/PowerPC/div-2.ll diff -u llvm/test/CodeGen/PowerPC/div-2.ll:1.5 llvm/test/CodeGen/PowerPC/div-2.ll:1.6 --- llvm/test/CodeGen/PowerPC/div-2.ll:1.5 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/div-2.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep srawi && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep srawi ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep blr int %test1(int %X) { Index: llvm/test/CodeGen/PowerPC/eqv-andc-orc-nor.ll diff -u llvm/test/CodeGen/PowerPC/eqv-andc-orc-nor.ll:1.5 llvm/test/CodeGen/PowerPC/eqv-andc-orc-nor.ll:1.6 --- llvm/test/CodeGen/PowerPC/eqv-andc-orc-nor.ll:1.5 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/eqv-andc-orc-nor.ll Mon Apr 16 12:36:06 2007 @@ -1,8 +1,13 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep eqv | wc -l | grep 3 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep andc | wc -l | grep 3 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep orc | wc -l | grep 2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep nor | wc -l | grep 3 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep nand | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \ +; RUN: grep eqv | wc -l | grep 3 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | \ +; RUN: grep andc | wc -l | grep 3 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \ +; RUN: grep orc | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | \ +; RUN: grep nor | wc -l | grep 3 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \ +; RUN: grep nand | wc -l | grep 1 int %EQV1(int %X, int %Y) { %A = xor int %X, %Y Index: llvm/test/CodeGen/PowerPC/fold-li.ll diff -u llvm/test/CodeGen/PowerPC/fold-li.ll:1.2 llvm/test/CodeGen/PowerPC/fold-li.ll:1.3 --- llvm/test/CodeGen/PowerPC/fold-li.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/fold-li.ll Mon Apr 16 12:36:06 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep -v align | not grep li +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \ +; RUN: grep -v align | not grep li ;; Test that immediates are folded into these instructions correctly. Index: llvm/test/CodeGen/PowerPC/fp-int-fp.ll diff -u llvm/test/CodeGen/PowerPC/fp-int-fp.ll:1.2 llvm/test/CodeGen/PowerPC/fp-int-fp.ll:1.3 --- llvm/test/CodeGen/PowerPC/fp-int-fp.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/fp-int-fp.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep r1 double %test1(double %X) { Index: llvm/test/CodeGen/PowerPC/fpcopy.ll diff -u llvm/test/CodeGen/PowerPC/fpcopy.ll:1.2 llvm/test/CodeGen/PowerPC/fpcopy.ll:1.3 --- llvm/test/CodeGen/PowerPC/fpcopy.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/fpcopy.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep fmr double %test(float %F) { Index: llvm/test/CodeGen/PowerPC/inlineasm-copy.ll diff -u llvm/test/CodeGen/PowerPC/inlineasm-copy.ll:1.2 llvm/test/CodeGen/PowerPC/inlineasm-copy.ll:1.3 --- llvm/test/CodeGen/PowerPC/inlineasm-copy.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/inlineasm-copy.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep mr int %test(int %Y, int %X) { Index: llvm/test/CodeGen/PowerPC/inverted-bool-compares.ll diff -u llvm/test/CodeGen/PowerPC/inverted-bool-compares.ll:1.2 llvm/test/CodeGen/PowerPC/inverted-bool-compares.ll:1.3 --- llvm/test/CodeGen/PowerPC/inverted-bool-compares.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/inverted-bool-compares.ll Mon Apr 16 12:36:06 2007 @@ -1,5 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep xori && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep xori int %test(bool %B, int* %P) { br bool %B, label %T, label %F Index: llvm/test/CodeGen/PowerPC/load-constant-addr.ll diff -u llvm/test/CodeGen/PowerPC/load-constant-addr.ll:1.2 llvm/test/CodeGen/PowerPC/load-constant-addr.ll:1.3 --- llvm/test/CodeGen/PowerPC/load-constant-addr.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/load-constant-addr.ll Mon Apr 16 12:36:06 2007 @@ -1,5 +1,5 @@ ; Should fold the ori into the lfs. -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep lfs && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep lfs ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep ori float %test() { Index: llvm/test/CodeGen/PowerPC/mem_update.ll diff -u llvm/test/CodeGen/PowerPC/mem_update.ll:1.5 llvm/test/CodeGen/PowerPC/mem_update.ll:1.6 --- llvm/test/CodeGen/PowerPC/mem_update.ll:1.5 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/mem_update.ll Mon Apr 16 12:36:06 2007 @@ -1,7 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -enable-ppc-preinc && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -enable-ppc-preinc | not grep addi && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 -enable-ppc-preinc && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 -enable-ppc-preinc | not grep addi +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -enable-ppc-preinc | \ +; RUN: not grep addi +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 -enable-ppc-preinc | \ +; RUN: not grep addi %Glob = global ulong 4 int *%test0(int *%X, int *%dest) { Index: llvm/test/CodeGen/PowerPC/mul-neg-power-2.ll diff -u llvm/test/CodeGen/PowerPC/mul-neg-power-2.ll:1.2 llvm/test/CodeGen/PowerPC/mul-neg-power-2.ll:1.3 --- llvm/test/CodeGen/PowerPC/mul-neg-power-2.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/mul-neg-power-2.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep mul int %test1(int %a) { Index: llvm/test/CodeGen/PowerPC/mulhs.ll diff -u llvm/test/CodeGen/PowerPC/mulhs.ll:1.3 llvm/test/CodeGen/PowerPC/mulhs.ll:1.4 --- llvm/test/CodeGen/PowerPC/mulhs.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/mulhs.ll Mon Apr 16 12:36:06 2007 @@ -1,8 +1,9 @@ ; All of these ands and shifts should be folded into rlwimi's -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep mulhwu && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep srawi && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep add && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep mulhw | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f +; RUN: not grep mulhwu %t +; RUN: not grep srawi %t +; RUN: not grep add %t +; RUN: grep mulhw %t | wc -l | grep 1 implementation ; Functions: Index: llvm/test/CodeGen/PowerPC/or-addressing-mode.ll diff -u llvm/test/CodeGen/PowerPC/or-addressing-mode.ll:1.2 llvm/test/CodeGen/PowerPC/or-addressing-mode.ll:1.3 --- llvm/test/CodeGen/PowerPC/or-addressing-mode.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/or-addressing-mode.ll Mon Apr 16 12:36:06 2007 @@ -1,5 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc && -; RUN: llvm-upgrade < %s | llvm-as | llc | not grep ori && +; RUN: llvm-upgrade < %s | llvm-as | llc | not grep ori ; RUN: llvm-upgrade < %s | llvm-as | llc | not grep rlwimi int %test1(sbyte* %P) { ;; or -> lwzx Index: llvm/test/CodeGen/PowerPC/reg-coalesce-simple.ll diff -u llvm/test/CodeGen/PowerPC/reg-coalesce-simple.ll:1.2 llvm/test/CodeGen/PowerPC/reg-coalesce-simple.ll:1.3 --- llvm/test/CodeGen/PowerPC/reg-coalesce-simple.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/reg-coalesce-simple.ll Mon Apr 16 12:36:06 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep or %struct.foo = type { int, int, [0 x ubyte] } Index: llvm/test/CodeGen/PowerPC/rlwimi.ll diff -u llvm/test/CodeGen/PowerPC/rlwimi.ll:1.5 llvm/test/CodeGen/PowerPC/rlwimi.ll:1.6 --- llvm/test/CodeGen/PowerPC/rlwimi.ll:1.5 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/rlwimi.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,5 @@ ; All of these ands and shifts should be folded into rlwimi's -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep and && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep and ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep rlwimi | wc -l | grep 8 implementation ; Functions: Index: llvm/test/CodeGen/PowerPC/rlwimi2.ll diff -u llvm/test/CodeGen/PowerPC/rlwimi2.ll:1.3 llvm/test/CodeGen/PowerPC/rlwimi2.ll:1.4 --- llvm/test/CodeGen/PowerPC/rlwimi2.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/rlwimi2.ll Mon Apr 16 12:36:07 2007 @@ -1,7 +1,8 @@ ; All of these ands and shifts should be folded into rlwimi's -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep rlwimi | wc -l | grep 3 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep srwi | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep slwi +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f +; RUN: grep rlwimi %t | wc -l | grep 3 +; RUN: grep srwi %t | wc -l | grep 1 +; RUN: not grep slwi %t implementation ; Functions: Index: llvm/test/CodeGen/PowerPC/rlwinm.ll diff -u llvm/test/CodeGen/PowerPC/rlwinm.ll:1.5 llvm/test/CodeGen/PowerPC/rlwinm.ll:1.6 --- llvm/test/CodeGen/PowerPC/rlwinm.ll:1.5 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/rlwinm.ll Mon Apr 16 12:36:07 2007 @@ -1,9 +1,10 @@ ; All of these ands and shifts should be folded into rlwimi's -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep and && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep srawi && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep srwi && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep slwi && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep rlwinm | wc -l | grep 8 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f +; RUN: not grep and %t +; RUN: not grep srawi %t +; RUN: not grep srwi %t +; RUN: not grep slwi %t +; RUN: grep rlwinm %t | wc -l | grep 8 implementation ; Functions: Index: llvm/test/CodeGen/PowerPC/rlwinm2.ll diff -u llvm/test/CodeGen/PowerPC/rlwinm2.ll:1.3 llvm/test/CodeGen/PowerPC/rlwinm2.ll:1.4 --- llvm/test/CodeGen/PowerPC/rlwinm2.ll:1.3 Thu Feb 1 20:16:22 2007 +++ llvm/test/CodeGen/PowerPC/rlwinm2.ll Mon Apr 16 12:36:07 2007 @@ -1,10 +1,11 @@ ; All of these ands and shifts should be folded into rlw[i]nm instructions -; RUN: llvm-as < %s | llc -march=ppc32 | not grep and && -; RUN: llvm-as < %s | llc -march=ppc32 | not grep srawi && -; RUN: llvm-as < %s | llc -march=ppc32 | not grep srwi && -; RUN: llvm-as < %s | llc -march=ppc32 | not grep slwi && -; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f +; RUN: not grep and %t +; RUN: not grep srawi %t +; RUN: not grep srwi %t +; RUN: not grep slwi %t +; RUN: grep rlwnm %t | wc -l | grep 1 +; RUN: grep rlwinm %t | wc -l | grep 1 define i32 @test1(i32 %X, i32 %Y) { entry: Index: llvm/test/CodeGen/PowerPC/rotl-2.ll diff -u llvm/test/CodeGen/PowerPC/rotl-2.ll:1.1 llvm/test/CodeGen/PowerPC/rotl-2.ll:1.2 --- llvm/test/CodeGen/PowerPC/rotl-2.ll:1.1 Mon Apr 2 17:08:54 2007 +++ llvm/test/CodeGen/PowerPC/rotl-2.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | wc -l | grep 4 && -; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | wc -l | grep 2 && +; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | wc -l | grep 4 +; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | wc -l | grep 2 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep or define i32 @rotl32(i32 %A, i8 %Amt) { Index: llvm/test/CodeGen/PowerPC/rotl.ll diff -u llvm/test/CodeGen/PowerPC/rotl.ll:1.6 llvm/test/CodeGen/PowerPC/rotl.ll:1.7 --- llvm/test/CodeGen/PowerPC/rotl.ll:1.6 Thu Feb 1 20:16:22 2007 +++ llvm/test/CodeGen/PowerPC/rotl.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,4 @@ -; RUN: llvm-as < %s | llc -march=ppc32 | not grep or && -; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | wc -l | grep 2 && +; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | wc -l | grep 2 ; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | wc -l | grep 2 define i32 @rotlw(i32 %x, i32 %sh) { Index: llvm/test/CodeGen/PowerPC/stfiwx.ll diff -u llvm/test/CodeGen/PowerPC/stfiwx.ll:1.3 llvm/test/CodeGen/PowerPC/stfiwx.ll:1.4 --- llvm/test/CodeGen/PowerPC/stfiwx.ll:1.3 Wed Dec 20 18:01:42 2006 +++ llvm/test/CodeGen/PowerPC/stfiwx.ll Mon Apr 16 12:36:07 2007 @@ -1,7 +1,12 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=stfiwx | grep stfiwx && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=stfiwx | not grep r1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-stfiwx | not grep stfiwx && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-stfiwx | grep r1 +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=stfiwx -o %t1 -f +; RUN: grep stfiwx %t1 +; RUN: not grep r1 %t1 +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-stfiwx \ +; RUN: -o %t2 -f +; RUN: not grep stfiwx %t2 +; RUN: grep r1 %t2 void %test(float %a, int* %b) { %tmp.2 = cast float %a to int Index: llvm/test/CodeGen/PowerPC/store-load-fwd.ll diff -u llvm/test/CodeGen/PowerPC/store-load-fwd.ll:1.2 llvm/test/CodeGen/PowerPC/store-load-fwd.ll:1.3 --- llvm/test/CodeGen/PowerPC/store-load-fwd.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/store-load-fwd.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep lwz int %test(int* %P) { store int 1, int* %P Index: llvm/test/CodeGen/PowerPC/subc.ll diff -u llvm/test/CodeGen/PowerPC/subc.ll:1.3 llvm/test/CodeGen/PowerPC/subc.ll:1.4 --- llvm/test/CodeGen/PowerPC/subc.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/subc.ll Mon Apr 16 12:36:07 2007 @@ -1,9 +1,10 @@ ; All of these should be codegen'd without loading immediates -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep subfc | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep subfe | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep subfze | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep subfme | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep subfic | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f +; RUN: grep subfc %t | wc -l | grep 1 +; RUN: grep subfe %t | wc -l | grep 1 +; RUN: grep subfze %t | wc -l | grep 1 +; RUN: grep subfme %t | wc -l | grep 1 +; RUN: grep subfic %t | wc -l | grep 2 implementation ; Functions: long %sub_ll(long %a, long %b) { Index: llvm/test/CodeGen/PowerPC/unsafe-math.ll diff -u llvm/test/CodeGen/PowerPC/unsafe-math.ll:1.2 llvm/test/CodeGen/PowerPC/unsafe-math.ll:1.3 --- llvm/test/CodeGen/PowerPC/unsafe-math.ll:1.2 Fri Jan 26 02:25:06 2007 +++ llvm/test/CodeGen/PowerPC/unsafe-math.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,6 @@ -; RUN: llvm-as < %s | llc -march=ppc32 | grep fmul | wc -l | grep 2 && -; RUN: llvm-as < %s | llc -march=ppc32 -enable-unsafe-fp-math | grep fmul | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=ppc32 | grep fmul | wc -l | grep 2 +; RUN: llvm-as < %s | llc -march=ppc32 -enable-unsafe-fp-math | \ +; RUN: grep fmul | wc -l | grep 1 define double @foo(double %X) { %tmp1 = mul double %X, 1.23 Index: llvm/test/CodeGen/PowerPC/vec_br_cmp.ll diff -u llvm/test/CodeGen/PowerPC/vec_br_cmp.ll:1.2 llvm/test/CodeGen/PowerPC/vec_br_cmp.ll:1.3 --- llvm/test/CodeGen/PowerPC/vec_br_cmp.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/vec_br_cmp.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vcmpeqfp. && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep mfcr +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 -o %t -f +; RUN: grep vcmpeqfp. %t +; RUN: not grep mfcr %t ; A predicate compare used immediately by a branch should not generate an mfcr. Index: llvm/test/CodeGen/PowerPC/vec_constants.ll diff -u llvm/test/CodeGen/PowerPC/vec_constants.ll:1.6 llvm/test/CodeGen/PowerPC/vec_constants.ll:1.7 --- llvm/test/CodeGen/PowerPC/vec_constants.ll:1.6 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/vec_constants.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep CPI Index: llvm/test/CodeGen/PowerPC/vec_mul.ll diff -u llvm/test/CodeGen/PowerPC/vec_mul.ll:1.3 llvm/test/CodeGen/PowerPC/vec_mul.ll:1.4 --- llvm/test/CodeGen/PowerPC/vec_mul.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/vec_mul.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep mullw && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep mullw ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vmsumuhm <4 x int> %test_v4i32(<4 x int>* %X, <4 x int>* %Y) { Index: llvm/test/CodeGen/PowerPC/vec_perf_shuffle.ll diff -u llvm/test/CodeGen/PowerPC/vec_perf_shuffle.ll:1.2 llvm/test/CodeGen/PowerPC/vec_perf_shuffle.ll:1.3 --- llvm/test/CodeGen/PowerPC/vec_perf_shuffle.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/vec_perf_shuffle.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep vperm <4 x float> %test_uu72(<4 x float> *%P1, <4 x float> *%P2) { Index: llvm/test/CodeGen/PowerPC/vec_shuffle.ll diff -u llvm/test/CodeGen/PowerPC/vec_shuffle.ll:1.8 llvm/test/CodeGen/PowerPC/vec_shuffle.ll:1.9 --- llvm/test/CodeGen/PowerPC/vec_shuffle.ll:1.8 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/vec_shuffle.ll Mon Apr 16 12:36:07 2007 @@ -1,9 +1,11 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llc -march=ppc32 -mcpu=g5 | not grep vperm && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vsldoi | wc -l | grep 2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vmrgh | wc -l | grep 7 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vmrgl | wc -l | grep 6 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vpkuhum | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vpkuwum | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | \ +; RUN: llc -march=ppc32 -mcpu=g5 | not grep vperm +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 > %t +; RUN: grep vsldoi %t | wc -l | grep 2 +; RUN: grep vmrgh %t | wc -l | grep 7 +; RUN: grep vmrgl %t | wc -l | grep 6 +; RUN: grep vpkuhum %t | wc -l | grep 1 +; RUN: grep vpkuwum %t | wc -l | grep 1 void %VSLDOI_xy(<8 x short>* %A, <8 x short>* %B) { entry: Index: llvm/test/CodeGen/PowerPC/vec_spat.ll diff -u llvm/test/CodeGen/PowerPC/vec_spat.ll:1.6 llvm/test/CodeGen/PowerPC/vec_spat.ll:1.7 --- llvm/test/CodeGen/PowerPC/vec_spat.ll:1.6 Sun Dec 31 00:01:59 2006 +++ llvm/test/CodeGen/PowerPC/vec_spat.ll Mon Apr 16 12:36:07 2007 @@ -1,8 +1,10 @@ ; Test that vectors are scalarized/lowered correctly. -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vspltw | wc -l | grep 2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g3 | grep stfs | wc -l | grep 4 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vsplti | wc -l | grep 3 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vsplth | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g3 | \ +; RUN: grep stfs | wc -l | grep 4 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 -o %t -f +; RUN: grep vspltw %t | wc -l | grep 2 +; RUN: grep vsplti %t | wc -l | grep 3 +; RUN: grep vsplth %t | wc -l | grep 1 %f4 = type <4 x float> %i4 = type <4 x int> Index: llvm/test/CodeGen/PowerPC/vec_vrsave.ll diff -u llvm/test/CodeGen/PowerPC/vec_vrsave.ll:1.3 llvm/test/CodeGen/PowerPC/vec_vrsave.ll:1.4 --- llvm/test/CodeGen/PowerPC/vec_vrsave.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/PowerPC/vec_vrsave.ll Mon Apr 16 12:36:07 2007 @@ -1,6 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vrlw && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep spr && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep vrsave +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 -o %t -f +; RUN: grep vrlw %t +; RUN: not grep spr %t +; RUN: not grep vrsave %t <4 x int> %test_rol() { ret <4 x int> < int -11534337, int -11534337, int -11534337, int -11534337 > From reid at x10sys.com Mon Apr 16 12:38:17 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:38:17 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll bitcast.ll bswap.ll cmp-test.ll compare-add.ll compare_folding.llx fp-stack-ret.ll long-setcc.ll mul-shift-reassoc.ll packed_struct.ll rdtsc.ll scalar_sse_minmax.ll select.ll store-fp-constant.ll test-hidden.ll test-pic-1.ll test-pic-2.ll test-pic-3.ll test-pic-4.ll test-pic-5.ll test-pic-6.ll test-pic-cpool.ll test-pic-jtbl.ll vec_clear.ll vec_extract.ll vec_ins_extract.ll vec_insert.ll vec_set-2.ll vec_set-3.ll vec_set-5.ll vec_set-6.ll vec_shuffle-2.ll vec_shuffle-3.ll vec_shuffle-4.ll vec_shuffle-5.ll vec_shuffle-6.ll vec_shuffle-7.ll vec_shuffle-8.ll vec_shuffle-9.ll vec_shuffle.ll vec_splat.ll vec_ss_load_fold.ll x86-64-mem.ll Message-ID: <200704161738.l3GHcHDP010621@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: 2006-10-19-SwitchUnnecessaryBranching.ll updated: 1.5 -> 1.6 bitcast.ll updated: 1.2 -> 1.3 bswap.ll updated: 1.5 -> 1.6 cmp-test.ll updated: 1.2 -> 1.3 compare-add.ll updated: 1.2 -> 1.3 compare_folding.llx updated: 1.5 -> 1.6 fp-stack-ret.ll updated: 1.4 -> 1.5 long-setcc.ll updated: 1.2 -> 1.3 mul-shift-reassoc.ll updated: 1.3 -> 1.4 packed_struct.ll updated: 1.4 -> 1.5 rdtsc.ll updated: 1.5 -> 1.6 scalar_sse_minmax.ll updated: 1.3 -> 1.4 select.ll updated: 1.6 -> 1.7 store-fp-constant.ll updated: 1.3 -> 1.4 test-hidden.ll updated: 1.4 -> 1.5 test-pic-1.ll updated: 1.3 -> 1.4 test-pic-2.ll updated: 1.2 -> 1.3 test-pic-3.ll updated: 1.2 -> 1.3 test-pic-4.ll updated: 1.3 -> 1.4 test-pic-5.ll updated: 1.2 -> 1.3 test-pic-6.ll updated: 1.2 -> 1.3 test-pic-cpool.ll updated: 1.3 -> 1.4 test-pic-jtbl.ll updated: 1.2 -> 1.3 vec_clear.ll updated: 1.3 -> 1.4 vec_extract.ll updated: 1.5 -> 1.6 vec_ins_extract.ll updated: 1.4 -> 1.5 vec_insert.ll updated: 1.3 -> 1.4 vec_set-2.ll updated: 1.3 -> 1.4 vec_set-3.ll updated: 1.4 -> 1.5 vec_set-5.ll updated: 1.2 -> 1.3 vec_set-6.ll updated: 1.2 -> 1.3 vec_shuffle-2.ll updated: 1.4 -> 1.5 vec_shuffle-3.ll updated: 1.3 -> 1.4 vec_shuffle-4.ll updated: 1.5 -> 1.6 vec_shuffle-5.ll updated: 1.3 -> 1.4 vec_shuffle-6.ll updated: 1.5 -> 1.6 vec_shuffle-7.ll updated: 1.2 -> 1.3 vec_shuffle-8.ll updated: 1.2 -> 1.3 vec_shuffle-9.ll updated: 1.2 -> 1.3 vec_shuffle.ll updated: 1.9 -> 1.10 vec_splat.ll updated: 1.7 -> 1.8 vec_ss_load_fold.ll updated: 1.3 -> 1.4 x86-64-mem.ll updated: 1.3 -> 1.4 --- Log message: For PR1319: http://llvm.org/PR1319 : Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. --- Diffs of the changes: (+128 -112) 2006-10-19-SwitchUnnecessaryBranching.ll | 3 ++- bitcast.ll | 3 +-- bswap.ll | 3 ++- cmp-test.ll | 3 +-- compare-add.ll | 1 - compare_folding.llx | 6 ++++-- fp-stack-ret.ll | 2 +- long-setcc.ll | 5 ++--- mul-shift-reassoc.ll | 2 +- packed_struct.ll | 10 +++++----- rdtsc.ll | 2 +- scalar_sse_minmax.ll | 6 ++++-- select.ll | 2 +- store-fp-constant.ll | 2 +- test-hidden.ll | 7 ++++--- test-pic-1.ll | 2 +- test-pic-2.ll | 9 +++++---- test-pic-3.ll | 9 +++++---- test-pic-4.ll | 4 ++-- test-pic-5.ll | 9 +++++---- test-pic-6.ll | 9 +++++---- test-pic-cpool.ll | 11 ++++++----- test-pic-jtbl.ll | 13 +++++++------ vec_clear.ll | 1 - vec_extract.ll | 9 +++++---- vec_ins_extract.ll | 2 -- vec_insert.ll | 5 +++-- vec_set-2.ll | 2 +- vec_set-3.ll | 7 +++---- vec_set-5.ll | 7 ++++--- vec_set-6.ll | 5 +++-- vec_shuffle-2.ll | 7 ++++--- vec_shuffle-3.ll | 5 +++-- vec_shuffle-4.ll | 6 +++--- vec_shuffle-5.ll | 5 +++-- vec_shuffle-6.ll | 8 ++++---- vec_shuffle-7.ll | 6 +++--- vec_shuffle-8.ll | 4 ++-- vec_shuffle-9.ll | 6 +++--- vec_shuffle.ll | 7 ++++--- vec_splat.ll | 2 +- vec_ss_load_fold.ll | 5 +++-- x86-64-mem.ll | 18 ++++++++++-------- 43 files changed, 128 insertions(+), 112 deletions(-) Index: llvm/test/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll diff -u llvm/test/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll:1.5 llvm/test/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll:1.6 --- llvm/test/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll:1.5 Fri Feb 16 18:44:34 2007 +++ llvm/test/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | %prcontext je 1 | grep "BB1_1:" +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | %prcontext je 1 | \ +; RUN: grep BB1_1: %str = internal constant [14 x sbyte] c"Hello world!\0A\00" ; <[14 x sbyte]*> [#uses=1] %str = internal constant [13 x sbyte] c"Blah world!\0A\00" ; <[13 x sbyte]*> [#uses=1] Index: llvm/test/CodeGen/X86/bitcast.ll diff -u llvm/test/CodeGen/X86/bitcast.ll:1.2 llvm/test/CodeGen/X86/bitcast.ll:1.3 --- llvm/test/CodeGen/X86/bitcast.ll:1.2 Fri Dec 29 14:01:32 2006 +++ llvm/test/CodeGen/X86/bitcast.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86-64 ; PR1033 Index: llvm/test/CodeGen/X86/bswap.ll diff -u llvm/test/CodeGen/X86/bswap.ll:1.5 llvm/test/CodeGen/X86/bswap.ll:1.6 --- llvm/test/CodeGen/X86/bswap.ll:1.5 Sun Apr 1 20:09:19 2007 +++ llvm/test/CodeGen/X86/bswap.ll Mon Apr 16 12:36:07 2007 @@ -1,6 +1,7 @@ ; bswap should be constant folded when it is passed a constant argument -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep bswapl | wc -l | grep 3 && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \ +; RUN: grep bswapl | wc -l | grep 3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep rolw | wc -l | grep 1 declare ushort %llvm.bswap.i16(ushort) Index: llvm/test/CodeGen/X86/cmp-test.ll diff -u llvm/test/CodeGen/X86/cmp-test.ll:1.2 llvm/test/CodeGen/X86/cmp-test.ll:1.3 --- llvm/test/CodeGen/X86/cmp-test.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/cmp-test.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep cmp | wc -l | grep 1 && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep cmp | wc -l | grep 1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep test | wc -l | grep 1 int %f1(int %X, int* %y) { Index: llvm/test/CodeGen/X86/compare-add.ll diff -u llvm/test/CodeGen/X86/compare-add.ll:1.2 llvm/test/CodeGen/X86/compare-add.ll:1.3 --- llvm/test/CodeGen/X86/compare-add.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/compare-add.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep add bool %X(int %X) { %Y = add int %X, 14 Index: llvm/test/CodeGen/X86/compare_folding.llx diff -u llvm/test/CodeGen/X86/compare_folding.llx:1.5 llvm/test/CodeGen/X86/compare_folding.llx:1.6 --- llvm/test/CodeGen/X86/compare_folding.llx:1.5 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/compare_folding.llx Mon Apr 16 12:36:07 2007 @@ -1,5 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah | grep movsd | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah | grep ucomisd +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah | \ +; RUN: grep movsd | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah | \ +; RUN: grep ucomisd declare bool %llvm.isunordered.f64(double,double) bool %test1(double %X, double %Y) { ;; Returns isunordered(X,Y) Index: llvm/test/CodeGen/X86/fp-stack-ret.ll diff -u llvm/test/CodeGen/X86/fp-stack-ret.ll:1.4 llvm/test/CodeGen/X86/fp-stack-ret.ll:1.5 --- llvm/test/CodeGen/X86/fp-stack-ret.ll:1.4 Mon Apr 16 09:17:04 2007 +++ llvm/test/CodeGen/X86/fp-stack-ret.ll Mon Apr 16 12:36:07 2007 @@ -1,7 +1,7 @@ ; RUN: llvm-as < %s | \ ; RUN: llc -mtriple=i686-apple-darwin8 -mcpu=yonah -march=x86 > %t ; RUN: grep fldl %t | wc -l | grep 1 -; RUN: not grep xmm %t && +; RUN: not grep xmm %t ; RUN: grep {sub.*esp} %t | wc -l | grep 1 ; These testcases shouldn't require loading into an XMM register then storing Index: llvm/test/CodeGen/X86/long-setcc.ll diff -u llvm/test/CodeGen/X86/long-setcc.ll:1.2 llvm/test/CodeGen/X86/long-setcc.ll:1.3 --- llvm/test/CodeGen/X86/long-setcc.ll:1.2 Wed Apr 11 11:10:48 2007 +++ llvm/test/CodeGen/X86/long-setcc.ll Mon Apr 16 12:36:07 2007 @@ -1,6 +1,5 @@ -; RUN: llvm-as < %s | llc -march=x86 && -; RUN: llvm-as < %s | llc -march=x86 | grep cmp | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=x86 | grep shr | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=x86 | grep cmp | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=x86 | grep shr | wc -l | grep 1 ; RUN: llvm-as < %s | llc -march=x86 | grep xor | wc -l | grep 1 define i1 @t1(i64 %x) { Index: llvm/test/CodeGen/X86/mul-shift-reassoc.ll diff -u llvm/test/CodeGen/X86/mul-shift-reassoc.ll:1.3 llvm/test/CodeGen/X86/mul-shift-reassoc.ll:1.4 --- llvm/test/CodeGen/X86/mul-shift-reassoc.ll:1.3 Wed Mar 28 13:03:14 2007 +++ llvm/test/CodeGen/X86/mul-shift-reassoc.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep lea && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep lea ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep add int %test(int %X, int %Y) { Index: llvm/test/CodeGen/X86/packed_struct.ll diff -u llvm/test/CodeGen/X86/packed_struct.ll:1.4 llvm/test/CodeGen/X86/packed_struct.ll:1.5 --- llvm/test/CodeGen/X86/packed_struct.ll:1.4 Fri Jan 5 12:35:20 2007 +++ llvm/test/CodeGen/X86/packed_struct.ll Mon Apr 16 12:36:07 2007 @@ -1,8 +1,8 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "foos+5" && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "foos+1" && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "foos+9" && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "bara+19" && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "bara+4" +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep foos+5 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep foos+1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep foos+9 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep bara+19 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep bara+4 ; make sure we compute the correct offset for a packed structure Index: llvm/test/CodeGen/X86/rdtsc.ll diff -u llvm/test/CodeGen/X86/rdtsc.ll:1.5 llvm/test/CodeGen/X86/rdtsc.ll:1.6 --- llvm/test/CodeGen/X86/rdtsc.ll:1.5 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/rdtsc.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep rdtsc && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep rdtsc ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86-64 | grep rdtsc declare ulong %llvm.readcyclecounter() Index: llvm/test/CodeGen/X86/scalar_sse_minmax.ll diff -u llvm/test/CodeGen/X86/scalar_sse_minmax.ll:1.3 llvm/test/CodeGen/X86/scalar_sse_minmax.ll:1.4 --- llvm/test/CodeGen/X86/scalar_sse_minmax.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/scalar_sse_minmax.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse1,+sse2 | grep mins | wc -l | grep 3 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse1,+sse2 | grep maxs | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse1,+sse2 | \ +; RUN: grep mins | wc -l | grep 3 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse1,+sse2 | \ +; RUN: grep maxs | wc -l | grep 2 declare bool %llvm.isunordered.f64( double %x, double %y ) declare bool %llvm.isunordered.f32( float %x, float %y ) Index: llvm/test/CodeGen/X86/select.ll diff -u llvm/test/CodeGen/X86/select.ll:1.6 llvm/test/CodeGen/X86/select.ll:1.7 --- llvm/test/CodeGen/X86/select.ll:1.6 Tue Jan 30 10:16:01 2007 +++ llvm/test/CodeGen/X86/select.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=pentium bool %boolSel(bool %A, bool %B, bool %C) { Index: llvm/test/CodeGen/X86/store-fp-constant.ll diff -u llvm/test/CodeGen/X86/store-fp-constant.ll:1.3 llvm/test/CodeGen/X86/store-fp-constant.ll:1.4 --- llvm/test/CodeGen/X86/store-fp-constant.ll:1.3 Mon Dec 11 21:59:46 2006 +++ llvm/test/CodeGen/X86/store-fp-constant.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep rodata && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep rodata ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep literal ; ; Check that no FP constants in this testcase ends up in the Index: llvm/test/CodeGen/X86/test-hidden.ll diff -u llvm/test/CodeGen/X86/test-hidden.ll:1.4 llvm/test/CodeGen/X86/test-hidden.ll:1.5 --- llvm/test/CodeGen/X86/test-hidden.ll:1.4 Tue Mar 27 21:38:26 2007 +++ llvm/test/CodeGen/X86/test-hidden.ll Mon Apr 16 12:36:07 2007 @@ -1,6 +1,7 @@ -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu | grep ".hidden" | wc -l | grep 2 && -; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin8.8.0 | grep ".private_extern" | wc -l | grep 2 +; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu | \ +; RUN: grep .hidden | wc -l | grep 2 +; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin8.8.0 | \ +; RUN: grep .private_extern | wc -l | grep 2 %struct.Person = type { i32 } @a = hidden global i32 0 Index: llvm/test/CodeGen/X86/test-pic-1.ll diff -u llvm/test/CodeGen/X86/test-pic-1.ll:1.3 llvm/test/CodeGen/X86/test-pic-1.ll:1.4 --- llvm/test/CodeGen/X86/test-pic-1.ll:1.3 Sun Apr 15 17:16:46 2007 +++ llvm/test/CodeGen/X86/test-pic-1.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t -f +; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t -f ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t ; RUN: grep piclabel %t | wc -l | grep 3 ; RUN: grep GOT %t | wc -l | grep 3 Index: llvm/test/CodeGen/X86/test-pic-2.ll diff -u llvm/test/CodeGen/X86/test-pic-2.ll:1.2 llvm/test/CodeGen/X86/test-pic-2.ll:1.3 --- llvm/test/CodeGen/X86/test-pic-2.ll:1.2 Fri Jan 26 02:25:06 2007 +++ llvm/test/CodeGen/X86/test-pic-2.ll Mon Apr 16 12:36:07 2007 @@ -1,7 +1,8 @@ -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOTOFF | wc -l | grep 4 +; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \ +; RUN: -o %t -f +; RUN: grep _GLOBAL_OFFSET_TABLE_ %t +; RUN: grep piclabel %t | wc -l | grep 3 +; RUN: grep GOTOFF %t | wc -l | grep 4 @ptr = internal global i32* null @dst = internal global i32 0 Index: llvm/test/CodeGen/X86/test-pic-3.ll diff -u llvm/test/CodeGen/X86/test-pic-3.ll:1.2 llvm/test/CodeGen/X86/test-pic-3.ll:1.3 --- llvm/test/CodeGen/X86/test-pic-3.ll:1.2 Fri Jan 26 02:25:06 2007 +++ llvm/test/CodeGen/X86/test-pic-3.ll Mon Apr 16 12:36:07 2007 @@ -1,7 +1,8 @@ -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep PLT | wc -l | grep 1 +; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \ +; RUN: -o %t -f +; RUN: grep _GLOBAL_OFFSET_TABLE_ %t +; RUN: grep piclabel %t | wc -l | grep 3 +; RUN: grep PLT %t | wc -l | grep 1 define void @bar() { entry: Index: llvm/test/CodeGen/X86/test-pic-4.ll diff -u llvm/test/CodeGen/X86/test-pic-4.ll:1.3 llvm/test/CodeGen/X86/test-pic-4.ll:1.4 --- llvm/test/CodeGen/X86/test-pic-4.ll:1.3 Sun Apr 15 17:16:46 2007 +++ llvm/test/CodeGen/X86/test-pic-4.ll Mon Apr 16 12:36:07 2007 @@ -3,8 +3,8 @@ ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t ; RUN: grep piclabel %t | wc -l | grep 3 ; RUN: grep PLT %t | wc -l | grep 1 -; RUN: grep "GOT" %t | wc -l | grep 1 -; RUN: not grep "GOTOFF" %t +; RUN: grep GOT %t | wc -l | grep 1 +; RUN: not grep GOTOFF %t @pfoo = external global void(...)* Index: llvm/test/CodeGen/X86/test-pic-5.ll diff -u llvm/test/CodeGen/X86/test-pic-5.ll:1.2 llvm/test/CodeGen/X86/test-pic-5.ll:1.3 --- llvm/test/CodeGen/X86/test-pic-5.ll:1.2 Fri Jan 26 02:25:06 2007 +++ llvm/test/CodeGen/X86/test-pic-5.ll Mon Apr 16 12:36:07 2007 @@ -1,7 +1,8 @@ -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep PLT | wc -l | grep 1 +; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \ +; RUN: -o %t -f +; RUN: grep _GLOBAL_OFFSET_TABLE_ %t +; RUN: grep piclabel %t | wc -l | grep 3 +; RUN: grep PLT %t | wc -l | grep 1 @ptr = external global i32* Index: llvm/test/CodeGen/X86/test-pic-6.ll diff -u llvm/test/CodeGen/X86/test-pic-6.ll:1.2 llvm/test/CodeGen/X86/test-pic-6.ll:1.3 --- llvm/test/CodeGen/X86/test-pic-6.ll:1.2 Fri Jan 26 02:25:06 2007 +++ llvm/test/CodeGen/X86/test-pic-6.ll Mon Apr 16 12:36:07 2007 @@ -1,7 +1,8 @@ -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOT | wc -l | grep 3 +; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \ +; RUN: -o %t -f +; RUN: grep _GLOBAL_OFFSET_TABLE_ %t +; RUN: grep piclabel %t | wc -l | grep 3 +; RUN: grep GOT %t | wc -l | grep 3 @ptr = global i32* null @dst = global i32 0 Index: llvm/test/CodeGen/X86/test-pic-cpool.ll diff -u llvm/test/CodeGen/X86/test-pic-cpool.ll:1.3 llvm/test/CodeGen/X86/test-pic-cpool.ll:1.4 --- llvm/test/CodeGen/X86/test-pic-cpool.ll:1.3 Fri Jan 26 02:25:06 2007 +++ llvm/test/CodeGen/X86/test-pic-cpool.ll Mon Apr 16 12:36:07 2007 @@ -1,8 +1,9 @@ -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOTOFF | wc -l | grep 2 && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep CPI | wc -l | grep 4 +; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \ +; RUN: -o %t -f +; RUN: grep _GLOBAL_OFFSET_TABLE_ %t +; RUN: grep piclabel %t | wc -l | grep 3 +; RUN: grep GOTOFF %t | wc -l | grep 2 +; RUN: grep CPI %t | wc -l | grep 4 define double @foo(i32 %a.u) { entry: Index: llvm/test/CodeGen/X86/test-pic-jtbl.ll diff -u llvm/test/CodeGen/X86/test-pic-jtbl.ll:1.2 llvm/test/CodeGen/X86/test-pic-jtbl.ll:1.3 --- llvm/test/CodeGen/X86/test-pic-jtbl.ll:1.2 Fri Jan 26 02:25:06 2007 +++ llvm/test/CodeGen/X86/test-pic-jtbl.ll Mon Apr 16 12:36:07 2007 @@ -1,9 +1,10 @@ -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep PLT | wc -l | grep 13 && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOTOFF | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep JTI | wc -l | grep 15 +; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \ +; RUN: -o %t -f +; RUN: grep _GLOBAL_OFFSET_TABLE_ %t +; RUN: grep piclabel %t | wc -l | grep 3 +; RUN: grep PLT %t | wc -l | grep 13 +; RUN: grep GOTOFF %t | wc -l | grep 1 +; RUN: grep JTI %t | wc -l | grep 15 define void @bar(i32 %n.u) { entry: Index: llvm/test/CodeGen/X86/vec_clear.ll diff -u llvm/test/CodeGen/X86/vec_clear.ll:1.3 llvm/test/CodeGen/X86/vec_clear.ll:1.4 --- llvm/test/CodeGen/X86/vec_clear.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_clear.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | not grep and <4 x float> %test(<4 x float>* %v1) { %tmp = load <4 x float>* %v1 Index: llvm/test/CodeGen/X86/vec_extract.ll diff -u llvm/test/CodeGen/X86/vec_extract.ll:1.5 llvm/test/CodeGen/X86/vec_extract.ll:1.6 --- llvm/test/CodeGen/X86/vec_extract.ll:1.5 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_extract.ll Mon Apr 16 12:36:07 2007 @@ -1,7 +1,8 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movss | wc -l | grep 3 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movhlps | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pshufd | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep unpckhpd | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: grep movss %t | wc -l | grep 3 +; RUN: grep movhlps %t | wc -l | grep 1 +; RUN: grep pshufd %t | wc -l | grep 1 +; RUN: grep unpckhpd %t | wc -l | grep 1 void %test1(<4 x float>* %F, float* %f) { %tmp = load <4 x float>* %F Index: llvm/test/CodeGen/X86/vec_ins_extract.ll diff -u llvm/test/CodeGen/X86/vec_ins_extract.ll:1.4 llvm/test/CodeGen/X86/vec_ins_extract.ll:1.5 --- llvm/test/CodeGen/X86/vec_ins_extract.ll:1.4 Sun Dec 31 00:01:59 2006 +++ llvm/test/CodeGen/X86/vec_ins_extract.ll Mon Apr 16 12:36:07 2007 @@ -1,6 +1,4 @@ ; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl -instcombine | \ -; RUN: llc -march=x86 -mcpu=yonah && -; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl -instcombine | \ ; RUN: llc -march=x86 -mcpu=yonah | not grep sub.*esp ; This checks that various insert/extract idiom work without going to the Index: llvm/test/CodeGen/X86/vec_insert.ll diff -u llvm/test/CodeGen/X86/vec_insert.ll:1.3 llvm/test/CodeGen/X86/vec_insert.ll:1.4 --- llvm/test/CodeGen/X86/vec_insert.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_insert.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movss | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pinsrw | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: grep movss %t | wc -l | grep 1 +; RUN: grep pinsrw %t | wc -l | grep 2 void %test(<4 x float>* %F, int %I) { %tmp = load <4 x float>* %F Index: llvm/test/CodeGen/X86/vec_set-2.ll diff -u llvm/test/CodeGen/X86/vec_set-2.ll:1.3 llvm/test/CodeGen/X86/vec_set-2.ll:1.4 --- llvm/test/CodeGen/X86/vec_set-2.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_set-2.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movss | wc -l | grep 1 && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movss | wc -l | grep 1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movd | wc -l | grep 1 <4 x float> %test1(float %a) { Index: llvm/test/CodeGen/X86/vec_set-3.ll diff -u llvm/test/CodeGen/X86/vec_set-3.ll:1.4 llvm/test/CodeGen/X86/vec_set-3.ll:1.5 --- llvm/test/CodeGen/X86/vec_set-3.ll:1.4 Tue Jan 30 10:16:01 2007 +++ llvm/test/CodeGen/X86/vec_set-3.ll Mon Apr 16 12:36:07 2007 @@ -1,7 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \ -; RUN: grep shufps | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \ -; RUN: grep pshufd | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: grep shufps %t | wc -l | grep 1 +; RUN: grep pshufd %t | wc -l | grep 1 <4 x float> %test(float %a) { %tmp = insertelement <4 x float> zeroinitializer, float %a, uint 1 Index: llvm/test/CodeGen/X86/vec_set-5.ll diff -u llvm/test/CodeGen/X86/vec_set-5.ll:1.2 llvm/test/CodeGen/X86/vec_set-5.ll:1.3 --- llvm/test/CodeGen/X86/vec_set-5.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_set-5.ll Mon Apr 16 12:36:07 2007 @@ -1,6 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movlhps | wc -l | grep 2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep unpcklps | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep punpckldq | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: grep movlhps %t | wc -l | grep 2 +; RUN: grep unpcklps %t | wc -l | grep 1 +; RUN: grep punpckldq %t | wc -l | grep 1 <4 x float> %test1(float %a, float %b) { %tmp = insertelement <4 x float> zeroinitializer, float %a, uint 0 Index: llvm/test/CodeGen/X86/vec_set-6.ll diff -u llvm/test/CodeGen/X86/vec_set-6.ll:1.2 llvm/test/CodeGen/X86/vec_set-6.ll:1.3 --- llvm/test/CodeGen/X86/vec_set-6.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_set-6.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep unpcklps | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep shufps | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: grep unpcklps %t | wc -l | grep 1 +; RUN: grep shufps %t | wc -l | grep 1 <4 x float> %test(float %a, float %b, float %c) { %tmp = insertelement <4 x float> zeroinitializer, float %a, uint 1 Index: llvm/test/CodeGen/X86/vec_shuffle-2.ll diff -u llvm/test/CodeGen/X86/vec_shuffle-2.ll:1.4 llvm/test/CodeGen/X86/vec_shuffle-2.ll:1.5 --- llvm/test/CodeGen/X86/vec_shuffle-2.ll:1.4 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_shuffle-2.ll Mon Apr 16 12:36:07 2007 @@ -1,6 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pshufhw | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pshuflw | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movhps | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: grep pshufhw %t | wc -l | grep 1 +; RUN: grep pshuflw %t | wc -l | grep 1 +; RUN: grep movhps %t | wc -l | grep 1 void %test1(<2 x long>* %res, <2 x long>* %A) { %tmp = load <2 x long>* %A Index: llvm/test/CodeGen/X86/vec_shuffle-3.ll diff -u llvm/test/CodeGen/X86/vec_shuffle-3.ll:1.3 llvm/test/CodeGen/X86/vec_shuffle-3.ll:1.4 --- llvm/test/CodeGen/X86/vec_shuffle-3.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_shuffle-3.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movlhps | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movhlps | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: grep movlhps %t | wc -l | grep 1 +; RUN: grep movhlps %t | wc -l | grep 1 <4 x float> %test1(<4 x float>* %x, <4 x float>* %y) { %tmp = load <4 x float>* %y Index: llvm/test/CodeGen/X86/vec_shuffle-4.ll diff -u llvm/test/CodeGen/X86/vec_shuffle-4.ll:1.5 llvm/test/CodeGen/X86/vec_shuffle-4.ll:1.6 --- llvm/test/CodeGen/X86/vec_shuffle-4.ll:1.5 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_shuffle-4.ll Mon Apr 16 12:36:07 2007 @@ -1,6 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep shuf | wc -l | grep 2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | not grep unpck +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 > %t +; RUN: grep shuf %t | wc -l | grep 2 +; RUN: not grep unpck %t void %test(<4 x float>* %res, <4 x float>* %A, <4 x float>* %B, <4 x float>* %C) { %tmp3 = load <4 x float>* %B %tmp5 = load <4 x float>* %C Index: llvm/test/CodeGen/X86/vec_shuffle-5.ll diff -u llvm/test/CodeGen/X86/vec_shuffle-5.ll:1.3 llvm/test/CodeGen/X86/vec_shuffle-5.ll:1.4 --- llvm/test/CodeGen/X86/vec_shuffle-5.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_shuffle-5.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movhlps | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep shufps | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: grep movhlps %t | wc -l | grep 1 +; RUN: grep shufps %t | wc -l | grep 1 void %test() { %tmp1 = load <4 x float>* null Index: llvm/test/CodeGen/X86/vec_shuffle-6.ll diff -u llvm/test/CodeGen/X86/vec_shuffle-6.ll:1.5 llvm/test/CodeGen/X86/vec_shuffle-6.ll:1.6 --- llvm/test/CodeGen/X86/vec_shuffle-6.ll:1.5 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_shuffle-6.ll Mon Apr 16 12:36:07 2007 @@ -1,7 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movapd | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movaps | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movups | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: grep movapd %t | wc -l | grep 1 +; RUN: grep movaps %t | wc -l | grep 1 +; RUN: grep movups %t | wc -l | grep 2 target triple = "i686-apple-darwin" Index: llvm/test/CodeGen/X86/vec_shuffle-7.ll diff -u llvm/test/CodeGen/X86/vec_shuffle-7.ll:1.2 llvm/test/CodeGen/X86/vec_shuffle-7.ll:1.3 --- llvm/test/CodeGen/X86/vec_shuffle-7.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_shuffle-7.ll Mon Apr 16 12:36:07 2007 @@ -1,6 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep xorps | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | not grep shufps +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: grep xorps %t | wc -l | grep 1 +; RUN: not grep shufps %t void %test() { cast <4 x int> zeroinitializer to <4 x float> Index: llvm/test/CodeGen/X86/vec_shuffle-8.ll diff -u llvm/test/CodeGen/X86/vec_shuffle-8.ll:1.2 llvm/test/CodeGen/X86/vec_shuffle-8.ll:1.3 --- llvm/test/CodeGen/X86/vec_shuffle-8.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_shuffle-8.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | not grep shufps +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \ +; RUN: not grep shufps void %test(<4 x float>* %res, <4 x float>* %A) { %tmp1 = load <4 x float>* %A Index: llvm/test/CodeGen/X86/vec_shuffle-9.ll diff -u llvm/test/CodeGen/X86/vec_shuffle-9.ll:1.2 llvm/test/CodeGen/X86/vec_shuffle-9.ll:1.3 --- llvm/test/CodeGen/X86/vec_shuffle-9.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_shuffle-9.ll Mon Apr 16 12:36:07 2007 @@ -1,6 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep punpck | wc -l | grep 2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | not grep pextrw +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: grep punpck %t | wc -l | grep 2 +; RUN: not grep pextrw %t <4 x int> %test(sbyte** %ptr) { entry: Index: llvm/test/CodeGen/X86/vec_shuffle.ll diff -u llvm/test/CodeGen/X86/vec_shuffle.ll:1.9 llvm/test/CodeGen/X86/vec_shuffle.ll:1.10 --- llvm/test/CodeGen/X86/vec_shuffle.ll:1.9 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_shuffle.ll Mon Apr 16 12:36:07 2007 @@ -1,6 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep shufp | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movups | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pshufhw | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: grep shufp %t | wc -l | grep 1 +; RUN: grep movups %t | wc -l | grep 1 +; RUN: grep pshufhw %t | wc -l | grep 1 void %test_v4sf(<4 x float>* %P, float %X, float %Y) { %tmp = insertelement <4 x float> zeroinitializer, float %X, uint 0 Index: llvm/test/CodeGen/X86/vec_splat.ll diff -u llvm/test/CodeGen/X86/vec_splat.ll:1.7 llvm/test/CodeGen/X86/vec_splat.ll:1.8 --- llvm/test/CodeGen/X86/vec_splat.ll:1.7 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_splat.ll Mon Apr 16 12:36:07 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep shufps && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep shufps ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse3 | grep movddup void %test_v4sf(<4 x float>* %P, <4 x float>* %Q, float %X) { Index: llvm/test/CodeGen/X86/vec_ss_load_fold.ll diff -u llvm/test/CodeGen/X86/vec_ss_load_fold.ll:1.3 llvm/test/CodeGen/X86/vec_ss_load_fold.ll:1.4 --- llvm/test/CodeGen/X86/vec_ss_load_fold.ll:1.3 Fri Dec 1 22:23:08 2006 +++ llvm/test/CodeGen/X86/vec_ss_load_fold.ll Mon Apr 16 12:36:07 2007 @@ -1,5 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse,+sse2 | grep minss | grep CPI | wc -l | grep 2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse,+sse2 | grep CPI | not grep movss +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse,+sse2 -o %t -f +; RUN: grep minss %t | grep CPI | wc -l | grep 2 +; RUN: grep CPI %t | not grep movss target endian = little target pointersize = 32 Index: llvm/test/CodeGen/X86/x86-64-mem.ll diff -u llvm/test/CodeGen/X86/x86-64-mem.ll:1.3 llvm/test/CodeGen/X86/x86-64-mem.ll:1.4 --- llvm/test/CodeGen/X86/x86-64-mem.ll:1.3 Mon Dec 4 12:06:24 2006 +++ llvm/test/CodeGen/X86/x86-64-mem.ll Mon Apr 16 12:36:07 2007 @@ -1,11 +1,13 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin | grep GOTPCREL | wc -l | grep 4 && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin | grep rip | wc -l | grep 6 && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin | grep movq | wc -l | grep 6 && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin | grep leaq | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin -relocation-model=static | grep rip | wc -l | grep 4 && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin -relocation-model=static | grep movl | wc -l | grep 2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin -relocation-model=static | grep movq | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin -o %t1 -f +; RUN: grep GOTPCREL %t1 | wc -l | grep 4 +; RUN: grep rip %t1 | wc -l | grep 6 +; RUN: grep movq %t1 | wc -l | grep 6 +; RUN: grep leaq %t1 | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: llc -mtriple=x86_64-apple-darwin -relocation-model=static -o %t2 -f +; RUN: grep rip %t2 | wc -l | grep 4 +; RUN: grep movl %t2 | wc -l | grep 2 +; RUN: grep movq %t2 | wc -l | grep 2 %ptr = external global int* %src = external global [0 x int] From reid at x10sys.com Mon Apr 16 12:46:11 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:46:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y Message-ID: <200704161746.l3GHkBHv010871@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.340 -> 1.341 --- Log message: Use a more optimal way to get the name of a function. Thanks, Chris. --- Diffs of the changes: (+2 -1) llvmAsmParser.y | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.340 llvm/lib/AsmParser/llvmAsmParser.y:1.341 --- llvm/lib/AsmParser/llvmAsmParser.y:1.340 Mon Apr 16 01:55:42 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y Mon Apr 16 12:45:50 2007 @@ -2823,7 +2823,8 @@ // Check for call to invalid intrinsic to avoid crashing later. if (Function *theF = dyn_cast(V)) { - if (theF->hasName() && 0 == strncmp(theF->getName().c_str(), "llvm.", 5)&& + if (theF->hasName() && + 0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5) && !theF->getIntrinsicID(true)) GEN_ERROR("Call to invalid LLVM intrinsic function '" + theF->getName() + "'"); From reid at x10sys.com Mon Apr 16 12:47:27 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:47:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.y.cvs Message-ID: <200704161747.l3GHlRZx010905@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp.cvs updated: 1.85 -> 1.86 llvmAsmParser.y.cvs updated: 1.86 -> 1.87 --- Log message: Regenerate. --- Diffs of the changes: (+19 -17) llvmAsmParser.cpp.cvs | 33 +++++++++++++++++---------------- llvmAsmParser.y.cvs | 3 ++- 2 files changed, 19 insertions(+), 17 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.85 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.86 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.85 Mon Apr 16 01:56:07 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Mon Apr 16 12:47:06 2007 @@ -1716,8 +1716,8 @@ 2396, 2405, 2414, 2423, 2427, 2432, 2436, 2440, 2445, 2455, 2474, 2483, 2559, 2563, 2570, 2581, 2594, 2604, 2615, 2625, 2634, 2643, 2646, 2647, 2654, 2658, 2663, 2684, 2701, 2715, - 2729, 2741, 2749, 2756, 2762, 2768, 2774, 2789, 2869, 2874, - 2878, 2885, 2892, 2900, 2907, 2915, 2923, 2937, 2954 + 2729, 2741, 2749, 2756, 2762, 2768, 2774, 2789, 2870, 2875, + 2879, 2886, 2893, 2901, 2908, 2916, 2924, 2938, 2955 }; #endif @@ -5488,7 +5488,8 @@ // Check for call to invalid intrinsic to avoid crashing later. if (Function *theF = dyn_cast(V)) { - if (theF->hasName() && 0 == strncmp(theF->getName().c_str(), "llvm.", 5)&& + if (theF->hasName() && + 0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5) && !theF->getIntrinsicID(true)) GEN_ERROR("Call to invalid LLVM intrinsic function '" + theF->getName() + "'"); @@ -5534,7 +5535,7 @@ break; case 278: -#line 2869 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +#line 2870 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = (yyvsp[0].InstVal); CHECK_FOR_ERROR @@ -5542,7 +5543,7 @@ break; case 279: -#line 2874 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +#line 2875 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -5550,7 +5551,7 @@ break; case 280: -#line 2878 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +#line 2879 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -5558,7 +5559,7 @@ break; case 281: -#line 2885 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +#line 2886 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); @@ -5569,7 +5570,7 @@ break; case 282: -#line 2892 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +#line 2893 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); @@ -5581,7 +5582,7 @@ break; case 283: -#line 2900 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +#line 2901 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); @@ -5592,7 +5593,7 @@ break; case 284: -#line 2907 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +#line 2908 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); @@ -5604,7 +5605,7 @@ break; case 285: -#line 2915 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +#line 2916 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[0].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + @@ -5615,7 +5616,7 @@ break; case 286: -#line 2923 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +#line 2924 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); @@ -5633,7 +5634,7 @@ break; case 287: -#line 2937 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +#line 2938 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); @@ -5654,7 +5655,7 @@ break; case 288: -#line 2954 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +#line 2955 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); @@ -5677,7 +5678,7 @@ } /* Line 1126 of yacc.c. */ -#line 5681 "llvmAsmParser.tab.c" +#line 5682 "llvmAsmParser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -5945,7 +5946,7 @@ } -#line 2971 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +#line 2972 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.86 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.87 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.86 Mon Apr 16 01:56:07 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Mon Apr 16 12:47:06 2007 @@ -2823,7 +2823,8 @@ // Check for call to invalid intrinsic to avoid crashing later. if (Function *theF = dyn_cast(V)) { - if (theF->hasName() && 0 == strncmp(theF->getName().c_str(), "llvm.", 5)&& + if (theF->hasName() && + 0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5) && !theF->getIntrinsicID(true)) GEN_ERROR("Call to invalid LLVM intrinsic function '" + theF->getName() + "'"); From reid at x10sys.com Mon Apr 16 12:51:46 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 12:51:46 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Alpha/ctpop.ll Message-ID: <200704161751.l3GHpkpM011000@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Alpha: ctpop.ll updated: 1.11 -> 1.12 --- Log message: For PR1336: http://llvm.org/PR1336 : Un-XFAIL because this passes now. --- Diffs of the changes: (+0 -1) ctpop.ll | 1 - 1 files changed, 1 deletion(-) Index: llvm/test/CodeGen/Alpha/ctpop.ll diff -u llvm/test/CodeGen/Alpha/ctpop.ll:1.11 llvm/test/CodeGen/Alpha/ctpop.ll:1.12 --- llvm/test/CodeGen/Alpha/ctpop.ll:1.11 Mon Apr 16 10:31:48 2007 +++ llvm/test/CodeGen/Alpha/ctpop.ll Mon Apr 16 12:51:25 2007 @@ -8,7 +8,6 @@ ; RUN: not grep -i ctpop ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha -mattr=-CIX | \ ; RUN: not grep -i ctpop -; XFAIL: * declare long %llvm.ctpop.i64(long) From asl at math.spbu.ru Mon Apr 16 13:11:37 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachOWriter.h README.txt Message-ID: <200704161811.l3GIBb0w011438@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachOWriter.h updated: 1.2 -> 1.3 README.txt updated: 1.3 -> 1.4 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+24 -24) MachOWriter.h | 10 +++++----- README.txt | 38 +++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 24 deletions(-) Index: llvm/lib/CodeGen/MachOWriter.h diff -u llvm/lib/CodeGen/MachOWriter.h:1.2 llvm/lib/CodeGen/MachOWriter.h:1.3 --- llvm/lib/CodeGen/MachOWriter.h:1.2 Wed Feb 28 01:40:50 2007 +++ llvm/lib/CodeGen/MachOWriter.h Mon Apr 16 13:10:22 2007 @@ -254,19 +254,19 @@ // The following constants are getting pulled in by one of the // system headers, which creates a neat clash with the enum. #if !defined(VM_PROT_NONE) -#define VM_PROT_NONE 0x00 +#define VM_PROT_NONE 0x00 #endif #if !defined(VM_PROT_READ) -#define VM_PROT_READ 0x01 +#define VM_PROT_READ 0x01 #endif #if !defined(VM_PROT_WRITE) -#define VM_PROT_WRITE 0x02 +#define VM_PROT_WRITE 0x02 #endif #if !defined(VM_PROT_EXECUTE) -#define VM_PROT_EXECUTE 0x04 +#define VM_PROT_EXECUTE 0x04 #endif #if !defined(VM_PROT_ALL) -#define VM_PROT_ALL 0x07 +#define VM_PROT_ALL 0x07 #endif // Constants for the vm protection fields Index: llvm/lib/CodeGen/README.txt diff -u llvm/lib/CodeGen/README.txt:1.3 llvm/lib/CodeGen/README.txt:1.4 --- llvm/lib/CodeGen/README.txt:1.3 Wed Mar 28 21:48:56 2007 +++ llvm/lib/CodeGen/README.txt Mon Apr 16 13:10:22 2007 @@ -2,29 +2,29 @@ Common register allocation / spilling problem: - mul lr, r4, lr - str lr, [sp, #+52] - ldr lr, [r1, #+32] - sxth r3, r3 - ldr r4, [sp, #+52] - mla r4, r3, lr, r4 + mul lr, r4, lr + str lr, [sp, #+52] + ldr lr, [r1, #+32] + sxth r3, r3 + ldr r4, [sp, #+52] + mla r4, r3, lr, r4 can be: - mul lr, r4, lr + mul lr, r4, lr mov r4, lr - str lr, [sp, #+52] - ldr lr, [r1, #+32] - sxth r3, r3 - mla r4, r3, lr, r4 + str lr, [sp, #+52] + ldr lr, [r1, #+32] + sxth r3, r3 + mla r4, r3, lr, r4 and then "merge" mul and mov: - mul r4, r4, lr - str lr, [sp, #+52] - ldr lr, [r1, #+32] - sxth r3, r3 - mla r4, r3, lr, r4 + mul r4, r4, lr + str lr, [sp, #+52] + ldr lr, [r1, #+32] + sxth r3, r3 + mla r4, r3, lr, r4 It also increase the likelyhood the store may become dead. @@ -70,13 +70,13 @@ bb27 ... ... - %reg1037 = ADDri %reg1039, 1 - %reg1038 = ADDrs %reg1032, %reg1039, %NOREG, 10 + %reg1037 = ADDri %reg1039, 1 + %reg1038 = ADDrs %reg1032, %reg1039, %NOREG, 10 Successors according to CFG: 0x8b03bf0 (#5) bb76 (0x8b03bf0, LLVM BB @0x8b032d0, ID#5): Predecessors according to CFG: 0x8b0c5f0 (#3) 0x8b0a7c0 (#4) - %reg1039 = PHI %reg1070, mbb, %reg1037, mbb + %reg1039 = PHI %reg1070, mbb, %reg1037, mbb Note ADDri is not a two-address instruction. However, its result %reg1037 is an operand of the PHI node in bb76 and its operand %reg1039 is the result of the From asl at math.spbu.ru Mon Apr 16 13:11:37 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:37 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/LoopPass.h Message-ID: <200704161811.l3GIBbXP011434@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: LoopPass.h updated: 1.13 -> 1.14 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+1 -1) LoopPass.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Analysis/LoopPass.h diff -u llvm/include/llvm/Analysis/LoopPass.h:1.13 llvm/include/llvm/Analysis/LoopPass.h:1.14 --- llvm/include/llvm/Analysis/LoopPass.h:1.13 Tue Mar 6 13:11:25 2007 +++ llvm/include/llvm/Analysis/LoopPass.h Mon Apr 16 13:10:22 2007 @@ -55,7 +55,7 @@ /// Assign pass manager to manager this pass virtual void assignPassManager(PMStack &PMS, - PassManagerType PMT = PMT_LoopPassManager); + PassManagerType PMT = PMT_LoopPassManager); }; From asl at math.spbu.ru Mon Apr 16 13:11:38 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:38 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CallGraphSCCPass.h Pass.h PassSupport.h Message-ID: <200704161811.l3GIBcpQ011450@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: CallGraphSCCPass.h updated: 1.10 -> 1.11 Pass.h updated: 1.81 -> 1.82 PassSupport.h updated: 1.37 -> 1.38 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+9 -7) CallGraphSCCPass.h | 2 +- Pass.h | 8 ++++---- PassSupport.h | 6 ++++-- 3 files changed, 9 insertions(+), 7 deletions(-) Index: llvm/include/llvm/CallGraphSCCPass.h diff -u llvm/include/llvm/CallGraphSCCPass.h:1.10 llvm/include/llvm/CallGraphSCCPass.h:1.11 --- llvm/include/llvm/CallGraphSCCPass.h:1.10 Thu Jan 25 19:08:18 2007 +++ llvm/include/llvm/CallGraphSCCPass.h Mon Apr 16 13:10:22 2007 @@ -52,7 +52,7 @@ /// Assign pass manager to manager this pass virtual void assignPassManager(PMStack &PMS, - PassManagerType PMT = PMT_CallGraphPassManager); + PassManagerType PMT = PMT_CallGraphPassManager); /// getAnalysisUsage - For this class, we declare that we require and preserve /// the call graph. If the derived class implements this method, it should Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.81 llvm/include/llvm/Pass.h:1.82 --- llvm/include/llvm/Pass.h:1.81 Mon Mar 5 19:55:46 2007 +++ llvm/include/llvm/Pass.h Mon Apr 16 13:10:22 2007 @@ -123,7 +123,7 @@ /// Each pass is responsible for assigning a pass manager to itself. /// PMS is the stack of available pass manager. virtual void assignPassManager(PMStack &PMS, - PassManagerType T = PMT_Unknown) {} + PassManagerType T = PMT_Unknown) {} /// Check if available pass managers are suitable for this pass or not. virtual void preparePassManager(PMStack &PMS) {} @@ -215,7 +215,7 @@ virtual bool runPass(BasicBlock&) { return false; } virtual void assignPassManager(PMStack &PMS, - PassManagerType T = PMT_ModulePassManager); + PassManagerType T = PMT_ModulePassManager); // Force out-of-line virtual method. virtual ~ModulePass(); }; @@ -282,7 +282,7 @@ bool run(Function &F); virtual void assignPassManager(PMStack &PMS, - PassManagerType T = PMT_FunctionPassManager); + PassManagerType T = PMT_FunctionPassManager); }; @@ -337,7 +337,7 @@ virtual bool runPass(BasicBlock &BB); virtual void assignPassManager(PMStack &PMS, - PassManagerType T = PMT_BasicBlockPassManager); + PassManagerType T = PMT_BasicBlockPassManager); }; /// PMStack Index: llvm/include/llvm/PassSupport.h diff -u llvm/include/llvm/PassSupport.h:1.37 llvm/include/llvm/PassSupport.h:1.38 --- llvm/include/llvm/PassSupport.h:1.37 Fri Mar 23 13:44:11 2007 +++ llvm/include/llvm/PassSupport.h Mon Apr 16 13:10:22 2007 @@ -137,8 +137,10 @@ /// const PassInfo *getPassInfo() const { return &PIObj; } + typedef Pass* (*NormalCtor_t)(); + RegisterPassBase(const char *Name, const char *Arg, const std::type_info &TI, - Pass *(*NormalCtor)() = 0, bool CFGOnly = false) + NormalCtor_t NormalCtor = 0, bool CFGOnly = false) : PIObj(Name, Arg, TI, NormalCtor, CFGOnly) { registerPass(); } @@ -164,7 +166,7 @@ // Register Pass using default constructor... RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false) : RegisterPassBase(Name, PassArg, typeid(PassName), - callDefaultCtor, CFGOnly) { + (RegisterPassBase::NormalCtor_t)callDefaultCtor, CFGOnly) { } }; From asl at math.spbu.ru Mon Apr 16 13:11:39 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:39 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h Message-ID: <200704161811.l3GIBdFW011457@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetLowering.h updated: 1.122 -> 1.123 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+2 -2) TargetLowering.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Target/TargetLowering.h diff -u llvm/include/llvm/Target/TargetLowering.h:1.122 llvm/include/llvm/Target/TargetLowering.h:1.123 --- llvm/include/llvm/Target/TargetLowering.h:1.122 Mon Apr 9 18:34:08 2007 +++ llvm/include/llvm/Target/TargetLowering.h Mon Apr 16 13:10:22 2007 @@ -884,9 +884,9 @@ // Div utility functions // SDOperand BuildSDIV(SDNode *N, SelectionDAG &DAG, - std::vector* Created) const; + std::vector* Created) const; SDOperand BuildUDIV(SDNode *N, SelectionDAG &DAG, - std::vector* Created) const; + std::vector* Created) const; //===--------------------------------------------------------------------===// From asl at math.spbu.ru Mon Apr 16 13:11:39 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/MSIL/MSILWriter.cpp MSILWriter.h Message-ID: <200704161811.l3GIBdPi011462@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/MSIL: MSILWriter.cpp updated: 1.3 -> 1.4 MSILWriter.h updated: 1.1 -> 1.2 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+3 -3) MSILWriter.cpp | 4 ++-- MSILWriter.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Target/MSIL/MSILWriter.cpp diff -u llvm/lib/Target/MSIL/MSILWriter.cpp:1.3 llvm/lib/Target/MSIL/MSILWriter.cpp:1.4 --- llvm/lib/Target/MSIL/MSILWriter.cpp:1.3 Tue Apr 10 21:44:19 2007 +++ llvm/lib/Target/MSIL/MSILWriter.cpp Mon Apr 16 13:10:23 2007 @@ -1,6 +1,6 @@ //===-- MSILWriter.cpp - Library for converting LLVM code to MSIL ---------===// // -// The LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file was developed by Roman Samoilov and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. @@ -1333,7 +1333,7 @@ } //===----------------------------------------------------------------------===// -// External Interface declaration +// External Interface declaration //===----------------------------------------------------------------------===// bool MSILTarget::addPassesToEmitWholeFile(PassManager &PM, std::ostream &o, Index: llvm/lib/Target/MSIL/MSILWriter.h diff -u llvm/lib/Target/MSIL/MSILWriter.h:1.1 llvm/lib/Target/MSIL/MSILWriter.h:1.2 --- llvm/lib/Target/MSIL/MSILWriter.h:1.1 Wed Mar 21 16:38:25 2007 +++ llvm/lib/Target/MSIL/MSILWriter.h Mon Apr 16 13:10:23 2007 @@ -1,6 +1,6 @@ //===-- MSILWriter.h - TargetMachine for the MSIL ---------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure +// The LLVM Compiler Infrastructure // // This file was developed by Roman Samoilov and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. From asl at math.spbu.ru Mon Apr 16 13:11:39 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/CodeExtractor.cpp LowerAllocations.cpp LowerInvoke.cpp LowerSelect.cpp LowerSwitch.cpp Mem2Reg.cpp Message-ID: <200704161811.l3GIBdWF011477@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: CodeExtractor.cpp updated: 1.52 -> 1.53 LowerAllocations.cpp updated: 1.72 -> 1.73 LowerInvoke.cpp updated: 1.57 -> 1.58 LowerSelect.cpp updated: 1.11 -> 1.12 LowerSwitch.cpp updated: 1.36 -> 1.37 Mem2Reg.cpp updated: 1.22 -> 1.23 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+6 -6) CodeExtractor.cpp | 2 +- LowerAllocations.cpp | 2 +- LowerInvoke.cpp | 2 +- LowerSelect.cpp | 2 +- LowerSwitch.cpp | 2 +- Mem2Reg.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/lib/Transforms/Utils/CodeExtractor.cpp diff -u llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.52 llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.53 --- llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.52 Sat Apr 7 00:31:27 2007 +++ llvm/lib/Transforms/Utils/CodeExtractor.cpp Mon Apr 16 13:10:23 2007 @@ -151,7 +151,7 @@ for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) if (DT->getNode(I)->getIDom()->getBlock() == OldPred) { DT->changeImmediateDominator(DT->getNode(I), DT->getNode(NewBB)); - EF->setImmediateDominator(I, NewBB); + EF->setImmediateDominator(I, NewBB); } } Index: llvm/lib/Transforms/Utils/LowerAllocations.cpp diff -u llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.72 llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.73 --- llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.72 Fri Mar 2 17:03:17 2007 +++ llvm/lib/Transforms/Utils/LowerAllocations.cpp Mon Apr 16 13:10:23 2007 @@ -43,7 +43,7 @@ AU.addRequired(); AU.setPreservesCFG(); - // This is a cluster of orthogonal Transforms: + // This is a cluster of orthogonal Transforms: AU.addPreserved(); AU.addPreservedID(PromoteMemoryToRegisterID); AU.addPreservedID(LowerSelectID); Index: llvm/lib/Transforms/Utils/LowerInvoke.cpp diff -u llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.57 llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.58 --- llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.57 Thu Feb 22 10:21:18 2007 +++ llvm/lib/Transforms/Utils/LowerInvoke.cpp Mon Apr 16 13:10:23 2007 @@ -80,7 +80,7 @@ bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { - // This is a cluster of orthogonal Transforms + // This is a cluster of orthogonal Transforms AU.addPreservedID(PromoteMemoryToRegisterID); AU.addPreservedID(LowerSelectID); AU.addPreservedID(LowerSwitchID); Index: llvm/lib/Transforms/Utils/LowerSelect.cpp diff -u llvm/lib/Transforms/Utils/LowerSelect.cpp:1.11 llvm/lib/Transforms/Utils/LowerSelect.cpp:1.12 --- llvm/lib/Transforms/Utils/LowerSelect.cpp:1.11 Sat Feb 10 19:37:51 2007 +++ llvm/lib/Transforms/Utils/LowerSelect.cpp Mon Apr 16 13:10:23 2007 @@ -37,7 +37,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const { // This certainly destroys the CFG. - // This is a cluster of orthogonal Transforms: + // This is a cluster of orthogonal Transforms: AU.addPreserved(); AU.addPreservedID(PromoteMemoryToRegisterID); AU.addPreservedID(LowerSwitchID); Index: llvm/lib/Transforms/Utils/LowerSwitch.cpp diff -u llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.36 llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.37 --- llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.36 Mon Mar 12 12:56:27 2007 +++ llvm/lib/Transforms/Utils/LowerSwitch.cpp Mon Apr 16 13:10:23 2007 @@ -33,7 +33,7 @@ virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { - // This is a cluster of orthogonal Transforms + // This is a cluster of orthogonal Transforms AU.addPreserved(); AU.addPreservedID(PromoteMemoryToRegisterID); AU.addPreservedID(LowerSelectID); Index: llvm/lib/Transforms/Utils/Mem2Reg.cpp diff -u llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.22 llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.23 --- llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.22 Tue Dec 19 16:17:40 2006 +++ llvm/lib/Transforms/Utils/Mem2Reg.cpp Mon Apr 16 13:10:23 2007 @@ -40,7 +40,7 @@ AU.addRequired(); AU.addRequired(); AU.setPreservesCFG(); - // This is a cluster of orthogonal Transforms + // This is a cluster of orthogonal Transforms AU.addPreserved(); AU.addPreservedID(LowerSelectID); AU.addPreservedID(LowerSwitchID); From asl at math.spbu.ru Mon Apr 16 13:11:39 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LowerPacked.cpp Reg2Mem.cpp Message-ID: <200704161811.l3GIBdlF011484@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LowerPacked.cpp updated: 1.20 -> 1.21 Reg2Mem.cpp updated: 1.11 -> 1.12 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+5 -5) LowerPacked.cpp | 2 +- Reg2Mem.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/Transforms/Scalar/LowerPacked.cpp diff -u llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.20 llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.21 --- llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.20 Wed Feb 14 21:39:18 2007 +++ llvm/lib/Transforms/Scalar/LowerPacked.cpp Mon Apr 16 13:10:23 2007 @@ -379,7 +379,7 @@ new AllocaInst(PTy->getElementType(), ConstantInt::get(Type::Int32Ty, PTy->getNumElements()), EI.getName() + ".alloca", - EI.getParent()->getParent()->getEntryBlock().begin()); + EI.getParent()->getParent()->getEntryBlock().begin()); for (unsigned i = 0; i < PTy->getNumElements(); ++i) { GetElementPtrInst *GEP = new GetElementPtrInst(alloca, ConstantInt::get(Type::Int32Ty, i), Index: llvm/lib/Transforms/Scalar/Reg2Mem.cpp diff -u llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.11 llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.12 --- llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.11 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/Scalar/Reg2Mem.cpp Mon Apr 16 13:10:23 2007 @@ -44,7 +44,7 @@ for(Value::use_iterator ii = i->use_begin(), ie = i->use_end(); ii != ie; ++ii) if (cast(*ii)->getParent() != bb || - isa(*ii)) + isa(*ii)) return true; return false; } @@ -52,9 +52,9 @@ virtual bool runOnFunction(Function &F) { if (!F.isDeclaration()) { //give us a clean block - BasicBlock* bbold = &F.getEntryBlock(); - BasicBlock* bbnew = new BasicBlock("allocablock", &F, &F.getEntryBlock()); - new BranchInst(bbold, bbnew); + BasicBlock* bbold = &F.getEntryBlock(); + BasicBlock* bbnew = new BasicBlock("allocablock", &F, &F.getEntryBlock()); + new BranchInst(bbold, bbnew); //find the instructions std::list worklist; From asl at math.spbu.ru Mon Apr 16 13:11:40 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64Bundling.cpp IA64ISelDAGToDAG.cpp IA64ISelLowering.cpp Message-ID: <200704161811.l3GIBee6011503@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64Bundling.cpp updated: 1.7 -> 1.8 IA64ISelDAGToDAG.cpp updated: 1.64 -> 1.65 IA64ISelLowering.cpp updated: 1.56 -> 1.57 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+39 -31) IA64Bundling.cpp | 8 +++---- IA64ISelDAGToDAG.cpp | 52 +++++++++++++++++++++++++++++---------------------- IA64ISelLowering.cpp | 10 ++++----- 3 files changed, 39 insertions(+), 31 deletions(-) Index: llvm/lib/Target/IA64/IA64Bundling.cpp diff -u llvm/lib/Target/IA64/IA64Bundling.cpp:1.7 llvm/lib/Target/IA64/IA64Bundling.cpp:1.8 --- llvm/lib/Target/IA64/IA64Bundling.cpp:1.7 Tue Dec 19 16:59:26 2006 +++ llvm/lib/Target/IA64/IA64Bundling.cpp Mon Apr 16 13:10:23 2007 @@ -56,10 +56,10 @@ return Changed; } - std::set PendingRegWrites; // XXX: ugly global, but - // pending writes can cross basic blocks. Note that - // taken branches end instruction groups. So we - // only need to worry about 'fallthrough' code + // XXX: ugly global, but pending writes can cross basic blocks. Note that + // taken branches end instruction groups. So we only need to worry about + // 'fallthrough' code + std::set PendingRegWrites; }; } // end of anonymous namespace Index: llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp diff -u llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.64 llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.65 --- llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.64 Tue Dec 19 16:59:26 2006 +++ llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp Mon Apr 16 13:10:23 2007 @@ -352,9 +352,10 @@ Chain = targetEntryPoint.getValue(1); SDOperand targetGPAddr= SDOperand(CurDAG->getTargetNode(IA64::ADDS, MVT::i64, - FnDescriptor, CurDAG->getConstant(8, MVT::i64)), 0); + FnDescriptor, + CurDAG->getConstant(8, MVT::i64)), 0); Chain = targetGPAddr.getValue(1); - SDOperand targetGP= + SDOperand targetGP = SDOperand(CurDAG->getTargetNode(IA64::LD8, MVT::i64, targetGPAddr), 0); Chain = targetGP.getValue(1); @@ -418,14 +419,14 @@ int FI = cast(N)->getIndex(); if (N->hasOneUse()) return CurDAG->SelectNodeTo(N, IA64::MOV, MVT::i64, - CurDAG->getTargetFrameIndex(FI, MVT::i64)); + CurDAG->getTargetFrameIndex(FI, MVT::i64)); else return CurDAG->getTargetNode(IA64::MOV, MVT::i64, CurDAG->getTargetFrameIndex(FI, MVT::i64)); } case ISD::ConstantPool: { // TODO: nuke the constant pool - // (ia64 doesn't need one) + // (ia64 doesn't need one) ConstantPoolSDNode *CP = cast(N); Constant *C = CP->getConstVal(); SDOperand CPI = CurDAG->getTargetConstantPool(C, MVT::i64, @@ -437,18 +438,24 @@ case ISD::GlobalAddress: { GlobalValue *GV = cast(N)->getGlobal(); SDOperand GA = CurDAG->getTargetGlobalAddress(GV, MVT::i64); - SDOperand Tmp = SDOperand(CurDAG->getTargetNode(IA64::ADDL_GA, MVT::i64, - CurDAG->getRegister(IA64::r1, MVT::i64), GA), 0); + SDOperand Tmp = + SDOperand(CurDAG->getTargetNode(IA64::ADDL_GA, MVT::i64, + CurDAG->getRegister(IA64::r1, + MVT::i64), GA), 0); return CurDAG->getTargetNode(IA64::LD8, MVT::i64, Tmp); } -/* XXX case ISD::ExternalSymbol: { - SDOperand EA = CurDAG->getTargetExternalSymbol(cast(N)->getSymbol(), - MVT::i64); - SDOperand Tmp = CurDAG->getTargetNode(IA64::ADDL_EA, MVT::i64, - CurDAG->getRegister(IA64::r1, MVT::i64), EA); - return CurDAG->getTargetNode(IA64::LD8, MVT::i64, Tmp); - } +/* XXX + case ISD::ExternalSymbol: { + SDOperand EA = CurDAG->getTargetExternalSymbol( + cast(N)->getSymbol(), + MVT::i64); + SDOperand Tmp = CurDAG->getTargetNode(IA64::ADDL_EA, MVT::i64, + CurDAG->getRegister(IA64::r1, + MVT::i64), + EA); + return CurDAG->getTargetNode(IA64::LD8, MVT::i64, Tmp); + } */ case ISD::LOAD: { // FIXME: load -1, not 1, for bools? @@ -504,15 +511,16 @@ default: assert(0 && "unknown type in store"); case MVT::i1: { // this is a bool Opc = IA64::ST1; // we store either 0 or 1 as a byte - // first load zero! - SDOperand Initial = CurDAG->getCopyFromReg(Chain, IA64::r0, MVT::i64); - Chain = Initial.getValue(1); - // then load 1 into the same reg iff the predicate to store is 1 + // first load zero! + SDOperand Initial = CurDAG->getCopyFromReg(Chain, IA64::r0, MVT::i64); + Chain = Initial.getValue(1); + // then load 1 into the same reg iff the predicate to store is 1 SDOperand Tmp = ST->getValue(); AddToISelQueue(Tmp); - Tmp = SDOperand(CurDAG->getTargetNode(IA64::TPCADDS, MVT::i64, Initial, - CurDAG->getTargetConstant(1, MVT::i64), - Tmp), 0); + Tmp = + SDOperand(CurDAG->getTargetNode(IA64::TPCADDS, MVT::i64, Initial, + CurDAG->getTargetConstant(1, MVT::i64), + Tmp), 0); return CurDAG->SelectNodeTo(N, Opc, MVT::Other, Address, Tmp, Chain); } case MVT::i64: Opc = IA64::ST8; break; @@ -551,14 +559,14 @@ case ISD::CALLSEQ_END: { int64_t Amt = cast(N->getOperand(1))->getValue(); unsigned Opc = N->getOpcode() == ISD::CALLSEQ_START ? - IA64::ADJUSTCALLSTACKDOWN : IA64::ADJUSTCALLSTACKUP; + IA64::ADJUSTCALLSTACKDOWN : IA64::ADJUSTCALLSTACKUP; SDOperand N0 = N->getOperand(0); AddToISelQueue(N0); return CurDAG->SelectNodeTo(N, Opc, MVT::Other, getI64Imm(Amt), N0); } case ISD::BR: - // FIXME: we don't need long branches all the time! + // FIXME: we don't need long branches all the time! SDOperand N0 = N->getOperand(0); AddToISelQueue(N0); return CurDAG->SelectNodeTo(N, IA64::BRL_NOTCALL, MVT::Other, Index: llvm/lib/Target/IA64/IA64ISelLowering.cpp diff -u llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.56 llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.57 --- llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.56 Wed Mar 7 10:25:09 2007 +++ llvm/lib/Target/IA64/IA64ISelLowering.cpp Mon Apr 16 13:10:23 2007 @@ -366,9 +366,9 @@ ValToStore = Val; } else { RegValuesToPass.push_back(Val); - if(1 /* TODO: if(calling external or varadic function)*/ ) { - ValToConvert = Val; // additionally pass this FP value as an int - } + if(1 /* TODO: if(calling external or varadic function)*/ ) { + ValToConvert = Val; // additionally pass this FP value as an int + } } break; } @@ -384,7 +384,7 @@ } if(ValToConvert.Val) { - Converts.push_back(DAG.getNode(IA64ISD::GETFD, MVT::i64, ValToConvert)); + Converts.push_back(DAG.getNode(IA64ISD::GETFD, MVT::i64, ValToConvert)); } } @@ -492,7 +492,7 @@ Chain = boolInR8.getValue(1); SDOperand zeroReg = DAG.getCopyFromReg(Chain, IA64::r0, MVT::i64, InFlag); InFlag = zeroReg.getValue(2); - Chain = zeroReg.getValue(1); + Chain = zeroReg.getValue(1); RetVal = DAG.getSetCC(MVT::i1, boolInR8, zeroReg, ISD::SETNE); break; From asl at math.spbu.ru Mon Apr 16 13:11:43 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp Message-ID: <200704161811.l3GIBhDi011511@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.146 -> 1.147 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+3 -3) PassManager.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.146 llvm/lib/VMCore/PassManager.cpp:1.147 --- llvm/lib/VMCore/PassManager.cpp:1.146 Thu Mar 8 13:05:01 2007 +++ llvm/lib/VMCore/PassManager.cpp Mon Apr 16 13:10:23 2007 @@ -1293,7 +1293,7 @@ /// Find appropriate Module Pass Manager in the PM Stack and /// add self into that manager. void ModulePass::assignPassManager(PMStack &PMS, - PassManagerType PreferredType) { + PassManagerType PreferredType) { // Find Module Pass Manager while(!PMS.empty()) { @@ -1312,7 +1312,7 @@ /// Find appropriate Function Pass Manager or Call Graph Pass Manager /// in the PM Stack and add self into that manager. void FunctionPass::assignPassManager(PMStack &PMS, - PassManagerType PreferredType) { + PassManagerType PreferredType) { // Find Module Pass Manager (TODO : Or Call Graph Pass Manager) while(!PMS.empty()) { @@ -1357,7 +1357,7 @@ /// Find appropriate Basic Pass Manager or Call Graph Pass Manager /// in the PM Stack and add self into that manager. void BasicBlockPass::assignPassManager(PMStack &PMS, - PassManagerType PreferredType) { + PassManagerType PreferredType) { BBPassManager *BBP = NULL; From asl at math.spbu.ru Mon Apr 16 13:11:43 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:43 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/BitVector.h hash_set.in Message-ID: <200704161811.l3GIBhc9011518@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: BitVector.h updated: 1.20 -> 1.21 hash_set.in updated: 1.8 -> 1.9 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+16 -16) BitVector.h | 30 +++++++++++++++--------------- hash_set.in | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) Index: llvm/include/llvm/ADT/BitVector.h diff -u llvm/include/llvm/ADT/BitVector.h:1.20 llvm/include/llvm/ADT/BitVector.h:1.21 --- llvm/include/llvm/ADT/BitVector.h:1.20 Wed Apr 4 17:13:39 2007 +++ llvm/include/llvm/ADT/BitVector.h Mon Apr 16 13:10:22 2007 @@ -128,12 +128,12 @@ int find_first() const { for (unsigned i = 0; i < NumBitWords(size()); ++i) if (Bits[i] != 0) { - if (sizeof(BitWord) == 4) - return i * BITS_PER_WORD + CountTrailingZeros_32(Bits[i]); - else if (sizeof(BitWord) == 8) - return i * BITS_PER_WORD + CountTrailingZeros_64(Bits[i]); - else - assert(0 && "Unsupported!"); + if (sizeof(BitWord) == 4) + return i * BITS_PER_WORD + CountTrailingZeros_32(Bits[i]); + else if (sizeof(BitWord) == 8) + return i * BITS_PER_WORD + CountTrailingZeros_64(Bits[i]); + else + assert(0 && "Unsupported!"); } return -1; } @@ -153,22 +153,22 @@ if (Copy != 0) { if (sizeof(BitWord) == 4) - return WordPos * BITS_PER_WORD + CountTrailingZeros_32(Copy); + return WordPos * BITS_PER_WORD + CountTrailingZeros_32(Copy); else if (sizeof(BitWord) == 8) - return WordPos * BITS_PER_WORD + CountTrailingZeros_64(Copy); + return WordPos * BITS_PER_WORD + CountTrailingZeros_64(Copy); else - assert(0 && "Unsupported!"); + assert(0 && "Unsupported!"); } // Check subsequent words. for (unsigned i = WordPos+1; i < NumBitWords(size()); ++i) if (Bits[i] != 0) { - if (sizeof(BitWord) == 4) - return i * BITS_PER_WORD + CountTrailingZeros_32(Bits[i]); - else if (sizeof(BitWord) == 8) - return i * BITS_PER_WORD + CountTrailingZeros_64(Bits[i]); - else - assert(0 && "Unsupported!"); + if (sizeof(BitWord) == 4) + return i * BITS_PER_WORD + CountTrailingZeros_32(Bits[i]); + else if (sizeof(BitWord) == 8) + return i * BITS_PER_WORD + CountTrailingZeros_64(Bits[i]); + else + assert(0 && "Unsupported!"); } return -1; } Index: llvm/include/llvm/ADT/hash_set.in diff -u llvm/include/llvm/ADT/hash_set.in:1.8 llvm/include/llvm/ADT/hash_set.in:1.9 --- llvm/include/llvm/ADT/hash_set.in:1.8 Wed Oct 26 10:02:21 2005 +++ llvm/include/llvm/ADT/hash_set.in Mon Apr 16 13:10:22 2007 @@ -84,7 +84,7 @@ /* template struct hash { unsigned int operator()(const unsigned int& x) const { - return x; + return x; } }; */ From asl at math.spbu.ru Mon Apr 16 13:11:40 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp AlphaISelDAGToDAG.cpp AlphaISelLowering.cpp AlphaLLRP.cpp AlphaRegisterInfo.cpp Message-ID: <200704161811.l3GIBetv011502@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaAsmPrinter.cpp updated: 1.63 -> 1.64 AlphaISelDAGToDAG.cpp updated: 1.68 -> 1.69 AlphaISelLowering.cpp updated: 1.85 -> 1.86 AlphaLLRP.cpp updated: 1.7 -> 1.8 AlphaRegisterInfo.cpp updated: 1.64 -> 1.65 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+207 -205) AlphaAsmPrinter.cpp | 16 ++-- AlphaISelDAGToDAG.cpp | 108 ++++++++++++++-------------- AlphaISelLowering.cpp | 79 ++++++++++---------- AlphaLLRP.cpp | 189 +++++++++++++++++++++++++------------------------- AlphaRegisterInfo.cpp | 20 ++--- 5 files changed, 207 insertions(+), 205 deletions(-) Index: llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp diff -u llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.63 llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.64 --- llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.63 Tue Feb 13 17:41:16 2007 +++ llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp Mon Apr 16 13:10:22 2007 @@ -53,9 +53,9 @@ bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode); bool PrintAsmMemoryOperand(const MachineInstr *MI, - unsigned OpNo, - unsigned AsmVariant, - const char *ExtraCode); + unsigned OpNo, + unsigned AsmVariant, + const char *ExtraCode); }; } // end of anonymous namespace @@ -278,16 +278,16 @@ /// PrintAsmOperand - Print out an operand for an inline asm expression. /// bool AlphaAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, - unsigned AsmVariant, - const char *ExtraCode) { + unsigned AsmVariant, + const char *ExtraCode) { printOperand(MI, OpNo); return false; } bool AlphaAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, - unsigned OpNo, - unsigned AsmVariant, - const char *ExtraCode) { + unsigned OpNo, + unsigned AsmVariant, + const char *ExtraCode) { if (ExtraCode && ExtraCode[0]) return true; // Unknown modifier. O << "0("; Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.68 llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.69 --- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.68 Wed Jan 24 15:09:16 2007 +++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Mon Apr 16 13:10:22 2007 @@ -50,7 +50,7 @@ static int64_t get_ldah16(int64_t x) { int64_t y = x / IMM_MULT; if (x % IMM_MULT > IMM_HIGH) - ++y; + ++y; return y; } @@ -145,7 +145,7 @@ public: AlphaDAGToDAGISel(TargetMachine &TM) : SelectionDAGISel(AlphaLowering), - AlphaLowering(*(AlphaTargetLowering*)(TM.getTargetLowering())) + AlphaLowering(*(AlphaTargetLowering*)(TM.getTargetLowering())) {} /// getI64Imm - Return a target constant with the specified value, of type @@ -177,7 +177,7 @@ default: return true; case 'm': // memory Op0 = Op; - AddToISelQueue(Op0); + AddToISelQueue(Op0); break; } @@ -203,7 +203,7 @@ MachineFunction* MF = BB->getParent(); unsigned GP = 0; for(MachineFunction::livein_iterator ii = MF->livein_begin(), - ee = MF->livein_end(); ii != ee; ++ii) + ee = MF->livein_end(); ii != ee; ++ii) if (ii->first == Alpha::R29) { GP = ii->second; break; @@ -219,7 +219,7 @@ MachineFunction* MF = BB->getParent(); unsigned RA = 0; for(MachineFunction::livein_iterator ii = MF->livein_begin(), - ee = MF->livein_end(); ii != ee; ++ii) + ee = MF->livein_end(); ii != ee; ++ii) if (ii->first == Alpha::R26) { RA = ii->second; break; @@ -283,16 +283,16 @@ AddToISelQueue(N1); AddToISelQueue(N2); Chain = CurDAG->getCopyToReg(Chain, Alpha::R24, N1, - SDOperand(0,0)); + SDOperand(0,0)); Chain = CurDAG->getCopyToReg(Chain, Alpha::R25, N2, - Chain.getValue(1)); + Chain.getValue(1)); Chain = CurDAG->getCopyToReg(Chain, Alpha::R27, N0, - Chain.getValue(1)); + Chain.getValue(1)); SDNode *CNode = CurDAG->getTargetNode(Alpha::JSRs, MVT::Other, MVT::Flag, Chain, Chain.getValue(1)); Chain = CurDAG->getCopyFromReg(Chain, Alpha::R27, MVT::i64, - SDOperand(CNode, 1)); + SDOperand(CNode, 1)); return CurDAG->SelectNodeTo(N, Alpha::BISr, MVT::i64, Chain, Chain); } @@ -316,11 +316,11 @@ int64_t val = (int64_t)uval; int32_t val32 = (int32_t)val; if (val <= IMM_HIGH + IMM_HIGH * IMM_MULT && - val >= IMM_LOW + IMM_LOW * IMM_MULT) + val >= IMM_LOW + IMM_LOW * IMM_MULT) break; //(LDAH (LDA)) if ((uval >> 32) == 0 && //empty upper bits - val32 <= IMM_HIGH + IMM_HIGH * IMM_MULT) - // val32 >= IMM_LOW + IMM_LOW * IMM_MULT) //always true + val32 <= IMM_HIGH + IMM_HIGH * IMM_MULT) + // val32 >= IMM_LOW + IMM_LOW * IMM_MULT) //always true break; //(zext (LDAH (LDA))) //Else use the constant pool ConstantInt *C = ConstantInt::get(Type::Int64Ty, uval); @@ -328,7 +328,7 @@ SDNode *Tmp = CurDAG->getTargetNode(Alpha::LDAHr, MVT::i64, CPI, getGlobalBaseReg()); return CurDAG->SelectNodeTo(N, Alpha::LDQr, MVT::i64, MVT::Other, - CPI, SDOperand(Tmp, 0), CurDAG->getEntryNode()); + CPI, SDOperand(Tmp, 0), CurDAG->getEntryNode()); } case ISD::TargetConstantFP: { ConstantFPSDNode *CN = cast(N); @@ -358,21 +358,21 @@ switch(CC) { default: DEBUG(N->dump()); assert(0 && "Unknown FP comparison!"); case ISD::SETEQ: case ISD::SETOEQ: case ISD::SETUEQ: - Opc = Alpha::CMPTEQ; break; + Opc = Alpha::CMPTEQ; break; case ISD::SETLT: case ISD::SETOLT: case ISD::SETULT: - Opc = Alpha::CMPTLT; break; + Opc = Alpha::CMPTLT; break; case ISD::SETLE: case ISD::SETOLE: case ISD::SETULE: - Opc = Alpha::CMPTLE; break; + Opc = Alpha::CMPTLE; break; case ISD::SETGT: case ISD::SETOGT: case ISD::SETUGT: - Opc = Alpha::CMPTLT; rev = true; break; + Opc = Alpha::CMPTLT; rev = true; break; case ISD::SETGE: case ISD::SETOGE: case ISD::SETUGE: - Opc = Alpha::CMPTLE; rev = true; break; + Opc = Alpha::CMPTLE; rev = true; break; case ISD::SETNE: case ISD::SETONE: case ISD::SETUNE: - Opc = Alpha::CMPTEQ; inv = true; break; + Opc = Alpha::CMPTEQ; inv = true; break; case ISD::SETO: - Opc = Alpha::CMPTUN; inv = true; break; + Opc = Alpha::CMPTUN; inv = true; break; case ISD::SETUO: - Opc = Alpha::CMPTUN; break; + Opc = Alpha::CMPTUN; break; }; SDOperand tmp1 = N->getOperand(rev?1:0); SDOperand tmp2 = N->getOperand(rev?0:1); @@ -385,12 +385,13 @@ switch(CC) { case ISD::SETUEQ: case ISD::SETULT: case ISD::SETULE: case ISD::SETUNE: case ISD::SETUGT: case ISD::SETUGE: - { - SDNode* cmp2 = CurDAG->getTargetNode(Alpha::CMPTUN, MVT::f64, tmp1, tmp2); - cmp = CurDAG->getTargetNode(Alpha::ADDT, MVT::f64, - SDOperand(cmp2, 0), SDOperand(cmp, 0)); - break; - } + { + SDNode* cmp2 = CurDAG->getTargetNode(Alpha::CMPTUN, MVT::f64, + tmp1, tmp2); + cmp = CurDAG->getTargetNode(Alpha::ADDT, MVT::f64, + SDOperand(cmp2, 0), SDOperand(cmp, 0)); + break; + } default: break; } @@ -403,8 +404,8 @@ case ISD::SELECT: if (MVT::isFloatingPoint(N->getValueType(0)) && - (N->getOperand(0).getOpcode() != ISD::SETCC || - !MVT::isFloatingPoint(N->getOperand(0).getOperand(1).getValueType()))) { + (N->getOperand(0).getOpcode() != ISD::SETCC || + !MVT::isFloatingPoint(N->getOperand(0).getOperand(1).getValueType()))) { //This should be the condition not covered by the Patterns //FIXME: Don't have SelectCode die, but rather return something testable // so that things like this can be caught in fall though code @@ -427,32 +428,31 @@ ConstantSDNode* SC = NULL; ConstantSDNode* MC = NULL; if (N->getOperand(0).getOpcode() == ISD::SRL && - (MC = dyn_cast(N->getOperand(1))) && - (SC = dyn_cast(N->getOperand(0).getOperand(1)))) - { - uint64_t sval = SC->getValue(); - uint64_t mval = MC->getValue(); - // If the result is a zap, let the autogened stuff handle it. - if (get_zapImm(N->getOperand(0), mval)) - break; - // given mask X, and shift S, we want to see if there is any zap in the - // mask if we play around with the botton S bits - uint64_t dontcare = (~0ULL) >> (64 - sval); - uint64_t mask = mval << sval; - - if (get_zapImm(mask | dontcare)) - mask = mask | dontcare; - - if (get_zapImm(mask)) { - AddToISelQueue(N->getOperand(0).getOperand(0)); - SDOperand Z = - SDOperand(CurDAG->getTargetNode(Alpha::ZAPNOTi, MVT::i64, - N->getOperand(0).getOperand(0), - getI64Imm(get_zapImm(mask))), 0); - return CurDAG->getTargetNode(Alpha::SRLr, MVT::i64, Z, - getI64Imm(sval)); - } + (MC = dyn_cast(N->getOperand(1))) && + (SC = dyn_cast(N->getOperand(0).getOperand(1)))) { + uint64_t sval = SC->getValue(); + uint64_t mval = MC->getValue(); + // If the result is a zap, let the autogened stuff handle it. + if (get_zapImm(N->getOperand(0), mval)) + break; + // given mask X, and shift S, we want to see if there is any zap in the + // mask if we play around with the botton S bits + uint64_t dontcare = (~0ULL) >> (64 - sval); + uint64_t mask = mval << sval; + + if (get_zapImm(mask | dontcare)) + mask = mask | dontcare; + + if (get_zapImm(mask)) { + AddToISelQueue(N->getOperand(0).getOperand(0)); + SDOperand Z = + SDOperand(CurDAG->getTargetNode(Alpha::ZAPNOTi, MVT::i64, + N->getOperand(0).getOperand(0), + getI64Imm(get_zapImm(mask))), 0); + return CurDAG->getTargetNode(Alpha::SRLr, MVT::i64, Z, + getI64Imm(sval)); } + } break; } Index: llvm/lib/Target/Alpha/AlphaISelLowering.cpp diff -u llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.85 llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.86 --- llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.85 Sat Mar 24 21:14:49 2007 +++ llvm/lib/Target/Alpha/AlphaISelLowering.cpp Mon Apr 16 13:10:22 2007 @@ -172,7 +172,7 @@ SDOperand Zero = DAG.getConstant(0, PtrVT); SDOperand Hi = DAG.getNode(AlphaISD::GPRelHi, MVT::i64, JTI, - DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64)); + DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64)); SDOperand Lo = DAG.getNode(AlphaISD::GPRelLo, MVT::i64, JTI, Hi); return Lo; } @@ -197,8 +197,8 @@ // //#define SP $30 static SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG, - int &VarArgsBase, - int &VarArgsOffset) { + int &VarArgsBase, + int &VarArgsOffset) { MachineFunction &MF = DAG.getMachineFunction(); MachineFrameInfo *MFI = MF.getFrameInfo(); std::vector ArgValues; @@ -224,17 +224,17 @@ abort(); case MVT::f64: args_float[ArgNo] = AddLiveIn(MF, args_float[ArgNo], - &Alpha::F8RCRegClass); + &Alpha::F8RCRegClass); ArgVal = DAG.getCopyFromReg(Root, args_float[ArgNo], ObjectVT); break; case MVT::f32: args_float[ArgNo] = AddLiveIn(MF, args_float[ArgNo], - &Alpha::F4RCRegClass); + &Alpha::F4RCRegClass); ArgVal = DAG.getCopyFromReg(Root, args_float[ArgNo], ObjectVT); break; case MVT::i64: args_int[ArgNo] = AddLiveIn(MF, args_int[ArgNo], - &Alpha::GPRCRegClass); + &Alpha::GPRCRegClass); ArgVal = DAG.getCopyFromReg(Root, args_int[ArgNo], MVT::i64); break; } @@ -286,9 +286,9 @@ static SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG) { SDOperand Copy = DAG.getCopyToReg(Op.getOperand(0), Alpha::R26, - DAG.getNode(AlphaISD::GlobalRetAddr, - MVT::i64), - SDOperand()); + DAG.getNode(AlphaISD::GlobalRetAddr, + MVT::i64), + SDOperand()); switch (Op.getNumOperands()) { default: assert(0 && "Do not know how to return this many arguments!"); @@ -306,7 +306,7 @@ ArgReg = Alpha::F0; } Copy = DAG.getCopyToReg(Copy, ArgReg, Op.getOperand(1), Copy.getValue(1)); - if(DAG.getMachineFunction().liveout_empty()) + if (DAG.getMachineFunction().liveout_empty()) DAG.getMachineFunction().addLiveOut(ArgReg); break; } @@ -387,8 +387,8 @@ switch (Op.getOpcode()) { default: assert(0 && "Wasn't expecting to be able to lower this!"); case ISD::FORMAL_ARGUMENTS: return LowerFORMAL_ARGUMENTS(Op, DAG, - VarArgsBase, - VarArgsOffset); + VarArgsBase, + VarArgsOffset); case ISD::RET: return LowerRET(Op,DAG); case ISD::JumpTable: return LowerJumpTable(Op, DAG); @@ -420,7 +420,7 @@ SDOperand CPI = DAG.getTargetConstantPool(C, MVT::i64, CP->getAlignment()); SDOperand Hi = DAG.getNode(AlphaISD::GPRelHi, MVT::i64, CPI, - DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64)); + DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64)); SDOperand Lo = DAG.getNode(AlphaISD::GPRelLo, MVT::i64, CPI, Hi); return Lo; } @@ -432,18 +432,18 @@ // if (!GV->hasWeakLinkage() && !GV->isDeclaration() && !GV->hasLinkOnceLinkage()) { if (GV->hasInternalLinkage()) { SDOperand Hi = DAG.getNode(AlphaISD::GPRelHi, MVT::i64, GA, - DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64)); + DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64)); SDOperand Lo = DAG.getNode(AlphaISD::GPRelLo, MVT::i64, GA, Hi); return Lo; } else return DAG.getNode(AlphaISD::RelLit, MVT::i64, GA, - DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64)); + DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64)); } case ISD::ExternalSymbol: { return DAG.getNode(AlphaISD::RelLit, MVT::i64, - DAG.getTargetExternalSymbol(cast(Op) - ->getSymbol(), MVT::i64), - DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64)); + DAG.getTargetExternalSymbol(cast(Op) + ->getSymbol(), MVT::i64), + DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64)); } case ISD::UREM: @@ -452,8 +452,8 @@ if (Op.getOperand(1).getOpcode() == ISD::Constant) { MVT::ValueType VT = Op.Val->getValueType(0); SDOperand Tmp1 = Op.Val->getOpcode() == ISD::UREM ? - BuildUDIV(Op.Val, DAG, NULL) : - BuildSDIV(Op.Val, DAG, NULL); + BuildUDIV(Op.Val, DAG, NULL) : + BuildSDIV(Op.Val, DAG, NULL); Tmp1 = DAG.getNode(ISD::MUL, VT, Tmp1, Op.getOperand(1)); Tmp1 = DAG.getNode(ISD::SUB, VT, Op.getOperand(0), Tmp1); return Tmp1; @@ -463,10 +463,10 @@ case ISD::UDIV: if (MVT::isInteger(Op.getValueType())) { if (Op.getOperand(1).getOpcode() == ISD::Constant) - return Op.getOpcode() == ISD::SDIV ? BuildSDIV(Op.Val, DAG, NULL) - : BuildUDIV(Op.Val, DAG, NULL); + return Op.getOpcode() == ISD::SDIV ? BuildSDIV(Op.Val, DAG, NULL) + : BuildUDIV(Op.Val, DAG, NULL); const char* opstr = 0; - switch(Op.getOpcode()) { + switch (Op.getOpcode()) { case ISD::UREM: opstr = "__remqu"; break; case ISD::SREM: opstr = "__remq"; break; case ISD::UDIV: opstr = "__divqu"; break; @@ -591,29 +591,28 @@ default: break; // Unknown constriant letter case 'f': return make_vector(Alpha::F0 , Alpha::F1 , Alpha::F2 , - Alpha::F3 , Alpha::F4 , Alpha::F5 , - Alpha::F6 , Alpha::F7 , Alpha::F8 , - Alpha::F9 , Alpha::F10, Alpha::F11, + Alpha::F3 , Alpha::F4 , Alpha::F5 , + Alpha::F6 , Alpha::F7 , Alpha::F8 , + Alpha::F9 , Alpha::F10, Alpha::F11, Alpha::F12, Alpha::F13, Alpha::F14, - Alpha::F15, Alpha::F16, Alpha::F17, - Alpha::F18, Alpha::F19, Alpha::F20, - Alpha::F21, Alpha::F22, Alpha::F23, + Alpha::F15, Alpha::F16, Alpha::F17, + Alpha::F18, Alpha::F19, Alpha::F20, + Alpha::F21, Alpha::F22, Alpha::F23, Alpha::F24, Alpha::F25, Alpha::F26, - Alpha::F27, Alpha::F28, Alpha::F29, - Alpha::F30, Alpha::F31, 0); + Alpha::F27, Alpha::F28, Alpha::F29, + Alpha::F30, Alpha::F31, 0); case 'r': return make_vector(Alpha::R0 , Alpha::R1 , Alpha::R2 , - Alpha::R3 , Alpha::R4 , Alpha::R5 , - Alpha::R6 , Alpha::R7 , Alpha::R8 , - Alpha::R9 , Alpha::R10, Alpha::R11, + Alpha::R3 , Alpha::R4 , Alpha::R5 , + Alpha::R6 , Alpha::R7 , Alpha::R8 , + Alpha::R9 , Alpha::R10, Alpha::R11, Alpha::R12, Alpha::R13, Alpha::R14, - Alpha::R15, Alpha::R16, Alpha::R17, - Alpha::R18, Alpha::R19, Alpha::R20, - Alpha::R21, Alpha::R22, Alpha::R23, + Alpha::R15, Alpha::R16, Alpha::R17, + Alpha::R18, Alpha::R19, Alpha::R20, + Alpha::R21, Alpha::R22, Alpha::R23, Alpha::R24, Alpha::R25, Alpha::R26, - Alpha::R27, Alpha::R28, Alpha::R29, - Alpha::R30, Alpha::R31, 0); - + Alpha::R27, Alpha::R28, Alpha::R29, + Alpha::R30, Alpha::R31, 0); } } Index: llvm/lib/Target/Alpha/AlphaLLRP.cpp diff -u llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.7 llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.8 --- llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.7 Tue Dec 19 16:59:25 2006 +++ llvm/lib/Target/Alpha/AlphaLLRP.cpp Mon Apr 16 13:10:22 2007 @@ -50,101 +50,104 @@ unsigned count = 0; for (MachineFunction::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) { - MachineBasicBlock& MBB = *FI; - bool ub = false; - for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ) { - if (count%4 == 0) - prev[0] = prev[1] = prev[2] = 0; //Slots cleared at fetch boundary - ++count; - MachineInstr *MI = I++; - switch (MI->getOpcode()) { - case Alpha::LDQ: case Alpha::LDL: - case Alpha::LDWU: case Alpha::LDBU: - case Alpha::LDT: case Alpha::LDS: - case Alpha::STQ: case Alpha::STL: - case Alpha::STW: case Alpha::STB: - case Alpha::STT: case Alpha::STS: - if (MI->getOperand(2).getReg() == Alpha::R30) { - if (prev[0] - && prev[0]->getOperand(2).getReg() == - MI->getOperand(2).getReg() - && prev[0]->getOperand(1).getImmedValue() == - MI->getOperand(1).getImmedValue()) { - prev[0] = prev[1]; - prev[1] = prev[2]; - prev[2] = 0; - BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31) - .addReg(Alpha::R31); - Changed = true; nopintro += 1; - count += 1; - } else if (prev[1] - && prev[1]->getOperand(2).getReg() == - MI->getOperand(2).getReg() - && prev[1]->getOperand(1).getImmedValue() == - MI->getOperand(1).getImmedValue()) { - prev[0] = prev[2]; - prev[1] = prev[2] = 0; - BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31) - .addReg(Alpha::R31); - BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31) - .addReg(Alpha::R31); - Changed = true; nopintro += 2; - count += 2; - } else if (prev[2] - && prev[2]->getOperand(2).getReg() == - MI->getOperand(2).getReg() - && prev[2]->getOperand(1).getImmedValue() == - MI->getOperand(1).getImmedValue()) { - prev[0] = prev[1] = prev[2] = 0; - BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31) - .addReg(Alpha::R31); - BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31) - .addReg(Alpha::R31); - BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31) - .addReg(Alpha::R31); - Changed = true; nopintro += 3; - count += 3; - } - prev[0] = prev[1]; - prev[1] = prev[2]; - prev[2] = MI; - break; - } - prev[0] = prev[1]; - prev[1] = prev[2]; - prev[2] = 0; - break; - case Alpha::ALTENT: - case Alpha::MEMLABEL: - case Alpha::PCLABEL: - case Alpha::IDEF_I: - case Alpha::IDEF_F32: - case Alpha::IDEF_F64: - --count; - break; - case Alpha::BR: - case Alpha::JMP: - ub = true; - //fall through - default: - prev[0] = prev[1]; - prev[1] = prev[2]; - prev[2] = 0; - break; - } + MachineBasicBlock& MBB = *FI; + bool ub = false; + for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ) { + if (count%4 == 0) + prev[0] = prev[1] = prev[2] = 0; //Slots cleared at fetch boundary + ++count; + MachineInstr *MI = I++; + switch (MI->getOpcode()) { + case Alpha::LDQ: case Alpha::LDL: + case Alpha::LDWU: case Alpha::LDBU: + case Alpha::LDT: case Alpha::LDS: + case Alpha::STQ: case Alpha::STL: + case Alpha::STW: case Alpha::STB: + case Alpha::STT: case Alpha::STS: + if (MI->getOperand(2).getReg() == Alpha::R30) { + if (prev[0] + && prev[0]->getOperand(2).getReg() == + MI->getOperand(2).getReg() + && prev[0]->getOperand(1).getImmedValue() == + MI->getOperand(1).getImmedValue()) { + prev[0] = prev[1]; + prev[1] = prev[2]; + prev[2] = 0; + BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31) + .addReg(Alpha::R31) + .addReg(Alpha::R31); + Changed = true; nopintro += 1; + count += 1; + } else if (prev[1] + && prev[1]->getOperand(2).getReg() == + MI->getOperand(2).getReg() + && prev[1]->getOperand(1).getImmedValue() == + MI->getOperand(1).getImmedValue()) { + prev[0] = prev[2]; + prev[1] = prev[2] = 0; + BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31) + .addReg(Alpha::R31) + .addReg(Alpha::R31); + BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31) + .addReg(Alpha::R31) + .addReg(Alpha::R31); + Changed = true; nopintro += 2; + count += 2; + } else if (prev[2] + && prev[2]->getOperand(2).getReg() == + MI->getOperand(2).getReg() + && prev[2]->getOperand(1).getImmedValue() == + MI->getOperand(1).getImmedValue()) { + prev[0] = prev[1] = prev[2] = 0; + BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31) + .addReg(Alpha::R31); + BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31) + .addReg(Alpha::R31); + BuildMI(MBB, MI, TII->get(Alpha::BISr), Alpha::R31).addReg(Alpha::R31) + .addReg(Alpha::R31); + Changed = true; nopintro += 3; + count += 3; + } + prev[0] = prev[1]; + prev[1] = prev[2]; + prev[2] = MI; + break; + } + prev[0] = prev[1]; + prev[1] = prev[2]; + prev[2] = 0; + break; + case Alpha::ALTENT: + case Alpha::MEMLABEL: + case Alpha::PCLABEL: + case Alpha::IDEF_I: + case Alpha::IDEF_F32: + case Alpha::IDEF_F64: + --count; + break; + case Alpha::BR: + case Alpha::JMP: + ub = true; + //fall through + default: + prev[0] = prev[1]; + prev[1] = prev[2]; + prev[2] = 0; + break; } - if (ub || AlignAll) { - //we can align stuff for free at this point - while (count % 4) { - BuildMI(MBB, MBB.end(), TII->get(Alpha::BISr), Alpha::R31) - .addReg(Alpha::R31).addReg(Alpha::R31); - ++count; - ++nopalign; - prev[0] = prev[1]; - prev[1] = prev[2]; - prev[2] = 0; - } + } + if (ub || AlignAll) { + //we can align stuff for free at this point + while (count % 4) { + BuildMI(MBB, MBB.end(), TII->get(Alpha::BISr), Alpha::R31) + .addReg(Alpha::R31).addReg(Alpha::R31); + ++count; + ++nopalign; + prev[0] = prev[1]; + prev[1] = prev[2]; + prev[2] = 0; } + } } return Changed; } Index: llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp diff -u llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.64 llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.65 --- llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.64 Tue Mar 20 03:07:46 2007 +++ llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp Mon Apr 16 13:10:22 2007 @@ -117,17 +117,17 @@ case Alpha::CPYST: if (MI->getOperand(1).getReg() == MI->getOperand(2).getReg()) { if (OpNum == 0) { // move -> store - unsigned InReg = MI->getOperand(1).getReg(); - Opc = (Opc == Alpha::BISr) ? Alpha::STQ : - ((Opc == Alpha::CPYSS) ? Alpha::STS : Alpha::STT); - NewMI = BuildMI(TII.get(Opc)).addReg(InReg).addFrameIndex(FrameIndex) - .addReg(Alpha::F31); + unsigned InReg = MI->getOperand(1).getReg(); + Opc = (Opc == Alpha::BISr) ? Alpha::STQ : + ((Opc == Alpha::CPYSS) ? Alpha::STS : Alpha::STT); + NewMI = BuildMI(TII.get(Opc)).addReg(InReg).addFrameIndex(FrameIndex) + .addReg(Alpha::F31); } else { // load -> move - unsigned OutReg = MI->getOperand(0).getReg(); - Opc = (Opc == Alpha::BISr) ? Alpha::LDQ : - ((Opc == Alpha::CPYSS) ? Alpha::LDS : Alpha::LDT); - NewMI = BuildMI(TII.get(Opc), OutReg).addFrameIndex(FrameIndex) - .addReg(Alpha::F31); + unsigned OutReg = MI->getOperand(0).getReg(); + Opc = (Opc == Alpha::BISr) ? Alpha::LDQ : + ((Opc == Alpha::CPYSS) ? Alpha::LDS : Alpha::LDT); + NewMI = BuildMI(TII.get(Opc), OutReg).addFrameIndex(FrameIndex) + .addReg(Alpha::F31); } } break; From asl at math.spbu.ru Mon Apr 16 13:11:44 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/IndMemRemoval.cpp Internalize.cpp Message-ID: <200704161811.l3GIBiuJ011542@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: IndMemRemoval.cpp updated: 1.14 -> 1.15 Internalize.cpp updated: 1.44 -> 1.45 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+5 -5) IndMemRemoval.cpp | 8 ++++---- Internalize.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/Transforms/IPO/IndMemRemoval.cpp diff -u llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.14 llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.15 --- llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.14 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/IPO/IndMemRemoval.cpp Mon Apr 16 13:10:23 2007 @@ -49,8 +49,8 @@ assert(F->isDeclaration() && "free not external?"); if (!F->use_empty()) { Function* FN = new Function(F->getFunctionType(), - GlobalValue::LinkOnceLinkage, - "free_llvm_bounce", &M); + GlobalValue::LinkOnceLinkage, + "free_llvm_bounce", &M); BasicBlock* bb = new BasicBlock("entry",FN); Instruction* R = new ReturnInst(bb); new FreeInst(FN->arg_begin(), R); @@ -64,8 +64,8 @@ assert(F->isDeclaration() && "malloc not external?"); if (!F->use_empty()) { Function* FN = new Function(F->getFunctionType(), - GlobalValue::LinkOnceLinkage, - "malloc_llvm_bounce", &M); + GlobalValue::LinkOnceLinkage, + "malloc_llvm_bounce", &M); BasicBlock* bb = new BasicBlock("entry",FN); Instruction* c = CastInst::createIntegerCast( FN->arg_begin(), Type::Int32Ty, false, "c", bb); Index: llvm/lib/Transforms/IPO/Internalize.cpp diff -u llvm/lib/Transforms/IPO/Internalize.cpp:1.44 llvm/lib/Transforms/IPO/Internalize.cpp:1.45 --- llvm/lib/Transforms/IPO/Internalize.cpp:1.44 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/IPO/Internalize.cpp Mon Apr 16 13:10:23 2007 @@ -68,7 +68,7 @@ InternalizePass::InternalizePass(const std::vector&exportList) : DontInternalize(false){ for(std::vector::const_iterator itr = exportList.begin(); - itr != exportList.end(); itr++) { + itr != exportList.end(); itr++) { ExternalNames.insert(*itr); } } From asl at math.spbu.ru Mon Apr 16 13:11:44 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp Message-ID: <200704161811.l3GIBiJk011568@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation: RSProfiling.cpp updated: 1.20 -> 1.21 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+19 -18) RSProfiling.cpp | 37 +++++++++++++++++++------------------ 1 files changed, 19 insertions(+), 18 deletions(-) Index: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.20 llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.21 --- llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.20 Mon Feb 19 01:34:47 2007 +++ llvm/lib/Transforms/Instrumentation/RSProfiling.cpp Mon Apr 16 13:10:23 2007 @@ -60,7 +60,7 @@ cl::values( clEnumValN(GBV, "global", "global counter"), clEnumValN(GBVO, "ra_global", - "register allocated global counter"), + "register allocated global counter"), clEnumValN(HOSTCC, "rdcc", "cycle counter"), clEnumValEnd)); @@ -82,7 +82,7 @@ static RegisterAnalysisGroup A("Profiling passes"); static RegisterPass NP("insert-null-profiling-rs", - "Measure profiling framework overhead"); + "Measure profiling framework overhead"); static RegisterAnalysisGroup NPT(NP); /// Chooser - Something that chooses when to make a sample of the profiled code @@ -155,7 +155,7 @@ }; RegisterPass X("insert-rs-profiling-framework", - "Insert random sampling instrumentation framework"); + "Insert random sampling instrumentation framework"); } //Local utilities @@ -202,14 +202,14 @@ "countercc", t); Value* nv = BinaryOperator::createSub(l, ConstantInt::get(T, 1), - "counternew", t); + "counternew", t); new StoreInst(nv, Counter, t); t->setCondition(s); //reset counter BasicBlock* oldnext = t->getSuccessor(0); BasicBlock* resetblock = new BasicBlock("reset", oldnext->getParent(), - oldnext); + oldnext); TerminatorInst* t2 = new BranchInst(oldnext, resetblock); t->setSuccessor(0, resetblock); new StoreInst(ResetValue, Counter, t2); @@ -275,14 +275,14 @@ "countercc", t); Value* nv = BinaryOperator::createSub(l, ConstantInt::get(T, 1), - "counternew", t); + "counternew", t); new StoreInst(nv, AI, t); t->setCondition(s); //reset counter BasicBlock* oldnext = t->getSuccessor(0); BasicBlock* resetblock = new BasicBlock("reset", oldnext->getParent(), - oldnext); + oldnext); TerminatorInst* t2 = new BranchInst(oldnext, resetblock); t->setSuccessor(0, resetblock); new StoreInst(ResetValue, AI, t2); @@ -304,7 +304,7 @@ CallInst* c = new CallInst(F, "rdcc", t); BinaryOperator* b = BinaryOperator::createAnd(c, ConstantInt::get(Type::Int64Ty, rm), - "mrdcc", t); + "mrdcc", t); ICmpInst *s = new ICmpInst(ICmpInst::ICMP_EQ, b, ConstantInt::get(Type::Int64Ty, 0), @@ -342,8 +342,8 @@ Value *OldVal = new LoadInst(ElementPtr, "OldCounter", InsertPos); profcode.insert(OldVal); Value *NewVal = BinaryOperator::createAdd(OldVal, - ConstantInt::get(Type::Int32Ty, 1), - "NewCounter", InsertPos); + ConstantInt::get(Type::Int32Ty, 1), + "NewCounter", InsertPos); profcode.insert(NewVal); profcode.insert(new StoreInst(NewVal, ElementPtr, InsertPos)); } @@ -366,7 +366,7 @@ TransCache[bb] = bb; //don't translate entry block else TransCache[bb] = new BasicBlock("dup_" + bb->getName(), bb->getParent(), - NULL); + NULL); return TransCache[bb]; } else if (Instruction* i = dyn_cast(v)) { //we have already translated this @@ -462,7 +462,7 @@ //b: new BranchInst(cast(Translate(dst)), bbC); new BranchInst(dst, cast(Translate(dst)), - ConstantInt::get(Type::Int1Ty, true), bbCp); + ConstantInt::get(Type::Int1Ty, true), bbCp); //c: { TerminatorInst* iB = src->getTerminator(); @@ -484,7 +484,7 @@ CollapsePhi(dst, bbC); //f: ReplacePhiPred(cast(Translate(dst)), - cast(Translate(src)),bbCp); + cast(Translate(src)),bbCp); CollapsePhi(cast(Translate(dst)), bbCp); //g: for(BasicBlock::iterator ib = dst->begin(), ie = dst->end(); ib != ie; @@ -494,7 +494,7 @@ if(bbC == phi->getIncomingBlock(x)) { phi->addIncoming(Translate(phi->getIncomingValue(x)), bbCp); cast(Translate(phi))->addIncoming(phi->getIncomingValue(x), - bbC); + bbC); } phi->removeIncomingValue(bbC); } @@ -510,15 +510,16 @@ //assume that stuff worked. now connect the duplicated basic blocks //with the originals in such a way as to preserve ssa. yuk! for (std::set >::iterator - ib = BackEdges.begin(), ie = BackEdges.end(); ib != ie; ++ib) + ib = BackEdges.begin(), ie = BackEdges.end(); ib != ie; ++ib) ProcessBackEdge(ib->first, ib->second, F); //oh, and add the edge from the reg2mem created entry node to the //duplicated second node TerminatorInst* T = F.getEntryBlock().getTerminator(); ReplaceInstWithInst(T, new BranchInst(T->getSuccessor(0), - cast(Translate(T->getSuccessor(0))), - ConstantInt::get(Type::Int1Ty, true))); + cast( + Translate(T->getSuccessor(0))), + ConstantInt::get(Type::Int1Ty, true))); //do whatever is needed now that the function is duplicated c->PrepFunction(&F); @@ -527,7 +528,7 @@ ChoicePoints.insert(&F.getEntryBlock()); for (std::set::iterator - ii = ChoicePoints.begin(), ie = ChoicePoints.end(); ii != ie; ++ii) + ii = ChoicePoints.begin(), ie = ChoicePoints.end(); ii != ie; ++ii) c->ProcessChoicePoint(*ii); ChoicePoints.clear(); From asl at math.spbu.ru Mon Apr 16 13:11:43 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Message-ID: <200704161811.l3GIBhI2011523@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: CallGraphSCCPass.cpp updated: 1.20 -> 1.21 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+11 -12) CallGraphSCCPass.cpp | 23 +++++++++++------------ 1 files changed, 11 insertions(+), 12 deletions(-) Index: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp diff -u llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.20 llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.21 --- llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.20 Mon Mar 5 14:01:30 2007 +++ llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Mon Apr 16 13:10:22 2007 @@ -82,8 +82,7 @@ I != E; ++I) { // Run all passes on current SCC - for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { - + for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { Pass *P = getContainedPass(Index); AnalysisUsage AnUsage; P->getAnalysisUsage(AnUsage); @@ -95,20 +94,20 @@ StartPassTimer(P); if (CallGraphSCCPass *CGSP = dynamic_cast(P)) - Changed |= CGSP->runOnSCC(*I); // TODO : What if CG is changed ? + Changed |= CGSP->runOnSCC(*I); // TODO : What if CG is changed ? else { - FPPassManager *FPP = dynamic_cast(P); - assert (FPP && "Invalid CGPassManager member"); + FPPassManager *FPP = dynamic_cast(P); + assert (FPP && "Invalid CGPassManager member"); - // Run pass P on all functions current SCC - std::vector &SCC = *I; - for (unsigned i = 0, e = SCC.size(); i != e; ++i) { - Function *F = SCC[i]->getFunction(); - if (F) { + // Run pass P on all functions current SCC + std::vector &SCC = *I; + for (unsigned i = 0, e = SCC.size(); i != e; ++i) { + Function *F = SCC[i]->getFunction(); + if (F) { dumpPassInfo(P, EXECUTION_MSG, ON_FUNCTION_MSG, F->getName()); Changed |= FPP->runOnFunction(*F); } - } + } } StopPassTimer(P); @@ -149,7 +148,7 @@ /// Assign pass manager to manage this pass. void CallGraphSCCPass::assignPassManager(PMStack &PMS, - PassManagerType PreferredType) { + PassManagerType PreferredType) { // Find CGPassManager while (!PMS.empty()) { if (PMS.top()->getPassManagerType() > PMT_CallGraphPassManager) From asl at math.spbu.ru Mon Apr 16 13:11:43 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:43 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200704161811.l3GIBhV1011528@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.431 -> 1.432 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+3 -1) Makefile.rules | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.431 llvm/Makefile.rules:1.432 --- llvm/Makefile.rules:1.431 Sat Apr 14 18:35:45 2007 +++ llvm/Makefile.rules Mon Apr 16 13:10:22 2007 @@ -1726,8 +1726,10 @@ endif check-line-length: - @egrep '.{81}' $(Sources) + @egrep -n '.{81}' $(Sources) +check-for-tabs: + @egrep -n ' ' $(Sources) #------------------------------------------------------------------------ # Print out the directories used for building #------------------------------------------------------------------------ From asl at math.spbu.ru Mon Apr 16 13:11:44 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86CodeEmitter.cpp X86ISelLowering.cpp Message-ID: <200704161811.l3GIBixU011535@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86CodeEmitter.cpp updated: 1.132 -> 1.133 X86ISelLowering.cpp updated: 1.389 -> 1.390 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+9 -9) X86CodeEmitter.cpp | 14 +++++++------- X86ISelLowering.cpp | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.132 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.133 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.132 Tue Apr 10 17:10:25 2007 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Mon Apr 16 13:10:23 2007 @@ -487,13 +487,13 @@ for (unsigned e = NumOps; i != e; ++i) { const MachineOperand& MO = MI.getOperand(i); if (MO.isRegister()) { - unsigned Reg = MO.getReg(); - // Trunc to byte are actually movb. The real source operand is the low - // byte of the register. - if (isTrunc8 && i == 1) - Reg = getX86SubSuperRegister(Reg, MVT::i8); - if (isX86_64NonExtLowByteReg(Reg)) - REX |= 0x40; + unsigned Reg = MO.getReg(); + // Trunc to byte are actually movb. The real source operand is the low + // byte of the register. + if (isTrunc8 && i == 1) + Reg = getX86SubSuperRegister(Reg, MVT::i8); + if (isX86_64NonExtLowByteReg(Reg)) + REX |= 0x40; } } Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.389 llvm/lib/Target/X86/X86ISelLowering.cpp:1.390 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.389 Wed Apr 11 23:14:49 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Mon Apr 16 13:10:23 2007 @@ -1345,8 +1345,8 @@ // We should use extra load for direct calls to dllimported functions in // non-JIT mode. if (getTargetMachine().getCodeModel() != CodeModel::Large - && !Subtarget->GVRequiresExtraLoad(G->getGlobal(), - getTargetMachine(), true)) + && !Subtarget->GVRequiresExtraLoad(G->getGlobal(), + getTargetMachine(), true)) Callee = DAG.getTargetGlobalAddress(G->getGlobal(), getPointerTy()); } else if (ExternalSymbolSDNode *S = dyn_cast(Callee)) if (getTargetMachine().getCodeModel() != CodeModel::Large) From asl at math.spbu.ru Mon Apr 16 13:11:44 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:44 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Dwarf.h MathExtras.h Message-ID: <200704161811.l3GIBi23011557@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Dwarf.h updated: 1.11 -> 1.12 MathExtras.h updated: 1.44 -> 1.45 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+3 -3) Dwarf.h | 2 +- MathExtras.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Support/Dwarf.h diff -u llvm/include/llvm/Support/Dwarf.h:1.11 llvm/include/llvm/Support/Dwarf.h:1.12 --- llvm/include/llvm/Support/Dwarf.h:1.11 Thu Feb 1 10:31:34 2007 +++ llvm/include/llvm/Support/Dwarf.h Mon Apr 16 13:10:22 2007 @@ -44,7 +44,7 @@ DW_TAG_user_base = 0x1000, // Recommended base for user tags. DW_CIE_VERSION = 1, // Common frame information version. - DW_CIE_ID = 0xffffffff // Common frame information mark. + DW_CIE_ID = 0xffffffff // Common frame information mark. }; enum dwarf_constants { Index: llvm/include/llvm/Support/MathExtras.h diff -u llvm/include/llvm/Support/MathExtras.h:1.44 llvm/include/llvm/Support/MathExtras.h:1.45 --- llvm/include/llvm/Support/MathExtras.h:1.44 Thu Mar 22 14:11:57 2007 +++ llvm/include/llvm/Support/MathExtras.h Mon Apr 16 13:10:22 2007 @@ -109,7 +109,7 @@ /// 32-bit argument, Value. inline uint32_t ByteSwap_32(uint32_t Value) { #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) - return __builtin_bswap32(Value); + return __builtin_bswap32(Value); #elif defined(_MSC_VER) && !defined(_DEBUG) return _byteswap_ulong(Value); #else @@ -125,7 +125,7 @@ /// 64-bit argument, Value. inline uint64_t ByteSwap_64(uint64_t Value) { #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) - return __builtin_bswap64(Value); + return __builtin_bswap64(Value); #elif defined(_MSC_VER) && !defined(_DEBUG) return _byteswap_uint64(Value); #else From asl at math.spbu.ru Mon Apr 16 13:11:44 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp TargetLowering.cpp Message-ID: <200704161811.l3GIBiSc011547@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: ScheduleDAGSimple.cpp updated: 1.25 -> 1.26 TargetLowering.cpp updated: 1.108 -> 1.109 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+23 -23) ScheduleDAGSimple.cpp | 42 +++++++++++++++++++++--------------------- TargetLowering.cpp | 4 ++-- 2 files changed, 23 insertions(+), 23 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.25 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.26 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.25 Sun Feb 4 02:47:20 2007 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp Mon Apr 16 13:10:22 2007 @@ -288,9 +288,9 @@ // Tally iterator /// SlotsAvailable - Returns true if all units are available. - /// + /// bool SlotsAvailable(Iter Begin, unsigned N, unsigned ResourceSet, - unsigned &Resource) { + unsigned &Resource) { assert(N && "Must check availability with N != 0"); // Determine end of interval Iter End = Begin + N; @@ -318,23 +318,23 @@ Resource = 0; return false; } - - /// RetrySlot - Finds a good candidate slot to retry search. + + /// RetrySlot - Finds a good candidate slot to retry search. Iter RetrySlot(Iter Begin, unsigned N, unsigned ResourceSet) { assert(N && "Must check availability with N != 0"); // Determine end of interval Iter End = Begin + N; assert(End <= Tally.end() && "Tally is not large enough for schedule"); - - while (Begin != End--) { - // Clear units in use - ResourceSet &= ~*End; - // If no units left then we should go no further - if (!ResourceSet) return End + 1; - } - // Made it all the way through - return Begin; - } + + while (Begin != End--) { + // Clear units in use + ResourceSet &= ~*End; + // If no units left then we should go no further + if (!ResourceSet) return End + 1; + } + // Made it all the way through + return Begin; + } /// FindAndReserveStages - Return true if the stages can be completed. If /// so mark as busy. @@ -391,13 +391,13 @@ // FindAndReserve - Locate an ideal slot for the specified stages and mark // as busy. unsigned FindAndReserve(unsigned Slot, InstrStage *StageBegin, - InstrStage *StageEnd) { - // Where to begin - Iter Begin = Tally.begin() + Slot; - // Find a free slot - Iter Where = FindSlots(Begin, StageBegin, StageEnd); - // Distance is slot number - unsigned Final = Where - Tally.begin(); + InstrStage *StageEnd) { + // Where to begin + Iter Begin = Tally.begin() + Slot; + // Find a free slot + Iter Where = FindSlots(Begin, StageBegin, StageEnd); + // Distance is slot number + unsigned Final = Where - Tally.begin(); return Final; } Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.108 llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.109 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.108 Wed Apr 11 23:44:28 2007 +++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon Apr 16 13:10:22 2007 @@ -2150,7 +2150,7 @@ /// multiplying by a magic number. See: /// SDOperand TargetLowering::BuildSDIV(SDNode *N, SelectionDAG &DAG, - std::vector* Created) const { + std::vector* Created) const { MVT::ValueType VT = N->getValueType(0); // Check to see if we can do this. @@ -2198,7 +2198,7 @@ /// multiplying by a magic number. See: /// SDOperand TargetLowering::BuildUDIV(SDNode *N, SelectionDAG &DAG, - std::vector* Created) const { + std::vector* Created) const { MVT::ValueType VT = N->getValueType(0); // Check to see if we can do this. From asl at math.spbu.ru Mon Apr 16 13:11:44 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 13:11:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrInfo.cpp ARMRegisterInfo.cpp Message-ID: <200704161811.l3GIBiYr011560@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMInstrInfo.cpp updated: 1.19 -> 1.20 ARMRegisterInfo.cpp updated: 1.85 -> 1.86 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+3 -3) ARMInstrInfo.cpp | 4 ++-- ARMRegisterInfo.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Target/ARM/ARMInstrInfo.cpp diff -u llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.19 llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.20 --- llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.19 Tue Apr 3 01:44:25 2007 +++ llvm/lib/Target/ARM/ARMInstrInfo.cpp Mon Apr 16 13:10:22 2007 @@ -53,8 +53,8 @@ case ARM::MOVr: case ARM::tMOVr: assert(MI.getNumOperands() == 2 && MI.getOperand(0).isRegister() && - MI.getOperand(1).isRegister() && - "Invalid ARM MOV instruction"); + MI.getOperand(1).isRegister() && + "Invalid ARM MOV instruction"); SrcReg = MI.getOperand(1).getReg(); DstReg = MI.getOperand(0).getReg(); return true; Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.85 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.86 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.85 Tue Apr 3 16:31:21 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Mon Apr 16 13:10:22 2007 @@ -1372,7 +1372,7 @@ } void ARMRegisterInfo::emitEpilogue(MachineFunction &MF, - MachineBasicBlock &MBB) const { + MachineBasicBlock &MBB) const { MachineBasicBlock::iterator MBBI = prior(MBB.end()); assert((MBBI->getOpcode() == ARM::BX_RET || MBBI->getOpcode() == ARM::tBX_RET || From dpatel at apple.com Mon Apr 16 13:11:24 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Mon, 16 Apr 2007 11:11:24 -0700 (PDT) Subject: [llvm-commits] [126202] Fix assertion that was off by one. Message-ID: <20070416181124.0EB5CEF60D15@src> Revision: 126202 Author: dpatel Date: 2007-04-16 11:11:23 -0700 (Mon, 16 Apr 2007) Log Message: ----------- Fix assertion that was off by one. Update comments. Patch by Duncan Sands. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-types.cpp Modified: apple-local/branches/llvm/gcc/llvm-types.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-types.cpp 2007-04-16 18:10:57 UTC (rev 126201) +++ apple-local/branches/llvm/gcc/llvm-types.cpp 2007-04-16 18:11:23 UTC (rev 126202) @@ -1256,14 +1256,12 @@ unsigned StartOffsetInBits = getFieldOffsetInBits(Field); unsigned EndBitOffset = FieldSizeInBits+StartOffsetInBits; - // If the last inserted LLVM field completely contains this bitfield, just + // If the last inserted LLVM field completely contains this bitfield, just // ignore this field. if (!Info.Elements.empty()) { - // If the last field does not completely contain *this* bitfield, extend - // it. unsigned LastFieldBitOffset = Info.ElementOffsetInBytes.back()*8; unsigned LastFieldBitSize = Info.ElementSizeInBytes.back()*8; - assert(LastFieldBitOffset < StartOffsetInBits && + assert(LastFieldBitOffset <= StartOffsetInBits && "This bitfield isn't part of the last field!"); if (EndBitOffset <= LastFieldBitOffset+LastFieldBitSize && LastFieldBitOffset+LastFieldBitSize >= StartOffsetInBits) { From dpatel at apple.com Mon Apr 16 13:13:49 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Mon, 16 Apr 2007 11:13:49 -0700 (PDT) Subject: [llvm-commits] [126204] Do not emit debug info for fields at variable offset, for now. Message-ID: <20070416181349.C1FE5EF61604@src> Revision: 126204 Author: dpatel Date: 2007-04-16 11:13:49 -0700 (Mon, 16 Apr 2007) Log Message: ----------- Do not emit debug info for fields at variable offset, for now. Patch by Duncan Sands. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-debug.cpp Modified: apple-local/branches/llvm/gcc/llvm-debug.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-debug.cpp 2007-04-16 18:12:08 UTC (rev 126203) +++ apple-local/branches/llvm/gcc/llvm-debug.cpp 2007-04-16 18:13:49 UTC (rev 126204) @@ -676,6 +676,10 @@ NULL; if (TREE_CODE(Member) == FIELD_DECL) { + if (TREE_CODE(DECL_FIELD_OFFSET(Member)) != INTEGER_CST) + // FIXME: field with variable position, skip it for now. + continue; + DerivedTypeDesc *MemberDesc = new DerivedTypeDesc(DW_TAG_member); // Field type is the declared type of the field. tree FieldNodeType = FieldType(Member); From baldrick at free.fr Mon Apr 16 13:49:42 2007 From: baldrick at free.fr (Duncan Sands) Date: Mon, 16 Apr 2007 13:49:42 -0500 Subject: [llvm-commits] CVS: llvm/test/FrontendAda/debug_var_size.ads Message-ID: <200704161849.l3GIngtN012574@zion.cs.uiuc.edu> Changes in directory llvm/test/FrontendAda: debug_var_size.ads added (r1.1) --- Log message: Testcase for debug info emission for structure fields at variable offsets. --- Diffs of the changes: (+8 -0) debug_var_size.ads | 8 ++++++++ 1 files changed, 8 insertions(+) Index: llvm/test/FrontendAda/debug_var_size.ads diff -c /dev/null llvm/test/FrontendAda/debug_var_size.ads:1.1 *** /dev/null Mon Apr 16 13:49:31 2007 --- llvm/test/FrontendAda/debug_var_size.ads Mon Apr 16 13:49:21 2007 *************** *** 0 **** --- 1,8 ---- + -- RUN: %llvmgcc -c -g %s -o /dev/null + package Debug_Var_Size is + subtype Length_Type is Positive range 1 .. 64; + type T (Length : Length_Type := 1) is record + Varying_Length : String (1 .. Length); + Fixed_Length : Boolean; + end record; + end; From baldrick at free.fr Mon Apr 16 13:51:34 2007 From: baldrick at free.fr (Duncan Sands) Date: Mon, 16 Apr 2007 13:51:34 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2007-03-26-BitfieldAfterZeroWidth.c Message-ID: <200704161851.l3GIpYRO012648@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2007-03-26-BitfieldAfterZeroWidth.c added (r1.1) --- Log message: Testcase for C front-end crash. --- Diffs of the changes: (+6 -0) 2007-03-26-BitfieldAfterZeroWidth.c | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/test/CFrontend/2007-03-26-BitfieldAfterZeroWidth.c diff -c /dev/null llvm/test/CFrontend/2007-03-26-BitfieldAfterZeroWidth.c:1.1 *** /dev/null Mon Apr 16 13:51:23 2007 --- llvm/test/CFrontend/2007-03-26-BitfieldAfterZeroWidth.c Mon Apr 16 13:51:13 2007 *************** *** 0 **** --- 1,6 ---- + // RUN: %llvmgcc %s -S -o - + struct W {}; + struct Y { + struct W w; + int i:1; + } __attribute__ ((packed)) y; From dpatel at apple.com Mon Apr 16 13:51:47 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 16 Apr 2007 13:51:47 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Pass.h CallGraphSCCPass.h Message-ID: <200704161851.l3GIplWI012663@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Pass.h updated: 1.82 -> 1.83 CallGraphSCCPass.h updated: 1.11 -> 1.12 --- Log message: Add getPotentialPassManagerType(). No functionality change, yet. --- Diffs of the changes: (+27 -1) CallGraphSCCPass.h | 5 +++++ Pass.h | 23 ++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.82 llvm/include/llvm/Pass.h:1.83 --- llvm/include/llvm/Pass.h:1.82 Mon Apr 16 13:10:22 2007 +++ llvm/include/llvm/Pass.h Mon Apr 16 13:51:25 2007 @@ -126,6 +126,11 @@ PassManagerType T = PMT_Unknown) {} /// Check if available pass managers are suitable for this pass or not. virtual void preparePassManager(PMStack &PMS) {} + + /// Return what kind of Pass Manager can manage this pass. + virtual PassManagerType getPotentialPassManagerType() const { + return PMT_Unknown; + } // Access AnalysisResolver inline void setResolver(AnalysisResolver *AR) { Resolver = AR; } @@ -193,7 +198,7 @@ template AnalysisType &getAnalysisID(const PassInfo *PI) const; - + }; inline std::ostream &operator<<(std::ostream &OS, const Pass &P) { @@ -216,6 +221,12 @@ virtual void assignPassManager(PMStack &PMS, PassManagerType T = PMT_ModulePassManager); + + /// Return what kind of Pass Manager can manage this pass. + virtual PassManagerType getPotentialPassManagerType() const { + return PMT_ModulePassManager; + } + // Force out-of-line virtual method. virtual ~ModulePass(); }; @@ -283,6 +294,11 @@ virtual void assignPassManager(PMStack &PMS, PassManagerType T = PMT_FunctionPassManager); + + /// Return what kind of Pass Manager can manage this pass. + virtual PassManagerType getPotentialPassManagerType() const { + return PMT_FunctionPassManager; + } }; @@ -338,6 +354,11 @@ virtual void assignPassManager(PMStack &PMS, PassManagerType T = PMT_BasicBlockPassManager); + + /// Return what kind of Pass Manager can manage this pass. + virtual PassManagerType getPotentialPassManagerType() const { + return PMT_BasicBlockPassManager; + } }; /// PMStack Index: llvm/include/llvm/CallGraphSCCPass.h diff -u llvm/include/llvm/CallGraphSCCPass.h:1.11 llvm/include/llvm/CallGraphSCCPass.h:1.12 --- llvm/include/llvm/CallGraphSCCPass.h:1.11 Mon Apr 16 13:10:22 2007 +++ llvm/include/llvm/CallGraphSCCPass.h Mon Apr 16 13:51:25 2007 @@ -54,6 +54,11 @@ virtual void assignPassManager(PMStack &PMS, PassManagerType PMT = PMT_CallGraphPassManager); + /// Return what kind of Pass Manager can manage this pass. + virtual PassManagerType getPotentialPassManagerType() const { + return PMT_CallGraphPassManager; + } + /// getAnalysisUsage - For this class, we declare that we require and preserve /// the call graph. If the derived class implements this method, it should /// always explicitly call the implementation here. From dpatel at apple.com Mon Apr 16 13:51:53 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 16 Apr 2007 13:51:53 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/LoopPass.h Message-ID: <200704161851.l3GIprpi012671@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: LoopPass.h updated: 1.14 -> 1.15 --- Log message: Add getPotentialPassManagerType(). No functionality change, yet. --- Diffs of the changes: (+4 -0) LoopPass.h | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/include/llvm/Analysis/LoopPass.h diff -u llvm/include/llvm/Analysis/LoopPass.h:1.14 llvm/include/llvm/Analysis/LoopPass.h:1.15 --- llvm/include/llvm/Analysis/LoopPass.h:1.14 Mon Apr 16 13:10:22 2007 +++ llvm/include/llvm/Analysis/LoopPass.h Mon Apr 16 13:51:25 2007 @@ -57,6 +57,10 @@ virtual void assignPassManager(PMStack &PMS, PassManagerType PMT = PMT_LoopPassManager); + /// Return what kind of Pass Manager can manage this pass. + virtual PassManagerType getPotentialPassManagerType() const { + return PMT_LoopPassManager; + } }; class LPPassManager : public FunctionPass, public PMDataManager { From evan.cheng at apple.com Mon Apr 16 13:56:07 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 16 Apr 2007 13:56:07 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/long.ll Message-ID: <200704161856.l3GIu7Ze012751@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: long.ll updated: 1.15 -> 1.16 --- Log message: Fix test. --- Diffs of the changes: (+1 -1) long.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CodeGen/ARM/long.ll diff -u llvm/test/CodeGen/ARM/long.ll:1.15 llvm/test/CodeGen/ARM/long.ll:1.16 --- llvm/test/CodeGen/ARM/long.ll:1.15 Sun Apr 15 15:47:22 2007 +++ llvm/test/CodeGen/ARM/long.ll Mon Apr 16 13:55:46 2007 @@ -3,7 +3,7 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep mvn | wc -l | grep 3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep adds | wc -l | grep 1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep adc | wc -l | grep 1 -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep subs | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep {subs } | wc -l | grep 1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep sbc | wc -l | grep 1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \ ; RUN: grep smull | wc -l | grep 1 From evan.cheng at apple.com Mon Apr 16 13:59:46 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 16 Apr 2007 13:59:46 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll Message-ID: <200704161859.l3GIxkRd012812@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: 2007-03-15-GEP-Idx-Sink.ll updated: 1.4 -> 1.5 --- Log message: One more callee-saved register used. --- Diffs of the changes: (+1 -1) 2007-03-15-GEP-Idx-Sink.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll diff -u llvm/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll:1.4 llvm/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll:1.5 --- llvm/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll:1.4 Sun Apr 15 17:16:46 2007 +++ llvm/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll Mon Apr 16 13:59:25 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-darwin | \ -; RUN: grep {addl \$12, %esp} +; RUN: grep {addl \$16, %esp} define void @foo(i8** %buf, i32 %size, i32 %col, i8* %p) { entry: From dpatel at apple.com Mon Apr 16 15:01:42 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Mon, 16 Apr 2007 13:01:42 -0700 (PDT) Subject: [llvm-commits] [126210] Fix handling of arrays with var-sized elements Message-ID: <20070416200142.3459BEFC20B5@src> Revision: 126210 Author: dpatel Date: 2007-04-16 13:01:41 -0700 (Mon, 16 Apr 2007) Log Message: ----------- Fix handling of arrays with var-sized elements Patch by Duncan Sands. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-abi.h apple-local/branches/llvm/gcc/llvm-convert.cpp apple-local/branches/llvm/gcc/llvm-debug.cpp apple-local/branches/llvm/gcc/llvm-internal.h apple-local/branches/llvm/gcc/llvm-types.cpp Modified: apple-local/branches/llvm/gcc/llvm-abi.h =================================================================== --- apple-local/branches/llvm/gcc/llvm-abi.h 2007-04-16 18:55:33 UTC (rev 126209) +++ apple-local/branches/llvm/gcc/llvm-abi.h 2007-04-16 20:01:41 UTC (rev 126210) @@ -110,7 +110,7 @@ } return FoundField ? isSingleElementStructOrArray(FoundField) : 0; case ARRAY_TYPE: - if (TREE_CODE(TYPE_SIZE(type)) != INTEGER_CST) + if (!isArrayCompatible(type)) return 0; tree length = arrayLength(type); if (!length || !integer_onep(length)) Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-16 18:55:33 UTC (rev 126209) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-16 20:01:41 UTC (rev 126210) @@ -253,6 +253,35 @@ } } +/// isInt64 - Return true if t is an INTEGER_CST that fits in a 64 bit integer. +/// If Unsigned is false, returns whether it fits in a int64_t. If Unsigned is +/// true, returns whether the value is non-negative and fits in a uint64_t. +/// Always returns false for overflowed constants. +bool isInt64(tree_node *t, bool Unsigned) { + if (HOST_BITS_PER_WIDE_INT == 64) + return host_integerp(t, Unsigned); + else { + assert(HOST_BITS_PER_WIDE_INT == 32 && + "Only 32- and 64-bit hosts supported!"); + return + (TREE_CODE (t) == INTEGER_CST && !TREE_OVERFLOW (t)) + && ((TYPE_UNSIGNED(TREE_TYPE(t)) == Unsigned) || + // If the constant is signed and we want an unsigned result, check + // that the value is non-negative. If the constant is unsigned and + // we want a signed result, check it fits in 63 bits. + (HOST_WIDE_INT)TREE_INT_CST_HIGH(t) >= 0); + } +} + +/// getInt64 - Extract the value of an INTEGER_CST as a 64 bit integer. If +/// Unsigned is false, the value must fit in a int64_t. If Unsigned is true, +/// the value must be non-negative and fit in a uint64_t. Must not be used on +/// overflowed constants. These conditions can be checked by calling isInt64. +uint64_t getInt64(tree_node *t, bool Unsigned) { + assert(isInt64(t, Unsigned) && "invalid constant!"); + return getINTEGER_CSTVal(t); +} + //===----------------------------------------------------------------------===// // ... High-Level Methods ... //===----------------------------------------------------------------------===// @@ -1374,16 +1403,18 @@ tree length; // Dynamic-size object: must push space on the stack. - if (TREE_CODE(type) == ARRAY_TYPE && (length = arrayLength(type))) { + if (TREE_CODE(type) == ARRAY_TYPE && + isSequentialCompatible(type) && + (length = arrayLength(type))) { Ty = ConvertType(TREE_TYPE(type)); // Get array element type. // Compute the number of elements in the array. Size = Emit(length, 0); - Size = CastToUIntType(Size, Size->getType()); } else { // Compute the variable's size in bytes. - Size = CastToUIntType(Emit(DECL_SIZE_UNIT(decl), 0), Type::Int32Ty); + Size = Emit(DECL_SIZE_UNIT(decl), 0); Ty = Type::Int8Ty; } + Size = CastToUIntType(Size, Type::Int32Ty); } const char *Name; // Name of variable @@ -4645,94 +4676,71 @@ } LValue TreeToLLVM::EmitLV_ARRAY_REF(tree exp) { + // The result type is an ElementTy* in the case of an ARRAY_REF, an array + // of ElementTy in the case of ARRAY_RANGE_REF. + tree Array = TREE_OPERAND(exp, 0); + tree ArrayType = TREE_TYPE(Array); tree Index = TREE_OPERAND(exp, 1); - assert((TREE_CODE (TREE_TYPE(Array)) == ARRAY_TYPE || - TREE_CODE (TREE_TYPE(Array)) == POINTER_TYPE || - TREE_CODE (TREE_TYPE(Array)) == REFERENCE_TYPE) && + tree IndexType = TREE_TYPE(Index); + tree ElementType = TREE_TYPE(ArrayType); + + assert((TREE_CODE (ArrayType) == ARRAY_TYPE || + TREE_CODE (ArrayType) == POINTER_TYPE || + TREE_CODE (ArrayType) == REFERENCE_TYPE) && "Unknown ARRAY_REF!"); - + // As an LLVM extension, we allow ARRAY_REF with a pointer as the first // operand. This construct maps directly to a getelementptr instruction. Value *ArrayAddr; - - if (TREE_CODE(TREE_TYPE(Array)) == ARRAY_TYPE) { + + if (TREE_CODE(ArrayType) == ARRAY_TYPE) { // First subtract the lower bound, if any, in the type of the index. tree LowerBound = array_ref_low_bound(exp); if (!integer_zerop(LowerBound)) - Index = fold(build2(MINUS_EXPR, TREE_TYPE(Index), Index, LowerBound)); - + Index = fold(build2(MINUS_EXPR, IndexType, Index, LowerBound)); + LValue ArrayAddrLV = EmitLV(Array); assert(!ArrayAddrLV.isBitfield() && "Arrays cannot be bitfields!"); ArrayAddr = ArrayAddrLV.Ptr; } else { ArrayAddr = Emit(Array, 0); } - + Value *IndexVal = Emit(Index, 0); - // FIXME: If UnitSize is a variable, or if it disagrees with the LLVM array - // element type, insert explicit pointer arithmetic here. - //tree ElementSizeInBytes = array_ref_element_size(exp); - const Type *IntPtrTy = getTargetData().getIntPtrType(); - if (IndexVal->getType() != IntPtrTy) { - if (TYPE_UNSIGNED(TREE_TYPE(Index))) // if the index is unsigned - // ZExt it to retain its value in the larger type - IndexVal = CastToUIntType(IndexVal, IntPtrTy); - else - // SExt it to retain its value in the larger type - IndexVal = CastToSIntType(IndexVal, IntPtrTy); - } + if (TYPE_UNSIGNED(IndexType)) // if the index is unsigned + // ZExt it to retain its value in the larger type + IndexVal = CastToUIntType(IndexVal, IntPtrTy); + else + // SExt it to retain its value in the larger type + IndexVal = CastToSIntType(IndexVal, IntPtrTy); - // If this is an index into an array, codegen as a GEP. - if (TREE_CODE(TREE_TYPE(Array)) == ARRAY_TYPE) { - Value *Ptr; - - // Check for variable sized array reference. - tree length = arrayLength(TREE_TYPE(Array)); - if (length && !host_integerp(length, 1)) { - // Make sure that ArrayAddr is of type ElementTy*, then do a 2-index gep. - ArrayAddr = BitCastToType(ArrayAddr, PointerType::get(Type::Int8Ty)); - Value *Scale = Emit(array_ref_element_size(exp), 0); - if (Scale->getType() != IntPtrTy) - Scale = CastToUIntType(Scale, IntPtrTy); - - IndexVal = BinaryOperator::createMul(IndexVal, Scale, "tmp", CurBB); - Ptr = new GetElementPtrInst(ArrayAddr, IndexVal, "tmp", CurBB); - } else { - // Otherwise, this is not a variable-sized array, use a GEP to index. - Ptr = new GetElementPtrInst(ArrayAddr, ConstantInt::get(Type::Int32Ty, 0), - IndexVal, "tmp", CurBB); - } - - // The result type is an ElementTy* in the case of an ARRAY_REF, an array - // of ElementTy in the case of ARRAY_RANGE_REF. Return the correct type. + // If this is an index into an LLVM array, codegen as a GEP. + if (isArrayCompatible(ArrayType)) { + Value *Ptr = new GetElementPtrInst(ArrayAddr, + ConstantInt::get(Type::Int32Ty, 0), + IndexVal, "tmp", CurBB); return BitCastToType(Ptr, PointerType::get(ConvertType(TREE_TYPE(exp)))); } - // Otherwise, this is an index off a pointer, codegen as a 2-idx GEP. - assert(TREE_CODE(TREE_TYPE(Array)) == POINTER_TYPE || - TREE_CODE(TREE_TYPE(Array)) == REFERENCE_TYPE); - tree IndexedType = TREE_TYPE(TREE_TYPE(Array)); - // If we are indexing over a fixed-size type, just use a GEP. - if (TREE_CODE(TYPE_SIZE(IndexedType)) == INTEGER_CST) { - const Type *PtrIndexedTy = PointerType::get(ConvertType(IndexedType)); - ArrayAddr = BitCastToType(ArrayAddr, PtrIndexedTy); - return new GetElementPtrInst(ArrayAddr, IndexVal, "tmp", CurBB); + if (isSequentialCompatible(ArrayType)) { + const Type *PtrElementTy = PointerType::get(ConvertType(ElementType)); + ArrayAddr = BitCastToType(ArrayAddr, PtrElementTy); + Value *Ptr = new GetElementPtrInst(ArrayAddr, IndexVal, "tmp", CurBB); + return BitCastToType(Ptr, PointerType::get(ConvertType(TREE_TYPE(exp)))); } - + // Otherwise, just do raw, low-level pointer arithmetic. FIXME: this could be // much nicer in cases like: // float foo(int w, float A[][w], int g) { return A[g][0]; } - + ArrayAddr = BitCastToType(ArrayAddr, PointerType::get(Type::Int8Ty)); Value *TypeSize = Emit(array_ref_element_size(exp), 0); + TypeSize = CastToUIntType(TypeSize, IntPtrTy); - if (TypeSize->getType() != IntPtrTy) - TypeSize = CastToUIntType(TypeSize, IntPtrTy); - IndexVal = BinaryOperator::createMul(IndexVal, TypeSize, "tmp", CurBB); Value *Ptr = new GetElementPtrInst(ArrayAddr, IndexVal, "tmp", CurBB); @@ -5790,44 +5798,41 @@ Constant *TreeConstantToLLVM::EmitLV_ARRAY_REF(tree exp) { tree Array = TREE_OPERAND(exp, 0); + tree ArrayType = TREE_TYPE(Array); tree Index = TREE_OPERAND(exp, 1); - assert((TREE_CODE (TREE_TYPE(Array)) == ARRAY_TYPE || - TREE_CODE (TREE_TYPE(Array)) == POINTER_TYPE || - TREE_CODE (TREE_TYPE(Array)) == REFERENCE_TYPE) && + tree IndexType = TREE_TYPE(Index); + assert((TREE_CODE (ArrayType) == ARRAY_TYPE || + TREE_CODE (ArrayType) == POINTER_TYPE || + TREE_CODE (ArrayType) == REFERENCE_TYPE) && "Unknown ARRAY_REF!"); - + + // Check for variable sized reference. + // FIXME: add support for array types where the size doesn't fit into 64 bits + assert(isArrayCompatible(ArrayType) || isSequentialCompatible(ArrayType) + && "Cannot have globals with variable size!"); + // As an LLVM extension, we allow ARRAY_REF with a pointer as the first // operand. This construct maps directly to a getelementptr instruction. Constant *ArrayAddr; - if (TREE_CODE (TREE_TYPE(Array)) == ARRAY_TYPE) { + if (TREE_CODE (ArrayType) == ARRAY_TYPE) { // First subtract the lower bound, if any, in the type of the index. tree LowerBound = array_ref_low_bound(exp); if (!integer_zerop(LowerBound)) - Index = fold(build2(MINUS_EXPR, TREE_TYPE(Index), Index, LowerBound)); + Index = fold(build2(MINUS_EXPR, IndexType, Index, LowerBound)); ArrayAddr = EmitLV(Array); } else { ArrayAddr = Convert(Array); } Constant *IndexVal = Convert(Index); - - // FIXME: If UnitSize is a variable, or if it disagrees with the LLVM array - // element type, insert explicit pointer arithmetic here. - //tree ElementSizeInBytes = array_ref_element_size(exp); - - if (IndexVal->getType() != Type::Int32Ty && - IndexVal->getType() != Type::Int64Ty) - IndexVal = ConstantExpr::getSExtOrBitCast(IndexVal, Type::Int64Ty); - - // Check for variable sized array reference. - if (TREE_CODE(TREE_TYPE(Array)) == ARRAY_TYPE) { - tree length = arrayLength(TREE_TYPE(Array)); - assert(!length || host_integerp(length, 1) && - "Cannot have globals with variable size!"); - } + const Type *IntPtrTy = getTargetData().getIntPtrType(); + if (IndexVal->getType() != IntPtrTy) + IndexVal = ConstantExpr::getIntegerCast(IndexVal, IntPtrTy, + !TYPE_UNSIGNED(IndexType)); + std::vector Idx; - if (TREE_CODE (TREE_TYPE(Array)) == ARRAY_TYPE) + if (isArrayCompatible(ArrayType)) Idx.push_back(ConstantInt::get(Type::Int32Ty, 0)); Idx.push_back(IndexVal); return ConstantExpr::getGetElementPtr(ArrayAddr, &Idx[0], Idx.size()); Modified: apple-local/branches/llvm/gcc/llvm-debug.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-debug.cpp 2007-04-16 18:55:33 UTC (rev 126209) +++ apple-local/branches/llvm/gcc/llvm-debug.cpp 2007-04-16 20:01:41 UTC (rev 126210) @@ -582,8 +582,6 @@ tree MinValue = TYPE_MIN_VALUE(Domain); tree MaxValue = TYPE_MAX_VALUE(Domain); if (MinValue && MaxValue && - TREE_CODE(MinValue) == INTEGER_CST && - TREE_CODE(MaxValue) == INTEGER_CST && host_integerp(MinValue, 0) && host_integerp(MaxValue, 0)) { Subrange->setLo(tree_low_cst(MinValue, 0)); Modified: apple-local/branches/llvm/gcc/llvm-internal.h =================================================================== --- apple-local/branches/llvm/gcc/llvm-internal.h 2007-04-16 18:55:33 UTC (rev 126209) +++ apple-local/branches/llvm/gcc/llvm-internal.h 2007-04-16 20:01:41 UTC (rev 126210) @@ -144,11 +144,32 @@ return TheTypeConverter->ConvertType(type); } +/// isInt64 - Return true if t is an INTEGER_CST that fits in a 64 bit integer. +/// If Unsigned is false, returns whether it fits in a int64_t. If Unsigned is +/// true, returns whether the value is non-negative and fits in a uint64_t. +/// Always returns false for overflowed constants. +bool isInt64(tree_node *t, bool Unsigned); + +/// getInt64 - Extract the value of an INTEGER_CST as a 64 bit integer. If +/// Unsigned is false, the value must fit in a int64_t. If Unsigned is true, +/// the value must be non-negative and fit in a uint64_t. Must not be used on +/// overflowed constants. These conditions can be checked by calling isInt64. +uint64_t getInt64(tree_node *t, bool Unsigned); + /// isPassedByInvisibleReference - Return true if the specified type should be /// passed by 'invisible reference'. In other words, instead of passing the /// thing by value, pass the address of a temporary. bool isPassedByInvisibleReference(tree_node *type); +/// isSequentialCompatible - Return true if the specified gcc array or pointer +/// type and the corresponding LLVM SequentialType lay out their components +/// identically in memory. +bool isSequentialCompatible(tree_node *type); + +/// isArrayCompatible - Return true if the specified gcc array or pointer type +/// corresponds to an LLVM array type. +bool isArrayCompatible(tree_node *type); + /// arrayLength - Return a tree expressing the number of elements in an array /// of the specified type, or NULL if the type does not specify the length. tree_node *arrayLength(tree_node *type); Modified: apple-local/branches/llvm/gcc/llvm-types.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-types.cpp 2007-04-16 18:55:33 UTC (rev 126209) +++ apple-local/branches/llvm/gcc/llvm-types.cpp 2007-04-16 20:01:41 UTC (rev 126210) @@ -73,6 +73,10 @@ // Note down LLVM type for GCC tree node. static const Type * llvm_set_type(tree Tr, const Type *Ty) { + assert(!TYPE_SIZE(Tr) || !Ty->isSized() || !isInt64(TYPE_SIZE(Tr), true) || + getInt64(TYPE_SIZE(Tr), true) == getTargetData().getTypeSizeInBits(Ty) + && "LLVM type size doesn't match GCC type size!"); + unsigned &TypeSlot = LTypesMap[Ty]; if (TypeSlot) { // Already in map. @@ -273,6 +277,39 @@ return Prefix + ContextStr + Name; } +/// isSequentialCompatible - Return true if the specified gcc array or pointer +/// type and the corresponding LLVM SequentialType lay out their components +/// identically in memory. +bool isSequentialCompatible(tree_node *type) { + assert((TREE_CODE (type) == ARRAY_TYPE || + TREE_CODE (type) == POINTER_TYPE || + TREE_CODE (type) == REFERENCE_TYPE) && "not a sequential type!"); + // This relies on gcc types with constant size mapping to LLVM types with the + // same size. + return isInt64(TYPE_SIZE(TREE_TYPE(type)), true); +} + +/// isArrayCompatible - Return true if the specified gcc array or pointer type +/// corresponds to an LLVM array type. +bool isArrayCompatible(tree_node *type) { + assert((TREE_CODE (type) == ARRAY_TYPE || + TREE_CODE (type) == POINTER_TYPE || + TREE_CODE (type) == REFERENCE_TYPE) && "not a sequential type!"); + return + (TREE_CODE (type) == ARRAY_TYPE) && ( + // Arrays with no size are fine as long as their components are layed out + // the same way in memory by LLVM. For example "int X[]" -> "[0 x int]". + (!TYPE_SIZE(type) && isSequentialCompatible(type)) || + + // Arrays with constant size map to LLVM arrays. If the array has zero + // size then there can be two exotic cases: (1) the array might have zero + // length and a component type of variable size; or (2) the array could + // have variable length and a component type with zero size. In both + // cases we convert to a zero length LLVM array. + (TYPE_SIZE(type) && isInt64(TYPE_SIZE(type), true)) + ); +} + /// arrayLength - Return a tree expressing the number of elements in an array /// of the specified type, or NULL if the type does not specify the length. tree_node *arrayLength(tree_node *type) { @@ -582,30 +619,37 @@ if (const Type *Ty = GET_TYPE_LLVM(type)) return Ty; - unsigned NumElements; - tree length = arrayLength(type); - if (length) { - if (host_integerp(length, 1)) { + if (isArrayCompatible(type)) { + uint64_t NumElements; + tree length = arrayLength(type); + + if (!length) { + // We get here if we have something that is globally declared as an + // array with no dimension, this becomes just a zero size array of the + // element type so that: int X[] becomes *'%X = external global [0 x int]' + // + // Note that this also affects new expressions, which return a pointer to + // an unsized array of elements. + NumElements = 0; + } else if (!isInt64(length, true)) { + // A variable length array where the element type has size zero. Turn + // it into a zero length array of the element type. + assert(integer_zerop(TYPE_SIZE(TREE_TYPE(type))) + && "variable length array has constant size!"); + NumElements = 0; + } else { // Normal array. - NumElements = tree_low_cst(length, 1); - } else { - // This handles cases like "int A[n]" which have a runtime constant - // number of elements, but is a compile-time variable. Since these are - // variable sized, we just represent them as the element themself. - return TypeDB.setType(type, ConvertType(TREE_TYPE(type))); + NumElements = getInt64(length, true); } - } else { - // We get here is if they have something that is globally declared as an - // array with no dimension, this becomes just a zero size array of the - // element type so that: int X[] becomes *'%X = external global [0 x int]' - // - // Note that this also affects new expressions, which return a pointer to - // an unsized array of elements. - NumElements = 0; + + return TypeDB.setType(type, ArrayType::get(ConvertType(TREE_TYPE(type)), + NumElements)); } - - return TypeDB.setType(type, ArrayType::get(ConvertType(TREE_TYPE(type)), - NumElements)); + + // This handles cases like "int A[n]" which have a runtime constant + // number of elements, but is a compile-time variable. Since these are + // variable sized, we just represent them as the element themself. + return TypeDB.setType(type, ConvertType(TREE_TYPE(type))); } case OFFSET_TYPE: // Handle OFFSET_TYPE specially. This is used for pointers to members, From evan.cheng at apple.com Mon Apr 16 15:04:32 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 16 Apr 2007 15:04:32 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/sse-load-ret.ll Message-ID: <200704162004.l3GK4WUn014031@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: sse-load-ret.ll updated: 1.3 -> 1.4 --- Log message: Fixes tests and remove xfail. --- Diffs of the changes: (+2 -3) sse-load-ret.ll | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/test/CodeGen/X86/sse-load-ret.ll diff -u llvm/test/CodeGen/X86/sse-load-ret.ll:1.3 llvm/test/CodeGen/X86/sse-load-ret.ll:1.4 --- llvm/test/CodeGen/X86/sse-load-ret.ll:1.3 Sun Apr 15 18:00:46 2007 +++ llvm/test/CodeGen/X86/sse-load-ret.ll Mon Apr 16 15:04:11 2007 @@ -1,8 +1,7 @@ ; RUN: llvm-upgrade < %s | llvm-as | \ -; RUN: llc -march=x86 -mcpu=yonah -enable-x86-sse | not grep movss +; RUN: llc -march=x86 -mcpu=yonah | not grep movss ; RUN: llvm-upgrade < %s | llvm-as | \ -; RUN: llc -march=x86 -mcpu=yonah -enable-x86-sse | not grep xmm -; XFAIL: * +; RUN: llc -march=x86 -mcpu=yonah | not grep xmm double %test1(double *%P) { %X = load double* %P From clattner at apple.com Mon Apr 16 15:07:19 2007 From: clattner at apple.com (clattner at apple.com) Date: Mon, 16 Apr 2007 13:07:19 -0700 (PDT) Subject: [llvm-commits] [126211] Fix the -Werror build. Message-ID: <20070416200719.1B036EFC2D8E@src> Revision: 126211 Author: clattner Date: 2007-04-16 13:07:18 -0700 (Mon, 16 Apr 2007) Log Message: ----------- Fix the -Werror build. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-convert.cpp Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-16 20:01:41 UTC (rev 126210) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-16 20:07:18 UTC (rev 126211) @@ -3244,7 +3244,7 @@ const Type *Ty = ConvertType(TREE_TYPE(exp)); Constant *Zero = ConstantInt::get(Ty, 0); Constant *One = ConstantInt::get(Ty, 1); - Constant *MinusOne = ConstantInt::get(Ty, -1); + Constant *MinusOne = ConstantInt::get(Ty, -1U); Value *LHS = Emit(TREE_OPERAND(exp, 0), 0); Value *RHS = Emit(TREE_OPERAND(exp, 1), 0); From dpatel at apple.com Mon Apr 16 15:13:20 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 16 Apr 2007 15:13:20 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/PassManagers.h Message-ID: <200704162013.l3GKDKw8014227@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: PassManagers.h updated: 1.15 -> 1.16 --- Log message: Give each pass manager chance to manage lower level analysis pass, which is pass required by one of pass managed by the manager. --- Diffs of the changes: (+20 -5) PassManagers.h | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-) Index: llvm/include/llvm/PassManagers.h diff -u llvm/include/llvm/PassManagers.h:1.15 llvm/include/llvm/PassManagers.h:1.16 --- llvm/include/llvm/PassManagers.h:1.15 Fri Mar 23 13:44:11 2007 +++ llvm/include/llvm/PassManagers.h Mon Apr 16 15:12:57 2007 @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/PassManager.h" - +#include "llvm/ADT/SmallVector.h" using namespace llvm; class llvm::PMDataManager; class llvm::PMStack; @@ -221,6 +221,19 @@ /// AvailableAnalysis appropriately if ProcessAnalysis is true. void add(Pass *P, bool ProcessAnalysis = true); + /// Add RequiredPass into list of lower level passes required by pass P. + /// RequiredPass is run on the fly by Pass Manager when P requests it + /// through getAnalysis interface. + virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass) { + assert (0 && + "Unable to handle Pass that requires lower level Analysis pass"); + } + + virtual Pass * getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F) { + assert (0 && "Unable to find on the fly pass"); + return NULL; + } + /// Initialize available analysis information. void initializeAnalysisInfo() { AvailableAnalysis.clear(); @@ -233,10 +246,12 @@ bool preserveHigherLevelAnalysis(Pass *P); - /// Populate RequiredPasses with the analysis pass that are required by - /// pass P. - void collectRequiredAnalysisPasses(std::vector &RequiredPasses, - Pass *P); + /// Populate RequiredPasses with analysis pass that are required by + /// pass P and are available. Populate ReqPassNotAvailable with analysis + /// pass that are required by pass P but are not available. + void collectRequiredAnalysis(SmallVector &RequiredPasses, + SmallVector &ReqPassNotAvailable, + Pass *P); /// All Required analyses should be available to the pass as it runs! Here /// we fill in the AnalysisImpls member of the pass so that it can From dpatel at apple.com Mon Apr 16 15:13:25 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 16 Apr 2007 15:13:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp Message-ID: <200704162013.l3GKDPkj014234@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.147 -> 1.148 --- Log message: Give each pass manager chance to manage lower level analysis pass, which is pass required by one of pass managed by the manager. --- Diffs of the changes: (+60 -20) PassManager.cpp | 80 ++++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 60 insertions(+), 20 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.147 llvm/lib/VMCore/PassManager.cpp:1.148 --- llvm/lib/VMCore/PassManager.cpp:1.147 Mon Apr 16 13:10:23 2007 +++ llvm/lib/VMCore/PassManager.cpp Mon Apr 16 15:12:57 2007 @@ -190,6 +190,11 @@ Info.setPreservesAll(); } + /// Add RequiredPass into list of lower level passes required by pass P. + /// RequiredPass is run on the fly by Pass Manager when P requests it + /// through getAnalysis interface. + virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass); + virtual const char *getPassName() const { return "Module Pass Manager"; } @@ -400,9 +405,14 @@ Pass *AnalysisPass = findAnalysisPass(*I); if (!AnalysisPass) { - // Schedule this analysis run first. AnalysisPass = (*I)->createPass(); - schedulePass(AnalysisPass); + // Schedule this analysis run first only if it is not a lower level + // analysis pass. Lower level analsyis passes are run on the fly. + if (P->getPotentialPassManagerType () >= + AnalysisPass->getPotentialPassManagerType()) + schedulePass(AnalysisPass); + else + delete AnalysisPass; } } @@ -642,11 +652,14 @@ // At the moment, this pass is the last user of all required passes. std::vector LastUses; - std::vector RequiredPasses; + SmallVector RequiredPasses; + SmallVector ReqAnalysisNotAvailable; + unsigned PDepth = this->getDepth(); - collectRequiredAnalysisPasses(RequiredPasses, P); - for (std::vector::iterator I = RequiredPasses.begin(), + collectRequiredAnalysis(RequiredPasses, + ReqAnalysisNotAvailable, P); + for (SmallVector::iterator I = RequiredPasses.begin(), E = RequiredPasses.end(); I != E; ++I) { Pass *PRequired = *I; unsigned RDepth = 0; @@ -661,11 +674,16 @@ TransferLastUses.push_back(PRequired); // Keep track of higher level analysis used by this manager. HigherLevelAnalysis.push_back(PRequired); - } else { - // Note : This feature is not yet implemented - assert (0 && - "Unable to handle Pass that requires lower level Analysis pass"); - } + } else + assert (0 && "Unable to accomodate Required Pass"); + } + + // Now, take care of required analysises that are not available. + for (SmallVector::iterator + I = ReqAnalysisNotAvailable.begin(), + E = ReqAnalysisNotAvailable.end() ;I != E; ++I) { + Pass *AnalysisPass = (*I)->createPass(); + this->addLowerLevelRequiredPass(P, AnalysisPass); } // Set P as P's last user until someone starts using P. @@ -691,27 +709,34 @@ PassVector.push_back(P); } -/// Populate RequiredPasses with the analysis pass that are required by -/// pass P. -void PMDataManager::collectRequiredAnalysisPasses(std::vector &RP, - Pass *P) { + +/// Populate RP with analysis pass that are required by +/// pass P and are available. Populate RP_NotAvail with analysis +/// pass that are required by pass P but are not available. +void PMDataManager::collectRequiredAnalysis(SmallVector&RP, + SmallVector &RP_NotAvail, + Pass *P) { AnalysisUsage AnUsage; P->getAnalysisUsage(AnUsage); const std::vector &RequiredSet = AnUsage.getRequiredSet(); for (std::vector::const_iterator I = RequiredSet.begin(), E = RequiredSet.end(); I != E; ++I) { - Pass *AnalysisPass = findAnalysisPass(*I, true); - assert (AnalysisPass && "Analysis pass is not available"); - RP.push_back(AnalysisPass); + AnalysisID AID = *I; + if (Pass *AnalysisPass = findAnalysisPass(*I, true)) + RP.push_back(AnalysisPass); + else + RP_NotAvail.push_back(AID); } const std::vector &IDs = AnUsage.getRequiredTransitiveSet(); for (std::vector::const_iterator I = IDs.begin(), E = IDs.end(); I != E; ++I) { - Pass *AnalysisPass = findAnalysisPass(*I, true); - assert (AnalysisPass && "Analysis pass is not available"); - RP.push_back(AnalysisPass); + AnalysisID AID = *I; + if (Pass *AnalysisPass = findAnalysisPass(*I, true)) + RP.push_back(AnalysisPass); + else + RP_NotAvail.push_back(AID); } } @@ -1154,6 +1179,21 @@ return Changed; } +/// Add RequiredPass into list of lower level passes required by pass P. +/// RequiredPass is run on the fly by Pass Manager when P requests it +/// through getAnalysis interface. +void MPPassManager::addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass) { + + assert (P->getPotentialPassManagerType() == PMT_ModulePassManager + && "Unable to handle Pass that requires lower level Analysis pass"); + assert ((P->getPotentialPassManagerType() < + RequiredPass->getPotentialPassManagerType()) + && "Unable to handle Pass that requires lower level Analysis pass"); + + assert (0 && + "Unable to handle Pass that requires lower level Analysis pass"); +} + //===----------------------------------------------------------------------===// // PassManagerImpl implementation // From clattner at apple.com Mon Apr 16 15:17:27 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 16 Apr 2007 13:17:27 -0700 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y In-Reply-To: <200704161746.l3GHkBHv010871@zion.cs.uiuc.edu> References: <200704161746.l3GHkBHv010871@zion.cs.uiuc.edu> Message-ID: > Use a more optimal way to get the name of a function. Thanks, Chris. Cool, please check that the name is >= 5 chars long too :) -Chris > > --- > Diffs of the changes: (+2 -1) > > llvmAsmParser.y | 3 ++- > 1 files changed, 2 insertions(+), 1 deletion(-) > > > Index: llvm/lib/AsmParser/llvmAsmParser.y > diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.340 llvm/lib/AsmParser/ > llvmAsmParser.y:1.341 > --- llvm/lib/AsmParser/llvmAsmParser.y:1.340 Mon Apr 16 01:55:42 2007 > +++ llvm/lib/AsmParser/llvmAsmParser.y Mon Apr 16 12:45:50 2007 > @@ -2823,7 +2823,8 @@ > > // Check for call to invalid intrinsic to avoid crashing later. > if (Function *theF = dyn_cast(V)) { > - if (theF->hasName() && 0 == strncmp(theF->getName().c_str(), > "llvm.", 5)&& > + if (theF->hasName() && > + 0 == strncmp(theF->getValueName()->getKeyData(), > "llvm.", 5) && > !theF->getIntrinsicID(true)) > GEN_ERROR("Call to invalid LLVM intrinsic function '" + > theF->getName() + "'"); > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Mon Apr 16 15:27:26 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 16 Apr 2007 15:27:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp Message-ID: <200704162027.l3GKRQP0014560@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.148 -> 1.149 --- Log message: Update module pass manager to support module passes that require function passes. --- Diffs of the changes: (+44 -11) PassManager.cpp | 55 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 44 insertions(+), 11 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.148 llvm/lib/VMCore/PassManager.cpp:1.149 --- llvm/lib/VMCore/PassManager.cpp:1.148 Mon Apr 16 15:12:57 2007 +++ llvm/lib/VMCore/PassManager.cpp Mon Apr 16 15:27:05 2007 @@ -195,6 +195,11 @@ /// through getAnalysis interface. virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass); + /// Return function pass corresponding to PassInfo PI, that is + /// required by module pass MP. Instantiate analysis pass, by using + /// its runOnFunction() for function F. + virtual Pass* getOnTheFlyPass(Pass *MP, const PassInfo *PI, Function &F); + virtual const char *getPassName() const { return "Module Pass Manager"; } @@ -218,6 +223,11 @@ virtual PassManagerType getPassManagerType() const { return PMT_ModulePassManager; } + + private: + /// Collection of on the fly FPPassManagers. These managers manage + /// function passes that are required by module passes. + std::map OnTheFlyManagers; }; //===----------------------------------------------------------------------===// @@ -614,6 +624,10 @@ enum PassDebuggingString DBG_STR) { std::vector DeadPasses; + + if (!TPM) + return; + TPM->collectLastUses(DeadPasses, P); for (std::vector::iterator I = DeadPasses.begin(), @@ -678,14 +692,6 @@ assert (0 && "Unable to accomodate Required Pass"); } - // Now, take care of required analysises that are not available. - for (SmallVector::iterator - I = ReqAnalysisNotAvailable.begin(), - E = ReqAnalysisNotAvailable.end() ;I != E; ++I) { - Pass *AnalysisPass = (*I)->createPass(); - this->addLowerLevelRequiredPass(P, AnalysisPass); - } - // Set P as P's last user until someone starts using P. // However, if P is a Pass Manager then it does not need // to record its last user. @@ -699,6 +705,14 @@ TransferLastUses.clear(); } + // Now, take care of required analysises that are not available. + for (SmallVector::iterator + I = ReqAnalysisNotAvailable.begin(), + E = ReqAnalysisNotAvailable.end() ;I != E; ++I) { + Pass *AnalysisPass = (*I)->createPass(); + this->addLowerLevelRequiredPass(P, AnalysisPass); + } + // Take a note of analysis required and made available by this pass. // Remove the analysis not preserved by this pass removeNotPreservedAnalysis(P); @@ -1190,10 +1204,29 @@ RequiredPass->getPotentialPassManagerType()) && "Unable to handle Pass that requires lower level Analysis pass"); - assert (0 && - "Unable to handle Pass that requires lower level Analysis pass"); + FPPassManager *FPP = OnTheFlyManagers[P]; + if (!FPP) { + FPP = new FPPassManager(getDepth() + 1); + OnTheFlyManagers[P] = FPP; + } + + FPP->add(RequiredPass, false); } - + +/// Return function pass corresponding to PassInfo PI, that is +/// required by module pass MP. Instantiate analysis pass, by using +/// its runOnFunction() for function F. +Pass* MPPassManager::getOnTheFlyPass(Pass *MP, const PassInfo *PI, + Function &F) { + AnalysisID AID = PI; + FPPassManager *FPP =OnTheFlyManagers[MP]; + assert (FPP && "Unable to find on the fly pass"); + + FPP->runOnFunction(F); + return FPP->findAnalysisPass(AID, false); +} + + //===----------------------------------------------------------------------===// // PassManagerImpl implementation // From reid at x10sys.com Mon Apr 16 15:31:27 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 15:31:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y Message-ID: <200704162031.l3GKVREk014695@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.341 -> 1.342 --- Log message: Check length of string before we walk off the end of it. Thanks, Chris. --- Diffs of the changes: (+3 -3) llvmAsmParser.y | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.341 llvm/lib/AsmParser/llvmAsmParser.y:1.342 --- llvm/lib/AsmParser/llvmAsmParser.y:1.341 Mon Apr 16 12:45:50 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y Mon Apr 16 15:31:06 2007 @@ -2823,9 +2823,9 @@ // Check for call to invalid intrinsic to avoid crashing later. if (Function *theF = dyn_cast(V)) { - if (theF->hasName() && - 0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5) && - !theF->getIntrinsicID(true)) + if (theF->hasName() && (strlen(theF->getValueName()->getKeyData()) >= 5)&& + (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) && + !theF->getIntrinsicID(true)) GEN_ERROR("Call to invalid LLVM intrinsic function '" + theF->getName() + "'"); } From reid at x10sys.com Mon Apr 16 15:36:00 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 15:36:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.y.cvs Message-ID: <200704162036.l3GKa0NE014781@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp.cvs updated: 1.86 -> 1.87 llvmAsmParser.y.cvs updated: 1.87 -> 1.88 --- Log message: Regenerate. --- Diffs of the changes: (+6 -6) llvmAsmParser.cpp.cvs | 6 +++--- llvmAsmParser.y.cvs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.86 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.87 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.86 Mon Apr 16 12:47:06 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Mon Apr 16 15:35:38 2007 @@ -5488,9 +5488,9 @@ // Check for call to invalid intrinsic to avoid crashing later. if (Function *theF = dyn_cast(V)) { - if (theF->hasName() && - 0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5) && - !theF->getIntrinsicID(true)) + if (theF->hasName() && (strlen(theF->getValueName()->getKeyData()) >= 5)&& + (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) && + !theF->getIntrinsicID(true)) GEN_ERROR("Call to invalid LLVM intrinsic function '" + theF->getName() + "'"); } Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.87 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.88 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.87 Mon Apr 16 12:47:06 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Mon Apr 16 15:35:38 2007 @@ -2823,9 +2823,9 @@ // Check for call to invalid intrinsic to avoid crashing later. if (Function *theF = dyn_cast(V)) { - if (theF->hasName() && - 0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5) && - !theF->getIntrinsicID(true)) + if (theF->hasName() && (strlen(theF->getValueName()->getKeyData()) >= 5)&& + (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) && + !theF->getIntrinsicID(true)) GEN_ERROR("Call to invalid LLVM intrinsic function '" + theF->getName() + "'"); } From dpatel at apple.com Mon Apr 16 15:40:20 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 16 Apr 2007 15:40:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp Message-ID: <200704162040.l3GKeKwE014898@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.149 -> 1.150 --- Log message: Print and delete on the fly pass managers. --- Diffs of the changes: (+19 -3) PassManager.cpp | 22 +++++++++++++++++++--- 1 files changed, 19 insertions(+), 3 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.149 llvm/lib/VMCore/PassManager.cpp:1.150 --- llvm/lib/VMCore/PassManager.cpp:1.149 Mon Apr 16 15:27:05 2007 +++ llvm/lib/VMCore/PassManager.cpp Mon Apr 16 15:39:59 2007 @@ -180,7 +180,17 @@ public: MPPassManager(int Depth) : PMDataManager(Depth) { } - + + // Delete on the fly managers. + virtual ~MPPassManager() { + for (std::map::iterator + I = OnTheFlyManagers.begin(), E = OnTheFlyManagers.end(); + I != E; ++I) { + FPPassManager *FPP = I->second; + delete FPP; + } + } + /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. bool runOnModule(Module &M); @@ -210,6 +220,8 @@ for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { ModulePass *MP = getContainedPass(Index); MP->dumpPassStructure(Offset + 1); + if (FPPassManager *FPP = OnTheFlyManagers[MP]) + FPP->dumpPassStructure(Offset + 2); dumpLastUses(MP, Offset+1); } } @@ -625,6 +637,7 @@ std::vector DeadPasses; + // If this is a on the fly manager then it does not have TPM. if (!TPM) return; @@ -795,8 +808,11 @@ void PMDataManager::dumpLastUses(Pass *P, unsigned Offset) const{ std::vector LUses; - - assert (TPM && "Top Level Manager is missing"); + + // If this is a on the fly manager then it does not have TPM. + if (!TPM) + return; + TPM->collectLastUses(LUses, P); for (std::vector::iterator I = LUses.begin(), From dpatel at apple.com Mon Apr 16 15:44:37 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 16 Apr 2007 15:44:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp Message-ID: <200704162044.l3GKibwO014990@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.150 -> 1.151 --- Log message: Do not assert during analysis implementation initialization. --- Diffs of the changes: (+3 -1) PassManager.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.150 llvm/lib/VMCore/PassManager.cpp:1.151 --- llvm/lib/VMCore/PassManager.cpp:1.150 Mon Apr 16 15:39:59 2007 +++ llvm/lib/VMCore/PassManager.cpp Mon Apr 16 15:44:16 2007 @@ -781,7 +781,9 @@ E = AnUsage.getRequiredSet().end(); I != E; ++I) { Pass *Impl = findAnalysisPass(*I, true); if (Impl == 0) - assert(0 && "Analysis used but not available!"); + // This may be analysis pass that is initialized on the fly. + // If that is not the case then it will raise an assert when it is used. + continue; AnalysisResolver *AR = P->getResolver(); AR->addAnalysisImplsPair(*I, Impl); } From dpatel at apple.com Mon Apr 16 15:56:56 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 16 Apr 2007 15:56:56 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Pass.h PassAnalysisSupport.h Message-ID: <200704162056.l3GKuuuf015234@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Pass.h updated: 1.83 -> 1.84 PassAnalysisSupport.h updated: 1.29 -> 1.30 --- Log message: Proivde getAnalysis(Func) support. --- Diffs of the changes: (+41 -0) Pass.h | 5 +++++ PassAnalysisSupport.h | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.83 llvm/include/llvm/Pass.h:1.84 --- llvm/include/llvm/Pass.h:1.83 Mon Apr 16 13:51:25 2007 +++ llvm/include/llvm/Pass.h Mon Apr 16 15:56:24 2007 @@ -197,8 +197,13 @@ AnalysisType &getAnalysis() const; // Defined in PassAnalysisSupport.h template + AnalysisType &getAnalysis(Function &F); // Defined in PassanalysisSupport.h + + template AnalysisType &getAnalysisID(const PassInfo *PI) const; + template + AnalysisType &getAnalysisID(const PassInfo *PI, Function &F); }; inline std::ostream &operator<<(std::ostream &OS, const Pass &P) { Index: llvm/include/llvm/PassAnalysisSupport.h diff -u llvm/include/llvm/PassAnalysisSupport.h:1.29 llvm/include/llvm/PassAnalysisSupport.h:1.30 --- llvm/include/llvm/PassAnalysisSupport.h:1.29 Fri Mar 23 13:44:11 2007 +++ llvm/include/llvm/PassAnalysisSupport.h Mon Apr 16 15:56:24 2007 @@ -127,6 +127,9 @@ return ResultPass; } + // Find pass that is implementing PI. Initialize pass for Function F. + Pass *findImplPass(Pass *P, const PassInfo *PI, Function &F); + void addAnalysisImplsPair(const PassInfo *PI, Pass *P) { std::pair pir = std::make_pair(PI,P); AnalysisImpls.push_back(pir); @@ -197,6 +200,39 @@ return *Result; } +/// getAnalysis() - This function is used by subclasses to get +/// to the analysis information that they claim to use by overriding the +/// getAnalysisUsage function. +/// +template +AnalysisType &Pass::getAnalysis(Function &F) { + assert(Resolver &&"Pass has not been inserted into a PassManager object!"); + + return getAnalysisID(getClassPassInfo(), F); +} + +template +AnalysisType &Pass::getAnalysisID(const PassInfo *PI, Function &F) { + assert(PI && "getAnalysis for unregistered pass!"); + assert(Resolver&&"Pass has not been inserted into a PassManager object!"); + // PI *must* appear in AnalysisImpls. Because the number of passes used + // should be a small number, we just do a linear search over a (dense) + // vector. + Pass *ResultPass = Resolver->findImplPass(this, PI, F); + assert (ResultPass && + "getAnalysis*() called on an analysis that was not " + "'required' by pass!"); + + // Because the AnalysisType may not be a subclass of pass (for + // AnalysisGroups), we must use dynamic_cast here to potentially adjust the + // return pointer (because the class may multiply inherit, once from pass, + // once from AnalysisType). + // + AnalysisType *Result = dynamic_cast(ResultPass); + assert(Result && "Pass does not implement interface required!"); + return *Result; +} + } // End llvm namespace #endif From dpatel at apple.com Mon Apr 16 15:56:56 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 16 Apr 2007 15:56:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp Message-ID: <200704162056.l3GKuuG2015227@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.151 -> 1.152 --- Log message: Proivde getAnalysis(Func) support. --- Diffs of the changes: (+5 -0) PassManager.cpp | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.151 llvm/lib/VMCore/PassManager.cpp:1.152 --- llvm/lib/VMCore/PassManager.cpp:1.151 Mon Apr 16 15:44:16 2007 +++ llvm/lib/VMCore/PassManager.cpp Mon Apr 16 15:56:24 2007 @@ -906,6 +906,11 @@ return PM.findAnalysisPass(ID, dir); } +Pass *AnalysisResolver::findImplPass(Pass *P, const PassInfo *AnalysisPI, + Function &F) { + return PM.getOnTheFlyPass(P, AnalysisPI, F); +} + //===----------------------------------------------------------------------===// // BBPassManager implementation From sabre at nondot.org Mon Apr 16 16:05:58 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 16:05:58 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/vec_call.ll Message-ID: <200704162105.l3GL5w4I015733@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: vec_call.ll updated: 1.4 -> 1.5 --- Log message: fix this test --- Diffs of the changes: (+2 -3) vec_call.ll | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/test/CodeGen/X86/vec_call.ll diff -u llvm/test/CodeGen/X86/vec_call.ll:1.4 llvm/test/CodeGen/X86/vec_call.ll:1.5 --- llvm/test/CodeGen/X86/vec_call.ll:1.4 Sun Apr 15 18:00:46 2007 +++ llvm/test/CodeGen/X86/vec_call.ll Mon Apr 16 16:05:37 2007 @@ -1,8 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \ +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -mtriple=powerpc-apple-darwin8 | \ ; RUN: grep {subl.*60} -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \ +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -mtriple=powerpc-apple-darwin8 | \ ; RUN: grep {movdqa.*32} -; XFAIL: * void %test() { tail call void %xx( int 1, int 2, int 3, int 4, int 5, int 6, int 7, <2 x long> cast (<4 x int> < int 4, int 3, int 2, int 1 > to <2 x long>), <2 x long> cast (<4 x int> < int 8, int 7, int 6, int 5 > to <2 x long>), <2 x long> cast (<4 x int> < int 6, int 4, int 2, int 0 > to <2 x long>), <2 x long> cast (<4 x int> < int 8, int 4, int 2, int 1 > to <2 x long>), <2 x long> cast (<4 x int> < int 0, int 1, int 3, int 9 > to <2 x long>) ) From asl at math.spbu.ru Mon Apr 16 16:07:21 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 16 Apr 2007 16:07:21 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2006-09-25-DebugFilename.c.tr Message-ID: <200704162107.l3GL7L79015768@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2006-09-25-DebugFilename.c.tr updated: 1.2 -> 1.3 --- Log message: Heal this test --- Diffs of the changes: (+2 -2) 2006-09-25-DebugFilename.c.tr | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/CFrontend/2006-09-25-DebugFilename.c.tr diff -u llvm/test/CFrontend/2006-09-25-DebugFilename.c.tr:1.2 llvm/test/CFrontend/2006-09-25-DebugFilename.c.tr:1.3 --- llvm/test/CFrontend/2006-09-25-DebugFilename.c.tr:1.2 Mon Apr 16 10:15:51 2007 +++ llvm/test/CFrontend/2006-09-25-DebugFilename.c.tr Mon Apr 16 16:07:00 2007 @@ -1,6 +1,6 @@ -// RUN: %llvmgcc -xc %s -S -o /dev/null |& \ +// RUN: ignore %llvmgcc -xc %s -S -o /dev/null |& \ // RUN: grep fluffy | grep 2006-09-25-DebugFilename.c.tr #include "2006-09-25-DebugFilename.h" int func1() { return hfunc1(); } -int func2() { int fluffy; return hfunc1(); } +int func2() { fluffy; return hfunc1(); } From baldrick at free.fr Mon Apr 16 16:12:24 2007 From: baldrick at free.fr (Duncan Sands) Date: Mon, 16 Apr 2007 16:12:24 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2007-03-27-ArrayCompatible.c Message-ID: <200704162112.l3GLCOv9015925@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2007-03-27-ArrayCompatible.c added (r1.1) --- Log message: Check handling of arrays of variable sized components. --- Diffs of the changes: (+10 -0) 2007-03-27-ArrayCompatible.c | 10 ++++++++++ 1 files changed, 10 insertions(+) Index: llvm/test/CFrontend/2007-03-27-ArrayCompatible.c diff -c /dev/null llvm/test/CFrontend/2007-03-27-ArrayCompatible.c:1.1 *** /dev/null Mon Apr 16 16:12:13 2007 --- llvm/test/CFrontend/2007-03-27-ArrayCompatible.c Mon Apr 16 16:12:03 2007 *************** *** 0 **** --- 1,10 ---- + // RUN: %llvmgcc -S %s -O2 -o - | grep {ret i8 0} + static char c(int n) { + char x[2][n]; + x[1][0]=0; + return *(n+(char *)x); + } + + char d(void) { + return c(2); + } From baldrick at free.fr Mon Apr 16 16:14:18 2007 From: baldrick at free.fr (Duncan Sands) Date: Mon, 16 Apr 2007 16:14:18 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2007-03-27-VarLengthArray.c Message-ID: <200704162114.l3GLEIex015968@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2007-03-27-VarLengthArray.c added (r1.1) --- Log message: Test code quality for variable length array references. --- Diffs of the changes: (+7 -0) 2007-03-27-VarLengthArray.c | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/test/CFrontend/2007-03-27-VarLengthArray.c diff -c /dev/null llvm/test/CFrontend/2007-03-27-VarLengthArray.c:1.1 *** /dev/null Mon Apr 16 16:14:07 2007 --- llvm/test/CFrontend/2007-03-27-VarLengthArray.c Mon Apr 16 16:13:57 2007 *************** *** 0 **** --- 1,7 ---- + // RUN: %llvmgcc -S %s -o - | grep {getelementptr i32} + extern void f(int *); + int e(int m, int n) { + int x[n]; + f(x); + return x[m]; + } From sabre at nondot.org Mon Apr 16 16:19:17 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 16:19:17 -0500 Subject: [llvm-commits] CVS: llvm/test/C++Frontend/2003-08-28-ForwardType.cpp Message-ID: <200704162119.l3GLJHlk016101@zion.cs.uiuc.edu> Changes in directory llvm/test/C++Frontend: 2003-08-28-ForwardType.cpp updated: 1.5 -> 1.6 --- Log message: MAke this test portable. --- Diffs of the changes: (+3 -1) 2003-08-28-ForwardType.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/test/C++Frontend/2003-08-28-ForwardType.cpp diff -u llvm/test/C++Frontend/2003-08-28-ForwardType.cpp:1.5 llvm/test/C++Frontend/2003-08-28-ForwardType.cpp:1.6 --- llvm/test/C++Frontend/2003-08-28-ForwardType.cpp:1.5 Thu Apr 21 18:48:37 2005 +++ llvm/test/C++Frontend/2003-08-28-ForwardType.cpp Mon Apr 16 16:18:56 2007 @@ -1,7 +1,9 @@ // RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null // Default placement versions of operator new. -inline void* operator new(unsigned, void* __p) throw(); +#include + +void* operator new(size_t, void* __p) throw(); template From baldrick at free.fr Mon Apr 16 16:20:07 2007 From: baldrick at free.fr (Duncan Sands) Date: Mon, 16 Apr 2007 16:20:07 -0500 Subject: [llvm-commits] CVS: llvm/test/lib/llvm.exp Message-ID: <200704162120.l3GLK7bO016137@zion.cs.uiuc.edu> Changes in directory llvm/test/lib: llvm.exp updated: 1.14 -> 1.15 --- Log message: Spelling fix. --- Diffs of the changes: (+1 -1) llvm.exp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/lib/llvm.exp diff -u llvm/test/lib/llvm.exp:1.14 llvm/test/lib/llvm.exp:1.15 --- llvm/test/lib/llvm.exp:1.14 Mon Apr 16 10:37:00 2007 +++ llvm/test/lib/llvm.exp Mon Apr 16 16:19:45 2007 @@ -112,7 +112,7 @@ if {[regexp {END.[ *]$} $line match endofscript]} { break - # if the line is continued, concatente and continue the loop + # if the line is continued, concatenate and continue the loop } elseif {[regexp {RUN: *(.+)(\\)$} $line match oneline suffix]} { set runline "$runline$oneline " From lattner at cs.uiuc.edu Mon Apr 16 16:20:48 2007 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 16 Apr 2007 16:20:48 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/cast-to-bool.c Message-ID: <200704162120.l3GLKmHd016202@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: cast-to-bool.c (r1.4) removed --- Log message: remove bogus test --- Diffs of the changes: (+0 -0) 0 files changed From lattner at cs.uiuc.edu Mon Apr 16 16:23:19 2007 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 16 Apr 2007 16:23:19 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/bit-accurate-int.c Message-ID: <200704162123.l3GLNJdk016344@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: bit-accurate-int.c (r1.3) removed --- Log message: We shouldn't have tests for features we don't have yet. --- Diffs of the changes: (+0 -0) 0 files changed From djg at cray.com Mon Apr 16 16:24:08 2007 From: djg at cray.com (Dan Gohman) Date: Mon, 16 Apr 2007 16:24:08 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/vec_call.ll In-Reply-To: <200704162105.l3GL5w4I015733@zion.cs.uiuc.edu> Message-ID: <20070416212408.GN15678@village.us.cray.com> > -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \ > +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 > -mtriple=powerpc-apple-darwin8 | \ Did you really mean to use a powerpc triple with -march=x86? Dan -- Dan Gohman, Cray Inc. From reid at x10sys.com Mon Apr 16 16:24:35 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 16:24:35 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CallingConv.h Message-ID: <200704162124.l3GLOZTx016435@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: CallingConv.h updated: 1.6 -> 1.7 --- Log message: Fix 80 col violations. --- Diffs of the changes: (+4 -4) CallingConv.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/include/llvm/CallingConv.h diff -u llvm/include/llvm/CallingConv.h:1.6 llvm/include/llvm/CallingConv.h:1.7 --- llvm/include/llvm/CallingConv.h:1.6 Sun Jan 28 07:31:35 2007 +++ llvm/include/llvm/CallingConv.h Mon Apr 16 16:24:12 2007 @@ -26,16 +26,16 @@ enum ID { /// C - The default llvm calling convention, compatible with C. This /// convention is the only calling convention that supports varargs calls. - /// As with typical C calling conventions, the callee/caller have to tolerate - /// certain amounts of prototype mismatch. + /// As with typical C calling conventions, the callee/caller have to + /// tolerate certain amounts of prototype mismatch. C = 0, // Generic LLVM calling conventions. None of these calling conventions // support varargs calls, and all assume that the caller and callee // prototype exactly match. - /// Fast - This calling convention attempts to make calls as fast as possible - /// (e.g. by passing things in registers). + /// Fast - This calling convention attempts to make calls as fast as + /// possible /// (e.g. by passing things in registers). Fast = 8, // Cold - This calling convention attempts to make code in the caller as From sabre at nondot.org Mon Apr 16 16:24:41 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 16:24:41 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/PredicateSimplifier/2006-10-22-IntOr.ll Message-ID: <200704162124.l3GLOfQf016444@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/PredicateSimplifier: 2006-10-22-IntOr.ll updated: 1.5 -> 1.6 --- Log message: fix incorrectly upgraded test --- Diffs of the changes: (+1 -1) 2006-10-22-IntOr.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Transforms/PredicateSimplifier/2006-10-22-IntOr.ll diff -u llvm/test/Transforms/PredicateSimplifier/2006-10-22-IntOr.ll:1.5 llvm/test/Transforms/PredicateSimplifier/2006-10-22-IntOr.ll:1.6 --- llvm/test/Transforms/PredicateSimplifier/2006-10-22-IntOr.ll:1.5 Mon Apr 16 12:36:08 2007 +++ llvm/test/Transforms/PredicateSimplifier/2006-10-22-IntOr.ll Mon Apr 16 16:24:14 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-upgrade < %s | llvm-as | \ -; RUN: opt -predsimplify -instcombine -simplifycfg -o %t -f +; RUN: opt -predsimplify -instcombine -simplifycfg | llvm-dis > %t ; RUN: grep -v declare %t | not grep fail ; RUN: grep -v declare %t | grep -c pass | grep 3 From sabre at nondot.org Mon Apr 16 16:36:25 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 14:36:25 -0700 (PDT) Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/vec_call.ll In-Reply-To: <20070416212408.GN15678@village.us.cray.com> References: <20070416212408.GN15678@village.us.cray.com> Message-ID: On Mon, 16 Apr 2007, Dan Gohman wrote: >> -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \ >> +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 >> -mtriple=powerpc-apple-darwin8 | \ > > Did you really mean to use a powerpc triple with -march=x86? Heh, no. But it works (determines you really want x86 darwin). I'll fix though, good eyes :) -Chris -- http://nondot.org/sabre/ http://llvm.org/ From sabre at nondot.org Mon Apr 16 16:26:58 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 16:26:58 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/vec_call.ll Message-ID: <200704162126.l3GLQwEk016545@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: vec_call.ll updated: 1.5 -> 1.6 --- Log message: use an x86 t-t for an x86 test. Thanks to Dan for noticing this! --- Diffs of the changes: (+2 -2) vec_call.ll | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/CodeGen/X86/vec_call.ll diff -u llvm/test/CodeGen/X86/vec_call.ll:1.5 llvm/test/CodeGen/X86/vec_call.ll:1.6 --- llvm/test/CodeGen/X86/vec_call.ll:1.5 Mon Apr 16 16:05:37 2007 +++ llvm/test/CodeGen/X86/vec_call.ll Mon Apr 16 16:26:37 2007 @@ -1,6 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -mtriple=powerpc-apple-darwin8 | \ +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -mtriple=i686-apple-darwin8 | \ ; RUN: grep {subl.*60} -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -mtriple=powerpc-apple-darwin8 | \ +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -mtriple=i686-apple-darwin8 | \ ; RUN: grep {movdqa.*32} void %test() { From dpatel at apple.com Mon Apr 16 16:28:35 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 16 Apr 2007 16:28:35 -0500 Subject: [llvm-commits] CVS: llvm/docs/WritingAnLLVMPass.html Message-ID: <200704162128.l3GLSZwn016651@zion.cs.uiuc.edu> Changes in directory llvm/docs: WritingAnLLVMPass.html updated: 1.54 -> 1.55 --- Log message: Document how, module pass can require function pass. --- Diffs of the changes: (+19 -3) WritingAnLLVMPass.html | 22 +++++++++++++++++++--- 1 files changed, 19 insertions(+), 3 deletions(-) Index: llvm/docs/WritingAnLLVMPass.html diff -u llvm/docs/WritingAnLLVMPass.html:1.54 llvm/docs/WritingAnLLVMPass.html:1.55 --- llvm/docs/WritingAnLLVMPass.html:1.54 Mon Mar 19 17:21:25 2007 +++ llvm/docs/WritingAnLLVMPass.html Mon Apr 16 16:28:14 2007 @@ -466,7 +466,9 @@ ModulePass indicates that your pass uses the entire program as a unit, refering to function bodies in no predictable order, or adding and removing functions. Because nothing is known about the behavior of ModulePass -subclasses, no optimization can be done for their execution.

+subclasses, no optimization can be done for their execution. A module pass +can use function level passes (e.g. dominators) using getAnalysis interface + getAnalysis(Function).

To write a correct ModulePass subclass, derive from ModulePass and overload the runOnModule method with the @@ -1127,7 +1129,21 @@ declare as required in your getAnalysisUsage implementation. This method can be called by your run* method implementation, or by any -other local method invoked by your run* method.

+other local method invoked by your run* method. + +A module level pass can use function level analysis info using this interface. +For example:

+ +
+   bool ModuleLevelPass::runOnModule(Module &M) {
+     ...
+     DominatorTree &DT = getAnalysis<DominatorTree>(Function &F);
+     ...
+   }
+
+ +In above example, runOnFunction for DominatorTree is called by pass manager +before returning a reference to the desired pass.

If your pass is capable of updating analyses if they exist (e.g., @@ -1799,7 +1815,7 @@ Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007/03/19 22:21:25 $ + Last modified: $Date: 2007/04/16 21:28:14 $ From sabre at nondot.org Mon Apr 16 16:30:42 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 16:30:42 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll Message-ID: <200704162130.l3GLUggh016750@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: 2007-03-15-GEP-Idx-Sink.ll updated: 1.5 -> 1.6 --- Log message: refix this --- Diffs of the changes: (+1 -1) 2007-03-15-GEP-Idx-Sink.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll diff -u llvm/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll:1.5 llvm/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll:1.6 --- llvm/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll:1.5 Mon Apr 16 13:59:25 2007 +++ llvm/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll Mon Apr 16 16:30:21 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-darwin | \ -; RUN: grep {addl \$16, %esp} +; RUN: grep {addl \$12, %esp} define void @foo(i8** %buf, i32 %size, i32 %col, i8* %p) { entry: From clattner at apple.com Mon Apr 16 16:33:53 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 16 Apr 2007 14:33:53 -0700 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y In-Reply-To: <200704162031.l3GKVREk014695@zion.cs.uiuc.edu> References: <200704162031.l3GKVREk014695@zion.cs.uiuc.edu> Message-ID: > Check length of string before we walk off the end of it. > Thanks, Chris. but I want to support nul characters in my names! -Chris > > --- > Diffs of the changes: (+3 -3) > > llvmAsmParser.y | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > > Index: llvm/lib/AsmParser/llvmAsmParser.y > diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.341 llvm/lib/AsmParser/ > llvmAsmParser.y:1.342 > --- llvm/lib/AsmParser/llvmAsmParser.y:1.341 Mon Apr 16 12:45:50 2007 > +++ llvm/lib/AsmParser/llvmAsmParser.y Mon Apr 16 15:31:06 2007 > @@ -2823,9 +2823,9 @@ > > // Check for call to invalid intrinsic to avoid crashing later. > if (Function *theF = dyn_cast(V)) { > - if (theF->hasName() && > - 0 == strncmp(theF->getValueName()->getKeyData(), > "llvm.", 5) && > - !theF->getIntrinsicID(true)) > + if (theF->hasName() && (strlen(theF->getValueName()- > >getKeyData()) >= 5)&& > + (0 == strncmp(theF->getValueName()->getKeyData(), > "llvm.", 5)) && > + !theF->getIntrinsicID(true)) > GEN_ERROR("Call to invalid LLVM intrinsic function '" + > theF->getName() + "'"); > } > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From rspencer at reidspencer.com Mon Apr 16 16:46:27 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Mon, 16 Apr 2007 14:46:27 -0700 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y In-Reply-To: References: <200704162031.l3GKVREk014695@zion.cs.uiuc.edu> Message-ID: <1176759987.23191.365.camel@bashful.x10sys.com> On Mon, 2007-04-16 at 14:33 -0700, Chris Lattner wrote: > > Check length of string before we walk off the end of it. > > Thanks, Chris. > > but I want to support nul characters in my names! Okay, so this whole "ValueName" and "StringMap" thing I don't understand. How do you get the length of a name now? Reid. > > -Chris > > > > > --- > > Diffs of the changes: (+3 -3) > > > > llvmAsmParser.y | 6 +++--- > > 1 files changed, 3 insertions(+), 3 deletions(-) > > > > > > Index: llvm/lib/AsmParser/llvmAsmParser.y > > diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.341 llvm/lib/AsmParser/ > > llvmAsmParser.y:1.342 > > --- llvm/lib/AsmParser/llvmAsmParser.y:1.341 Mon Apr 16 12:45:50 2007 > > +++ llvm/lib/AsmParser/llvmAsmParser.y Mon Apr 16 15:31:06 2007 > > @@ -2823,9 +2823,9 @@ > > > > // Check for call to invalid intrinsic to avoid crashing later. > > if (Function *theF = dyn_cast(V)) { > > - if (theF->hasName() && > > - 0 == strncmp(theF->getValueName()->getKeyData(), > > "llvm.", 5) && > > - !theF->getIntrinsicID(true)) > > + if (theF->hasName() && (strlen(theF->getValueName()- > > >getKeyData()) >= 5)&& > > + (0 == strncmp(theF->getValueName()->getKeyData(), > > "llvm.", 5)) && > > + !theF->getIntrinsicID(true)) > > GEN_ERROR("Call to invalid LLVM intrinsic function '" + > > theF->getName() + "'"); > > } > > > > > > > > _______________________________________________ > > 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 jeffc at jolt-lang.org Mon Apr 16 16:49:19 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Mon, 16 Apr 2007 16:49:19 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86Subtarget.cpp Message-ID: <200704162149.l3GLnJx5017211@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86Subtarget.cpp updated: 1.54 -> 1.55 --- Log message: Before assuming that the original code didn't work for Athlon64, the person who replaced it with a FIXME should have determined what did work. Then he would have realized that the code was in fact correct, and would have avoided breaking it. --- Diffs of the changes: (+2 -6) X86Subtarget.cpp | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) Index: llvm/lib/Target/X86/X86Subtarget.cpp diff -u llvm/lib/Target/X86/X86Subtarget.cpp:1.54 llvm/lib/Target/X86/X86Subtarget.cpp:1.55 --- llvm/lib/Target/X86/X86Subtarget.cpp:1.54 Tue Apr 10 17:10:25 2007 +++ llvm/lib/Target/X86/X86Subtarget.cpp Mon Apr 16 16:48:58 2007 @@ -115,12 +115,8 @@ if (ECX & 0x1) X86SSELevel = SSE3; if ((ECX >> 9) & 0x1) X86SSELevel = SSSE3; - if (memcmp(text.c, "GenuineIntel", 12) == 0) { - X86::GetCpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX); - HasX86_64 = (EDX >> 29) & 0x1; - } else if (memcmp(text.c, "AuthenticAMD", 12) == 0) { - // FIXME: Correctly check for 64-bit stuff - } + X86::GetCpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX); + HasX86_64 = (EDX >> 29) & 0x1; } static const char *GetCurrentX86CPU() { From clattner at apple.com Mon Apr 16 16:49:22 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 16 Apr 2007 14:49:22 -0700 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y In-Reply-To: <1176759987.23191.365.camel@bashful.x10sys.com> References: <200704162031.l3GKVREk014695@zion.cs.uiuc.edu> <1176759987.23191.365.camel@bashful.x10sys.com> Message-ID: <5BEE5D32-ED57-427E-B936-E4F887FA28A5@apple.com> On Apr 16, 2007, at 2:46 PM, Reid Spencer wrote: > On Mon, 2007-04-16 at 14:33 -0700, Chris Lattner wrote: >>> Check length of string before we walk off the end of it. >>> Thanks, Chris. >> >> but I want to support nul characters in my names! > > Okay, so this whole "ValueName" and "StringMap" thing I don't > understand. How do you get the length of a name now? getKeyLength() method on the ValueName. -Chris From reid at x10sys.com Mon Apr 16 16:51:01 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 16:51:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Message-ID: <200704162151.l3GLp19K017282@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: Execution.cpp updated: 1.177 -> 1.178 --- Log message: Implement @sext and @zext parameter attribute handling properly instead of forcing every small argument of every function regardless of attributes or calling convention to be expanded. --- Diffs of the changes: (+20 -11) Execution.cpp | 31 ++++++++++++++++++++----------- 1 files changed, 20 insertions(+), 11 deletions(-) Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.177 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.178 --- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.177 Thu Mar 8 17:37:24 2007 +++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Mon Apr 16 16:50:40 2007 @@ -16,6 +16,7 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Instructions.h" +#include "llvm/ParameterAttributes.h" #include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/ADT/APInt.h" @@ -844,8 +845,8 @@ ExecutionContext &SF = ECStack.back(); // Check to see if this is an intrinsic function call... - if (Function *F = CS.getCalledFunction()) - if (F->isDeclaration ()) + Function *F = CS.getCalledFunction(); + if (F && F->isDeclaration ()) switch (F->getIntrinsicID()) { case Intrinsic::not_intrinsic: break; @@ -880,21 +881,28 @@ return; } + SF.Caller = CS; std::vector ArgVals; const unsigned NumArgs = SF.Caller.arg_size(); ArgVals.reserve(NumArgs); + uint16_t pNum = 1; for (CallSite::arg_iterator i = SF.Caller.arg_begin(), - e = SF.Caller.arg_end(); i != e; ++i) { + e = SF.Caller.arg_end(); i != e; ++i, ++pNum) { Value *V = *i; ArgVals.push_back(getOperandValue(V, SF)); - // Promote all integral types whose size is < sizeof(int) into ints. We do - // this by zero or sign extending the value as appropriate according to the - // source type. - const Type *Ty = V->getType(); - if (Ty->isInteger()) - if (ArgVals.back().IntVal.getBitWidth() < 32) - ArgVals.back().IntVal = ArgVals.back().IntVal.sext(32); + if (F) { + // Promote all integral types whose size is < sizeof(i32) into i32. + // We do this by zero or sign extending the value as appropriate + // according to the parameter attributes + const Type *Ty = V->getType(); + if (Ty->isInteger() && (ArgVals.back().IntVal.getBitWidth() < 32)) + if (const ParamAttrsList *PA = F->getParamAttrs()) + if (PA->paramHasAttr(pNum, ParamAttr::ZExt)) + ArgVals.back().IntVal = ArgVals.back().IntVal.zext(32); + else if (PA->paramHasAttr(pNum, ParamAttr::SExt)) + ArgVals.back().IntVal = ArgVals.back().IntVal.sext(32); + } } // To handle indirect calls, we must get the pointer value from the argument @@ -1317,7 +1325,8 @@ // Handle non-varargs arguments... unsigned i = 0; - for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); AI != E; ++AI, ++i) + for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); + AI != E; ++AI, ++i) SetValue(AI, ArgVals[i], StackFrame); // Handle varargs arguments... From reid at x10sys.com Mon Apr 16 16:53:17 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 16:53:17 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/bit-intrinsics.ll Message-ID: <200704162153.l3GLrH6n017328@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: bit-intrinsics.ll updated: 1.2 -> 1.3 --- Log message: Also validate that the code generation of IntrinsicLowering for LLI works. --- Diffs of the changes: (+25 -6) bit-intrinsics.ll | 31 +++++++++++++++++++++++++------ 1 files changed, 25 insertions(+), 6 deletions(-) Index: llvm/test/CodeGen/Generic/bit-intrinsics.ll diff -u llvm/test/CodeGen/Generic/bit-intrinsics.ll:1.2 llvm/test/CodeGen/Generic/bit-intrinsics.ll:1.3 --- llvm/test/CodeGen/Generic/bit-intrinsics.ll:1.2 Thu Apr 5 17:57:45 2007 +++ llvm/test/CodeGen/Generic/bit-intrinsics.ll Mon Apr 16 16:52:56 2007 @@ -1,15 +1,34 @@ ; Make sure this testcase is supported by all code generators. Either the ; intrinsic is supported natively or IntrinsicLowering provides it. -; RUN: llvm-as < %s | llc +; RUN: llvm-as < %s > %t.bc +; RUN: lli --force-interpreter=true %t.bc +; RUN: llc %t.bc -o /dev/null -f ; XFAIL: * +declare i32 @llvm.part.set.i32.i32.i32(i32 %x, i32 %rep, i32 %hi, i32 %lo) +declare i16 @llvm.part.set.i16.i16.i16(i16 %x, i16 %rep, i32 %hi, i32 %lo) +define i32 @test_part_set(i32 %A, i16 %B) { + %a = call i32 @llvm.part.set.i32.i32.i32(i32 %A, i32 27, i32 8, i32 0) + %b = call i16 @llvm.part.set.i16.i16.i16(i16 %B, i16 27, i32 8, i32 0) + %c = zext i16 %b to i32 + %d = add i32 %a, %c + ret i32 %d +} -declare i32 @llvm.bit.part.select.i32.i32(i32 %x, i32 %hi, i32 %lo) -declare i16 @llvm.bit.part.select.i16.i16(i16 %x, i32 %hi, i32 %lo) -define i32 @bit_part_select(i32 %A, i16 %B) { - %a = call i32 @llvm.bit.part.select.i32.i32(i32 %A, i32 8, i32 0) - %b = call i16 @llvm.bit.part.select.i16.i16(i16 %B, i32 8, i32 0) +declare i32 @llvm.part.select.i32.i32(i32 %x, i32 %hi, i32 %lo) +declare i16 @llvm.part.select.i16.i16(i16 %x, i32 %hi, i32 %lo) +define i32 @test_part_select(i32 %A, i16 %B) { + %a = call i32 @llvm.part.select.i32.i32(i32 %A, i32 8, i32 0) + %b = call i16 @llvm.part.select.i16.i16(i16 %B, i32 8, i32 0) %c = zext i16 %b to i32 %d = add i32 %a, %c ret i32 %d } + +define i32 @main(i32 %argc, i8** %argv) { + %a = call i32 @test_part_set(i32 23, i16 57) + %b = call i32 @test_part_select(i32 23, i16 57) + %c = add i32 %a, %b + %d = urem i32 %c, 1 + ret i32 %d +} From reid at x10sys.com Mon Apr 16 16:57:35 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 16:57:35 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/LICM/scalar_promote.ll Message-ID: <200704162157.l3GLvZQg017456@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/LICM: scalar_promote.ll updated: 1.5 -> 1.6 --- Log message: Fix this test from Duncan's experiment. --- Diffs of the changes: (+1 -1) scalar_promote.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Transforms/LICM/scalar_promote.ll diff -u llvm/test/Transforms/LICM/scalar_promote.ll:1.5 llvm/test/Transforms/LICM/scalar_promote.ll:1.6 --- llvm/test/Transforms/LICM/scalar_promote.ll:1.5 Mon Apr 16 10:15:52 2007 +++ llvm/test/Transforms/LICM/scalar_promote.ll Mon Apr 16 16:57:14 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-upgrade < %s | llvm-as | opt -licm -stats |& \ -; RUN: grep {memory locations promoted to register} +; RUN: grep {memory locations promoted to register} %X = global int 7 From jeffc at jolt-lang.org Mon Apr 16 17:00:06 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Mon, 16 Apr 2007 17:00:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86Subtarget.cpp Message-ID: <200704162200.l3GM06wk017567@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86Subtarget.cpp updated: 1.55 -> 1.56 --- Log message: In the event that some really old non-Intel or -AMD CPU is encountered... --- Diffs of the changes: (+5 -2) X86Subtarget.cpp | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) Index: llvm/lib/Target/X86/X86Subtarget.cpp diff -u llvm/lib/Target/X86/X86Subtarget.cpp:1.55 llvm/lib/Target/X86/X86Subtarget.cpp:1.56 --- llvm/lib/Target/X86/X86Subtarget.cpp:1.55 Mon Apr 16 16:48:58 2007 +++ llvm/lib/Target/X86/X86Subtarget.cpp Mon Apr 16 16:59:44 2007 @@ -115,8 +115,11 @@ if (ECX & 0x1) X86SSELevel = SSE3; if ((ECX >> 9) & 0x1) X86SSELevel = SSSE3; - X86::GetCpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX); - HasX86_64 = (EDX >> 29) & 0x1; + if (memcmp(text.c, "GenuineIntel", 12) == 0 || + memcmp(text.c, "AuthenticAMD", 12) == 0) { + X86::GetCpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX); + HasX86_64 = (EDX >> 29) & 0x1; + } } static const char *GetCurrentX86CPU() { From reid at x10sys.com Mon Apr 16 17:02:18 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 17:02:18 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y Message-ID: <200704162202.l3GM2Itu017651@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.342 -> 1.343 --- Log message: Okay, yes there *is* a getKeyLength method on ValueName. And, it should be used because we *do* want to allow nulls in names. --- Diffs of the changes: (+1 -1) llvmAsmParser.y | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.342 llvm/lib/AsmParser/llvmAsmParser.y:1.343 --- llvm/lib/AsmParser/llvmAsmParser.y:1.342 Mon Apr 16 15:31:06 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y Mon Apr 16 17:01:57 2007 @@ -2823,7 +2823,7 @@ // Check for call to invalid intrinsic to avoid crashing later. if (Function *theF = dyn_cast(V)) { - if (theF->hasName() && (strlen(theF->getValueName()->getKeyData()) >= 5)&& + if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) && (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) && !theF->getIntrinsicID(true)) GEN_ERROR("Call to invalid LLVM intrinsic function '" + From reid at x10sys.com Mon Apr 16 17:02:44 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 17:02:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.y.cvs Message-ID: <200704162202.l3GM2iPF017690@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp.cvs updated: 1.87 -> 1.88 llvmAsmParser.y.cvs updated: 1.88 -> 1.89 --- Log message: Regenerate --- Diffs of the changes: (+2 -2) llvmAsmParser.cpp.cvs | 2 +- llvmAsmParser.y.cvs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.87 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.88 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.87 Mon Apr 16 15:35:38 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Mon Apr 16 17:02:22 2007 @@ -5488,7 +5488,7 @@ // Check for call to invalid intrinsic to avoid crashing later. if (Function *theF = dyn_cast(V)) { - if (theF->hasName() && (strlen(theF->getValueName()->getKeyData()) >= 5)&& + if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) && (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) && !theF->getIntrinsicID(true)) GEN_ERROR("Call to invalid LLVM intrinsic function '" + Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.88 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.89 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.88 Mon Apr 16 15:35:38 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Mon Apr 16 17:02:23 2007 @@ -2823,7 +2823,7 @@ // Check for call to invalid intrinsic to avoid crashing later. if (Function *theF = dyn_cast(V)) { - if (theF->hasName() && (strlen(theF->getValueName()->getKeyData()) >= 5)&& + if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) && (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) && !theF->getIntrinsicID(true)) GEN_ERROR("Call to invalid LLVM intrinsic function '" + From asl at math.spbu.ru Mon Apr 16 17:06:34 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 17 Apr 2007 02:06:34 +0400 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86Subtarget.cpp In-Reply-To: <200704162149.l3GLnJx5017211.SS1422SS@zion.cs.uiuc.edu> References: <200704162149.l3GLnJx5017211.SS1422SS@zion.cs.uiuc.edu> Message-ID: <1176761194.13159.65.camel@asl.dorms.spbu.ru> Jeff, > Before assuming that the original code didn't work for Athlon64, the person who > replaced it with a FIXME should have determined what did work. Then he would have > realized that the code was in fact correct, and would have avoided breaking it. The prev. code didn't know about AMD processors at all. It was one big "FIXME: support AMD processors". You can just look into diff for 1.53 to verify it. I wasn't be able to verify 64-bit stuff that's why I put another FIXME there. So, I don't see any breakage here. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From reid at x10sys.com Mon Apr 16 17:21:40 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 17:21:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp Message-ID: <200704162221.l3GMLevm018356@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: IntrinsicLowering.cpp updated: 1.80 -> 1.81 --- Log message: Fix problems in the PartSet lowering having to do with incorrect bit width. --- Diffs of the changes: (+5 -3) IntrinsicLowering.cpp | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/IntrinsicLowering.cpp diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.80 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.81 --- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.80 Thu Apr 12 16:53:38 2007 +++ llvm/lib/CodeGen/IntrinsicLowering.cpp Mon Apr 16 17:21:14 2007 @@ -538,8 +538,10 @@ new BranchInst(large, small, is_large, entry); // Block "large" - BinaryOperator* MaskBits = + Instruction* MaskBits = BinaryOperator::createSub(RepBitWidth, NumBits, "", large); + MaskBits = CastInst::createIntegerCast(MaskBits, RepMask->getType(), + false, "", large); BinaryOperator* Mask1 = BinaryOperator::createLShr(RepMask, MaskBits, "", large); BinaryOperator* Rep2 = BinaryOperator::createAnd(Mask1, Rep, "", large); @@ -575,10 +577,10 @@ Value* t8 = BinaryOperator::createXor(t7, ValMask, "", reverse); Value* t9 = BinaryOperator::createAnd(t8, Val, "", reverse); Value* t10 = BinaryOperator::createShl(Rep4, Lo, "", reverse); - if (RepBits < ValBits) + if (32 < ValBits) RepBitWidth = cast(ConstantExpr::getZExt(RepBitWidth, ValTy)); - else if (RepBits > ValBits) + else if (32 > ValBits) RepBitWidth = cast(ConstantExpr::getTrunc(RepBitWidth, ValTy)); Value* t11 = BinaryOperator::createSub(RepBitWidth, Hi, "", reverse); From dpatel at apple.com Mon Apr 16 18:02:43 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 16 Apr 2007 18:02:43 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll Message-ID: <200704162302.l3GN2hYh019433@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/LoopUnroll: 2007-04-16-PhiUpdate.ll added (r1.1) --- Log message: New test case. --- Diffs of the changes: (+17 -0) 2007-04-16-PhiUpdate.ll | 17 +++++++++++++++++ 1 files changed, 17 insertions(+) Index: llvm/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll diff -c /dev/null llvm/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll:1.1 *** /dev/null Mon Apr 16 18:02:32 2007 --- llvm/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll Mon Apr 16 18:02:22 2007 *************** *** 0 **** --- 1,17 ---- + ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-unroll -disable-output + + void @sal__math_float_manipulator_7__math__joint_array_dcv_ops__Omultiply__3([6 x float]* %agg.result) { + entry: + %tmp282911 = zext i8 0 to i32 ; [#uses=1] + br label %cond_next + + cond_next: ; preds = %cond_next, %entry + %indvar = phi i8 [ 0, %entry ], [ %indvar.next, %cond_next ] ; [#uses=1] + %indvar.next = add i8 %indvar, 1 ; [#uses=2] + %exitcond = icmp eq i8 %indvar.next, 7 ; [#uses=1] + br i1 %exitcond, label %bb27, label %cond_next + + bb27: ; preds = %cond_next + %tmp282911.lcssa = phi i32 [ %tmp282911, %cond_next ] ; [#uses=0] + ret void + } From dpatel at apple.com Mon Apr 16 18:04:07 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 16 Apr 2007 18:04:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnroll.cpp Message-ID: <200704162304.l3GN47iQ019496@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopUnroll.cpp updated: 1.38 -> 1.39 --- Log message: Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070416/047888.html --- Diffs of the changes: (+6 -0) LoopUnroll.cpp | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.38 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.39 --- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.38 Tue Mar 6 19:38:05 2007 +++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp Mon Apr 16 18:03:45 2007 @@ -304,6 +304,12 @@ (*SI)->removeIncomingValue(LatchBlock, false); if (InVal) (*SI)->addIncoming(InVal, cast(LastValueMap[LatchBlock])); + if ((*SI)->getNumIncomingValues() == 0) { + // Remove this phi node. + // If anyone is using this PHI, make them use a dummy value instead... + (*SI)->replaceAllUsesWith(UndefValue::get((*SI)->getType())); + (*SI)->eraseFromParent(); + } } } From reid at x10sys.com Mon Apr 16 18:27:19 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 18:27:19 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704162327.l3GNRJtX020188@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html updated: 1.14 -> 1.15 --- Log message: Path by Gordon Henricksen --- Diffs of the changes: (+12 -2) Name.html | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.14 llvm-www/Name.html:1.15 --- llvm-www/Name.html:1.14 Sat Apr 14 11:50:07 2007 +++ llvm-www/Name.html Mon Apr 16 18:26:58 2007 @@ -151,7 +151,7 @@ Jeff Cohen Oscar Oscar = Open Source Compiler And Runtime - Reid Spencer + Reid Spencer Alluvium The layers of sediment deposited by a river. Also retains the LLVM letters but is a word and connotes "bed rock" and fluidity @@ -161,6 +161,8 @@ Average Compiler" (BooBoo!). An acronym that you can pronounce. Unfortunately, the New York Athletic Club wouldn't like us stealing their domain. :) + OscctrPronouncable acronym for Open Source Compiler + Components and Runtime. Bill WendlingZemblaIt's a fictional northern European country in "Pale Fire" by Nabokov. PalaThe island utopia in Aldos Huxley's "Island". @@ -264,6 +266,14 @@ -ski ending sounds good. For both this and the Dragomni above a "BSD daemon"-like logo of a dragon named, e.g. Dragonski, could be used. + Gordon Henriksen + Advanced Compiler KitACK! With an ill-deserved nod to NeXT. + (It's the wrong language, after all.) + + Core CompilerLikely to give certain influential marketing + departments fits. + VelicicodeDerived from the Italian for fast. + Nucleo VeloceItalian for fast core. @@ -274,6 +284,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
Last modified: $Date: 2007/04/14 16:50:07 $ +
Last modified: $Date: 2007/04/16 23:26:58 $ From reid at x10sys.com Mon Apr 16 18:32:49 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 18:32:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200704162332.l3GNWnTX020320@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.172 -> 1.173 --- Log message: Make long line fit in 80 cols. --- Diffs of the changes: (+1 -1) Writer.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.172 llvm/lib/Bytecode/Writer/Writer.cpp:1.173 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.172 Thu Apr 12 13:32:50 2007 +++ llvm/lib/Bytecode/Writer/Writer.cpp Mon Apr 16 18:32:28 2007 @@ -1000,7 +1000,7 @@ unsigned CC = I->getCallingConv()+1; unsigned ID = (Slot << 5) | (CC & 15); - if (I->isDeclaration()) // If external, we don't have an FunctionInfo block. + if (I->isDeclaration()) // If external, we don't have an FunctionInfo block. ID |= 1 << 4; if (I->getAlignment() || I->hasSection() || (CC & ~15) != 0 || From dpatel at apple.com Mon Apr 16 18:52:58 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 16 Apr 2007 18:52:58 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll Message-ID: <200704162352.l3GNqwO8020622@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/LoopUnroll: 2007-04-16-PhiUpdate.ll updated: 1.1 -> 1.2 --- Log message: Add PR number for reference. --- Diffs of the changes: (+1 -0) 2007-04-16-PhiUpdate.ll | 1 + 1 files changed, 1 insertion(+) Index: llvm/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll diff -u llvm/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll:1.1 llvm/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll:1.2 --- llvm/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll:1.1 Mon Apr 16 18:02:22 2007 +++ llvm/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll Mon Apr 16 18:52:37 2007 @@ -1,3 +1,4 @@ +; PR 1334 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-unroll -disable-output void @sal__math_float_manipulator_7__math__joint_array_dcv_ops__Omultiply__3([6 x float]* %agg.result) { From sabre at nondot.org Mon Apr 16 19:02:59 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 19:02:59 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/README.txt Message-ID: <200704170002.l3H02xt4020801@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: README.txt updated: 1.165 -> 1.166 --- Log message: SSE4 is apparently public now. --- Diffs of the changes: (+2 -0) README.txt | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Target/X86/README.txt diff -u llvm/lib/Target/X86/README.txt:1.165 llvm/lib/Target/X86/README.txt:1.166 --- llvm/lib/Target/X86/README.txt:1.165 Sat Apr 14 18:06:09 2007 +++ llvm/lib/Target/X86/README.txt Mon Apr 16 19:02:37 2007 @@ -3,6 +3,8 @@ //===---------------------------------------------------------------------===// Missing features: + - Support for SSE4: http://www.intel.com/software/penryn +http://softwarecommunity.intel.com/isn/Downloads/Intel%20SSE4%20Programming%20Reference.pdf - support for 3DNow! - weird abis? From rspencer at reidspencer.com Mon Apr 16 19:06:17 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Mon, 16 Apr 2007 17:06:17 -0700 Subject: [llvm-commits] CVS: llvm/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll In-Reply-To: <200704162352.l3GNqwO8020622@zion.cs.uiuc.edu> References: <200704162352.l3GNqwO8020622@zion.cs.uiuc.edu> Message-ID: <1176768377.23191.377.camel@bashful.x10sys.com> On Mon, 2007-04-16 at 18:52 -0500, Devang Patel wrote: > > Changes in directory llvm/test/Transforms/LoopUnroll: > > 2007-04-16-PhiUpdate.ll updated: 1.1 -> 1.2 > --- > Log message: > > Add PR number for reference. Yeah! Its actually handy to do so now :) Reid. > > > --- > Diffs of the changes: (+1 -0) > > 2007-04-16-PhiUpdate.ll | 1 + > 1 files changed, 1 insertion(+) > > > Index: llvm/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll > diff -u llvm/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll:1.1 llvm/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll:1.2 > --- llvm/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll:1.1 Mon Apr 16 18:02:22 2007 > +++ llvm/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll Mon Apr 16 18:52:37 2007 > @@ -1,3 +1,4 @@ > +; PR 1334 > ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-unroll -disable-output > > void @sal__math_float_manipulator_7__math__joint_array_dcv_ops__Omultiply__3([6 x float]* %agg.result) { > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Mon Apr 16 19:17:32 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 16 Apr 2007 19:17:32 -0500 Subject: [llvm-commits] CVS: llvm/docs/WritingAnLLVMPass.html Message-ID: <200704170017.l3H0HWnQ021120@zion.cs.uiuc.edu> Changes in directory llvm/docs: WritingAnLLVMPass.html updated: 1.55 -> 1.56 --- Log message: Remove "ModulePasses requiring FunctionPasses" from the list of future extensions. --- Diffs of the changes: (+2 -29) WritingAnLLVMPass.html | 31 ++----------------------------- 1 files changed, 2 insertions(+), 29 deletions(-) Index: llvm/docs/WritingAnLLVMPass.html diff -u llvm/docs/WritingAnLLVMPass.html:1.55 llvm/docs/WritingAnLLVMPass.html:1.56 --- llvm/docs/WritingAnLLVMPass.html:1.55 Mon Apr 16 16:28:14 2007 +++ llvm/docs/WritingAnLLVMPass.html Mon Apr 16 19:17:11 2007 @@ -103,8 +103,6 @@

  • Future extensions planned
  • @@ -1137,7 +1135,7 @@
        bool ModuleLevelPass::runOnModule(Module &M) {
          ...
    -     DominatorTree &DT = getAnalysis<DominatorTree>(Function &F);
    +     DominatorTree &DT = getAnalysis<DominatorTree>(Func);
          ...
        }
     
    @@ -1780,31 +1778,6 @@ haven't had time (or multiprocessor machines, thus a reason) to implement this. Despite that, we have kept the LLVM passes SMP ready, and you should too.

    - - - - - -
    - -

    Currently it is illegal for a ModulePass -to require a FunctionPass. This is because -there is only one instance of the FunctionPass object ever created, thus nowhere -to store information for all of the functions in the program at the same time. -Although this has come up a couple of times before, this has always been worked -around by factoring one big complicated pass into a global and an -interprocedural part, both of which are distinct. In the future, it would be -nice to have this though.

    - -

    Note that it is no problem for a FunctionPass to require the results of a ModulePass, only the other way around.

    - -
    -
    @@ -1815,7 +1788,7 @@ Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/04/16 21:28:14 $ + Last modified: $Date: 2007/04/17 00:17:11 $
    From jeffc at jolt-lang.org Mon Apr 16 20:30:26 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Mon, 16 Apr 2007 18:30:26 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86Subtarget.cpp In-Reply-To: <1176761194.13159.65.camel@asl.dorms.spbu.ru> References: <200704162149.l3GLnJx5017211.SS1422SS@zion.cs.uiuc.edu> <1176761194.13159.65.camel@asl.dorms.spbu.ru> Message-ID: <46242332.6020308@jolt-lang.org> Yes, it worked for AMD. I have AMD, and I wrote the code to support AMD. I left the code the way it was because it was correct for AMD. I actually tested it on an AMD system. Anton Korobeynikov wrote: > Jeff, > > >> Before assuming that the original code didn't work for Athlon64, the person who >> replaced it with a FIXME should have determined what did work. Then he would have >> realized that the code was in fact correct, and would have avoided breaking it. >> > The prev. code didn't know about AMD processors at all. It was one big > "FIXME: support AMD processors". You can just look into diff for 1.53 to > verify it. I wasn't be able to verify 64-bit stuff that's why I put > another FIXME there. > > So, I don't see any breakage here. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070416/1c44ea2f/attachment.html From jeffc at jolt-lang.org Mon Apr 16 20:40:53 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Mon, 16 Apr 2007 18:40:53 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86Subtarget.cpp In-Reply-To: <46242332.6020308@jolt-lang.org> References: <200704162149.l3GLnJx5017211.SS1422SS@zion.cs.uiuc.edu> <1176761194.13159.65.camel@asl.dorms.spbu.ru> <46242332.6020308@jolt-lang.org> Message-ID: <462425A5.5020209@jolt-lang.org> Looks like Evan broke it last October. Jeff Cohen wrote: > Yes, it worked for AMD. I have AMD, and I wrote the code to support > AMD. I left the code the way it was because it was correct for AMD. > I actually tested it on an AMD system. > > Anton Korobeynikov wrote: >> Jeff, >> >> >>> Before assuming that the original code didn't work for Athlon64, the person who >>> replaced it with a FIXME should have determined what did work. Then he would have >>> realized that the code was in fact correct, and would have avoided breaking it. >>> >> The prev. code didn't know about AMD processors at all. It was one big >> "FIXME: support AMD processors". You can just look into diff for 1.53 to >> verify it. I wasn't be able to verify 64-bit stuff that's why I put >> another FIXME there. >> >> So, I don't see any breakage here. >> >> > ------------------------------------------------------------------------ > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070416/822ac666/attachment.html From reid at x10sys.com Mon Apr 16 20:57:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 16 Apr 2007 20:57:16 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704170157.l3H1vGHG022991@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html updated: 1.15 -> 1.16 --- Log message: Add my and Nicolas entries. --- Diffs of the changes: (+10 -2) Name.html | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.15 llvm-www/Name.html:1.16 --- llvm-www/Name.html:1.15 Mon Apr 16 18:26:58 2007 +++ llvm-www/Name.html Mon Apr 16 20:56:54 2007 @@ -151,7 +151,7 @@ Jeff Cohen Oscar Oscar = Open Source Compiler And Runtime - Reid Spencer + Reid Spencer Alluvium The layers of sediment deposited by a river. Also retains the LLVM letters but is a word and connotes "bed rock" and fluidity @@ -163,6 +163,8 @@ their domain. :) OscctrPronouncable acronym for Open Source Compiler Components and Runtime. + ToscarToolkit for Open Source Compiler and Runtime, + prounced as "Teh Oscar!" Bill WendlingZemblaIt's a fictional northern European country in "Pale Fire" by Nabokov. PalaThe island utopia in Aldos Huxley's "Island". @@ -274,6 +276,12 @@ departments fits. VelicicodeDerived from the Italian for fast. Nucleo VeloceItalian for fast core. + Nicolas PouillonSsabir + A sabir is an hybrid language formerly used around Mediterranean Sea. + English equivalent is pidgin + (on WP page, the three points about Pidgin creation are quite relevant + for LLVM :-) ). Spelling it ("Ssabir") not only makes the name unique, + but recalls LLVM is all about SSA. @@ -284,6 +292,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/16 23:26:58 $ +
    Last modified: $Date: 2007/04/17 01:56:54 $ From sabre at nondot.org Mon Apr 16 21:05:00 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 21:05:00 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ValueSymbolTable.h Message-ID: <200704170205.l3H250qN023160@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: ValueSymbolTable.h updated: 1.10 -> 1.11 --- Log message: urr, yeah. --- Diffs of the changes: (+2 -4) ValueSymbolTable.h | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) Index: llvm/include/llvm/ValueSymbolTable.h diff -u llvm/include/llvm/ValueSymbolTable.h:1.10 llvm/include/llvm/ValueSymbolTable.h:1.11 --- llvm/include/llvm/ValueSymbolTable.h:1.10 Tue Apr 3 19:30:49 2007 +++ llvm/include/llvm/ValueSymbolTable.h Mon Apr 16 21:04:39 2007 @@ -2,10 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by Reid Spencer based on the original SymbolTable.h -// written by the LLVM research group and re-written by Reid Spencer. -// It is distributed under the University of Illinois Open Source License. -// See LICENSE.TXT for details. +// This file was developed by Reid Spencer and is distributed under +// the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // From sabre at nondot.org Mon Apr 16 22:27:13 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 22:27:13 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Argument.h BasicBlock.h Function.h GlobalVariable.h Instruction.h Module.h SymbolTableListTraits.h ValueSymbolTable.h Message-ID: <200704170327.l3H3RDhn024568@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Argument.h updated: 1.15 -> 1.16 BasicBlock.h updated: 1.64 -> 1.65 Function.h updated: 1.75 -> 1.76 GlobalVariable.h updated: 1.41 -> 1.42 Instruction.h updated: 1.83 -> 1.84 Module.h updated: 1.85 -> 1.86 SymbolTableListTraits.h updated: 1.5 -> 1.6 ValueSymbolTable.h updated: 1.11 -> 1.12 --- Log message: Refactor SymbolTableListTraits to only have a single pointer in it, instead of two. This shrinkifies Function by 8 bytes (104->96) and Module by 8 bytes (68->60). On a testcase of mine, this reduces the memory used to read a module header from 565680b to 561024, a little over 4K. --- Diffs of the changes: (+61 -54) Argument.h | 8 +++----- BasicBlock.h | 10 ++++++---- Function.h | 18 +++++++++++++++--- GlobalVariable.h | 8 +++----- Instruction.h | 8 +++----- Module.h | 17 +++++++++++++++-- SymbolTableListTraits.h | 27 ++++++++++----------------- ValueSymbolTable.h | 19 ++++++------------- 8 files changed, 61 insertions(+), 54 deletions(-) Index: llvm/include/llvm/Argument.h diff -u llvm/include/llvm/Argument.h:1.15 llvm/include/llvm/Argument.h:1.16 --- llvm/include/llvm/Argument.h:1.15 Fri Apr 13 13:12:09 2007 +++ llvm/include/llvm/Argument.h Mon Apr 16 22:26:42 2007 @@ -18,9 +18,8 @@ namespace llvm { -template struct ilist_traits; -template class SymbolTableListTraits; +template + class SymbolTableListTraits; /// A class to represent an incoming formal argument to a Function. An argument /// is a very simple Value. It is essentially a named (optional) type. When used @@ -33,8 +32,7 @@ Argument *Prev, *Next; // Next and Prev links for our intrusive linked list void setNext(Argument *N) { Next = N; } void setPrev(Argument *N) { Prev = N; } - friend class SymbolTableListTraits >; + friend class SymbolTableListTraits; void setParent(Function *parent); public: Index: llvm/include/llvm/BasicBlock.h diff -u llvm/include/llvm/BasicBlock.h:1.64 llvm/include/llvm/BasicBlock.h:1.65 --- llvm/include/llvm/BasicBlock.h:1.64 Fri Apr 13 13:12:09 2007 +++ llvm/include/llvm/BasicBlock.h Mon Apr 16 22:26:42 2007 @@ -25,11 +25,12 @@ template class PredIterator; template<> struct ilist_traits - : public SymbolTableListTraits { + : public SymbolTableListTraits { // createSentinel is used to create a node that marks the end of the list... static Instruction *createSentinel(); static void destroySentinel(Instruction *I) { delete I; } static iplist &getList(BasicBlock *BB); + static ValueSymbolTable *getSymTab(BasicBlock *ItemParent); }; /// This represents a single basic block in LLVM. A basic block is simply a @@ -52,11 +53,12 @@ private : InstListType InstList; BasicBlock *Prev, *Next; // Next and Prev links for our intrusive linked list + Function *Parent; void setParent(Function *parent); void setNext(BasicBlock *N) { Next = N; } void setPrev(BasicBlock *N) { Prev = N; } - friend class SymbolTableListTraits; + friend class SymbolTableListTraits; BasicBlock(const BasicBlock &); // Do not implement void operator=(const BasicBlock &); // Do not implement @@ -76,8 +78,8 @@ /// getParent - Return the enclosing method, or null if none /// - const Function *getParent() const { return InstList.getParent(); } - Function *getParent() { return InstList.getParent(); } + const Function *getParent() const { return Parent; } + Function *getParent() { return Parent; } // getNext/Prev - Return the next or previous basic block in the list. BasicBlock *getNext() { return Next; } Index: llvm/include/llvm/Function.h diff -u llvm/include/llvm/Function.h:1.75 llvm/include/llvm/Function.h:1.76 --- llvm/include/llvm/Function.h:1.75 Mon Apr 16 01:54:34 2007 +++ llvm/include/llvm/Function.h Mon Apr 16 22:26:42 2007 @@ -30,21 +30,23 @@ // Traits for intrusive list of instructions... template<> struct ilist_traits - : public SymbolTableListTraits { + : public SymbolTableListTraits { // createSentinel is used to create a node that marks the end of the list... static BasicBlock *createSentinel(); static void destroySentinel(BasicBlock *BB) { delete BB; } static iplist &getList(Function *F); + static ValueSymbolTable *getSymTab(Function *ItemParent); }; template<> struct ilist_traits - : public SymbolTableListTraits { + : public SymbolTableListTraits { // createSentinel is used to create a node that marks the end of the list... static Argument *createSentinel(); static void destroySentinel(Argument *A) { delete A; } static iplist &getList(Function *F); + static ValueSymbolTable *getSymTab(Function *ItemParent); }; class Function : public GlobalValue, public Annotable { @@ -67,7 +69,7 @@ ParamAttrsList *ParamAttrs; ///< Parameter attributes unsigned CallingConvention; ///< Calling convention to use - friend class SymbolTableListTraits; + friend class SymbolTableListTraits; void setParent(Module *parent); Function *Prev, *Next; @@ -238,6 +240,16 @@ void dropAllReferences(); }; +inline ValueSymbolTable * +ilist_traits::getSymTab(Function *F) { + return F ? &F->getValueSymbolTable() : 0; +} + +inline ValueSymbolTable * +ilist_traits::getSymTab(Function *F) { + return F ? &F->getValueSymbolTable() : 0; +} + } // End llvm namespace #endif Index: llvm/include/llvm/GlobalVariable.h diff -u llvm/include/llvm/GlobalVariable.h:1.41 llvm/include/llvm/GlobalVariable.h:1.42 --- llvm/include/llvm/GlobalVariable.h:1.41 Fri Apr 13 13:12:09 2007 +++ llvm/include/llvm/GlobalVariable.h Mon Apr 16 22:26:42 2007 @@ -27,13 +27,11 @@ class Module; class Constant; class PointerType; -template struct ilist_traits; -template class SymbolTableListTraits; +template + class SymbolTableListTraits; class GlobalVariable : public GlobalValue { - friend class SymbolTableListTraits >; + friend class SymbolTableListTraits; void operator=(const GlobalVariable &); // Do not implement GlobalVariable(const GlobalVariable &); // Do not implement Index: llvm/include/llvm/Instruction.h diff -u llvm/include/llvm/Instruction.h:1.83 llvm/include/llvm/Instruction.h:1.84 --- llvm/include/llvm/Instruction.h:1.83 Fri Apr 13 13:12:09 2007 +++ llvm/include/llvm/Instruction.h Mon Apr 16 22:26:42 2007 @@ -22,9 +22,8 @@ struct AssemblyAnnotationWriter; class BinaryOperator; -template struct ilist_traits; -template class SymbolTableListTraits; +template + class SymbolTableListTraits; class Instruction : public User { void operator=(const Instruction &); // Do not implement @@ -36,8 +35,7 @@ void setNext(Instruction *N) { Next = N; } void setPrev(Instruction *N) { Prev = N; } - friend class SymbolTableListTraits >; + friend class SymbolTableListTraits; void setParent(BasicBlock *P); protected: Instruction(const Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, Index: llvm/include/llvm/Module.h diff -u llvm/include/llvm/Module.h:1.85 llvm/include/llvm/Module.h:1.86 --- llvm/include/llvm/Module.h:1.85 Fri Mar 23 13:44:11 2007 +++ llvm/include/llvm/Module.h Mon Apr 16 22:26:42 2007 @@ -26,18 +26,20 @@ class FunctionType; template<> struct ilist_traits - : public SymbolTableListTraits { + : public SymbolTableListTraits { // createSentinel is used to create a node that marks the end of the list. static Function *createSentinel(); static void destroySentinel(Function *F) { delete F; } static iplist &getList(Module *M); + static inline ValueSymbolTable *getSymTab(Module *M); }; template<> struct ilist_traits - : public SymbolTableListTraits { + : public SymbolTableListTraits { // createSentinel is used to create a node that marks the end of the list. static GlobalVariable *createSentinel(); static void destroySentinel(GlobalVariable *GV) { delete GV; } static iplist &getList(Module *M); + static inline ValueSymbolTable *getSymTab(Module *M); }; /// A Module instance is used to store all the information related to an @@ -319,6 +321,17 @@ return O; } +inline ValueSymbolTable * +ilist_traits::getSymTab(Module *M) { + return M ? &M->getValueSymbolTable() : 0; +} + +inline ValueSymbolTable * +ilist_traits::getSymTab(Module *M) { + return M ? &M->getValueSymbolTable() : 0; +} + + } // End llvm namespace #endif Index: llvm/include/llvm/SymbolTableListTraits.h diff -u llvm/include/llvm/SymbolTableListTraits.h:1.5 llvm/include/llvm/SymbolTableListTraits.h:1.6 --- llvm/include/llvm/SymbolTableListTraits.h:1.5 Thu Apr 21 15:11:51 2005 +++ llvm/include/llvm/SymbolTableListTraits.h Mon Apr 16 22:26:42 2007 @@ -31,24 +31,17 @@ template class iplist; template struct ilist_traits; -// ValueSubClass - The type of objects that I hold -// ItemParentType - I call setParent() on all of my "ValueSubclass" items, and -// this is the value that I pass in. -// SymTabType - This is the class type, whose symtab I insert my -// ValueSubClass items into. Most of the time it is -// ItemParentType, but Instructions have item parents of BB's -// but symtabtype's of a Function +// ValueSubClass - The type of objects that I hold, e.g. Instruction. +// ItemParentType - The type of object that owns the list, e.g. BasicBlock. +// TraitBaseClass - The class this trait should inherit from, it should +// inherit from ilist_traits // -template > +template class SymbolTableListTraits { - SymTabClass *SymTabObject; + typedef ilist_traits TraitsClass; ItemParentClass *ItemParent; public: - SymbolTableListTraits() : SymTabObject(0), ItemParent(0) {} - - SymTabClass *getParent() { return SymTabObject; } - const SymTabClass *getParent() const { return SymTabObject; } + SymbolTableListTraits() : ItemParent(0) {} static ValueSubClass *getPrev(ValueSubClass *V) { return V->getPrev(); } static ValueSubClass *getNext(ValueSubClass *V) { return V->getNext(); } @@ -68,10 +61,10 @@ ilist_traits > &L2, ilist_iterator first, ilist_iterator last); - //private: - void setItemParent(ItemParentClass *IP) { ItemParent = IP; }//This is private! - void setParent(SymTabClass *Parent); // This is private! + void setItemParent(ItemParentClass *IP) { ItemParent = IP; } + template + void setSymTabObject(TPtr *, TPtr); }; } // End llvm namespace Index: llvm/include/llvm/ValueSymbolTable.h diff -u llvm/include/llvm/ValueSymbolTable.h:1.11 llvm/include/llvm/ValueSymbolTable.h:1.12 --- llvm/include/llvm/ValueSymbolTable.h:1.11 Mon Apr 16 21:04:39 2007 +++ llvm/include/llvm/ValueSymbolTable.h Mon Apr 16 22:26:42 2007 @@ -18,10 +18,8 @@ #include "llvm/ADT/StringMap.h" namespace llvm { - template + template class SymbolTableListTraits; - template struct ilist_traits; class BasicBlock; class Function; class Module; @@ -32,16 +30,11 @@ /// class ValueSymbolTable { friend class Value; - friend class SymbolTableListTraits >; - friend class SymbolTableListTraits >; - friend class SymbolTableListTraits >; - friend class SymbolTableListTraits >; - friend class SymbolTableListTraits >; + friend class SymbolTableListTraits; + friend class SymbolTableListTraits; + friend class SymbolTableListTraits; + friend class SymbolTableListTraits; + friend class SymbolTableListTraits; /// @name Types /// @{ public: From sabre at nondot.org Mon Apr 16 22:27:13 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 22:27:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/BasicBlock.cpp Function.cpp Module.cpp SymbolTableListTraitsImpl.h Type.cpp Message-ID: <200704170327.l3H3RDYF024581@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: BasicBlock.cpp updated: 1.75 -> 1.76 Function.cpp updated: 1.121 -> 1.122 Module.cpp updated: 1.78 -> 1.79 SymbolTableListTraitsImpl.h updated: 1.10 -> 1.11 Type.cpp updated: 1.182 -> 1.183 --- Log message: Refactor SymbolTableListTraits to only have a single pointer in it, instead of two. This shrinkifies Function by 8 bytes (104->96) and Module by 8 bytes (68->60). On a testcase of mine, this reduces the memory used to read a module header from 565680b to 561024, a little over 4K. --- Diffs of the changes: (+78 -60) BasicBlock.cpp | 28 ++++++++----- Function.cpp | 7 --- Module.cpp | 8 --- SymbolTableListTraitsImpl.h | 94 +++++++++++++++++++++++++------------------- Type.cpp | 1 5 files changed, 78 insertions(+), 60 deletions(-) Index: llvm/lib/VMCore/BasicBlock.cpp diff -u llvm/lib/VMCore/BasicBlock.cpp:1.75 llvm/lib/VMCore/BasicBlock.cpp:1.76 --- llvm/lib/VMCore/BasicBlock.cpp:1.75 Sun Feb 11 23:18:08 2007 +++ llvm/lib/VMCore/BasicBlock.cpp Mon Apr 16 22:26:42 2007 @@ -22,6 +22,15 @@ #include using namespace llvm; +inline ValueSymbolTable * +ilist_traits::getSymTab(BasicBlock *BB) { + if (BB) + if (Function *F = BB->getParent()) + return &F->getValueSymbolTable(); + return 0; +} + + namespace { /// DummyInst - An instance of this class is used to mark the end of the /// instruction list. This is not a real instruction. @@ -57,24 +66,24 @@ // Explicit instantiation of SymbolTableListTraits since some of the methods // are not in the public header file... -template class SymbolTableListTraits; +template class SymbolTableListTraits; -BasicBlock::BasicBlock(const std::string &Name, Function *Parent, +BasicBlock::BasicBlock(const std::string &Name, Function *NewParent, BasicBlock *InsertBefore) - : Value(Type::LabelTy, Value::BasicBlockVal) { - // Initialize the instlist... + : Value(Type::LabelTy, Value::BasicBlockVal), Parent(0) { + // Initialize the instlist. InstList.setItemParent(this); // Make sure that we get added to a function LeakDetector::addGarbageObject(this); if (InsertBefore) { - assert(Parent && + assert(NewParent && "Cannot insert block before another block with no function!"); - Parent->getBasicBlockList().insert(InsertBefore, this); - } else if (Parent) { - Parent->getBasicBlockList().push_back(this); + NewParent->getBasicBlockList().insert(InsertBefore, this); + } else if (NewParent) { + NewParent->getBasicBlockList().push_back(this); } setName(Name); @@ -91,7 +100,8 @@ if (getParent()) LeakDetector::addGarbageObject(this); - InstList.setParent(parent); + // Set Parent=parent, updating instruction symtab entries as appropriate. + InstList.setSymTabObject(&Parent, parent); if (getParent()) LeakDetector::removeGarbageObject(this); Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.121 llvm/lib/VMCore/Function.cpp:1.122 --- llvm/lib/VMCore/Function.cpp:1.121 Mon Apr 16 11:56:54 2007 +++ llvm/lib/VMCore/Function.cpp Mon Apr 16 22:26:42 2007 @@ -44,8 +44,8 @@ // Explicit instantiations of SymbolTableListTraits since some of the methods // are not in the public header file... -template class SymbolTableListTraits; -template class SymbolTableListTraits; +template class SymbolTableListTraits; +template class SymbolTableListTraits; //===----------------------------------------------------------------------===// // Argument Implementation @@ -144,9 +144,7 @@ ParamAttrs = 0; CallingConvention = 0; BasicBlocks.setItemParent(this); - BasicBlocks.setParent(this); ArgumentList.setItemParent(this); - ArgumentList.setParent(this); SymTab = new ValueSymbolTable(); assert((getReturnType()->isFirstClassType() ||getReturnType() == Type::VoidTy) @@ -171,7 +169,6 @@ // Delete all of the method arguments and unlink from symbol table... ArgumentList.clear(); - ArgumentList.setParent(0); delete SymTab; } Index: llvm/lib/VMCore/Module.cpp diff -u llvm/lib/VMCore/Module.cpp:1.78 llvm/lib/VMCore/Module.cpp:1.79 --- llvm/lib/VMCore/Module.cpp:1.78 Mon Apr 9 01:12:07 2007 +++ llvm/lib/VMCore/Module.cpp Mon Apr 16 22:26:42 2007 @@ -55,8 +55,8 @@ // Explicit instantiations of SymbolTableListTraits since some of the methods // are not in the public header file. -template class SymbolTableListTraits; -template class SymbolTableListTraits; +template class SymbolTableListTraits; +template class SymbolTableListTraits; //===----------------------------------------------------------------------===// // Primitive Module methods. @@ -65,9 +65,7 @@ Module::Module(const std::string &MID) : ModuleID(MID), DataLayout("") { FunctionList.setItemParent(this); - FunctionList.setParent(this); GlobalList.setItemParent(this); - GlobalList.setParent(this); ValSymTab = new ValueSymbolTable(); TypeSymTab = new TypeSymbolTable(); } @@ -75,9 +73,7 @@ Module::~Module() { dropAllReferences(); GlobalList.clear(); - GlobalList.setParent(0); FunctionList.clear(); - FunctionList.setParent(0); LibraryList.clear(); delete ValSymTab; delete TypeSymTab; Index: llvm/lib/VMCore/SymbolTableListTraitsImpl.h diff -u llvm/lib/VMCore/SymbolTableListTraitsImpl.h:1.10 llvm/lib/VMCore/SymbolTableListTraitsImpl.h:1.11 --- llvm/lib/VMCore/SymbolTableListTraitsImpl.h:1.10 Sun Feb 11 23:18:08 2007 +++ llvm/lib/VMCore/SymbolTableListTraitsImpl.h Mon Apr 16 22:26:42 2007 @@ -21,53 +21,68 @@ namespace llvm { -template -void SymbolTableListTraits -::setParent(SymTabClass *STO) { - iplist &List = SubClass::getList(ItemParent); - - // Remove all of the items from the old symtab.. - if (SymTabObject && !List.empty()) { - ValueSymbolTable &SymTab = SymTabObject->getValueSymbolTable(); - for (typename iplist::iterator I = List.begin(); - I != List.end(); ++I) - if (I->hasName()) SymTab.removeValueName(I->getValueName()); +/// setSymTabObject - This is called when (f.e.) the parent of a basic block +/// changes. This requires us to remove all the instruction symtab entries from +/// the current function and reinsert them into the new function. +template +template +void SymbolTableListTraits +::setSymTabObject(TPtr *Dest, TPtr Src) { + // Get the old symtab and value list before doing the assignment. + ValueSymbolTable *OldST = TraitsClass::getSymTab(ItemParent); + + // Do it. + *Dest = Src; + + // Get the new SymTab object. + ValueSymbolTable *NewST = TraitsClass::getSymTab(ItemParent); + + // If there is nothing to do, quick exit. + if (OldST == NewST) return; + + // Move all the elements from the old symtab to the new one. + iplist &ItemList = TraitsClass::getList(ItemParent); + if (ItemList.empty()) return; + + if (OldST) { + // Remove all entries from the previous symtab. + for (typename iplist::iterator I = ItemList.begin(); + I != ItemList.end(); ++I) + if (I->hasName()) + OldST->removeValueName(I->getValueName()); } - SymTabObject = STO; - - // Add all of the items to the new symtab... - if (SymTabObject && !List.empty()) { - ValueSymbolTable &SymTab = SymTabObject->getValueSymbolTable(); - for (typename iplist::iterator I = List.begin(); - I != List.end(); ++I) - if (I->hasName()) SymTab.reinsertValue(I); + if (NewST) { + // Add all of the items to the new symtab. + for (typename iplist::iterator I = ItemList.begin(); + I != ItemList.end(); ++I) + if (I->hasName()) + NewST->reinsertValue(I); } + } -template -void SymbolTableListTraits +template +void SymbolTableListTraits ::addNodeToList(ValueSubClass *V) { assert(V->getParent() == 0 && "Value already in a container!!"); V->setParent(ItemParent); - if (V->hasName() && SymTabObject) - SymTabObject->getValueSymbolTable().reinsertValue(V); + if (V->hasName()) + if (ValueSymbolTable *ST = TraitsClass::getSymTab(ItemParent)) + ST->reinsertValue(V); } -template -void SymbolTableListTraits +template +void SymbolTableListTraits ::removeNodeFromList(ValueSubClass *V) { V->setParent(0); - if (V->hasName() && SymTabObject) - SymTabObject->getValueSymbolTable().removeValueName(V->getValueName()); + if (V->hasName()) + if (ValueSymbolTable *ST = TraitsClass::getSymTab(ItemParent)) + ST->removeValueName(V->getValueName()); } -template -void SymbolTableListTraits +template +void SymbolTableListTraits ::transferNodesFromList(iplist > &L2, ilist_iterator first, ilist_iterator last) { @@ -77,16 +92,17 @@ // We only have to update symbol table entries if we are transferring the // instructions to a different symtab object... - SymTabClass *NewSTO = SymTabObject, *OldSTO = L2.SymTabObject; - if (NewSTO != OldSTO) { + ValueSymbolTable *NewST = TraitsClass::getSymTab(ItemParent); + ValueSymbolTable *OldST = TraitsClass::getSymTab(OldIP); + if (NewST != OldST) { for (; first != last; ++first) { ValueSubClass &V = *first; bool HasName = V.hasName(); - if (OldSTO && HasName) - OldSTO->getValueSymbolTable().removeValueName(V.getValueName()); + if (OldST && HasName) + OldST->removeValueName(V.getValueName()); V.setParent(NewIP); - if (NewSTO && HasName) - NewSTO->getValueSymbolTable().reinsertValue(&V); + if (NewST && HasName) + NewST->reinsertValue(&V); } } else { // Just transferring between blocks in the same function, simply update the Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.182 llvm/lib/VMCore/Type.cpp:1.183 --- llvm/lib/VMCore/Type.cpp:1.182 Tue Apr 10 21:44:19 2007 +++ llvm/lib/VMCore/Type.cpp Mon Apr 16 22:26:42 2007 @@ -433,7 +433,6 @@ // Calculate whether or not this type is abstract setAbstract(isAbstract); - } StructType::StructType(const std::vector &Types, bool isPacked) From sabre at nondot.org Mon Apr 16 23:04:41 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 23:04:41 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/BasicBlock.h Function.h Module.h SymbolTableListTraits.h Message-ID: <200704170404.l3H44fPB025342@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: BasicBlock.h updated: 1.65 -> 1.66 Function.h updated: 1.76 -> 1.77 Module.h updated: 1.86 -> 1.87 SymbolTableListTraits.h updated: 1.6 -> 1.7 --- Log message: The (negative) offset from a SymbolTableListTraits-using ilist to its container object is always constant. As such, evaluate it at compile time instead of storing it as an ivar in SymbolTableListTraits. This shrinks every SymbolTableListTraits ilist by a word, shrinking BasicBlock from 44->40 bytes, Function from 96->88 bytes, and Module from 60->52 bytes. --- Diffs of the changes: (+61 -3) BasicBlock.h | 12 ++++++++++++ Function.h | 22 ++++++++++++++++++++++ Module.h | 20 ++++++++++++++++++++ SymbolTableListTraits.h | 10 +++++++--- 4 files changed, 61 insertions(+), 3 deletions(-) Index: llvm/include/llvm/BasicBlock.h diff -u llvm/include/llvm/BasicBlock.h:1.65 llvm/include/llvm/BasicBlock.h:1.66 --- llvm/include/llvm/BasicBlock.h:1.65 Mon Apr 16 22:26:42 2007 +++ llvm/include/llvm/BasicBlock.h Mon Apr 16 23:04:14 2007 @@ -31,6 +31,7 @@ static void destroySentinel(Instruction *I) { delete I; } static iplist &getList(BasicBlock *BB); static ValueSymbolTable *getSymTab(BasicBlock *ItemParent); + static int getListOffset(); }; /// This represents a single basic block in LLVM. A basic block is simply a @@ -194,8 +195,19 @@ /// the basic block). /// BasicBlock *splitBasicBlock(iterator I, const std::string &BBName = ""); + + + static unsigned getInstListOffset() { + BasicBlock *Obj = 0; + return reinterpret_cast(&Obj->InstList); + } }; +inline int +ilist_traits::getListOffset() { + return BasicBlock::getInstListOffset(); +} + } // End llvm namespace #endif Index: llvm/include/llvm/Function.h diff -u llvm/include/llvm/Function.h:1.76 llvm/include/llvm/Function.h:1.77 --- llvm/include/llvm/Function.h:1.76 Mon Apr 16 22:26:42 2007 +++ llvm/include/llvm/Function.h Mon Apr 16 23:04:14 2007 @@ -37,6 +37,7 @@ static void destroySentinel(BasicBlock *BB) { delete BB; } static iplist &getList(Function *F); static ValueSymbolTable *getSymTab(Function *ItemParent); + static int getListOffset(); }; template<> struct ilist_traits @@ -47,6 +48,7 @@ static void destroySentinel(Argument *A) { delete A; } static iplist &getList(Function *F); static ValueSymbolTable *getSymTab(Function *ItemParent); + static int getListOffset(); }; class Function : public GlobalValue, public Annotable { @@ -238,6 +240,15 @@ /// including any contained basic blocks. /// void dropAllReferences(); + + static unsigned getBasicBlockListOffset() { + Function *Obj = 0; + return reinterpret_cast(&Obj->BasicBlocks); + } + static unsigned getArgumentListOffset() { + Function *Obj = 0; + return reinterpret_cast(&Obj->ArgumentList); + } }; inline ValueSymbolTable * @@ -250,6 +261,17 @@ return F ? &F->getValueSymbolTable() : 0; } +inline int +ilist_traits::getListOffset() { + return Function::getBasicBlockListOffset(); +} + +inline int +ilist_traits::getListOffset() { + return Function::getArgumentListOffset(); +} + + } // End llvm namespace #endif Index: llvm/include/llvm/Module.h diff -u llvm/include/llvm/Module.h:1.86 llvm/include/llvm/Module.h:1.87 --- llvm/include/llvm/Module.h:1.86 Mon Apr 16 22:26:42 2007 +++ llvm/include/llvm/Module.h Mon Apr 16 23:04:14 2007 @@ -32,6 +32,7 @@ static void destroySentinel(Function *F) { delete F; } static iplist &getList(Module *M); static inline ValueSymbolTable *getSymTab(Module *M); + static int getListOffset(); }; template<> struct ilist_traits : public SymbolTableListTraits { @@ -40,6 +41,7 @@ static void destroySentinel(GlobalVariable *GV) { delete GV; } static iplist &getList(Module *M); static inline ValueSymbolTable *getSymTab(Module *M); + static int getListOffset(); }; /// A Module instance is used to store all the information related to an @@ -313,6 +315,15 @@ /// that has "dropped all references", except operator delete. void dropAllReferences(); /// @} + + static unsigned getFunctionListOffset() { + Module *Obj = 0; + return reinterpret_cast(&Obj->FunctionList); + } + static unsigned getGlobalVariableListOffset() { + Module *Obj = 0; + return reinterpret_cast(&Obj->GlobalList); + } }; /// An iostream inserter for modules. @@ -331,6 +342,15 @@ return M ? &M->getValueSymbolTable() : 0; } +inline int +ilist_traits::getListOffset() { + return Module::getFunctionListOffset(); +} + +inline int +ilist_traits::getListOffset() { + return Module::getGlobalVariableListOffset(); +} } // End llvm namespace Index: llvm/include/llvm/SymbolTableListTraits.h diff -u llvm/include/llvm/SymbolTableListTraits.h:1.6 llvm/include/llvm/SymbolTableListTraits.h:1.7 --- llvm/include/llvm/SymbolTableListTraits.h:1.6 Mon Apr 16 22:26:42 2007 +++ llvm/include/llvm/SymbolTableListTraits.h Mon Apr 16 23:04:14 2007 @@ -39,10 +39,15 @@ template class SymbolTableListTraits { typedef ilist_traits TraitsClass; - ItemParentClass *ItemParent; public: - SymbolTableListTraits() : ItemParent(0) {} + SymbolTableListTraits() {} + /// getListOwner - Return the object that owns this list. If this is a list + /// of instructions, it returns the BasicBlock that owns them. + ItemParentClass *getListOwner() { + return reinterpret_cast((char*)this- + TraitsClass::getListOffset()); + } static ValueSubClass *getPrev(ValueSubClass *V) { return V->getPrev(); } static ValueSubClass *getNext(ValueSubClass *V) { return V->getNext(); } static const ValueSubClass *getPrev(const ValueSubClass *V) { @@ -62,7 +67,6 @@ ilist_iterator first, ilist_iterator last); //private: - void setItemParent(ItemParentClass *IP) { ItemParent = IP; } template void setSymTabObject(TPtr *, TPtr); }; From sabre at nondot.org Mon Apr 16 23:04:50 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 23:04:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/BasicBlock.cpp Function.cpp Module.cpp SymbolTableListTraitsImpl.h Message-ID: <200704170404.l3H44okE025355@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: BasicBlock.cpp updated: 1.76 -> 1.77 Function.cpp updated: 1.122 -> 1.123 Module.cpp updated: 1.79 -> 1.80 SymbolTableListTraitsImpl.h updated: 1.11 -> 1.12 --- Log message: The (negative) offset from a SymbolTableListTraits-using ilist to its container object is always constant. As such, evaluate it at compile time instead of storing it as an ivar in SymbolTableListTraits. This shrinks every SymbolTableListTraits ilist by a word, shrinking BasicBlock from 44->40 bytes, Function from 96->88 bytes, and Module from 60->52 bytes. --- Diffs of the changes: (+9 -14) BasicBlock.cpp | 2 -- Function.cpp | 2 -- Module.cpp | 2 -- SymbolTableListTraitsImpl.h | 17 +++++++++-------- 4 files changed, 9 insertions(+), 14 deletions(-) Index: llvm/lib/VMCore/BasicBlock.cpp diff -u llvm/lib/VMCore/BasicBlock.cpp:1.76 llvm/lib/VMCore/BasicBlock.cpp:1.77 --- llvm/lib/VMCore/BasicBlock.cpp:1.76 Mon Apr 16 22:26:42 2007 +++ llvm/lib/VMCore/BasicBlock.cpp Mon Apr 16 23:04:14 2007 @@ -72,8 +72,6 @@ BasicBlock::BasicBlock(const std::string &Name, Function *NewParent, BasicBlock *InsertBefore) : Value(Type::LabelTy, Value::BasicBlockVal), Parent(0) { - // Initialize the instlist. - InstList.setItemParent(this); // Make sure that we get added to a function LeakDetector::addGarbageObject(this); Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.122 llvm/lib/VMCore/Function.cpp:1.123 --- llvm/lib/VMCore/Function.cpp:1.122 Mon Apr 16 22:26:42 2007 +++ llvm/lib/VMCore/Function.cpp Mon Apr 16 23:04:14 2007 @@ -143,8 +143,6 @@ : GlobalValue(PointerType::get(Ty), Value::FunctionVal, 0, 0, Linkage, name) { ParamAttrs = 0; CallingConvention = 0; - BasicBlocks.setItemParent(this); - ArgumentList.setItemParent(this); SymTab = new ValueSymbolTable(); assert((getReturnType()->isFirstClassType() ||getReturnType() == Type::VoidTy) Index: llvm/lib/VMCore/Module.cpp diff -u llvm/lib/VMCore/Module.cpp:1.79 llvm/lib/VMCore/Module.cpp:1.80 --- llvm/lib/VMCore/Module.cpp:1.79 Mon Apr 16 22:26:42 2007 +++ llvm/lib/VMCore/Module.cpp Mon Apr 16 23:04:14 2007 @@ -64,8 +64,6 @@ Module::Module(const std::string &MID) : ModuleID(MID), DataLayout("") { - FunctionList.setItemParent(this); - GlobalList.setItemParent(this); ValSymTab = new ValueSymbolTable(); TypeSymTab = new TypeSymbolTable(); } Index: llvm/lib/VMCore/SymbolTableListTraitsImpl.h diff -u llvm/lib/VMCore/SymbolTableListTraitsImpl.h:1.11 llvm/lib/VMCore/SymbolTableListTraitsImpl.h:1.12 --- llvm/lib/VMCore/SymbolTableListTraitsImpl.h:1.11 Mon Apr 16 22:26:42 2007 +++ llvm/lib/VMCore/SymbolTableListTraitsImpl.h Mon Apr 16 23:04:14 2007 @@ -29,19 +29,19 @@ void SymbolTableListTraits ::setSymTabObject(TPtr *Dest, TPtr Src) { // Get the old symtab and value list before doing the assignment. - ValueSymbolTable *OldST = TraitsClass::getSymTab(ItemParent); + ValueSymbolTable *OldST = TraitsClass::getSymTab(getListOwner()); // Do it. *Dest = Src; // Get the new SymTab object. - ValueSymbolTable *NewST = TraitsClass::getSymTab(ItemParent); + ValueSymbolTable *NewST = TraitsClass::getSymTab(getListOwner()); // If there is nothing to do, quick exit. if (OldST == NewST) return; // Move all the elements from the old symtab to the new one. - iplist &ItemList = TraitsClass::getList(ItemParent); + iplist &ItemList = TraitsClass::getList(getListOwner()); if (ItemList.empty()) return; if (OldST) { @@ -66,9 +66,10 @@ void SymbolTableListTraits ::addNodeToList(ValueSubClass *V) { assert(V->getParent() == 0 && "Value already in a container!!"); - V->setParent(ItemParent); + ItemParentClass *Owner = getListOwner(); + V->setParent(Owner); if (V->hasName()) - if (ValueSymbolTable *ST = TraitsClass::getSymTab(ItemParent)) + if (ValueSymbolTable *ST = TraitsClass::getSymTab(Owner)) ST->reinsertValue(V); } @@ -77,7 +78,7 @@ ::removeNodeFromList(ValueSubClass *V) { V->setParent(0); if (V->hasName()) - if (ValueSymbolTable *ST = TraitsClass::getSymTab(ItemParent)) + if (ValueSymbolTable *ST = TraitsClass::getSymTab(getListOwner())) ST->removeValueName(V->getValueName()); } @@ -87,12 +88,12 @@ ilist_iterator first, ilist_iterator last) { // We only have to do work here if transferring instructions between BBs - ItemParentClass *NewIP = ItemParent, *OldIP = L2.ItemParent; + ItemParentClass *NewIP = getListOwner(), *OldIP = L2.getListOwner(); if (NewIP == OldIP) return; // No work to do at all... // We only have to update symbol table entries if we are transferring the // instructions to a different symtab object... - ValueSymbolTable *NewST = TraitsClass::getSymTab(ItemParent); + ValueSymbolTable *NewST = TraitsClass::getSymTab(NewIP); ValueSymbolTable *OldST = TraitsClass::getSymTab(OldIP); if (NewST != OldST) { for (; first != last; ++first) { From alenhar2 at cs.uiuc.edu Mon Apr 16 23:07:48 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Mon, 16 Apr 2007 23:07:48 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Alpha/cmov.ll Message-ID: <200704170407.l3H47mKw025448@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Alpha: cmov.ll updated: 1.4 -> 1.5 --- Log message: this is fixed --- Diffs of the changes: (+1 -1) cmov.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CodeGen/Alpha/cmov.ll diff -u llvm/test/CodeGen/Alpha/cmov.ll:1.4 llvm/test/CodeGen/Alpha/cmov.ll:1.5 --- llvm/test/CodeGen/Alpha/cmov.ll:1.4 Sun Apr 15 18:00:46 2007 +++ llvm/test/CodeGen/Alpha/cmov.ll Mon Apr 16 23:07:27 2007 @@ -1,6 +1,6 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | not grep cmovlt ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep cmoveq -; XFAIL: * + long %cmov_lt(long %a, long %c) { entry: From alenhar2 at cs.uiuc.edu Mon Apr 16 23:08:20 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Mon, 16 Apr 2007 23:08:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaInstrFormats.td AlphaInstrInfo.td Message-ID: <200704170408.l3H48KLi025477@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaInstrFormats.td updated: 1.29 -> 1.30 AlphaInstrInfo.td updated: 1.137 -> 1.138 --- Log message: Use this nifty Constraints thing and fix the inverted conditional moves --- Diffs of the changes: (+21 -17) AlphaInstrFormats.td | 18 +++++++++++------- AlphaInstrInfo.td | 20 ++++++++++---------- 2 files changed, 21 insertions(+), 17 deletions(-) Index: llvm/lib/Target/Alpha/AlphaInstrFormats.td diff -u llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.29 llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.30 --- llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.29 Tue Oct 31 10:49:55 2006 +++ llvm/lib/Target/Alpha/AlphaInstrFormats.td Mon Apr 16 23:07:59 2007 @@ -158,14 +158,16 @@ class OForm4 opcode, bits<7> fun, string asmstr, list pattern, InstrItinClass itin> : InstAlpha { let Pattern = pattern; - let OperandList = (ops GPRC:$RDEST, GPRC:$RFALSE, GPRC:$RTRUE, GPRC:$RCOND); + let OperandList = (ops GPRC:$RDEST, GPRC:$RCOND, GPRC:$RTRUE, GPRC:$RFALSE); + let Constraints = "$RFALSE = $RDEST"; + let DisableEncoding = "$RFALSE"; bits<5> Rc; - bits<5> Rb; bits<5> Ra; + bits<5> Rb; bits<7> Function = fun; - let isTwoAddress = 1; +// let isTwoAddress = 1; let Inst{25-21} = Ra; let Inst{20-16} = Rb; let Inst{15-13} = 0; @@ -195,14 +197,16 @@ class OForm4L opcode, bits<7> fun, string asmstr, list pattern, InstrItinClass itin> : InstAlpha { let Pattern = pattern; - let OperandList = (ops GPRC:$RDEST, GPRC:$RFALSE, s64imm:$RTRUE, GPRC:$RCOND); - + let OperandList = (ops GPRC:$RDEST, GPRC:$RCOND, s64imm:$RTRUE, GPRC:$RFALSE); + let Constraints = "$RFALSE = $RDEST"; + let DisableEncoding = "$RFALSE"; + bits<5> Rc; - bits<8> LIT; bits<5> Ra; + bits<8> LIT; bits<7> Function = fun; - let isTwoAddress = 1; +// let isTwoAddress = 1; let Inst{25-21} = Ra; let Inst{20-13} = LIT; let Inst{12} = 1; Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.137 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.138 --- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.137 Wed Jan 24 15:09:16 2007 +++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Mon Apr 16 23:07:59 2007 @@ -190,16 +190,16 @@ (CMOVEQi GPRC:$src1, immUExt8:$src2, GPRC:$which)>; //Invert sense when we can for constants: -//def : Pat<(select (setne GPRC:$RCOND, 0), immUExt8:$RFALSE, GPRC:$RTRUE), -// (CMOVNEi GPRC:$RTRUE, immUExt8:$RFALSE, GPRC:$RCOND)>; -//def : Pat<(select (setgt GPRC:$RCOND, 0), immUExt8:$RFALSE, GPRC:$RTRUE), -// (CMOVGTi GPRC:$RTRUE, immUExt8:$RFALSE, GPRC:$RCOND)>; -//def : Pat<(select (setge GPRC:$RCOND, 0), immUExt8:$RFALSE, GPRC:$RTRUE), -// (CMOVGEi GPRC:$RTRUE, immUExt8:$RFALSE, GPRC:$RCOND)>; -//def : Pat<(select (setlt GPRC:$RCOND, 0), immUExt8:$RFALSE, GPRC:$RTRUE), -// (CMOVLTi GPRC:$RTRUE, immUExt8:$RFALSE, GPRC:$RCOND)>; -//def : Pat<(select (setle GPRC:$RCOND, 0), immUExt8:$RFALSE, GPRC:$RTRUE), -// (CMOVLEi GPRC:$RTRUE, immUExt8:$RFALSE, GPRC:$RCOND)>; +def : Pat<(select (setne GPRC:$RCOND, 0), GPRC:$RTRUE, immUExt8:$RFALSE), + (CMOVEQi GPRC:$RCOND, immUExt8:$RFALSE, GPRC:$RTRUE)>; +def : Pat<(select (setgt GPRC:$RCOND, 0), GPRC:$RTRUE, immUExt8:$RFALSE), + (CMOVLEi GPRC:$RCOND, immUExt8:$RFALSE, GPRC:$RTRUE)>; +def : Pat<(select (setge GPRC:$RCOND, 0), GPRC:$RTRUE, immUExt8:$RFALSE), + (CMOVLTi GPRC:$RCOND, immUExt8:$RFALSE, GPRC:$RTRUE)>; +def : Pat<(select (setlt GPRC:$RCOND, 0), GPRC:$RTRUE, immUExt8:$RFALSE), + (CMOVGEi GPRC:$RCOND, immUExt8:$RFALSE, GPRC:$RTRUE)>; +def : Pat<(select (setle GPRC:$RCOND, 0), GPRC:$RTRUE, immUExt8:$RFALSE), + (CMOVGTi GPRC:$RCOND, immUExt8:$RFALSE, GPRC:$RTRUE)>; multiclass all_inst opc, bits<7> funl, bits<7> funq, string asmstr, PatFrag OpNode, InstrItinClass itin> { From sabre at nondot.org Mon Apr 16 23:32:01 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 23:32:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Message-ID: <200704170432.l3H4W1mr025906@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Function.cpp updated: 1.123 -> 1.124 --- Log message: merge several fields in GlobalValue to use the same word, move CallingConv field into SubclassData in Value. This shrinks GlobalVAlue from 48->40 bytes, Function from 88->76, and GlobalVariable from 76->68. This trims 4640 bytes off my testcase, reading a bc file without materializing any functions. --- Diffs of the changes: (+0 -1) Function.cpp | 1 - 1 files changed, 1 deletion(-) Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.123 llvm/lib/VMCore/Function.cpp:1.124 --- llvm/lib/VMCore/Function.cpp:1.123 Mon Apr 16 23:04:14 2007 +++ llvm/lib/VMCore/Function.cpp Mon Apr 16 23:31:29 2007 @@ -142,7 +142,6 @@ const std::string &name, Module *ParentModule) : GlobalValue(PointerType::get(Ty), Value::FunctionVal, 0, 0, Linkage, name) { ParamAttrs = 0; - CallingConvention = 0; SymTab = new ValueSymbolTable(); assert((getReturnType()->isFirstClassType() ||getReturnType() == Type::VoidTy) From sabre at nondot.org Mon Apr 16 23:32:01 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Apr 2007 23:32:01 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Function.h GlobalValue.h Message-ID: <200704170432.l3H4W1WO025913@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Function.h updated: 1.77 -> 1.78 GlobalValue.h updated: 1.35 -> 1.36 --- Log message: merge several fields in GlobalValue to use the same word, move CallingConv field into SubclassData in Value. This shrinks GlobalVAlue from 48->40 bytes, Function from 88->76, and GlobalVariable from 76->68. This trims 4640 bytes off my testcase, reading a bc file without materializing any functions. --- Diffs of the changes: (+13 -10) Function.h | 9 ++++++--- GlobalValue.h | 14 +++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) Index: llvm/include/llvm/Function.h diff -u llvm/include/llvm/Function.h:1.77 llvm/include/llvm/Function.h:1.78 --- llvm/include/llvm/Function.h:1.77 Mon Apr 16 23:04:14 2007 +++ llvm/include/llvm/Function.h Mon Apr 16 23:31:29 2007 @@ -69,7 +69,10 @@ ArgumentListType ArgumentList; ///< The formal arguments ValueSymbolTable *SymTab; ///< Symbol table of args/instructions ParamAttrsList *ParamAttrs; ///< Parameter attributes - unsigned CallingConvention; ///< Calling convention to use + + + // The Calling Convention is stored in Value::SubclassData. + /*unsigned CallingConvention;*/ friend class SymbolTableListTraits; @@ -113,8 +116,8 @@ /// getCallingConv()/setCallingConv(uint) - These method get and set the /// calling convention of this function. The enum values for the known /// calling conventions are defined in CallingConv.h. - unsigned getCallingConv() const { return CallingConvention; } - void setCallingConv(unsigned CC) { CallingConvention = CC; } + unsigned getCallingConv() const { return SubclassData; } + void setCallingConv(unsigned CC) { SubclassData = CC; } /// Obtains a constant pointer to the ParamAttrsList object which holds the /// parameter attributes information, if any. Index: llvm/include/llvm/GlobalValue.h diff -u llvm/include/llvm/GlobalValue.h:1.35 llvm/include/llvm/GlobalValue.h:1.36 --- llvm/include/llvm/GlobalValue.h:1.35 Fri Apr 13 13:12:09 2007 +++ llvm/include/llvm/GlobalValue.h Mon Apr 16 23:31:29 2007 @@ -29,7 +29,7 @@ public: /// @brief An enumeration for the kinds of linkage for global values. enum LinkageTypes { - ExternalLinkage, ///< Externally visible function + ExternalLinkage = 0,///< Externally visible function LinkOnceLinkage, ///< Keep one copy of function when linking (inline) WeakLinkage, ///< Keep one copy of named function when linking (weak) AppendingLinkage, ///< Special purpose, only applies to global arrays @@ -42,8 +42,8 @@ /// @brief An enumeration for the kinds of visibility of global values. enum VisibilityTypes { - DefaultVisibility, ///< The GV is visible - HiddenVisibility ///< The GV is hidden + DefaultVisibility = 0, ///< The GV is visible + HiddenVisibility ///< The GV is hidden }; protected: @@ -55,10 +55,10 @@ } Module *Parent; - LinkageTypes Linkage; // The linkage of this global - VisibilityTypes Visibility; // The visibility style of this global - unsigned Alignment; // Alignment of this symbol, must be power of two - std::string Section; // Section to emit this into, empty mean default + LinkageTypes Linkage : 4; // The linkage of this global + VisibilityTypes Visibility : 1; // The visibility style of this global + unsigned Alignment : 16; // Alignment of this symbol, must be power of two + std::string Section; // Section to emit this into, empty mean default public: ~GlobalValue() { removeDeadConstantUsers(); // remove any dead constants using this. From jeffc at jolt-lang.org Tue Apr 17 00:33:25 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Tue, 17 Apr 2007 00:33:25 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/BasicBlock.h Function.h Module.h Message-ID: <200704170533.l3H5XPrW026989@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: BasicBlock.h updated: 1.66 -> 1.67 Function.h updated: 1.78 -> 1.79 Module.h updated: 1.87 -> 1.88 --- Log message: Fix build breakage on 64-bit systems. --- Diffs of the changes: (+5 -5) BasicBlock.h | 2 +- Function.h | 4 ++-- Module.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/include/llvm/BasicBlock.h diff -u llvm/include/llvm/BasicBlock.h:1.66 llvm/include/llvm/BasicBlock.h:1.67 --- llvm/include/llvm/BasicBlock.h:1.66 Mon Apr 16 23:04:14 2007 +++ llvm/include/llvm/BasicBlock.h Tue Apr 17 00:33:04 2007 @@ -199,7 +199,7 @@ static unsigned getInstListOffset() { BasicBlock *Obj = 0; - return reinterpret_cast(&Obj->InstList); + return unsigned(reinterpret_cast(&Obj->InstList)); } }; Index: llvm/include/llvm/Function.h diff -u llvm/include/llvm/Function.h:1.78 llvm/include/llvm/Function.h:1.79 --- llvm/include/llvm/Function.h:1.78 Mon Apr 16 23:31:29 2007 +++ llvm/include/llvm/Function.h Tue Apr 17 00:33:04 2007 @@ -246,11 +246,11 @@ static unsigned getBasicBlockListOffset() { Function *Obj = 0; - return reinterpret_cast(&Obj->BasicBlocks); + return unsigned(reinterpret_cast(&Obj->BasicBlocks)); } static unsigned getArgumentListOffset() { Function *Obj = 0; - return reinterpret_cast(&Obj->ArgumentList); + return unsigned(reinterpret_cast(&Obj->ArgumentList)); } }; Index: llvm/include/llvm/Module.h diff -u llvm/include/llvm/Module.h:1.87 llvm/include/llvm/Module.h:1.88 --- llvm/include/llvm/Module.h:1.87 Mon Apr 16 23:04:14 2007 +++ llvm/include/llvm/Module.h Tue Apr 17 00:33:04 2007 @@ -318,11 +318,11 @@ static unsigned getFunctionListOffset() { Module *Obj = 0; - return reinterpret_cast(&Obj->FunctionList); + return unsigned(reinterpret_cast(&Obj->FunctionList)); } static unsigned getGlobalVariableListOffset() { Module *Obj = 0; - return reinterpret_cast(&Obj->GlobalList); + return unsigned(reinterpret_cast(&Obj->GlobalList)); } }; From jeffc at jolt-lang.org Tue Apr 17 00:48:56 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Tue, 17 Apr 2007 00:48:56 -0500 Subject: [llvm-commits] CVS: llvm/test/C++Frontend/2005-01-03-StaticInitializers.cpp Message-ID: <200704170548.l3H5mupC027300@zion.cs.uiuc.edu> Changes in directory llvm/test/C++Frontend: 2005-01-03-StaticInitializers.cpp updated: 1.3 -> 1.4 --- Log message: Make it work on 64-bit systems. --- Diffs of the changes: (+1 -1) 2005-01-03-StaticInitializers.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/C++Frontend/2005-01-03-StaticInitializers.cpp diff -u llvm/test/C++Frontend/2005-01-03-StaticInitializers.cpp:1.3 llvm/test/C++Frontend/2005-01-03-StaticInitializers.cpp:1.4 --- llvm/test/C++Frontend/2005-01-03-StaticInitializers.cpp:1.3 Mon Apr 16 10:31:48 2007 +++ llvm/test/C++Frontend/2005-01-03-StaticInitializers.cpp Tue Apr 17 00:48:35 2007 @@ -4,5 +4,5 @@ int A[2]; }; -int XX = (int)&(((struct S*)0)->A[1]); +int XX = (int)(long)&(((struct S*)0)->A[1]); From asl at math.spbu.ru Tue Apr 17 04:20:32 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 17 Apr 2007 04:20:32 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/mingw-alloca.ll Message-ID: <200704170920.l3H9KWHW007935@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: mingw-alloca.ll added (r1.1) --- Log message: Implemented correct stack probing on mingw/cygwin for dynamic alloca's. Also, fixed static case in presence of eax livin. This fixes PR331: http://llvm.org/PR331 PS: Why don't we still have push/pop instructions? :) --- Diffs of the changes: (+27 -0) mingw-alloca.ll | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+) Index: llvm/test/CodeGen/X86/mingw-alloca.ll diff -c /dev/null llvm/test/CodeGen/X86/mingw-alloca.ll:1.1 *** /dev/null Tue Apr 17 04:20:10 2007 --- llvm/test/CodeGen/X86/mingw-alloca.ll Tue Apr 17 04:20:00 2007 *************** *** 0 **** --- 1,27 ---- + ; RUN: llvm-as < %s | llc -o %t -f + ; RUN: grep __alloca %t | wc -l | grep 2 + ; RUN: grep 8028 %t + ; RUN: grep {pushl %eax} %t + ; RUN: grep 8024 %t | wc -l | grep 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" + target triple = "i386-mingw32" + + define void @foo1(i32 %N) { + entry: + %tmp14 = alloca i32, i32 %N ; [#uses=1] + call void @bar1( i32* %tmp14 ) + ret void + } + + declare void @bar1(i32*) + + define void @foo2(i32 inreg %N) { + entry: + %A2 = alloca [2000 x i32], align 16 ; <[2000 x i32]*> [#uses=1] + %A2.sub = getelementptr [2000 x i32]* %A2, i32 0, i32 0 ; [#uses=1] + call void @bar2( i32* %A2.sub, i32 %N ) + ret void + } + + declare void @bar2(i32*, i32) From asl at math.spbu.ru Tue Apr 17 04:20:33 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 17 Apr 2007 04:20:33 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAGNodes.h Message-ID: <200704170920.l3H9KX3v007940@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAGNodes.h updated: 1.183 -> 1.184 --- Log message: Implemented correct stack probing on mingw/cygwin for dynamic alloca's. Also, fixed static case in presence of eax livin. This fixes PR331: http://llvm.org/PR331 PS: Why don't we still have push/pop instructions? :) --- Diffs of the changes: (+5 -4) SelectionDAGNodes.h | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.183 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.184 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.183 Sun Apr 1 02:28:37 2007 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Tue Apr 17 04:20:00 2007 @@ -430,10 +430,11 @@ TRUNCSTORE, // DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned - // to a specified boundary. The first operand is the token chain, the - // second is the number of bytes to allocate, and the third is the alignment - // boundary. The size is guaranteed to be a multiple of the stack - // alignment, and the alignment is guaranteed to be bigger than the stack + // to a specified boundary. This node always has two return values: a new + // stack pointer value and a chain. The first operand is the token chain, + // the second is the number of bytes to allocate, and the third is the + // alignment boundary. The size is guaranteed to be a multiple of the stack + // alignment, and the alignment is guaranteed to be bigger than the stack // alignment (if required) or 0 to get standard stack alignment. DYNAMIC_STACKALLOC, From asl at math.spbu.ru Tue Apr 17 04:20:33 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 17 Apr 2007 04:20:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp Message-ID: <200704170920.l3H9KXEO007945@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.337 -> 1.338 --- Log message: Implemented correct stack probing on mingw/cygwin for dynamic alloca's. Also, fixed static case in presence of eax livin. This fixes PR331: http://llvm.org/PR331 PS: Why don't we still have push/pop instructions? :) --- Diffs of the changes: (+2 -2) CBackend.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.337 llvm/lib/Target/CBackend/CBackend.cpp:1.338 --- llvm/lib/Target/CBackend/CBackend.cpp:1.337 Fri Apr 13 17:52:03 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Tue Apr 17 04:20:00 2007 @@ -1281,8 +1281,8 @@ // Alloca is hard to get, and we don't want to include stdlib.h here. Out << "/* get a declaration for alloca */\n" << "#if defined(__CYGWIN__) || defined(__MINGW32__)\n" - << "extern void *_alloca(unsigned long);\n" - << "#define alloca(x) _alloca(x)\n" + << "#define alloca(x) __builtin_alloca((x))\n" + << "#define _alloca(x) __builtin_alloca((x))\n" << "#elif defined(__APPLE__)\n" << "extern void *__builtin_alloca(unsigned long);\n" << "#define alloca(x) __builtin_alloca(x)\n" From asl at math.spbu.ru Tue Apr 17 04:20:35 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 17 Apr 2007 04:20:35 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp X86ISelLowering.h X86InstrInfo.td X86RegisterInfo.cpp Message-ID: <200704170920.l3H9KZxW007956@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.390 -> 1.391 X86ISelLowering.h updated: 1.97 -> 1.98 X86InstrInfo.td updated: 1.301 -> 1.302 X86RegisterInfo.cpp updated: 1.209 -> 1.210 --- Log message: Implemented correct stack probing on mingw/cygwin for dynamic alloca's. Also, fixed static case in presence of eax livin. This fixes PR331: http://llvm.org/PR331 PS: Why don't we still have push/pop instructions? :) --- Diffs of the changes: (+68 -5) X86ISelLowering.cpp | 36 +++++++++++++++++++++++++++++++++++- X86ISelLowering.h | 1 + X86InstrInfo.td | 3 +++ X86RegisterInfo.cpp | 33 +++++++++++++++++++++++++++++---- 4 files changed, 68 insertions(+), 5 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.390 llvm/lib/Target/X86/X86ISelLowering.cpp:1.391 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.390 Mon Apr 16 13:10:23 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Tue Apr 17 04:20:00 2007 @@ -237,7 +237,10 @@ setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand); if (Subtarget->is64Bit()) setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i64, Expand); - setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32 , Expand); + if (Subtarget->isTargetCygMing()) + setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32, Custom); + else + setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32, Expand); if (X86ScalarSSE) { // Set up the FP register classes. @@ -3401,6 +3404,36 @@ } } +SDOperand X86TargetLowering::LowerDYNAMIC_STACKALLOC(SDOperand Op, + SelectionDAG &DAG) { + // Get the inputs. + SDOperand Chain = Op.getOperand(0); + SDOperand Size = Op.getOperand(1); + // FIXME: Ensure alignment here + + TargetLowering::ArgListTy Args; + TargetLowering::ArgListEntry Entry; + MVT::ValueType IntPtr = getPointerTy(); + MVT::ValueType SPTy = (Subtarget->is64Bit() ? MVT::i64 : MVT::i32); + const Type *IntPtrTy = getTargetData()->getIntPtrType(); + + Entry.Node = Size; + Entry.Ty = IntPtrTy; + Entry.isInReg = true; // Should pass in EAX + Args.push_back(Entry); + std::pair CallResult = + LowerCallTo(Chain, IntPtrTy, false, false, CallingConv::C, false, + DAG.getExternalSymbol("_alloca", IntPtr), Args, DAG); + + SDOperand SP = DAG.getCopyFromReg(CallResult.second, X86StackPtr, SPTy); + + std::vector Tys; + Tys.push_back(SPTy); + Tys.push_back(MVT::Other); + SDOperand Ops[2] = { SP, CallResult.second }; + return DAG.getNode(ISD::MERGE_VALUES, Tys, Ops, 2); +} + SDOperand X86TargetLowering::LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG) { MachineFunction &MF = DAG.getMachineFunction(); @@ -4002,6 +4035,7 @@ case ISD::INTRINSIC_WO_CHAIN: return LowerINTRINSIC_WO_CHAIN(Op, DAG); case ISD::RETURNADDR: return LowerRETURNADDR(Op, DAG); case ISD::FRAMEADDR: return LowerFRAMEADDR(Op, DAG); + case ISD::DYNAMIC_STACKALLOC: return LowerDYNAMIC_STACKALLOC(Op, DAG); } return SDOperand(); } Index: llvm/lib/Target/X86/X86ISelLowering.h diff -u llvm/lib/Target/X86/X86ISelLowering.h:1.97 llvm/lib/Target/X86/X86ISelLowering.h:1.98 --- llvm/lib/Target/X86/X86ISelLowering.h:1.97 Mon Apr 9 18:31:19 2007 +++ llvm/lib/Target/X86/X86ISelLowering.h Tue Apr 17 04:20:00 2007 @@ -401,6 +401,7 @@ SDOperand LowerJumpTable(SDOperand Op, SelectionDAG &DAG); SDOperand LowerCALL(SDOperand Op, SelectionDAG &DAG); SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG); + SDOperand LowerDYNAMIC_STACKALLOC(SDOperand Op, SelectionDAG &DAG); SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG); SDOperand LowerREADCYCLCECOUNTER(SDOperand Op, SelectionDAG &DAG); SDOperand LowerVASTART(SDOperand Op, SelectionDAG &DAG); Index: llvm/lib/Target/X86/X86InstrInfo.td diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.301 llvm/lib/Target/X86/X86InstrInfo.td:1.302 --- llvm/lib/Target/X86/X86InstrInfo.td:1.301 Tue Apr 10 17:10:25 2007 +++ llvm/lib/Target/X86/X86InstrInfo.td Tue Apr 17 04:20:00 2007 @@ -477,6 +477,9 @@ def POP32r : I<0x58, AddRegFrm, (ops GR32:$reg), "pop{l} $reg", []>, Imp<[ESP],[ESP]>; +def PUSH32r : I<0x50, AddRegFrm, + (ops GR32:$reg), "push{l} $reg", []>, Imp<[ESP],[ESP]>; + def MovePCtoStack : I<0, Pseudo, (ops piclabel:$label), "call $label", []>; Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.209 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.210 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.209 Tue Apr 3 01:18:31 2007 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Tue Apr 17 04:20:00 2007 @@ -1039,14 +1039,39 @@ if (NumBytes) { // adjust stack pointer: ESP -= numbytes if (NumBytes >= 4096 && Subtarget->isTargetCygMing()) { + // Check, whether EAX is livein for this function + bool isEAXAlive = false; + for (MachineFunction::livein_iterator II = MF.livein_begin(), + EE = MF.livein_end(); (II != EE) && !isEAXAlive; ++II) { + unsigned Reg = II->first; + isEAXAlive = (Reg == X86::EAX || Reg == X86::AX || + Reg == X86::AH || Reg == X86::AL); + } + // Function prologue calls _alloca to probe the stack when allocating // more than 4k bytes in one go. Touching the stack at 4K increments is // necessary to ensure that the guard pages used by the OS virtual memory // manager are allocated in correct sequence. - MI = BuildMI(TII.get(X86::MOV32ri), X86::EAX).addImm(NumBytes); - MBB.insert(MBBI, MI); - MI = BuildMI(TII.get(X86::CALLpcrel32)).addExternalSymbol("_alloca"); - MBB.insert(MBBI, MI); + if (!isEAXAlive) { + MI = BuildMI(TII.get(X86::MOV32ri), X86::EAX).addImm(NumBytes); + MBB.insert(MBBI, MI); + MI = BuildMI(TII.get(X86::CALLpcrel32)).addExternalSymbol("_alloca"); + MBB.insert(MBBI, MI); + } else { + // Save EAX + MI = BuildMI(TII.get(X86::PUSH32r), X86::EAX); + MBB.insert(MBBI, MI); + // Allocate NumBytes-4 bytes on stack. We'll also use 4 already + // allocated bytes for EAX. + MI = BuildMI(TII.get(X86::MOV32ri), X86::EAX).addImm(NumBytes-4); + MBB.insert(MBBI, MI); + MI = BuildMI(TII.get(X86::CALLpcrel32)).addExternalSymbol("_alloca"); + MBB.insert(MBBI, MI); + // Restore EAX + MI = addRegOffset(BuildMI(TII.get(X86::MOV32rm), X86::EAX), + StackPtr, NumBytes-4); + MBB.insert(MBBI, MI); + } } else { unsigned Opc = (NumBytes < 128) ? (Is64Bit ? X86::SUB64ri8 : X86::SUB32ri8) : From baldrick at free.fr Tue Apr 17 11:08:28 2007 From: baldrick at free.fr (Duncan Sands) Date: Tue, 17 Apr 2007 18:08:28 +0200 Subject: [llvm-commits] llvm-gcc: use ConstantInt::getAllOnesValue to get -1 Message-ID: <200704171808.28788.baldrick@free.fr> Use ConstantInt::getAllOnesValue to get hold of -1 in CEIL_DIV_EXPR. Ciao, Duncan. -------------- next part -------------- A non-text attachment was scrubbed... Name: all_ones.diff Type: text/x-diff Size: 636 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070417/af68863a/attachment.bin From clattner at apple.com Tue Apr 17 11:28:46 2007 From: clattner at apple.com (clattner at apple.com) Date: Tue, 17 Apr 2007 09:28:46 -0700 (PDT) Subject: [llvm-commits] [126244] Use ConstantInt:: getAllOnesValue to get hold of -1 in CEIL_DIV_EXPR. Message-ID: <20070417162846.08A6EF1A0F8F@src> Revision: 126244 Author: clattner Date: 2007-04-17 09:28:45 -0700 (Tue, 17 Apr 2007) Log Message: ----------- Use ConstantInt::getAllOnesValue to get hold of -1 in CEIL_DIV_EXPR. Patch by Duncan Sands Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-convert.cpp Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-17 07:31:45 UTC (rev 126243) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-17 16:28:45 UTC (rev 126244) @@ -3244,7 +3244,7 @@ const Type *Ty = ConvertType(TREE_TYPE(exp)); Constant *Zero = ConstantInt::get(Ty, 0); Constant *One = ConstantInt::get(Ty, 1); - Constant *MinusOne = ConstantInt::get(Ty, -1U); + Constant *MinusOne = ConstantInt::getAllOnesValue(Ty); Value *LHS = Emit(TREE_OPERAND(exp, 0), 0); Value *RHS = Emit(TREE_OPERAND(exp, 1), 0); From clattner at apple.com Tue Apr 17 11:31:15 2007 From: clattner at apple.com (Chris Lattner) Date: Tue, 17 Apr 2007 09:31:15 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp X86ISelLowering.h X86InstrInfo.td X86RegisterInfo.cpp In-Reply-To: <200704170920.l3H9KZxW007956@zion.cs.uiuc.edu> References: <200704170920.l3H9KZxW007956@zion.cs.uiuc.edu> Message-ID: > > Implemented correct stack probing on mingw/cygwin for dynamic > alloca's. > Also, fixed static case in presence of eax livin. This fixes PR331: > http://llvm.org/PR331 Cool :) > > +SDOperand X86TargetLowering::LowerDYNAMIC_STACKALLOC(SDOperand Op, > + SelectionDAG > &DAG) { Please add a comment above this that explains why this lowering is needed. Also, please assert that the subtarget isCygMing() on entry, to make it obvious to the reader that this is cygwin-specific lowering code. Thanks Anton! -Chris From sabre at nondot.org Tue Apr 17 12:22:23 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 12:22:23 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp X86AsmPrinter.h X86ISelLowering.cpp X86IntelAsmPrinter.cpp X86MachineFunctionInfo.h X86RegisterInfo.cpp Message-ID: <200704171722.l3HHMNEc018294@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ATTAsmPrinter.cpp updated: 1.99 -> 1.100 X86AsmPrinter.cpp updated: 1.238 -> 1.239 X86AsmPrinter.h updated: 1.43 -> 1.44 X86ISelLowering.cpp updated: 1.391 -> 1.392 X86IntelAsmPrinter.cpp updated: 1.69 -> 1.70 X86MachineFunctionInfo.h updated: 1.4 -> 1.5 X86RegisterInfo.cpp updated: 1.210 -> 1.211 --- Log message: rename X86FunctionInfo to X86MachineFunctionInfo to match the header file it is defined in. --- Diffs of the changes: (+23 -21) X86ATTAsmPrinter.cpp | 2 +- X86AsmPrinter.cpp | 8 ++++---- X86AsmPrinter.h | 2 +- X86ISelLowering.cpp | 12 +++++++----- X86IntelAsmPrinter.cpp | 2 +- X86MachineFunctionInfo.h | 16 ++++++++-------- X86RegisterInfo.cpp | 2 +- 7 files changed, 23 insertions(+), 21 deletions(-) Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.99 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.100 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.99 Sat Mar 24 21:01:03 2007 +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Tue Apr 17 12:21:52 2007 @@ -92,7 +92,7 @@ // Populate function information map. Actually, We don't want to populate // non-stdcall or non-fastcall functions' information right now. if (CC == CallingConv::X86_StdCall || CC == CallingConv::X86_FastCall) - FunctionInfoMap[F] = *MF.getInfo(); + FunctionInfoMap[F] = *MF.getInfo(); X86SharedAsmPrinter::decorateName(CurrentFnName, F); Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.238 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.239 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.238 Sat Mar 31 08:11:52 2007 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Tue Apr 17 12:21:52 2007 @@ -32,9 +32,9 @@ #include "llvm/Target/TargetOptions.h" using namespace llvm; -static X86FunctionInfo calculateFunctionInfo(const Function *F, - const TargetData *TD) { - X86FunctionInfo Info; +static X86MachineFunctionInfo calculateFunctionInfo(const Function *F, + const TargetData *TD) { + X86MachineFunctionInfo Info; uint64_t Size = 0; switch (F->getCallingConv()) { @@ -77,7 +77,7 @@ FMFInfoMap::const_iterator info_item = FunctionInfoMap.find(F); - const X86FunctionInfo *Info; + const X86MachineFunctionInfo *Info; if (info_item == FunctionInfoMap.end()) { // Calculate apropriate function info and populate map FunctionInfoMap[F] = calculateFunctionInfo(F, TM.getTargetData()); Index: llvm/lib/Target/X86/X86AsmPrinter.h diff -u llvm/lib/Target/X86/X86AsmPrinter.h:1.43 llvm/lib/Target/X86/X86AsmPrinter.h:1.44 --- llvm/lib/Target/X86/X86AsmPrinter.h:1.43 Fri Jan 26 15:22:28 2007 +++ llvm/lib/Target/X86/X86AsmPrinter.h Tue Apr 17 12:21:52 2007 @@ -48,7 +48,7 @@ // // This structure is using e.g. for name decoration for stdcall & fastcall'ed // function, since we have to use arguments' size for decoration. - typedef std::map FMFInfoMap; + typedef std::map FMFInfoMap; FMFInfoMap FunctionInfoMap; void decorateName(std::string& Name, const GlobalValue* GV); Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.391 llvm/lib/Target/X86/X86ISelLowering.cpp:1.392 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.391 Tue Apr 17 04:20:00 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Tue Apr 17 12:21:52 2007 @@ -729,7 +729,8 @@ RegSaveFrameIndex = 0xAAAAAAA; // X86-64 only. ReturnAddrIndex = 0; // No return address slot generated yet. - MF.getInfo()->setBytesToPopOnReturn(BytesToPopOnReturn); + MF.getInfo() + ->setBytesToPopOnReturn(BytesToPopOnReturn); // Return the new list of results. return DAG.getNode(ISD::MERGE_VALUES, Op.Val->getVTList(), @@ -973,7 +974,8 @@ BytesToPopOnReturn = StackSize; // Callee pops all stack arguments. BytesCallerReserves = 0; - MF.getInfo()->setBytesToPopOnReturn(BytesToPopOnReturn); + MF.getInfo() + ->setBytesToPopOnReturn(BytesToPopOnReturn); // Return the new list of results. return DAG.getNode(ISD::MERGE_VALUES, Op.Val->getVTList(), @@ -3441,7 +3443,7 @@ if (Fn->hasExternalLinkage() && Subtarget->isTargetCygMing() && Fn->getName() == "main") - MF.getInfo()->setForceFramePointer(true); + MF.getInfo()->setForceFramePointer(true); unsigned CC = cast(Op.getOperand(1))->getValue(); if (Subtarget->is64Bit()) @@ -3457,10 +3459,10 @@ case CallingConv::C: return LowerCCCArguments(Op, DAG); case CallingConv::X86_StdCall: - MF.getInfo()->setDecorationStyle(StdCall); + MF.getInfo()->setDecorationStyle(StdCall); return LowerCCCArguments(Op, DAG, true); case CallingConv::X86_FastCall: - MF.getInfo()->setDecorationStyle(FastCall); + MF.getInfo()->setDecorationStyle(FastCall); return LowerFastCCArguments(Op, DAG); } } Index: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.69 llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.70 --- llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.69 Tue Jan 30 14:08:38 2007 +++ llvm/lib/Target/X86/X86IntelAsmPrinter.cpp Tue Apr 17 12:21:52 2007 @@ -51,7 +51,7 @@ // Populate function information map. Actually, We don't want to populate // non-stdcall or non-fastcall functions' information right now. if (CC == CallingConv::X86_StdCall || CC == CallingConv::X86_FastCall) - FunctionInfoMap[F] = *MF.getInfo(); + FunctionInfoMap[F] = *MF.getInfo(); X86SharedAsmPrinter::decorateName(CurrentFnName, F); Index: llvm/lib/Target/X86/X86MachineFunctionInfo.h diff -u llvm/lib/Target/X86/X86MachineFunctionInfo.h:1.4 llvm/lib/Target/X86/X86MachineFunctionInfo.h:1.5 --- llvm/lib/Target/X86/X86MachineFunctionInfo.h:1.4 Mon Sep 25 22:57:53 2006 +++ llvm/lib/Target/X86/X86MachineFunctionInfo.h Tue Apr 17 12:21:52 2007 @@ -24,9 +24,9 @@ FastCall }; -/// X86FunctionInfo - This class is derived from MachineFunction private +/// X86MachineFunctionInfo - This class is derived from MachineFunction private /// X86 target-specific information for each MachineFunction. -class X86FunctionInfo : public MachineFunctionInfo { +class X86MachineFunctionInfo : public MachineFunctionInfo { /// ForceFramePointer - True if the function is required to use of frame /// pointer for reasons other than it containing dynamic allocation or /// that FP eliminatation is turned off. For example, Cygwin main function @@ -42,13 +42,13 @@ NameDecorationStyle DecorationStyle; public: - X86FunctionInfo() : ForceFramePointer(false), - BytesToPopOnReturn(0), - DecorationStyle(None) {} + X86MachineFunctionInfo() : ForceFramePointer(false), + BytesToPopOnReturn(0), + DecorationStyle(None) {} - X86FunctionInfo(MachineFunction &MF) : ForceFramePointer(false), - BytesToPopOnReturn(0), - DecorationStyle(None) {} + X86MachineFunctionInfo(MachineFunction &MF) : ForceFramePointer(false), + BytesToPopOnReturn(0), + DecorationStyle(None) {} bool getForceFramePointer() const { return ForceFramePointer;} void setForceFramePointer(bool forceFP) { ForceFramePointer = forceFP; } Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.210 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.211 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.210 Tue Apr 17 04:20:00 2007 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Tue Apr 17 12:21:52 2007 @@ -927,7 +927,7 @@ bool X86RegisterInfo::hasFP(const MachineFunction &MF) const { return (NoFramePointerElim || MF.getFrameInfo()->hasVarSizedObjects() || - MF.getInfo()->getForceFramePointer()); + MF.getInfo()->getForceFramePointer()); } void X86RegisterInfo:: From sabre at nondot.org Tue Apr 17 12:36:29 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 12:36:29 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Verifier.cpp Message-ID: <200704171736.l3HHaTeW018762@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Verifier.cpp updated: 1.202 -> 1.203 --- Log message: eliminate a use of Instruction::getPrev(), patch by Gabor Greif in 2005. --- Diffs of the changes: (+2 -1) Verifier.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.202 llvm/lib/VMCore/Verifier.cpp:1.203 --- llvm/lib/VMCore/Verifier.cpp:1.202 Wed Apr 11 21:48:46 2007 +++ llvm/lib/VMCore/Verifier.cpp Tue Apr 17 12:36:12 2007 @@ -640,7 +640,8 @@ // This can be tested by checking whether the instruction before this is // either nonexistent (because this is begin()) or is a PHI node. If not, // then there is some other instruction before a PHI. - Assert2(&PN.getParent()->front() == &PN || isa(PN.getPrev()), + Assert2(&PN == &PN.getParent()->front() || + isa(--BasicBlock::iterator(&PN)), "PHI nodes not grouped at top of basic block!", &PN, PN.getParent()); From sabre at nondot.org Tue Apr 17 12:38:46 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 12:38:46 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Message-ID: <200704171738.l3HHckDJ018851@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: Execution.cpp updated: 1.178 -> 1.179 --- Log message: eliminate use of Instruction::getPrev(). Patch by Gabor Greif in 2005. --- Diffs of the changes: (+6 -3) Execution.cpp | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.178 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.179 --- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.178 Mon Apr 16 16:50:40 2007 +++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Tue Apr 17 12:38:28 2007 @@ -866,16 +866,19 @@ // If it is an unknown intrinsic function, use the intrinsic lowering // class to transform it into hopefully tasty LLVM code. // - Instruction *Prev = CS.getInstruction()->getPrev(); + BasicBlock::iterator me(CS.getInstruction()); BasicBlock *Parent = CS.getInstruction()->getParent(); + bool atBegin(Parent->begin() == me); + if (!atBegin) + --me; IL->LowerIntrinsicCall(cast(CS.getInstruction())); // Restore the CurInst pointer to the first instruction newly inserted, if // any. - if (!Prev) { + if (atBegin) { SF.CurInst = Parent->begin(); } else { - SF.CurInst = Prev; + SF.CurInst = me; ++SF.CurInst; } return; From sabre at nondot.org Tue Apr 17 12:48:14 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 12:48:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/SimplifyCFG.cpp Message-ID: <200704171748.l3HHmEhg019049@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: SimplifyCFG.cpp updated: 1.120 -> 1.121 --- Log message: remove use of Instruction::getNext --- Diffs of the changes: (+5 -3) SimplifyCFG.cpp | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/Utils/SimplifyCFG.cpp diff -u llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.120 llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.121 --- llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.120 Sun Apr 1 20:44:59 2007 +++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp Tue Apr 17 12:47:54 2007 @@ -1447,10 +1447,11 @@ // predecessor and use logical operations to pick the right destination. BasicBlock *TrueDest = BI->getSuccessor(0); BasicBlock *FalseDest = BI->getSuccessor(1); - if (Instruction *Cond = dyn_cast(BI->getCondition())) + if (Instruction *Cond = dyn_cast(BI->getCondition())) { + BasicBlock::iterator CondIt = Cond; if ((isa(Cond) || isa(Cond)) && Cond->getParent() == BB && &BB->front() == Cond && - Cond->getNext() == BI && Cond->hasOneUse() && + &*++CondIt == BI && Cond->hasOneUse() && TrueDest != BB && FalseDest != BB) for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI!=E; ++PI) if (BranchInst *PBI = dyn_cast((*PI)->getTerminator())) @@ -1496,8 +1497,9 @@ return SimplifyCFG(BB) | 1; } } + } - // Scan predessor blocks for conditional branchs. + // Scan predessor blocks for conditional branches. for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) if (BranchInst *PBI = dyn_cast((*PI)->getTerminator())) if (PBI != BI && PBI->isConditional()) { From sabre at nondot.org Tue Apr 17 12:51:20 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 12:51:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp Message-ID: <200704171751.l3HHpKYB019139@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation: RSProfiling.cpp updated: 1.21 -> 1.22 --- Log message: eliminate use of Instruction::getNext() --- Diffs of the changes: (+15 -13) RSProfiling.cpp | 28 +++++++++++++++------------- 1 files changed, 15 insertions(+), 13 deletions(-) Index: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.21 llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.22 --- llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.21 Mon Apr 16 13:10:23 2007 +++ llvm/lib/Transforms/Instrumentation/RSProfiling.cpp Tue Apr 17 12:51:03 2007 @@ -230,9 +230,10 @@ void GlobalRandomCounterOpt::PrepFunction(Function* F) { //make a local temporary to cache the global BasicBlock& bb = F->getEntryBlock(); - AI = new AllocaInst(T, 0, "localcounter", bb.begin()); - LoadInst* l = new LoadInst(Counter, "counterload", AI->getNext()); - new StoreInst(l, AI, l->getNext()); + BasicBlock::iterator InsertPt = bb.begin(); + AI = new AllocaInst(T, 0, "localcounter", InsertPt); + LoadInst* l = new LoadInst(Counter, "counterload", InsertPt); + new StoreInst(l, AI, InsertPt); //modify all functions and return values to restore the local variable to/from //the global variable @@ -240,25 +241,26 @@ fib != fie; ++fib) for(BasicBlock::iterator bib = fib->begin(), bie = fib->end(); bib != bie; ++bib) - if (isa(&*bib)) { + if (isa(bib)) { LoadInst* l = new LoadInst(AI, "counter", bib); new StoreInst(l, Counter, bib); - l = new LoadInst(Counter, "counter", bib->getNext()); - new StoreInst(l, AI, l->getNext()); - } else if (isa(&*bib)) { + l = new LoadInst(Counter, "counter", ++bib); + new StoreInst(l, AI, bib--); + } else if (isa(bib)) { LoadInst* l = new LoadInst(AI, "counter", bib); new StoreInst(l, Counter, bib); - BasicBlock* bb = cast(&*bib)->getNormalDest(); - Instruction* i = bb->begin(); - while (isa(i)) i = i->getNext(); + BasicBlock* bb = cast(bib)->getNormalDest(); + BasicBlock::iterator i = bb->begin(); + while (isa(i)) + ++i; l = new LoadInst(Counter, "counter", i); - bb = cast(&*bib)->getUnwindDest(); + bb = cast(bib)->getUnwindDest(); i = bb->begin(); - while (isa(i)) i = i->getNext(); + while (isa(i)) ++i; l = new LoadInst(Counter, "counter", i); - new StoreInst(l, AI, l->getNext()); + new StoreInst(l, AI, i); } else if (isa(&*bib) || isa(&*bib)) { LoadInst* l = new LoadInst(AI, "counter", bib); new StoreInst(l, Counter, bib); From sabre at nondot.org Tue Apr 17 12:53:03 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 12:53:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/LoadValueNumbering.cpp Message-ID: <200704171753.l3HHr3un019196@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: LoadValueNumbering.cpp updated: 1.38 -> 1.39 --- Log message: Remove use of Instruction::getNext --- Diffs of the changes: (+12 -9) LoadValueNumbering.cpp | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-) Index: llvm/lib/Analysis/LoadValueNumbering.cpp diff -u llvm/lib/Analysis/LoadValueNumbering.cpp:1.38 llvm/lib/Analysis/LoadValueNumbering.cpp:1.39 --- llvm/lib/Analysis/LoadValueNumbering.cpp:1.38 Fri Apr 6 23:43:07 2007 +++ llvm/lib/Analysis/LoadValueNumbering.cpp Tue Apr 17 12:52:45 2007 @@ -336,15 +336,18 @@ // we see any candidate loads, then we know they have the same value # as LI. // bool LoadInvalidatedInBBAfter = false; - for (BasicBlock::iterator I = LI->getNext(); I != LoadBB->end(); ++I) { - // If this instruction is a load, then this instruction returns the same - // value as LI. - if (isa(I) && cast(I)->getOperand(0) == LoadPtr) - RetVals.push_back(I); - - if (AA.getModRefInfo(I, LoadPtr, LoadSize) & AliasAnalysis::Mod) { - LoadInvalidatedInBBAfter = true; - break; + { + BasicBlock::iterator I = LI; + for (++I; I != LoadBB->end(); ++I) { + // If this instruction is a load, then this instruction returns the same + // value as LI. + if (isa(I) && cast(I)->getOperand(0) == LoadPtr) + RetVals.push_back(I); + + if (AA.getModRefInfo(I, LoadPtr, LoadSize) & AliasAnalysis::Mod) { + LoadInvalidatedInBBAfter = true; + break; + } } } From sabre at nondot.org Tue Apr 17 12:54:29 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 12:54:29 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp Message-ID: <200704171754.l3HHsTej019254@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation: RSProfiling.cpp updated: 1.22 -> 1.23 --- Log message: remove use of BasicBlock::getNext --- Diffs of the changes: (+4 -3) RSProfiling.cpp | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.22 llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.23 --- llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.22 Tue Apr 17 12:51:03 2007 +++ llvm/lib/Transforms/Instrumentation/RSProfiling.cpp Tue Apr 17 12:54:12 2007 @@ -455,10 +455,11 @@ // add in edge from C using x in A' //a: - BasicBlock* bbC = new BasicBlock("choice", &F, src->getNext() ); + Function::iterator BBN = src; ++BBN; + BasicBlock* bbC = new BasicBlock("choice", &F, BBN); //ChoicePoints.insert(bbC); - BasicBlock* bbCp = - new BasicBlock("choice", &F, cast(Translate(src))->getNext() ); + BBN = cast(Translate(src)); + BasicBlock* bbCp = new BasicBlock("choice", &F, ++BBN); ChoicePoints.insert(bbCp); //b: From sabre at nondot.org Tue Apr 17 13:03:18 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 13:03:18 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/README.txt Message-ID: <200704171803.l3HI3IWO019415@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: README.txt updated: 1.21 -> 1.22 --- Log message: add a note --- Diffs of the changes: (+43 -0) README.txt | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+) Index: llvm/lib/Target/ARM/README.txt diff -u llvm/lib/Target/ARM/README.txt:1.21 llvm/lib/Target/ARM/README.txt:1.22 --- llvm/lib/Target/ARM/README.txt:1.21 Tue Mar 20 17:32:39 2007 +++ llvm/lib/Target/ARM/README.txt Tue Apr 17 13:03:00 2007 @@ -476,3 +476,46 @@ in a load / store. 2. Allow iv reuse even when a type conversion is required. For example, i8 and i32 load / store addressing modes are identical. + + +//===---------------------------------------------------------------------===// + +This: + +int foo(int a, int b, int c, int d) { + long long acc = (long long)a * (long long)b; + acc += (long long)c * (long long)d; + return (int)(acc >> 32); +} + +Should compile to use SMLAL (Signed Multiply Accumulate Long) which multiplies +two signed 32-bit values to produce a 64-bit value, and accumulates this with +a 64-bit value. + +We currently get this with v6: + +_foo: + mul r12, r1, r0 + smmul r1, r1, r0 + smmul r0, r3, r2 + mul r3, r3, r2 + adds r3, r3, r12 + adc r0, r0, r1 + bx lr + +and this with v4: + +_foo: + stmfd sp!, {r7, lr} + mov r7, sp + mul r12, r1, r0 + smull r0, r1, r1, r0 + smull lr, r0, r3, r2 + mul r3, r3, r2 + adds r3, r3, r12 + adc r0, r0, r1 + ldmfd sp!, {r7, pc} + +This apparently occurs in real code. + +//===---------------------------------------------------------------------===// From sabre at nondot.org Tue Apr 17 13:04:12 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 13:04:12 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Instruction.h Message-ID: <200704171804.l3HI4Crd019487@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Instruction.h updated: 1.84 -> 1.85 --- Log message: Instruction:: Next/Prev accessors are now private --- Diffs of the changes: (+8 -7) Instruction.h | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) Index: llvm/include/llvm/Instruction.h diff -u llvm/include/llvm/Instruction.h:1.84 llvm/include/llvm/Instruction.h:1.85 --- llvm/include/llvm/Instruction.h:1.84 Mon Apr 16 22:26:42 2007 +++ llvm/include/llvm/Instruction.h Tue Apr 17 13:03:55 2007 @@ -82,13 +82,6 @@ inline const BasicBlock *getParent() const { return Parent; } inline BasicBlock *getParent() { return Parent; } - // getNext/Prev - Return the next or previous instruction in the list. The - // last node in the list is a terminator instruction. - Instruction *getNext() { return Next; } - const Instruction *getNext() const { return Next; } - Instruction *getPrev() { return Prev; } - const Instruction *getPrev() const { return Prev; } - /// removeFromParent - This method unlinks 'this' from the containing basic /// block, but does not delete it. /// @@ -231,6 +224,14 @@ #define LAST_OTHER_INST(N) OtherOpsEnd = N+1 #include "llvm/Instruction.def" }; + +private: + // getNext/Prev - Return the next or previous instruction in the list. The + // last node in the list is a terminator instruction. + Instruction *getNext() { return Next; } + const Instruction *getNext() const { return Next; } + Instruction *getPrev() { return Prev; } + const Instruction *getPrev() const { return Prev; } }; } // End llvm namespace From sabre at nondot.org Tue Apr 17 13:10:05 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 13:10:05 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp LowerSwitch.cpp Message-ID: <200704171810.l3HIA5Re019667@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: BreakCriticalEdges.cpp updated: 1.43 -> 1.44 LowerSwitch.cpp updated: 1.37 -> 1.38 --- Log message: remove use of BasicBlock::getNext --- Diffs of the changes: (+6 -3) BreakCriticalEdges.cpp | 3 ++- LowerSwitch.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp diff -u llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.43 llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.44 --- llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.43 Sun Apr 15 03:47:27 2007 +++ llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp Tue Apr 17 13:09:47 2007 @@ -129,7 +129,8 @@ // Insert the block into the function... right after the block TI lives in. Function &F = *TIBB->getParent(); - F.getBasicBlockList().insert(TIBB->getNext(), NewBB); + Function::iterator FBBI = TIBB; + F.getBasicBlockList().insert(++FBBI, NewBB); // If there are any PHI nodes in DestBB, we need to update them so that they // merge incoming values from NewBB instead of from TIBB. Index: llvm/lib/Transforms/Utils/LowerSwitch.cpp diff -u llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.37 llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.38 --- llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.37 Mon Apr 16 13:10:23 2007 +++ llvm/lib/Transforms/Utils/LowerSwitch.cpp Tue Apr 17 13:09:47 2007 @@ -155,7 +155,8 @@ // left branch if it is and right branch if not. Function* F = OrigBlock->getParent(); BasicBlock* NewNode = new BasicBlock("NodeBlock"); - F->getBasicBlockList().insert(OrigBlock->getNext(), NewNode); + Function::iterator FI = OrigBlock; + F->getBasicBlockList().insert(++FI, NewNode); ICmpInst* Comp = new ICmpInst(ICmpInst::ICMP_SLT, Val, Pivot.Low, "Pivot"); NewNode->getInstList().push_back(Comp); @@ -175,7 +176,8 @@ { Function* F = OrigBlock->getParent(); BasicBlock* NewLeaf = new BasicBlock("LeafBlock"); - F->getBasicBlockList().insert(OrigBlock->getNext(), NewLeaf); + Function::iterator FI = OrigBlock; + F->getBasicBlockList().insert(++FI, NewLeaf); // Emit comparison ICmpInst* Comp = NULL; From sabre at nondot.org Tue Apr 17 13:15:21 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 13:15:21 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/GlobalVariable.h Message-ID: <200704171815.l3HIFLq5019870@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: GlobalVariable.h updated: 1.42 -> 1.43 --- Log message: bool on darwin/ppc is 4 bytes. --- Diffs of the changes: (+2 -2) GlobalVariable.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/include/llvm/GlobalVariable.h diff -u llvm/include/llvm/GlobalVariable.h:1.42 llvm/include/llvm/GlobalVariable.h:1.43 --- llvm/include/llvm/GlobalVariable.h:1.42 Mon Apr 16 22:26:42 2007 +++ llvm/include/llvm/GlobalVariable.h Tue Apr 17 13:15:04 2007 @@ -41,8 +41,8 @@ void setNext(GlobalVariable *N) { Next = N; } void setPrev(GlobalVariable *N) { Prev = N; } - bool isConstantGlobal; // Is this a global constant? - bool isThreadLocalSymbol; // Is this symbol "Thread Local"? + bool isConstantGlobal : 1; // Is this a global constant? + bool isThreadLocalSymbol : 1; // Is this symbol "Thread Local"? Use Initializer; public: From sabre at nondot.org Tue Apr 17 13:16:57 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 13:16:57 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/BasicBlock.h Message-ID: <200704171816.l3HIGvo6019998@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: BasicBlock.h updated: 1.67 -> 1.68 --- Log message: make next/prev accessors private --- Diffs of the changes: (+8 -6) BasicBlock.h | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) Index: llvm/include/llvm/BasicBlock.h diff -u llvm/include/llvm/BasicBlock.h:1.67 llvm/include/llvm/BasicBlock.h:1.68 --- llvm/include/llvm/BasicBlock.h:1.67 Tue Apr 17 00:33:04 2007 +++ llvm/include/llvm/BasicBlock.h Tue Apr 17 13:16:39 2007 @@ -82,12 +82,6 @@ const Function *getParent() const { return Parent; } Function *getParent() { return Parent; } - // getNext/Prev - Return the next or previous basic block in the list. - BasicBlock *getNext() { return Next; } - const BasicBlock *getNext() const { return Next; } - BasicBlock *getPrev() { return Prev; } - const BasicBlock *getPrev() const { return Prev; } - /// use_back - Specialize the methods defined in Value, as we know that an /// BasicBlock can only be used by Instructions (specifically PHI and terms). Instruction *use_back() { return cast(*use_begin());} @@ -201,6 +195,14 @@ BasicBlock *Obj = 0; return unsigned(reinterpret_cast(&Obj->InstList)); } + +private: + // getNext/Prev - Return the next or previous basic block in the list. Access + // these with Function::iterator. + BasicBlock *getNext() { return Next; } + const BasicBlock *getNext() const { return Next; } + BasicBlock *getPrev() { return Prev; } + const BasicBlock *getPrev() const { return Prev; } }; inline int From djg at cray.com Tue Apr 17 13:21:53 2007 From: djg at cray.com (Dan Gohman) Date: Tue, 17 Apr 2007 13:21:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LICM.cpp Message-ID: <200704171821.l3HILrqo020112@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LICM.cpp updated: 1.90 -> 1.91 --- Log message: Spell doFinalization right, so that it is a proper virtual override and gets called. --- Diffs of the changes: (+1 -1) LICM.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.90 llvm/lib/Transforms/Scalar/LICM.cpp:1.91 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.90 Sat Apr 14 18:32:02 2007 +++ llvm/lib/Transforms/Scalar/LICM.cpp Tue Apr 17 13:21:36 2007 @@ -77,7 +77,7 @@ AU.addRequired(); } - bool doFinalize() { + bool doFinalization() { LoopToAliasMap.clear(); return false; } From sabre at nondot.org Tue Apr 17 13:30:58 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 13:30:58 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/GlobalVariable.h Function.h Message-ID: <200704171830.l3HIUw20020388@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: GlobalVariable.h updated: 1.43 -> 1.44 Function.h updated: 1.79 -> 1.80 --- Log message: make getnext/getprev accessors private. --- Diffs of the changes: (+15 -15) Function.h | 18 +++++++++--------- GlobalVariable.h | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) Index: llvm/include/llvm/GlobalVariable.h diff -u llvm/include/llvm/GlobalVariable.h:1.43 llvm/include/llvm/GlobalVariable.h:1.44 --- llvm/include/llvm/GlobalVariable.h:1.43 Tue Apr 17 13:15:04 2007 +++ llvm/include/llvm/GlobalVariable.h Tue Apr 17 13:30:41 2007 @@ -93,12 +93,6 @@ } } - // getNext/Prev - Return the next or previous global variable in the list. - GlobalVariable *getNext() { return Next; } - const GlobalVariable *getNext() const { return Next; } - GlobalVariable *getPrev() { return Prev; } - const GlobalVariable *getPrev() const { return Prev; } - /// If the value is a global constant, its value is immutable throughout the /// runtime execution of the program. Assigning a value into the constant /// leads to undefined behavior. @@ -132,6 +126,12 @@ static inline bool classof(const Value *V) { return V->getValueID() == Value::GlobalVariableVal; } +private: + // getNext/Prev - Return the next or previous global variable in the list. + GlobalVariable *getNext() { return Next; } + const GlobalVariable *getNext() const { return Next; } + GlobalVariable *getPrev() { return Prev; } + const GlobalVariable *getPrev() const { return Prev; } }; } // End llvm namespace Index: llvm/include/llvm/Function.h diff -u llvm/include/llvm/Function.h:1.79 llvm/include/llvm/Function.h:1.80 --- llvm/include/llvm/Function.h:1.79 Tue Apr 17 00:33:04 2007 +++ llvm/include/llvm/Function.h Tue Apr 17 13:30:41 2007 @@ -149,15 +149,6 @@ void eraseFromParent(); - // getNext/Prev - Return the next or previous function in the list. These - // methods should never be used directly, and are only used to implement the - // function list as part of the module. - // - Function *getNext() { return Next; } - const Function *getNext() const { return Next; } - Function *getPrev() { return Prev; } - const Function *getPrev() const { return Prev; } - /// Get the underlying elements of the Function... the basic block list is /// empty for external functions. /// @@ -252,6 +243,15 @@ Function *Obj = 0; return unsigned(reinterpret_cast(&Obj->ArgumentList)); } +private: + // getNext/Prev - Return the next or previous function in the list. These + // methods should never be used directly, and are only used to implement the + // function list as part of the module. + // + Function *getNext() { return Next; } + const Function *getNext() const { return Next; } + Function *getPrev() { return Prev; } + const Function *getPrev() const { return Prev; } }; inline ValueSymbolTable * From sabre at nondot.org Tue Apr 17 13:42:00 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 13:42:00 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/ilist Message-ID: <200704171842.l3HIg0h4020862@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: ilist updated: 1.26 -> 1.27 --- Log message: Commit an patch from Gabor Greif in Mar 2005. This eliminates the tail pointer from ilist, storing it in the prev pointer of the first node in the list instead. This shrinks ilist from 8 to 4 bytes, BasicBlock from 40->36 bytes, Function from 76->68 bytes, Module from 52->44 bytes. --- Diffs of the changes: (+37 -18) ilist | 55 +++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 37 insertions(+), 18 deletions(-) Index: llvm/include/llvm/ADT/ilist diff -u llvm/include/llvm/ADT/ilist:1.26 llvm/include/llvm/ADT/ilist:1.27 --- llvm/include/llvm/ADT/ilist:1.26 Wed Jun 15 13:28:44 2005 +++ llvm/include/llvm/ADT/ilist Tue Apr 17 13:41:42 2007 @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // This file defines classes to implement an intrusive doubly linked list class -// (ie each node of the list must contain a next and previous field for the +// (i.e. each node of the list must contain a next and previous field for the // list. // // The ilist_traits trait class is used to gain access to the next and previous @@ -22,7 +22,7 @@ // really want to know if it's empty. // // The ilist class is implemented by allocating a 'tail' node when the list is -// created (using ilist_traits<>::createEndMarker()). This tail node is +// created (using ilist_traits<>::createSentinel()). This tail node is // absolutely required because the user must be able to compute end()-1. Because // of this, users of the direct next/prev links will see an extra link on the // end of the list, which should be ignored. @@ -134,7 +134,7 @@ // Increment and decrement operators... ilist_iterator &operator--() { // predecrement - Back up NodePtr = Traits::getPrev(NodePtr); - assert(NodePtr && "--'d off the beginning of an ilist!"); + assert(Traits::getNext(NodePtr) && "--'d off the beginning of an ilist!"); return *this; } ilist_iterator &operator++() { // preincrement - Advance @@ -213,12 +213,20 @@ //===----------------------------------------------------------------------===// // // iplist - The subset of list functionality that can safely be used on nodes of -// polymorphic types, ie a heterogeneus list with a common base class that holds -// the next/prev pointers... +// polymorphic types, i.e. a heterogenous list with a common base class that +// holds the next/prev pointers... // template > class iplist : public Traits { - NodeTy *Head, *Tail; + NodeTy *Head; + + // Use the prev node pointer of 'head' as the tail pointer. This is really a + // circularly linked list where we snip the 'next' link from the sentinel node + // back to the first node in the list (to preserve assertions about going off + // the end of the list). + NodeTy *getTail() { return getPrev(Head); } + const NodeTy *getTail() const { return getPrev(Head); } + void setTail(NodeTy *N) { setPrev(Head, N); } static bool op_less(NodeTy &L, NodeTy &R) { return L < R; } static bool op_equal(NodeTy &L, NodeTy &R) { return L == R; } @@ -235,28 +243,28 @@ typedef std::reverse_iterator const_reverse_iterator; typedef std::reverse_iterator reverse_iterator; - iplist() : Head(Traits::createSentinel()), Tail(Head) { + iplist() : Head(Traits::createSentinel()) { setNext(Head, 0); - setPrev(Head, 0); + setTail(Head); } - ~iplist() { clear(); Traits::destroySentinel(Tail); } + ~iplist() { clear(); Traits::destroySentinel(getTail()); } // Iterator creation methods. iterator begin() { return iterator(Head); } const_iterator begin() const { return const_iterator(Head); } - iterator end() { return iterator(Tail); } - const_iterator end() const { return const_iterator(Tail); } + iterator end() { return iterator(getTail()); } + const_iterator end() const { return const_iterator(getTail()); } // reverse iterator creation methods. reverse_iterator rbegin() { return reverse_iterator(end()); } const_reverse_iterator rbegin() const{ return const_reverse_iterator(end()); } reverse_iterator rend() { return reverse_iterator(begin()); } - const_reverse_iterator rend() const {return const_reverse_iterator(begin());} + const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } // Miscellaneous inspection routines. size_type max_size() const { return size_type(-1); } - bool empty() const { return Head == Tail; } + bool empty() const { return Head == getTail(); } // Front and back accessor functions... reference front() { @@ -269,17 +277,16 @@ } reference back() { assert(!empty() && "Called back() on empty list!"); - return *getPrev(Tail); + return *getPrev(getTail()); } const_reference back() const { assert(!empty() && "Called back() on empty list!"); - return *getPrev(Tail); + return *getPrev(getTail()); } void swap(iplist &RHS) { abort(); // Swap does not use list traits callback correctly yet! std::swap(Head, RHS.Head); - std::swap(Tail, RHS.Tail); } iterator insert(iterator where, NodeTy *New) { @@ -287,7 +294,7 @@ setNext(New, CurNode); setPrev(New, PrevNode); - if (PrevNode) + if (CurNode != Head) // Is PrevNode off the beginning of the list? setNext(PrevNode, New); else Head = New; @@ -303,7 +310,7 @@ NodeTy *NextNode = getNext(Node); NodeTy *PrevNode = getPrev(Node); - if (PrevNode) + if (Node != Head) // Is PrevNode off the beginning of the list? setNext(PrevNode, NextNode); else Head = NextNode; @@ -331,7 +338,15 @@ // void transfer(iterator position, iplist &L2, iterator first, iterator last) { assert(first != last && "Should be checked by callers"); + if (position != last) { + // Note: we have to be careful about the case when we move the first node + // in the list. This node is the list sentinel node and we can't move it. + NodeTy *ThisSentinel = getTail(); + setTail(0); + NodeTy *L2Sentinel = L2.getTail(); + L2.setTail(0); + // Remove [first, last) from its old position. NodeTy *First = &*first, *Prev = getPrev(First); NodeTy *Next = last.getNodePtrUnchecked(), *Last = getPrev(Next); @@ -357,6 +372,10 @@ setPrev(PosNext, Last); transferNodesFromList(L2, First, PosNext); + + // Now that everything is set, restore the pointers to the list sentinals. + L2.setTail(L2Sentinel); + setTail(ThisSentinel); } } From sabre at nondot.org Tue Apr 17 14:03:20 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 14:03:20 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/PowerPC/sign_ext_inreg1.ll Message-ID: <200704171903.l3HJ3Ku5021651@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/PowerPC: sign_ext_inreg1.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+12 -0) sign_ext_inreg1.ll | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: llvm/test/CodeGen/PowerPC/sign_ext_inreg1.ll diff -c /dev/null llvm/test/CodeGen/PowerPC/sign_ext_inreg1.ll:1.1 *** /dev/null Tue Apr 17 14:03:12 2007 --- llvm/test/CodeGen/PowerPC/sign_ext_inreg1.ll Tue Apr 17 14:03:02 2007 *************** *** 0 **** --- 1,12 ---- + ; RUN: llvm-as < %s | llc -march=ppc32 | grep srwi + ; RUN: llvm-as < %s | llc -march=ppc32 | not grep rlwimi + + define i32 @baz(i64 %a) { + %tmp29 = lshr i64 %a, 24 ; [#uses=1] + %tmp23 = trunc i64 %tmp29 to i32 ; [#uses=1] + %tmp410 = lshr i32 %tmp23, 9 ; [#uses=1] + %tmp45 = trunc i32 %tmp410 to i16 ; [#uses=1] + %tmp456 = sext i16 %tmp45 to i32 ; [#uses=1] + ret i32 %tmp456 + } + From sabre at nondot.org Tue Apr 17 14:03:39 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 14:03:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200704171903.l3HJ3d2p021674@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.290 -> 1.291 --- Log message: SIGN_EXTEND_INREG does not demand its top bits. Give SimplifyDemandedBits a chance to hack on it. This compiles: int baz(long long a) { return (short)(((int)(a >>24)) >> 9); } into: _baz: slwi r2, r3, 8 srwi r2, r2, 9 extsh r3, r2 blr instead of: _baz: srwi r2, r4, 24 rlwimi r2, r3, 8, 0, 23 srwi r2, r2, 9 extsh r3, r2 blr This implements CodeGen/PowerPC/sign_ext_inreg1.ll --- Diffs of the changes: (+6 -1) DAGCombiner.cpp | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.290 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.291 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.290 Wed Apr 11 11:51:53 2007 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Apr 17 14:03:21 2007 @@ -2429,10 +2429,15 @@ return DAG.getNode(ISD::SIGN_EXTEND_INREG, VT, N0.getOperand(0), N1); } - // fold (sext_in_reg x) -> (zext_in_reg x) if the sign bit is zero + // fold (sext_in_reg x) -> (zext_in_reg x) if the sign bit is known zero. if (TLI.MaskedValueIsZero(N0, 1ULL << (EVTBits-1))) return DAG.getZeroExtendInReg(N0, EVT); + // fold operands of sext_in_reg based on knowledge that the top bits are not + // demanded. + if (SimplifyDemandedBits(SDOperand(N, 0))) + return SDOperand(N, 0); + // fold (sext_in_reg (load x)) -> (smaller sextload x) // fold (sext_in_reg (srl (load x), c)) -> (smaller sextload (x+c/evtbits)) SDOperand NarrowLoad = ReduceLoadWidth(N); From asl at math.spbu.ru Tue Apr 17 14:34:17 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 17 Apr 2007 14:34:17 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200704171934.l3HJYHHO022401@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.392 -> 1.393 --- Log message: Add comment --- Diffs of the changes: (+9 -0) X86ISelLowering.cpp | 9 +++++++++ 1 files changed, 9 insertions(+) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.392 llvm/lib/Target/X86/X86ISelLowering.cpp:1.393 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.392 Tue Apr 17 12:21:52 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Tue Apr 17 14:34:00 2007 @@ -3406,8 +3406,17 @@ } } + +// Lower dynamic stack allocation to _alloca call for Cygwin/Mingw targets. +// Calls to _alloca is needed to probe the stack when allocating more than 4k +// bytes in one go. Touching the stack at 4K increments is necessary to ensure +// that the guard pages used by the OS virtual memory manager are allocated in +// correct sequence. SDOperand X86TargetLowering::LowerDYNAMIC_STACKALLOC(SDOperand Op, SelectionDAG &DAG) { + assert(Subtarget->isTargetCygMing() && + "This should be used only on Cygwin/Mingw targets"); + // Get the inputs. SDOperand Chain = Op.getOperand(0); SDOperand Size = Op.getOperand(1); From clattner at apple.com Tue Apr 17 15:07:30 2007 From: clattner at apple.com (Chris Lattner) Date: Tue, 17 Apr 2007 13:07:30 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp In-Reply-To: <200704171934.l3HJYHHO022401@zion.cs.uiuc.edu> References: <200704171934.l3HJYHHO022401@zion.cs.uiuc.edu> Message-ID: Thanks Anton! On Apr 17, 2007, at 12:34 PM, Anton Korobeynikov wrote: > > > Changes in directory llvm/lib/Target/X86: > > X86ISelLowering.cpp updated: 1.392 -> 1.393 > --- > Log message: > > Add comment > > > --- > Diffs of the changes: (+9 -0) > > X86ISelLowering.cpp | 9 +++++++++ > 1 files changed, 9 insertions(+) > > > Index: llvm/lib/Target/X86/X86ISelLowering.cpp > diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.392 llvm/lib/ > Target/X86/X86ISelLowering.cpp:1.393 > --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.392 Tue Apr 17 > 12:21:52 2007 > +++ llvm/lib/Target/X86/X86ISelLowering.cpp Tue Apr 17 14:34:00 2007 > @@ -3406,8 +3406,17 @@ > } > } > > + > +// Lower dynamic stack allocation to _alloca call for Cygwin/Mingw > targets. > +// Calls to _alloca is needed to probe the stack when allocating > more than 4k > +// bytes in one go. Touching the stack at 4K increments is > necessary to ensure > +// that the guard pages used by the OS virtual memory manager are > allocated in > +// correct sequence. > SDOperand X86TargetLowering::LowerDYNAMIC_STACKALLOC(SDOperand Op, > SelectionDAG > &DAG) { > + assert(Subtarget->isTargetCygMing() && > + "This should be used only on Cygwin/Mingw targets"); > + > // Get the inputs. > SDOperand Chain = Op.getOperand(0); > SDOperand Size = Op.getOperand(1); > > > > _______________________________________________ > 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 Apr 17 15:22:29 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Apr 2007 15:22:29 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveVariables.h Message-ID: <200704172022.l3HKMT1Y023305@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveVariables.h updated: 1.36 -> 1.37 --- Log message: Keep track of number of uses within the function per virtual register. --- Diffs of the changes: (+5 -1) LiveVariables.h | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/LiveVariables.h diff -u llvm/include/llvm/CodeGen/LiveVariables.h:1.36 llvm/include/llvm/CodeGen/LiveVariables.h:1.37 --- llvm/include/llvm/CodeGen/LiveVariables.h:1.36 Sat Mar 17 04:29:54 2007 +++ llvm/include/llvm/CodeGen/LiveVariables.h Tue Apr 17 15:22:11 2007 @@ -83,12 +83,16 @@ /// is a bit set which uses the basic block number as an index. BitVector UsedBlocks; + /// NumUses - Number of uses of this register across the entire function. + /// + unsigned NumUses; + /// Kills - List of MachineInstruction's which are the last use of this /// virtual register (kill it) in their basic block. /// std::vector Kills; - VarInfo() : DefInst(0) {} + VarInfo() : DefInst(0), NumUses(0) {} /// removeKill - Delete a kill corresponding to the specified /// machine instruction. Returns true if there was a kill From evan.cheng at apple.com Tue Apr 17 15:22:31 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Apr 2007 15:22:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveVariables.cpp Message-ID: <200704172022.l3HKMV1e023312@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveVariables.cpp updated: 1.71 -> 1.72 --- Log message: Keep track of number of uses within the function per virtual register. --- Diffs of the changes: (+1 -0) LiveVariables.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/CodeGen/LiveVariables.cpp diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.71 llvm/lib/CodeGen/LiveVariables.cpp:1.72 --- llvm/lib/CodeGen/LiveVariables.cpp:1.71 Sat Mar 17 04:29:54 2007 +++ llvm/lib/CodeGen/LiveVariables.cpp Tue Apr 17 15:22:11 2007 @@ -141,6 +141,7 @@ unsigned BBNum = MBB->getNumber(); VRInfo.UsedBlocks[BBNum] = true; + VRInfo.NumUses++; // Check to see if this basic block is already a kill block... if (!VRInfo.Kills.empty() && VRInfo.Kills.back()->getParent() == MBB) { From evan.cheng at apple.com Tue Apr 17 15:23:57 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Apr 2007 15:23:57 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h Message-ID: <200704172023.l3HKNvSw023352@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: MRegisterInfo.h updated: 1.102 -> 1.103 --- Log message: Change getAllocatableSet() so it returns allocatable registers for a specific register class. --- Diffs of the changes: (+4 -2) MRegisterInfo.h | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Target/MRegisterInfo.h diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.102 llvm/include/llvm/Target/MRegisterInfo.h:1.103 --- llvm/include/llvm/Target/MRegisterInfo.h:1.102 Tue Mar 20 03:05:54 2007 +++ llvm/include/llvm/Target/MRegisterInfo.h Tue Apr 17 15:23:34 2007 @@ -241,8 +241,10 @@ } /// getAllocatableSet - Returns a bitset indexed by register number - /// indicating if a register is allocatable or not. - BitVector getAllocatableSet(MachineFunction &MF) const; + /// indicating if a register is allocatable or not. If a register class is + /// specified, returns the subset for the class. + BitVector getAllocatableSet(MachineFunction &MF, + const TargetRegisterClass *RC = NULL) const; const TargetRegisterDesc &operator[](unsigned RegNo) const { assert(RegNo < NumRegs && From evan.cheng at apple.com Tue Apr 17 15:23:57 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Apr 2007 15:23:57 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/MRegisterInfo.cpp Message-ID: <200704172023.l3HKNvGb023357@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: MRegisterInfo.cpp updated: 1.22 -> 1.23 --- Log message: Change getAllocatableSet() so it returns allocatable registers for a specific register class. --- Diffs of the changes: (+7 -4) MRegisterInfo.cpp | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) Index: llvm/lib/Target/MRegisterInfo.cpp diff -u llvm/lib/Target/MRegisterInfo.cpp:1.22 llvm/lib/Target/MRegisterInfo.cpp:1.23 --- llvm/lib/Target/MRegisterInfo.cpp:1.22 Mon Feb 19 15:49:53 2007 +++ llvm/lib/Target/MRegisterInfo.cpp Tue Apr 17 15:23:34 2007 @@ -34,13 +34,16 @@ MRegisterInfo::~MRegisterInfo() {} -BitVector MRegisterInfo::getAllocatableSet(MachineFunction &MF) const { +BitVector MRegisterInfo::getAllocatableSet(MachineFunction &MF, + const TargetRegisterClass *RC) const { BitVector Allocatable(NumRegs); for (MRegisterInfo::regclass_iterator I = regclass_begin(), E = regclass_end(); I != E; ++I) { - const TargetRegisterClass *RC = *I; - for (TargetRegisterClass::iterator I = RC->allocation_order_begin(MF), - E = RC->allocation_order_end(MF); I != E; ++I) + const TargetRegisterClass *TRC = *I; + if (RC && TRC != RC) + continue; + for (TargetRegisterClass::iterator I = TRC->allocation_order_begin(MF), + E = TRC->allocation_order_end(MF); I != E; ++I) Allocatable.set(*I); } return Allocatable; From evan.cheng at apple.com Tue Apr 17 15:25:32 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Apr 2007 15:25:32 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp Message-ID: <200704172025.l3HKPWdR023395@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveInterval.cpp updated: 1.43 -> 1.44 --- Log message: Add a register allocation preference field; add a method to compute size of a live interval. --- Diffs of the changes: (+9 -0) LiveInterval.cpp | 9 +++++++++ 1 files changed, 9 insertions(+) Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.43 llvm/lib/CodeGen/LiveInterval.cpp:1.44 --- llvm/lib/CodeGen/LiveInterval.cpp:1.43 Sat Dec 16 23:15:13 2006 +++ llvm/lib/CodeGen/LiveInterval.cpp Tue Apr 17 15:25:11 2007 @@ -349,6 +349,8 @@ ValueNumberInfo.clear(); ValueNumberInfo.append(NewValueNumberInfo.begin(), NewValueNumberInfo.end()); weight += Other.weight; + if (Other.preference && !preference) + preference = Other.preference; } /// MergeRangesInAsValue - Merge all of the intervals in RHS into this live @@ -467,6 +469,13 @@ } } +unsigned LiveInterval::getSize() const { + unsigned Sum = 0; + for (const_iterator I = begin(), E = end(); I != E; ++I) + Sum += I->end - I->start; + return Sum; +} + std::ostream& llvm::operator<<(std::ostream& os, const LiveRange &LR) { return os << '[' << LR.start << ',' << LR.end << ':' << LR.ValId << ")"; } From evan.cheng at apple.com Tue Apr 17 15:25:33 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Apr 2007 15:25:33 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveInterval.h Message-ID: <200704172025.l3HKPXJP023400@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveInterval.h updated: 1.35 -> 1.36 --- Log message: Add a register allocation preference field; add a method to compute size of a live interval. --- Diffs of the changes: (+6 -1) LiveInterval.h | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/LiveInterval.h diff -u llvm/include/llvm/CodeGen/LiveInterval.h:1.35 llvm/include/llvm/CodeGen/LiveInterval.h:1.36 --- llvm/include/llvm/CodeGen/LiveInterval.h:1.35 Tue Mar 20 03:13:50 2007 +++ llvm/include/llvm/CodeGen/LiveInterval.h Tue Apr 17 15:25:11 2007 @@ -81,6 +81,7 @@ struct LiveInterval { typedef SmallVector Ranges; unsigned reg; // the register of this interval + unsigned preference; // preferred register to allocate for this interval float weight; // weight of this interval MachineInstr* remat; // definition if the definition rematerializable Ranges ranges; // the ranges in which this register is live @@ -94,7 +95,7 @@ public: LiveInterval(unsigned Reg, float Weight) - : reg(Reg), weight(Weight), remat(NULL) { + : reg(Reg), preference(0), weight(Weight), remat(NULL) { } typedef Ranges::iterator iterator; @@ -256,6 +257,10 @@ removeRange(LR.start, LR.end); } + /// getSize - Returns the sum of sizes of all the LiveRange's. + /// + unsigned getSize() const; + bool operator<(const LiveInterval& other) const { return beginNumber() < other.beginNumber(); } From baldrick at free.fr Tue Apr 17 15:29:07 2007 From: baldrick at free.fr (Duncan Sands) Date: Tue, 17 Apr 2007 22:29:07 +0200 Subject: [llvm-commits] llvm-gcc: fix for PR1332 Message-ID: <200704172229.07950.baldrick@free.fr> The testcase: struct Z { int :1; int :0; int :1; } z; The zero width field causes the second :1 field to start at bit 32. This requires inserting 24 bits of padding. For some obscure reason the padding logic subtracts the number of bits of padding from the new field size before adding it, meaning that it tries to add -23 new bits rather than +1, causing an assertion failure. With the attached patch struct Z converts to %struct.Z = type { i8, [3 x i8], i8 } Lightly tested. Ciao, Duncan. -------------- next part -------------- A non-text attachment was scrubbed... Name: bitstuff.diff Type: text/x-diff Size: 2495 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070417/ef96a0b3/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 2007-03-26-ZeroWidthBitfieldAfterPadding.c Type: text/x-csrc Size: 78 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070417/ef96a0b3/attachment-0001.bin From dpatel at apple.com Tue Apr 17 15:29:29 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 17 Apr 2007 15:29:29 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2007-04-17-ZeroSizeBitFields.c Message-ID: <200704172029.l3HKTTBj023477@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2007-04-17-ZeroSizeBitFields.c added (r1.1) --- Log message: New test case. --- Diffs of the changes: (+4 -0) 2007-04-17-ZeroSizeBitFields.c | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/test/CFrontend/2007-04-17-ZeroSizeBitFields.c diff -c /dev/null llvm/test/CFrontend/2007-04-17-ZeroSizeBitFields.c:1.1 *** /dev/null Tue Apr 17 15:29:22 2007 --- llvm/test/CFrontend/2007-04-17-ZeroSizeBitFields.c Tue Apr 17 15:29:12 2007 *************** *** 0 **** --- 1,4 ---- + ; PR 1332 + ; RUN: %llvmgcc %s -S -o /dev/null + + struct Z { int a:1; int :0; int c:1; } z; From dpatel at apple.com Tue Apr 17 15:29:12 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Tue, 17 Apr 2007 13:29:12 -0700 (PDT) Subject: [llvm-commits] [126245] Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/ Week-of-Mon-20070416/047943.html Message-ID: <20070417202912.A40AFF24490E@src> Revision: 126245 Author: dpatel Date: 2007-04-17 13:29:12 -0700 (Tue, 17 Apr 2007) Log Message: ----------- Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070416/047943.html Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-types.cpp Modified: apple-local/branches/llvm/gcc/llvm-types.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-types.cpp 2007-04-17 16:28:45 UTC (rev 126244) +++ apple-local/branches/llvm/gcc/llvm-types.cpp 2007-04-17 20:29:12 UTC (rev 126245) @@ -1382,8 +1382,10 @@ Pad = ArrayType::get(Pad, PadBytes); Info.addElement(Pad, FirstUnallocatedByte, PadBytes); FirstUnallocatedByte = StartOffsetInBits/8; - // This field will use some of the bits from this PadBytes. - FieldSizeInBits = FieldSizeInBits - (PadBytes*8 - PadBits); + // This field will use some of the bits from this PadBytes, if + // starting offset is not at byte boundry. + if (StartOffsetFromByteBoundry != 0) + FieldSizeInBits = FieldSizeInBits - (8 - PadBits); } // Now, Field starts at FirstUnallocatedByte and everything is aligned. From evan.cheng at apple.com Tue Apr 17 15:32:48 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Apr 2007 15:32:48 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h Message-ID: <200704172032.l3HKWmRI023560@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveIntervalAnalysis.h updated: 1.77 -> 1.78 --- Log message: Copy coalescing change to prevent a physical register from being pin to a long live interval that has low usage density. 1. Change order of coalescing to join physical registers with virtual registers first before virtual register intervals become too long. 2. Check size and usage density to determine if it's worthwhile to join. 3. If joining is aborted, assign virtual register live interval allocation preference field to the physical register. 4. Register allocator should try to allocate to the preferred register first (if available) to create identify moves that can be eliminated. --- Diffs of the changes: (+6 -2) LiveIntervalAnalysis.h | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) Index: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h diff -u llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.77 llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.78 --- llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.77 Mon Apr 2 13:49:18 2007 +++ llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h Tue Apr 17 15:32:26 2007 @@ -23,6 +23,7 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/LiveInterval.h" #include "llvm/ADT/BitVector.h" +#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/IndexedMap.h" namespace llvm { @@ -30,6 +31,7 @@ class LiveVariables; class MRegisterInfo; class TargetInstrInfo; + class TargetRegisterClass; class VirtRegMap; class LiveIntervals : public MachineFunctionPass { @@ -56,6 +58,7 @@ Reg2RegMap r2rMap_; BitVector allocatableRegs_; + DenseMap allocatableRCRegs_; /// JoinedLIs - Keep track which register intervals have been coalesced /// with other intervals. @@ -202,7 +205,7 @@ /// CopyCoallesceInMBB - Coallsece copies in the specified MBB, putting /// copies that cannot yet be coallesced into the "TryAgain" list. void CopyCoallesceInMBB(MachineBasicBlock *MBB, - std::vector &TryAgain); + std::vector &TryAgain, bool PhysOnly = false); /// JoinCopy - Attempt to join intervals corresponding to SrcReg/DstReg, /// which are the src/dst of the copy instruction CopyMI. This returns true @@ -210,7 +213,8 @@ /// to coallesce these this copy, due to register constraints. It returns /// false if it is not currently possible to coallesce this interval, but /// it may be possible if other things get coallesced. - bool JoinCopy(MachineInstr *CopyMI, unsigned SrcReg, unsigned DstReg); + bool JoinCopy(MachineInstr *CopyMI, unsigned SrcReg, unsigned DstReg, + bool PhysOnly = false); /// JoinIntervals - Attempt to join these two intervals. On failure, this /// returns false. Otherwise, if one of the intervals being joined is a From evan.cheng at apple.com Tue Apr 17 15:32:49 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Apr 2007 15:32:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp RegAllocLinearScan.cpp Message-ID: <200704172032.l3HKWn7c023567@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveIntervalAnalysis.cpp updated: 1.234 -> 1.235 RegAllocLinearScan.cpp updated: 1.142 -> 1.143 --- Log message: Copy coalescing change to prevent a physical register from being pin to a long live interval that has low usage density. 1. Change order of coalescing to join physical registers with virtual registers first before virtual register intervals become too long. 2. Check size and usage density to determine if it's worthwhile to join. 3. If joining is aborted, assign virtual register live interval allocation preference field to the physical register. 4. Register allocator should try to allocate to the preferred register first (if available) to create identify moves that can be eliminated. --- Diffs of the changes: (+98 -86) LiveIntervalAnalysis.cpp | 153 +++++++++++++++++++++++------------------------ RegAllocLinearScan.cpp | 31 ++++++--- 2 files changed, 98 insertions(+), 86 deletions(-) Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.234 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.235 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.234 Wed Apr 4 02:40:01 2007 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Apr 17 15:32:26 2007 @@ -30,6 +30,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" +#include "llvm/ADT/SmallSet.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include @@ -87,8 +88,11 @@ mri_ = tm_->getRegisterInfo(); tii_ = tm_->getInstrInfo(); lv_ = &getAnalysis(); - allocatableRegs_ = mri_->getAllocatableSet(fn); r2rMap_.grow(mf_->getSSARegMap()->getLastVirtReg()); + allocatableRegs_ = mri_->getAllocatableSet(fn); + for (MRegisterInfo::regclass_iterator I = mri_->regclass_begin(), + E = mri_->regclass_end(); I != E; ++I) + allocatableRCRegs_.insert(std::make_pair(*I,mri_->getAllocatableSet(fn, *I))); // Number MachineInstrs and MachineBasicBlocks. // Initialize MBB indexes to a sentinal. @@ -120,10 +124,16 @@ } // Join (coallesce) intervals if requested. - if (EnableJoining) joinIntervals(); + if (EnableJoining) { + joinIntervals(); + DOUT << "********** INTERVALS POST JOINING **********\n"; + for (iterator I = begin(), E = end(); I != E; ++I) { + I->second.print(DOUT, mri_); + DOUT << "\n"; + } + } numIntervalsAfter += getNumIntervals(); - // perform a final pass over the instructions and compute spill // weights, coalesce virtual registers and remove identity moves. @@ -156,6 +166,7 @@ mii = mbbi->erase(mii); ++numPeep; } else { + SmallSet UniqueUses; for (unsigned i = 0, e = mii->getNumOperands(); i != e; ++i) { const MachineOperand &mop = mii->getOperand(i); if (mop.isRegister() && mop.getReg() && @@ -164,6 +175,10 @@ unsigned reg = rep(mop.getReg()); mii->getOperand(i).setReg(reg); + // Multiple uses of reg by the same instruction. It should not + // contribute to spill weight again. + if (UniqueUses.count(reg) != 0) + continue; LiveInterval &RegInt = getInterval(reg); float w = (mop.isUse()+mop.isDef()) * powf(10.0F, (float)loopDepth); // If the definition instruction is re-materializable, its spill @@ -173,6 +188,7 @@ if (RegInt.remat && !tii_->isLoadFromStackSlot(RegInt.remat, Dummy)) w /= 2; RegInt.weight += w; + UniqueUses.insert(reg); } } ++mii; @@ -188,15 +204,15 @@ // it and hope it will be easier to allocate for this li. if (isZeroLengthInterval(&LI)) LI.weight = HUGE_VALF; - + + // Slightly prefer live interval that has been assigned a preferred reg. + if (LI.preference) + LI.weight *= 1.01F; + // Divide the weight of the interval by its size. This encourages // spilling of intervals that are large and have few uses, and // discourages spilling of small intervals with many uses. - unsigned Size = 0; - for (LiveInterval::iterator II = LI.begin(), E = LI.end(); II != E;++II) - Size += II->end - II->start; - - LI.weight /= Size; + LI.weight /= LI.getSize(); } } @@ -866,14 +882,15 @@ return true; } + /// JoinCopy - Attempt to join intervals corresponding to SrcReg/DstReg, /// which are the src/dst of the copy instruction CopyMI. This returns true /// if the copy was successfully coallesced away, or if it is never possible -/// to coallesce these this copy, due to register constraints. It returns +/// to coallesce this copy, due to register constraints. It returns /// false if it is not currently possible to coallesce this interval, but /// it may be possible if other things get coallesced. bool LiveIntervals::JoinCopy(MachineInstr *CopyMI, - unsigned SrcReg, unsigned DstReg) { + unsigned SrcReg, unsigned DstReg, bool PhysOnly) { DOUT << getInstructionIndex(CopyMI) << '\t' << *CopyMI; // Get representative registers. @@ -886,21 +903,24 @@ return true; // Not coallescable. } + bool SrcIsPhys = MRegisterInfo::isPhysicalRegister(repSrcReg); + bool DstIsPhys = MRegisterInfo::isPhysicalRegister(repDstReg); + if (PhysOnly && !SrcIsPhys && !DstIsPhys) + // Only joining physical registers with virtual registers in this round. + return true; + // If they are both physical registers, we cannot join them. - if (MRegisterInfo::isPhysicalRegister(repSrcReg) && - MRegisterInfo::isPhysicalRegister(repDstReg)) { + if (SrcIsPhys && DstIsPhys) { DOUT << "\tCan not coallesce physregs.\n"; return true; // Not coallescable. } // We only join virtual registers with allocatable physical registers. - if (MRegisterInfo::isPhysicalRegister(repSrcReg) && - !allocatableRegs_[repSrcReg]) { + if (SrcIsPhys && !allocatableRegs_[repSrcReg]) { DOUT << "\tSrc reg is unallocatable physreg.\n"; return true; // Not coallescable. } - if (MRegisterInfo::isPhysicalRegister(repDstReg) && - !allocatableRegs_[repDstReg]) { + if (DstIsPhys && !allocatableRegs_[repDstReg]) { DOUT << "\tDst reg is unallocatable physreg.\n"; return true; // Not coallescable. } @@ -912,17 +932,16 @@ } LiveInterval &SrcInt = getInterval(repSrcReg); - LiveInterval &DestInt = getInterval(repDstReg); - assert(SrcInt.reg == repSrcReg && DestInt.reg == repDstReg && + LiveInterval &DstInt = getInterval(repDstReg); + assert(SrcInt.reg == repSrcReg && DstInt.reg == repDstReg && "Register mapping is horribly broken!"); - + DOUT << "\t\tInspecting "; SrcInt.print(DOUT, mri_); - DOUT << " and "; DestInt.print(DOUT, mri_); + DOUT << " and "; DstInt.print(DOUT, mri_); DOUT << ": "; // Check if it is necessary to propagate "isDead" property before intervals // are joined. - MachineBasicBlock *CopyBB = CopyMI->getParent(); MachineOperand *mopd = CopyMI->findRegisterDefOperand(DstReg); bool isDead = mopd->isDead(); bool isShorten = false; @@ -965,59 +984,32 @@ // virtual register. Once the coalescing is done, it cannot be broken and // these are not spillable! If the destination interval uses are far away, // think twice about coalescing them! - if (!mopd->isDead() && MRegisterInfo::isPhysicalRegister(repSrcReg)) { - // Small function. No need to worry! - unsigned Threshold = allocatableRegs_.count() * 2; - if (r2iMap_.size() <= Threshold) - goto TryJoin; - - LiveVariables::VarInfo& dvi = lv_->getVarInfo(repDstReg); - // Is the value used in the current BB or any immediate successroe BB? - if (dvi.UsedBlocks[CopyBB->getNumber()]) - goto TryJoin; - for (MachineBasicBlock::succ_iterator SI = CopyBB->succ_begin(), - SE = CopyBB->succ_end(); SI != SE; ++SI) { - MachineBasicBlock *SuccMBB = *SI; - if (dvi.UsedBlocks[SuccMBB->getNumber()]) - goto TryJoin; - } - - // Ok, no use in this BB and no use in immediate successor BB's. Be really - // careful now! - // It's only used in one BB, forget about it! - if (dvi.UsedBlocks.count() < 2) { - ++numAborts; - return false; - } - - // Determine whether to allow coalescing based on how far the closest - // use is. - unsigned CopyIdx = getInstructionIndex(CopyMI); - unsigned MinDist = i2miMap_.size() * InstrSlots::NUM; - int UseBBNum = dvi.UsedBlocks.find_first(); - while (UseBBNum != -1) { - MachineBasicBlock *UseBB = mf_->getBlockNumbered(UseBBNum); - unsigned UseIdx = getMBBStartIdx(UseBB); - if (UseIdx > CopyIdx) { - MinDist = std::min(MinDist, UseIdx - CopyIdx); - if (MinDist <= Threshold) - break; - } - UseBBNum = dvi.UsedBlocks.find_next(UseBBNum); - } - if (MinDist > Threshold) { - // Don't do it! + if (!mopd->isDead() && (SrcIsPhys || DstIsPhys)) { + LiveInterval &JoinVInt = SrcIsPhys ? DstInt : SrcInt; + unsigned JoinVReg = SrcIsPhys ? repDstReg : repSrcReg; + unsigned JoinPReg = SrcIsPhys ? repSrcReg : repDstReg; + const TargetRegisterClass *RC = mf_->getSSARegMap()->getRegClass(JoinVReg); + unsigned Threshold = allocatableRCRegs_[RC].count(); + + // If the virtual register live interval is long has it has low use desity, + // do not join them, instead mark the physical register as its allocation + // preference. + unsigned Length = JoinVInt.getSize() / InstrSlots::NUM; + LiveVariables::VarInfo &vi = lv_->getVarInfo(JoinVReg); + if (Length > Threshold && + (((float)vi.NumUses / Length) < (1.0 / Threshold))) { + JoinVInt.preference = JoinPReg; ++numAborts; + DOUT << "\tMay tie down a physical register, abort!\n"; return false; } } -TryJoin: // Okay, attempt to join these two intervals. On failure, this returns false. // Otherwise, if one of the intervals being joined is a physreg, this method - // always canonicalizes DestInt to be it. The output "SrcInt" will not have + // always canonicalizes DstInt to be it. The output "SrcInt" will not have // been modified, so we can use this information below to update aliases. - if (JoinIntervals(DestInt, SrcInt)) { + if (JoinIntervals(DstInt, SrcInt)) { if (isDead) { // Result of the copy is dead. Propagate this property. if (SrcStart == 0) { @@ -1038,14 +1030,14 @@ if (isShorten || isDead) { // Shorten the live interval. - LiveInterval &LiveInInt = (repSrcReg == DestInt.reg) ? DestInt : SrcInt; + LiveInterval &LiveInInt = (repSrcReg == DstInt.reg) ? DstInt : SrcInt; LiveInInt.removeRange(RemoveStart, RemoveEnd); } } else { // Coallescing failed. // If we can eliminate the copy without merging the live ranges, do so now. - if (AdjustCopiesBackFrom(SrcInt, DestInt, CopyMI)) + if (AdjustCopiesBackFrom(SrcInt, DstInt, CopyMI)) return true; // Otherwise, we are unable to join the intervals. @@ -1053,7 +1045,7 @@ return false; } - bool Swapped = repSrcReg == DestInt.reg; + bool Swapped = repSrcReg == DstInt.reg; if (Swapped) std::swap(repSrcReg, repDstReg); assert(MRegisterInfo::isVirtualRegister(repSrcReg) && @@ -1070,9 +1062,10 @@ LiveVariables::VarInfo& dVI = lv_->getVarInfo(repDstReg); LiveVariables::VarInfo& sVI = lv_->getVarInfo(repSrcReg); dVI.UsedBlocks |= sVI.UsedBlocks; + dVI.NumUses += sVI.NumUses; } - DOUT << "\n\t\tJoined. Result = "; DestInt.print(DOUT, mri_); + DOUT << "\n\t\tJoined. Result = "; DstInt.print(DOUT, mri_); DOUT << "\n"; // Remember these liveintervals have been joined. @@ -1082,7 +1075,7 @@ // If the intervals were swapped by Join, swap them back so that the register // mapping (in the r2i map) is correct. - if (Swapped) SrcInt.swap(DestInt); + if (Swapped) SrcInt.swap(DstInt); removeInterval(repSrcReg); r2rMap_[repSrcReg] = repDstReg; @@ -1270,6 +1263,8 @@ // the LHS. LHS.MergeRangesInAsValue(RHS, LHSValNo); LHS.weight += RHS.weight; + if (RHS.preference && !LHS.preference) + LHS.preference = RHS.preference; return true; } @@ -1478,7 +1473,7 @@ void LiveIntervals::CopyCoallesceInMBB(MachineBasicBlock *MBB, - std::vector &TryAgain) { + std::vector &TryAgain, bool PhysOnly) { DOUT << ((Value*)MBB->getBasicBlock())->getName() << ":\n"; for (MachineBasicBlock::iterator MII = MBB->begin(), E = MBB->end(); @@ -1489,7 +1484,7 @@ unsigned SrcReg, DstReg; if (!tii_->isMoveInstr(*Inst, SrcReg, DstReg)) continue; - if (!JoinCopy(Inst, SrcReg, DstReg)) + if (!JoinCopy(Inst, SrcReg, DstReg, PhysOnly)) TryAgain.push_back(getCopyRec(Inst, SrcReg, DstReg)); } } @@ -1512,9 +1507,11 @@ // Otherwise, join intervals in inner loops before other intervals. // Unfortunately we can't just iterate over loop hierarchy here because // there may be more MBB's than BB's. Collect MBB's for sorting. + + // Join intervals in the function prolog first. We want to join physical + // registers with virtual registers before the intervals got too long. std::vector > MBBs; - for (MachineFunction::iterator I = mf_->begin(), E = mf_->end(); - I != E; ++I) + for (MachineFunction::iterator I = mf_->begin(), E = mf_->end(); I != E;++I) MBBs.push_back(std::make_pair(LI.getLoopDepth(I->getBasicBlock()), I)); // Sort by loop depth. @@ -1522,7 +1519,9 @@ // Finally, join intervals in loop nest order. for (unsigned i = 0, e = MBBs.size(); i != e; ++i) - CopyCoallesceInMBB(MBBs[i].second, TryAgainList); + CopyCoallesceInMBB(MBBs[i].second, TryAgainList, true); + for (unsigned i = 0, e = MBBs.size(); i != e; ++i) + CopyCoallesceInMBB(MBBs[i].second, TryAgainList, false); } // Joining intervals can allow other intervals to be joined. Iteratively join Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.142 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.143 --- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.142 Tue Mar 20 03:13:50 2007 +++ llvm/lib/CodeGen/RegAllocLinearScan.cpp Tue Apr 17 15:32:26 2007 @@ -563,15 +563,17 @@ // Find a register to spill. float minWeight = HUGE_VALF; - unsigned minReg = 0; - for (TargetRegisterClass::iterator i = RC->allocation_order_begin(*mf_), - e = RC->allocation_order_end(*mf_); i != e; ++i) { - unsigned reg = *i; - if (minWeight > SpillWeights[reg]) { - minWeight = SpillWeights[reg]; - minReg = reg; + unsigned minReg = cur->preference; // Try the preferred register first. + + if (!minReg || SpillWeights[minReg] == HUGE_VALF) + for (TargetRegisterClass::iterator i = RC->allocation_order_begin(*mf_), + e = RC->allocation_order_end(*mf_); i != e; ++i) { + unsigned reg = *i; + if (minWeight > SpillWeights[reg]) { + minWeight = SpillWeights[reg]; + minReg = reg; + } } - } // If we didn't find a register that is spillable, try aliases? if (!minReg) { @@ -778,7 +780,18 @@ unsigned FreeReg = 0; unsigned FreeRegInactiveCount = 0; - + + // If copy coalescer has assigned a "preferred" register, check if it's + // available first. + if (cur->preference) + if (prt_->isRegAvail(cur->preference)) { + DOUT << "\t\tassigned the preferred register: " + << mri_->getName(cur->preference) << "\n"; + return cur->preference; + } else + DOUT << "\t\tunable to assign the preferred register: " + << mri_->getName(cur->preference) << "\n"; + // Scan for the first available register. TargetRegisterClass::iterator I = rc->allocation_order_begin(*mf_); TargetRegisterClass::iterator E = rc->allocation_order_end(*mf_); From dpatel at apple.com Tue Apr 17 15:36:06 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 17 Apr 2007 13:36:06 -0700 Subject: [llvm-commits] llvm-gcc: fix for PR1332 In-Reply-To: <200704172229.07950.baldrick@free.fr> References: <200704172229.07950.baldrick@free.fr> Message-ID: On Apr 17, 2007, at 1:29 PM, Duncan Sands wrote: > The testcase: > > struct Z { int :1; int :0; int :1; } z; > > The zero width field causes the second :1 field > to start at bit 32. This requires inserting 24 bits > of padding. For some obscure reason the padding logic > subtracts the number of bits of padding from the new > field size before adding it, meaning that it tries to > add -23 new bits rather than +1, causing an assertion > failure. I just checked in simpler fix. Need to reduce field size only if start of field is not at byte boundary. - Devang > With the attached patch struct Z converts to > %struct.Z = type { i8, [3 x i8], i8 } > Lightly tested. > > Ciao, > > Duncan. -------------- next part -------------- A non-text attachment was scrubbed... Name: bitstuff.diff Type: text/x-diff Size: 2495 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070417/b0011091/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 2007-03-26-ZeroWidthBitfieldAfterPadding.c Type: text/x-csrc Size: 78 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070417/b0011091/attachment-0001.bin -------------- next part -------------- > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From baldrick at free.fr Tue Apr 17 15:42:06 2007 From: baldrick at free.fr (Duncan Sands) Date: Tue, 17 Apr 2007 22:42:06 +0200 Subject: [llvm-commits] [126245] Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/ Week-of-Mon-20070416/047943.html In-Reply-To: <20070417202912.A40AFF24490E@src> References: <20070417202912.A40AFF24490E@src> Message-ID: <200704172242.06347.baldrick@free.fr> Hi Devang, I just posted a fix which fixes some other issues too. A few lines earlier: if (StartOffsetFromByteBoundry != 0) { // New field does not start at byte boundry. PadBits = StartOffsetInBits - (FirstUnallocatedByte*8); PadBytes = PadBits/8 + 1; } PadBytes += StartOffsetInBits/8-FirstUnallocatedByte; If StartOffsetFromByteBoundry != 0, then PadBytes gets added to twice, setting it to 2*PadBits/8 + 1. > Pad = ArrayType::get(Pad, PadBytes); > Info.addElement(Pad, FirstUnallocatedByte, PadBytes); > FirstUnallocatedByte = StartOffsetInBits/8; > - // This field will use some of the bits from this PadBytes. > - FieldSizeInBits = FieldSizeInBits - (PadBytes*8 - PadBits); > + // This field will use some of the bits from this PadBytes, if > + // starting offset is not at byte boundry. > + if (StartOffsetFromByteBoundry != 0) > + FieldSizeInBits = FieldSizeInBits - (8 - PadBits); Here PadBits can be bigger than 8, which will lead to a bad result :) Even if it is less than 8 this can create a negative FieldSizeInBits. For example, if FieldSizeInBits=1, StartOffsetFromByteBoundry=1, then typically PadBits=1, meaning you are setting FieldSizeInBits to -6 here! > } > > // Now, Field starts at FirstUnallocatedByte and everything is aligned. Best wishes, Duncan. From baldrick at free.fr Tue Apr 17 15:50:51 2007 From: baldrick at free.fr (Duncan Sands) Date: Tue, 17 Apr 2007 15:50:51 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2007-04-17-ZeroSizeBitFields.c Message-ID: <200704172050.l3HKopbJ023865@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2007-04-17-ZeroSizeBitFields.c updated: 1.1 -> 1.2 --- Log message: Use // not ; since this is C. --- Diffs of the changes: (+2 -2) 2007-04-17-ZeroSizeBitFields.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/CFrontend/2007-04-17-ZeroSizeBitFields.c diff -u llvm/test/CFrontend/2007-04-17-ZeroSizeBitFields.c:1.1 llvm/test/CFrontend/2007-04-17-ZeroSizeBitFields.c:1.2 --- llvm/test/CFrontend/2007-04-17-ZeroSizeBitFields.c:1.1 Tue Apr 17 15:29:12 2007 +++ llvm/test/CFrontend/2007-04-17-ZeroSizeBitFields.c Tue Apr 17 15:50:33 2007 @@ -1,4 +1,4 @@ -; PR 1332 -; RUN: %llvmgcc %s -S -o /dev/null +// PR 1332 +// RUN: %llvmgcc %s -S -o /dev/null struct Z { int a:1; int :0; int c:1; } z; From dpatel at apple.com Tue Apr 17 15:57:32 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 17 Apr 2007 13:57:32 -0700 Subject: [llvm-commits] [126245] Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/ Week-of-Mon-20070416/047943.html In-Reply-To: <200704172242.06347.baldrick@free.fr> References: <20070417202912.A40AFF24490E@src> <200704172242.06347.baldrick@free.fr> Message-ID: Hi, if (StartOffsetInBits > FirstUnallocatedByte*8) is true then (StartOffsetFromByteBoundry == 0) is always true. If so, we could simply this even further. In other words, if we need pad bytes for a new field then it always starts at byte boundary. Can you think of an example where this is not true ? Thanks, - Devang On Apr 17, 2007, at 1:42 PM, Duncan Sands wrote: > Hi Devang, I just posted a fix which fixes some other issues too. > A few lines earlier: > > if (StartOffsetFromByteBoundry != 0) { > // New field does not start at byte boundry. > PadBits = StartOffsetInBits - (FirstUnallocatedByte*8); > PadBytes = PadBits/8 + 1; > } > > PadBytes += StartOffsetInBits/8-FirstUnallocatedByte; > > If StartOffsetFromByteBoundry != 0, then PadBytes gets added to twice, > setting it to 2*PadBits/8 + 1. > >> Pad = ArrayType::get(Pad, PadBytes); >> Info.addElement(Pad, FirstUnallocatedByte, PadBytes); >> FirstUnallocatedByte = StartOffsetInBits/8; >> - // This field will use some of the bits from this PadBytes. >> - FieldSizeInBits = FieldSizeInBits - (PadBytes*8 - PadBits); >> + // This field will use some of the bits from this PadBytes, if >> + // starting offset is not at byte boundry. >> + if (StartOffsetFromByteBoundry != 0) >> + FieldSizeInBits = FieldSizeInBits - (8 - PadBits); > > Here PadBits can be bigger than 8, which will lead to a bad result :) > Even if it is less than 8 this can create a negative FieldSizeInBits. > For example, if FieldSizeInBits=1, StartOffsetFromByteBoundry=1, then > typically PadBits=1, meaning you are setting FieldSizeInBits to -6 > here! > >> } >> >> // Now, Field starts at FirstUnallocatedByte and everything is >> aligned. > > Best wishes, > > Duncan. From sabre at nondot.org Tue Apr 17 16:12:44 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 16:12:44 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/PowerPC/shl_elim.ll Message-ID: <200704172112.l3HLCibH024340@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/PowerPC: shl_elim.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+11 -0) shl_elim.ll | 11 +++++++++++ 1 files changed, 11 insertions(+) Index: llvm/test/CodeGen/PowerPC/shl_elim.ll diff -c /dev/null llvm/test/CodeGen/PowerPC/shl_elim.ll:1.1 *** /dev/null Tue Apr 17 16:12:36 2007 --- llvm/test/CodeGen/PowerPC/shl_elim.ll Tue Apr 17 16:12:26 2007 *************** *** 0 **** --- 1,11 ---- + ; RUN: llvm-as < %s | llc -march=ppc32 | not grep slwi + + define i32 @test1(i64 %a) { + %tmp29 = lshr i64 %a, 24 ; [#uses=1] + %tmp23 = trunc i64 %tmp29 to i32 ; [#uses=1] + %tmp410 = lshr i32 %tmp23, 9 ; [#uses=1] + %tmp45 = trunc i32 %tmp410 to i16 ; [#uses=1] + %tmp456 = sext i16 %tmp45 to i32 ; [#uses=1] + ret i32 %tmp456 + } + From sabre at nondot.org Tue Apr 17 16:14:33 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 16:14:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Message-ID: <200704172114.l3HLEX4i024408@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: TargetLowering.cpp updated: 1.109 -> 1.110 --- Log message: Fold (x << c1)>> c2 into a single shift if the bits shifted out aren't used. This compiles: int baz(long long a) { return (short)(((int)(a >>24)) >> 9); } into: _baz: srwi r2, r3, 1 extsh r3, r2 blr on PPC, instead of: _baz: slwi r2, r3, 8 srwi r2, r2, 9 extsh r3, r2 blr GCC produces: _baz: srwi r10,r4,24 insrwi r10,r3,24,0 srawi r9,r3,24 srawi r3,r10,9 extsh r3,r3 blr This implements CodeGen/PowerPC/shl_elim.ll --- Diffs of the changes: (+52 -5) TargetLowering.cpp | 57 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 52 insertions(+), 5 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.109 llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.110 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.109 Mon Apr 16 13:10:22 2007 +++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Tue Apr 17 16:14:16 2007 @@ -563,7 +563,32 @@ break; case ISD::SHL: if (ConstantSDNode *SA = dyn_cast(Op.getOperand(1))) { - if (SimplifyDemandedBits(Op.getOperand(0), DemandedMask >> SA->getValue(), + unsigned ShAmt = SA->getValue(); + SDOperand InOp = Op.getOperand(0); + + // If this is ((X >>u C1) << ShAmt), see if we can simplify this into a + // single shift. We can do this if the bottom bits (which are shifted + // out) are never demanded. + if (InOp.getOpcode() == ISD::SRL && + isa(InOp.getOperand(1))) { + if (ShAmt && (DemandedMask & ((1ULL << ShAmt)-1)) == 0) { + unsigned C1 = cast(InOp.getOperand(1))->getValue(); + unsigned Opc = ISD::SHL; + int Diff = ShAmt-C1; + if (Diff < 0) { + Diff = -Diff; + Opc = ISD::SRL; + } + + SDOperand NewSA = + TLO.DAG.getConstant(ShAmt-C1, Op.getOperand(0).getValueType()); + MVT::ValueType VT = Op.getValueType(); + return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SRL, VT, + InOp.getOperand(0), NewSA)); + } + } + + if (SimplifyDemandedBits(Op.getOperand(0), DemandedMask >> ShAmt, KnownZero, KnownOne, TLO, Depth+1)) return true; KnownZero <<= SA->getValue(); @@ -575,11 +600,33 @@ if (ConstantSDNode *SA = dyn_cast(Op.getOperand(1))) { MVT::ValueType VT = Op.getValueType(); unsigned ShAmt = SA->getValue(); + uint64_t TypeMask = MVT::getIntVTBitMask(VT); + unsigned VTSize = MVT::getSizeInBits(VT); + SDOperand InOp = Op.getOperand(0); + + // If this is ((X << C1) >>u ShAmt), see if we can simplify this into a + // single shift. We can do this if the top bits (which are shifted out) + // are never demanded. + if (InOp.getOpcode() == ISD::SHL && + isa(InOp.getOperand(1))) { + if (ShAmt && (DemandedMask & (~0ULL << (VTSize-ShAmt))) == 0) { + unsigned C1 = cast(InOp.getOperand(1))->getValue(); + unsigned Opc = ISD::SRL; + int Diff = ShAmt-C1; + if (Diff < 0) { + Diff = -Diff; + Opc = ISD::SHL; + } + + SDOperand NewSA = + TLO.DAG.getConstant(Diff, Op.getOperand(0).getValueType()); + return TLO.CombineTo(Op, TLO.DAG.getNode(Opc, VT, + InOp.getOperand(0), NewSA)); + } + } // Compute the new bits that are at the top now. - uint64_t TypeMask = MVT::getIntVTBitMask(VT); - if (SimplifyDemandedBits(Op.getOperand(0), - (DemandedMask << ShAmt) & TypeMask, + if (SimplifyDemandedBits(InOp, (DemandedMask << ShAmt) & TypeMask, KnownZero, KnownOne, TLO, Depth+1)) return true; assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); @@ -589,7 +636,7 @@ KnownOne >>= ShAmt; uint64_t HighBits = (1ULL << ShAmt)-1; - HighBits <<= MVT::getSizeInBits(VT) - ShAmt; + HighBits <<= VTSize - ShAmt; KnownZero |= HighBits; // High bits known zero. } break; From reid at x10sys.com Tue Apr 17 16:27:44 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 17 Apr 2007 16:27:44 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704172127.l3HLRilB024729@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.110 -> 1.111 --- Log message: Add Calum Wilkie. --- Diffs of the changes: (+4 -3) DevMtgMay2007.html | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.110 llvm-www/DevMtgMay2007.html:1.111 --- llvm-www/DevMtgMay2007.html:1.110 Mon Apr 16 12:00:32 2007 +++ llvm-www/DevMtgMay2007.html Tue Apr 17 16:27:27 2007 @@ -307,13 +307,13 @@ Andrew LenharthUIUC Julien LerougeApple Inc. Nick LewyckyIndependent + Efrem LipkinCoDesign - @@ -332,11 +332,12 @@ +
    Confirmed Attendees
    NameOrganization
    Efrem LipkinCoDesign
    Gabe McArthurIndependent
    Paul McJonesAdobe Systems Incorporated.
    Scott MichelAerospace
    Sarah ThompsonNASA, Ames Research Center
    Bill WendlingApple Inc.
    Marcel WeiherMetaObject
    Calum Wilkie
    Microchip Technology
    -

    Total confirmed: 37

    +

    Total confirmed: 38

    @@ -354,6 +355,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
    Last modified: $Date: 2007/04/16 17:00:32 $ +
    Last modified: $Date: 2007/04/17 21:27:27 $ From dpatel at apple.com Tue Apr 17 16:59:38 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Tue, 17 Apr 2007 14:59:38 -0700 (PDT) Subject: [llvm-commits] [126246] If all struct bitfields are packed then struct is packed. Message-ID: <20070417215938.26B6FF2DAF40@src> Revision: 126246 Author: dpatel Date: 2007-04-17 14:59:37 -0700 (Tue, 17 Apr 2007) Log Message: ----------- If all struct bitfields are packed then struct is packed. This fixes recent SingleSource 2003-05-21-BitFieldHandling.c regression. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-types.cpp Modified: apple-local/branches/llvm/gcc/llvm-types.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-types.cpp 2007-04-17 20:29:12 UTC (rev 126245) +++ apple-local/branches/llvm/gcc/llvm-types.cpp 2007-04-17 21:59:37 UTC (rev 126246) @@ -945,7 +945,7 @@ /// getLLVMType - Return the LLVM type for the specified object. /// const Type *getLLVMType() const { - return StructType::get(Elements, Packed); + return StructType::get(Elements, Packed || AllBitFields); } /// getSizeAsLLVMStruct - Return the size of this struct if it were converted From clattner at apple.com Tue Apr 17 17:10:19 2007 From: clattner at apple.com (Chris Lattner) Date: Tue, 17 Apr 2007 15:10:19 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/MRegisterInfo.cpp In-Reply-To: <200704172023.l3HKNvGb023357@zion.cs.uiuc.edu> References: <200704172023.l3HKNvGb023357@zion.cs.uiuc.edu> Message-ID: > MRegisterInfo::~MRegisterInfo() {} > > -BitVector MRegisterInfo::getAllocatableSet(MachineFunction &MF) > const { > +BitVector MRegisterInfo::getAllocatableSet(MachineFunction &MF, > + const > TargetRegisterClass *RC) const { > BitVector Allocatable(NumRegs); > for (MRegisterInfo::regclass_iterator I = regclass_begin(), > E = regclass_end(); I != E; ++I) { > + const TargetRegisterClass *TRC = *I; > + if (RC && TRC != RC) > + continue; If RC is specified, you should just scan it, instead of walking regclass_begin->end to find it. -Chris > + for (TargetRegisterClass::iterator I = TRC- > >allocation_order_begin(MF), > + E = TRC->allocation_order_end(MF); I != E; ++I) > Allocatable.set(*I); > } > return Allocatable; > > > > _______________________________________________ > 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 Apr 17 17:40:15 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 17:40:15 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrInfo.td Message-ID: <200704172240.l3HMeFEo026084@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMInstrInfo.td updated: 1.95 -> 1.96 --- Log message: dag combiner just got better at pruning bits. This fixes CodeGen/ARM/rev.ll --- Diffs of the changes: (+1 -1) ARMInstrInfo.td | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMInstrInfo.td diff -u llvm/lib/Target/ARM/ARMInstrInfo.td:1.95 llvm/lib/Target/ARM/ARMInstrInfo.td:1.96 --- llvm/lib/Target/ARM/ARMInstrInfo.td:1.95 Sun Apr 1 20:30:03 2007 +++ llvm/lib/Target/ARM/ARMInstrInfo.td Tue Apr 17 17:39:58 2007 @@ -982,7 +982,7 @@ "revsh $dst, $src", [(set GPR:$dst, (sext_inreg - (or (srl (and GPR:$src, 0xFFFF), 8), + (or (srl (and GPR:$src, 0xFF00), 8), (shl GPR:$src, 8)), i16))]>, Requires<[IsARM, HasV6]>; From sabre at nondot.org Tue Apr 17 17:53:20 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 17:53:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Message-ID: <200704172253.l3HMrKUN026323@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: TargetLowering.cpp updated: 1.110 -> 1.111 --- Log message: Fix a bug in my previous patch, grabbing the shift amount width from the wrong operand. --- Diffs of the changes: (+2 -2) TargetLowering.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.110 llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.111 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.110 Tue Apr 17 16:14:16 2007 +++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Tue Apr 17 17:53:02 2007 @@ -581,7 +581,7 @@ } SDOperand NewSA = - TLO.DAG.getConstant(ShAmt-C1, Op.getOperand(0).getValueType()); + TLO.DAG.getConstant(ShAmt-C1, Op.getOperand(1).getValueType()); MVT::ValueType VT = Op.getValueType(); return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SRL, VT, InOp.getOperand(0), NewSA)); @@ -619,7 +619,7 @@ } SDOperand NewSA = - TLO.DAG.getConstant(Diff, Op.getOperand(0).getValueType()); + TLO.DAG.getConstant(Diff, Op.getOperand(1).getValueType()); return TLO.CombineTo(Op, TLO.DAG.getNode(Opc, VT, InOp.getOperand(0), NewSA)); } From reid at x10sys.com Tue Apr 17 18:10:38 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 17 Apr 2007 18:10:38 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/bits.h Message-ID: <200704172310.l3HNAcAu026708@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: bits.h added (r1.1) --- Log message: Add a helper header file for these test cases. --- Diffs of the changes: (+89 -0) bits.h | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 89 insertions(+) Index: llvm-test/SingleSource/UnitTests/Integer/bits.h diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/bits.h:1.1 *** /dev/null Tue Apr 17 18:10:30 2007 --- llvm-test/SingleSource/UnitTests/Integer/bits.h Tue Apr 17 18:10:20 2007 *************** *** 0 **** --- 1,89 ---- + //===--- bits.h --- Test The bit_select builtin ---------------------------===// + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This header file contains some type and macro definitiosn useful for working + // with bit accurate types and the bitwise builtins + // + //===----------------------------------------------------------------------===// + + #include + #include + + typedef unsigned int __attribute__((bitwidth(1))) Int1; + typedef unsigned int __attribute__((bitwidth(2))) Int2; + typedef unsigned int __attribute__((bitwidth(3))) Int3; + typedef unsigned int __attribute__((bitwidth(4))) Int4; + typedef unsigned int __attribute__((bitwidth(5))) Int5; + typedef unsigned int __attribute__((bitwidth(6))) Int6; + typedef unsigned int __attribute__((bitwidth(7))) Int7; + typedef unsigned int __attribute__((bitwidth(8))) Int8; + typedef unsigned int __attribute__((bitwidth(16))) Int16; + typedef unsigned int __attribute__((bitwidth(17))) Int17; + typedef unsigned int __attribute__((bitwidth(19))) Int19; + typedef unsigned int __attribute__((bitwidth(17))) Int32; + typedef unsigned int __attribute__((bitwidth(36))) Int36; + typedef unsigned int __attribute__((bitwidth(47))) Int47; + typedef unsigned int __attribute__((bitwidth(48))) Int48; + typedef unsigned int __attribute__((bitwidth(64))) Int64; + typedef unsigned int __attribute__((bitwidth(65))) Int65; + typedef unsigned int __attribute__((bitwidth(128))) Int128; + /*typedef unsigned int __attribute__((bitwidth(256))) Int256; */ + + #define bitwidthof(TORV) (__bitwidthof__(typeof(TORV))) + + #define bit_concat(X, Y) ({ \ + unsigned int __attribute__((bitwidth(__bitwidthof__(X)+__bitwidthof__(Y)))) R; \ + typeof(X) X2 = X; \ + typeof(Y) Y2 = Y; \ + __builtin_bit_concat(&R, &X2, &Y2); \ + R; \ + }) + + #define bit_select(Val, Bit) ({ \ + typeof(Val) Val2 = Val; \ + __builtin_bit_select(&Val2, Bit); \ + }) + + #define bit_set(Val, Repl, Bit) ({ \ + typeof(Val) Result = 0; \ + typeof(Val) Val2 = Val; \ + typeof(Repl) Repl2 = Repl; \ + __builtin_bit_set(&Result, &Val2, &Repl, Bit); \ + Result; \ + }) + + + #define part_select(Val, Lo, Hi) ({ \ + typeof(Val) Result = 0; \ + typeof(Val) Val2 = Val; \ + __builtin_bit_part_select(&Result, &Val2, Lo, Hi); \ + Result; \ + }) + + #define part_set(Val, Repl, Lo, Hi) ({ \ + typeof(Val) Result = 0; \ + typeof(Val) Val2 = Val; \ + typeof(Repl) Repl2 = Repl; \ + __builtin_bit_part_set(&Result, &Val2, &Repl2, Lo, Hi); \ + Result; \ + }) + + #define reduce(how, what) { \ + typeof(what) what2 = what; \ + __bulitin_bit_reduce_ ## how(&what2); \ + } + + #define printBits(val) { \ + int bit = bitwidthof(val); \ + for ( ; bit > 0; --bit) { \ + if (bit_select(val, bit-1)) \ + putchar('1'); \ + else \ + putchar('0'); \ + } \ + } + From reid at x10sys.com Tue Apr 17 18:12:54 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 17 Apr 2007 18:12:54 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/bit_concat.c bit_concat_cpp.cpp bit_concat_cpp.reference_output bit_concat.reference_output Message-ID: <200704172312.l3HNCsPZ026756@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: bit_concat.c updated: 1.2 -> 1.3 bit_concat_cpp.cpp updated: 1.1 -> 1.2 bit_concat_cpp.reference_output updated: 1.1 -> 1.2 bit_concat.reference_output updated: 1.2 -> 1.3 --- Log message: Revise this test to use the new header file and to shift before we add so that we don't alway have the low order bit being 0. Update reference output as a consequence of the formula change. --- Diffs of the changes: (+233 -261) bit_concat.c | 40 ++---- bit_concat.reference_output | 172 ++++++++++++++--------------- bit_concat_cpp.cpp | 46 ++----- bit_concat_cpp.reference_output | 236 ++++++++++++++++++++-------------------- 4 files changed, 233 insertions(+), 261 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/bit_concat.c diff -u llvm-test/SingleSource/UnitTests/Integer/bit_concat.c:1.2 llvm-test/SingleSource/UnitTests/Integer/bit_concat.c:1.3 --- llvm-test/SingleSource/UnitTests/Integer/bit_concat.c:1.2 Mon Feb 12 14:57:48 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bit_concat.c Tue Apr 17 18:12:36 2007 @@ -1,4 +1,4 @@ -//===--- part_select.c --- Test The bit_select builtin --------------------===// +//===--- bit_concat.c --- Test The bit_concat builtin --------------------===// // // This file was developed by Reid Spencer and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. @@ -12,28 +12,14 @@ #include #include +#include "bits.h" -typedef unsigned int __attribute__((bitwidth(17))) BitType1; -typedef unsigned int __attribute__((bitwidth(19))) BitType2; -typedef unsigned long long __attribute__((bitwidth(36))) ConcatType; -int numbits1 = 17; -int numbits2 = 19; - -void printBits(ConcatType val, int numbits ) { - int j; - for (j = numbits; j > 0; --j) { - if (__builtin_bit_select(val, j)) - printf("1"); - else - printf("0"); - } -} int main(int argc, char** argv) { - BitType1 X = 0; - BitType2 Y = 0; - ConcatType Z = 0; + Int17 X = 0; + Int19 Y = 0; + Int36 Z = 0; int i, j; int count = (argc > 1 ? atoi(argv[1]) % 128 : 128); @@ -41,21 +27,21 @@ for (i = 0; i < count; i++) { Y = X = 0; - for (j = 0; j < numbits1; j++) { - X += (rand() % 2 == 0 ? 0 : 1); + for (j = 0; j < bitwidthof(Int17); j++) { X <<= 1; + X += (rand() % 2 == 0 ? 0 : 1); } - for (j = 0; j < numbits2; j++) { - Y += (rand() % 2 == 0 ? 0 : 1); + for (j = 0; j < bitwidthof(Int19); j++) { Y <<= 1; + Y += (rand() % 2 == 0 ? 0 : 1); } - Z = __builtin_bit_concat(X, Y); + Z = bit_concat(X, Y); printf("bit_concat("); - printBits(X, numbits1); + printBits(X); printf(","); - printBits(Y, numbits2); + printBits(Y); printf(") = "); - printBits(Z, numbits1 + numbits2); + printBits(Z); printf("\n"); } return 0; Index: llvm-test/SingleSource/UnitTests/Integer/bit_concat_cpp.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/bit_concat_cpp.cpp:1.1 llvm-test/SingleSource/UnitTests/Integer/bit_concat_cpp.cpp:1.2 --- llvm-test/SingleSource/UnitTests/Integer/bit_concat_cpp.cpp:1.1 Wed Mar 28 11:31:50 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bit_concat_cpp.cpp Tue Apr 17 18:12:36 2007 @@ -12,50 +12,36 @@ #include #include - -typedef unsigned int __attribute__((bitwidth(17))) BitType1; -typedef unsigned int __attribute__((bitwidth(19))) BitType2; -typedef unsigned long long __attribute__((bitwidth(36))) ConcatType; -int numbits1 = 17; -int numbits2 = 19; - -void printBits(ConcatType val, int numbits ) { - int j; - for (j = numbits; j > 0; --j) { - if (__builtin_bit_select(val, j)) - printf("1"); - else - printf("0"); - } -} +#include "bits.h" int main(int argc, char** argv) { - BitType1 X = 0; - BitType2 Y = 0; - ConcatType Z = 0; - int i, j; int count = (argc > 1 ? atoi(argv[1]) % 128 : 128); + Int17 X = 0; + Int19 Y = 0; + Int36 Z = 0; + srand(count); - for (i = 0; i < count; i++) { + for (int i = 0; i < count; i++) { Y = X = 0; - for (j = 0; j < numbits1; j++) { - X += (rand() % 2 == 0 ? 0 : 1); + for (int j = 0; j < bitwidthof(X); j++) { X <<= 1; + X += (rand() % 2 == 0 ? 0 : 1); } - for (j = 0; j < numbits2; j++) { - Y += (rand() % 2 == 0 ? 0 : 1); + for (int j = 0; j < bitwidthof(Y); j++) { Y <<= 1; + Y += (rand() % 2 == 0 ? 0 : 1); } - Z = __builtin_bit_concat(X, Y); + Z = bit_concat(X, Y); printf("bit_concat("); - printBits(X, numbits1); + printBits(X); + printf("(%d),",int(X)); printf(","); - printBits(Y, numbits2); - printf(") = "); - printBits(Z, numbits1 + numbits2); + printBits(Y); + printf("(%d)) = ",int(Y)); + printBits(Z); printf("\n"); } return 0; Index: llvm-test/SingleSource/UnitTests/Integer/bit_concat_cpp.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/bit_concat_cpp.reference_output:1.1 llvm-test/SingleSource/UnitTests/Integer/bit_concat_cpp.reference_output:1.2 --- llvm-test/SingleSource/UnitTests/Integer/bit_concat_cpp.reference_output:1.1 Wed Mar 28 11:31:50 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bit_concat_cpp.reference_output Tue Apr 17 18:12:36 2007 @@ -1,119 +1,119 @@ -bit_concat(00111100000001110,0010011010011011100) = 001111000000011100010011010011011100 -bit_concat(01011110001011010,0000001001101010000) = 010111100010110100000001001101010000 -bit_concat(01001100001011000,0101011010000011010) = 010011000010110000101011010000011010 -bit_concat(00000100110101110,0100100011111011011) = 000001001101011100100100011111011011 -bit_concat(01110100110111110,0100100001100001010) = 011101001101111100100100001100001010 -bit_concat(01000010101001000,0000111111111110111) = 010000101010010000000111111111110111 -bit_concat(01111011100100110,0010101010110011100) = 011110111001001100010101010110011100 -bit_concat(00010000001001001,0010001000110010000) = 000100000010010010010001000110010000 -bit_concat(00100011011111010,0001001100100000101) = 001000110111110100001001100100000101 -bit_concat(01010100111100110,0011011011100011010) = 010101001111001100011011011100011010 -bit_concat(01000110110000101,0111101101000001000) = 010001101100001010111101101000001000 -bit_concat(00011011111011110,0010111101101101100) = 000110111110111100010111101101101100 -bit_concat(01010110001001111,0001111000000001010) = 010101100010011110001111000000001010 -bit_concat(00000111000110001,0010010000101101111) = 000001110001100010010010000101101111 -bit_concat(00010000000100100,0000001111010110001) = 000100000001001000000001111010110001 -bit_concat(01111101011001101,0100101101001100010) = 011111010110011010100101101001100010 -bit_concat(00111101010001000,0001101011111101000) = 001111010100010000001101011111101000 -bit_concat(00001001101011000,0111100010110110111) = 000010011010110000111100010110110111 -bit_concat(01011011111011100,0000011100101110100) = 010110111110111000000011100101110100 -bit_concat(01110011101111110,0011101010111100011) = 011100111011111100011101010111100011 -bit_concat(00000011110111000,0100011100101010110) = 000000111101110000100011100101010110 -bit_concat(00001001101111001,0100110101110101100) = 000010011011110010100110101110101100 -bit_concat(00111110010100101,0100011111000000001) = 001111100101001010100011111000000001 -bit_concat(01010000011010000,0111111100100111101) = 010100000110100000111111100100111101 -bit_concat(00101000000100011,0100110101011111010) = 001010000001000110100110101011111010 -bit_concat(01011100111010011,0100001110001010000) = 010111001110100110100001110001010000 -bit_concat(01000101000101001,0100000101001000000) = 010001010001010010100000101001000000 -bit_concat(01111111011111111,0101000000000101011) = 011111110111111110101000000000101011 -bit_concat(00001001110010000,0001010100001100011) = 000010011100100000001010100001100011 -bit_concat(01010111110100001,0001001100101100110) = 010101111101000010001001100101100110 -bit_concat(00011010010100110,0010010100111001010) = 000110100101001100010010100111001010 -bit_concat(00001001010011011,0111100000100000010) = 000010010100110110111100000100000010 -bit_concat(01110000101011100,0010101101110101110) = 011100001010111000010101101110101110 -bit_concat(01001100000101000,0111100100111101100) = 010011000001010000111100100111101100 -bit_concat(00110100001000111,0110101111001001110) = 001101000010001110110101111001001110 -bit_concat(01011100011111010,0011111000011001000) = 010111000111110100011111000011001000 -bit_concat(00001011100101100,0110110110010010110) = 000010111001011000110110110010010110 -bit_concat(01101111001111010,0110011001110101000) = 011011110011110100110011001110101000 -bit_concat(01000111010100000,0100011101001100100) = 010001110101000000100011101001100100 -bit_concat(01110000000001000,0110011101011000010) = 011100000000010000110011101011000010 -bit_concat(01001000100100010,0000100000001000001) = 010010001001000100000100000001000001 -bit_concat(00111011010010001,0011011110110011010) = 001110110100100010011011110110011010 -bit_concat(00101001011011101,0000010011110110110) = 001010010110111010000010011110110110 -bit_concat(00111010111001001,0010010001111101000) = 001110101110010010010010001111101000 -bit_concat(01010110011101101,0000010100000000010) = 010101100111011010000010100000000010 -bit_concat(00101001111110110,0110010010011111000) = 001010011111101100110010010011111000 -bit_concat(00111000011011111,0111101010110110001) = 001110000110111110111101010110110001 -bit_concat(01110100011101010,0011100101000111111) = 011101000111010100011100101000111111 -bit_concat(01100110010000111,0010110100011010110) = 011001100100001110010110100011010110 -bit_concat(00100110101101001,0101111010000010110) = 001001101011010010101111010000010110 -bit_concat(00001011110001110,0001101100100000001) = 000010111100011100001101100100000001 -bit_concat(01100100010010001,0000000001101011111) = 011001000100100010000000001101011111 -bit_concat(01001000001001011,0100011010111010001) = 010010000010010110100011010111010001 -bit_concat(00011111010100100,0100111000100011000) = 000111110101001000100111000100011000 -bit_concat(01110010001010110,0000011100000001111) = 011100100010101100000011100000001111 -bit_concat(00011100111111001,0101100100001110111) = 000111001111110010101100100001110111 -bit_concat(01100011111010101,0000000001010101001) = 011000111110101010000000001010101001 -bit_concat(01111010100001101,0011111001101100011) = 011110101000011010011111001101100011 -bit_concat(01111001111001001,0110000111110101011) = 011110011110010010110000111110101011 -bit_concat(01010001101010110,0011101111100000000) = 010100011010101100011101111100000000 -bit_concat(00100001001001110,0011101000010010010) = 001000010010011100011101000010010010 -bit_concat(00110010111110101,0010011000000000110) = 001100101111101010010011000000000110 -bit_concat(01010111101111011,0010110110110111101) = 010101111011110110010110110110111101 -bit_concat(01001111110011010,0111000011101001000) = 010011111100110100111000011101001000 -bit_concat(01101010110101011,0111001001100101100) = 011010101101010110111001001100101100 -bit_concat(01100111010010100,0100011011001011111) = 011001110100101000100011011001011111 -bit_concat(00011110100101011,0000100001100100111) = 000111101001010110000100001100100111 -bit_concat(00111111010000011,0100110101000101100) = 001111110100000110100110101000101100 -bit_concat(01110010011011010,0010110110000001011) = 011100100110110100010110110000001011 -bit_concat(00001100000000001,0000010111010011000) = 000011000000000010000010111010011000 -bit_concat(00101101101001001,0101010010110000101) = 001011011010010010101010010110000101 -bit_concat(01011111010011001,0010011010100001111) = 010111110100110010010011010100001111 -bit_concat(00011010110011011,0100110110101011000) = 000110101100110110100110110101011000 -bit_concat(01100111011000001,0000011110000011111) = 011001110110000010000011110000011111 -bit_concat(00111011011101111,0000000011101011111) = 001110110111011110000000011101011111 -bit_concat(00010000101111111,0011101011000100110) = 000100001011111110011101011000100110 -bit_concat(00110001010110100,0000101111110000110) = 001100010101101000000101111110000110 -bit_concat(01111010001011100,0111000000110111100) = 011110100010111000111000000110111100 -bit_concat(01111001111100010,0101010011100011101) = 011110011111000100101010011100011101 -bit_concat(00001110111111101,0110000001011100101) = 000011101111111010110000001011100101 -bit_concat(01110100010101000,0001100111101001011) = 011101000101010000001100111101001011 -bit_concat(01111001100100010,0010100001100110001) = 011110011001000100010100001100110001 -bit_concat(00000011110100001,0000111000011111110) = 000000111101000010000111000011111110 -bit_concat(01110100000101100,0101000110011010101) = 011101000001011000101000110011010101 -bit_concat(00110000100110000,0110111000110000110) = 001100001001100000110111000110000110 -bit_concat(00000001001000101,0101110111100100100) = 000000010010001010101110111100100100 -bit_concat(00100111101111100,0101011011100100111) = 001001111011111000101011011100100111 -bit_concat(00010100010111101,0001110100011111110) = 000101000101111010001110100011111110 -bit_concat(01011000011111110,0101100110001000011) = 010110000111111100101100110001000011 -bit_concat(01010100001000011,0001011110101111101) = 010101000010000110001011110101111101 -bit_concat(00100001010010010,0011011000110010011) = 001000010100100100011011000110010011 -bit_concat(01010010111111100,0100111110111000011) = 010100101111111000100111110111000011 -bit_concat(00101010100101100,0110111011100010110) = 001010101001011000110111011100010110 -bit_concat(00001101010101001,0111101100011001010) = 000011010101010010111101100011001010 -bit_concat(01000010110010001,0101100001110001001) = 010000101100100010101100001110001001 -bit_concat(01011000000101010,0001110110011110111) = 010110000001010100001110110011110111 -bit_concat(01101101001001010,0111011100101100001) = 011011010010010100111011100101100001 -bit_concat(00100011110110010,0011001011000000101) = 001000111101100100011001011000000101 -bit_concat(01001010011001110,0101001001110001000) = 010010100110011100101001001110001000 -bit_concat(01110010010011001,0001110111111111001) = 011100100100110010001110111111111001 -bit_concat(00011010110010000,0110001101001011000) = 000110101100100000110001101001011000 -bit_concat(01010110100111101,0111010011110011000) = 010101101001111010111010011110011000 -bit_concat(00010001011111001,0011011010111111101) = 000100010111110010011011010111111101 -bit_concat(00000011101000010,0000111010100001001) = 000000111010000100000111010100001001 -bit_concat(00010100101110111,0010100101001111101) = 000101001011101110010100101001111101 -bit_concat(00100101110001100,0111001110111001000) = 001001011100011000111001110111001000 -bit_concat(00100000111100010,0010101011111100100) = 001000001111000100010101011111100100 -bit_concat(00001111110100101,0110011101111101000) = 000011111101001010110011101111101000 -bit_concat(01111101011110110,0110010000101000111) = 011111010111101100110010000101000111 -bit_concat(01011100111110101,0010001101000111000) = 010111001111101010010001101000111000 -bit_concat(00010001011111000,0111011010110001011) = 000100010111110000111011010110001011 -bit_concat(00011001111100110,0101110011100000010) = 000110011111001100101110011100000010 -bit_concat(00101011000011001,0111001001101111010) = 001010110000110010111001001101111010 -bit_concat(00101100100011101,0101111000101100001) = 001011001000111010101111000101100001 -bit_concat(00100101110001010,0101111101101001101) = 001001011100010100101111101101001101 -bit_concat(01110101000101111,0101010010100101000) = 011101010001011110101010010100101000 -bit_concat(00110100100011001,0010010100000010101) = 001101001000110010010010100000010101 -bit_concat(01101100000011111,0100110011010101100) = 011011000000111110100110011010101100 +bit_concat(00111100000001110(30734),,1010011010011011100(341212)) = 001111000000011101010011010011011100 +bit_concat(11011110001011010(113754),,1000001001101010000(267088)) = 110111100010110101000001001101010000 +bit_concat(11001100001011000(104536),,1101011010000011010(439322)) = 110011000010110001101011010000011010 +bit_concat(10000100110101110(68014),,0100100011111011011(149467)) = 100001001101011100100100011111011011 +bit_concat(01110100110111110(59838),,1100100001100001010(410378)) = 011101001101111101100100001100001010 +bit_concat(11000010101001000(99656),,0000111111111110111(32759)) = 110000101010010000000111111111110111 +bit_concat(01111011100100110(63270),,0010101010110011100(87452)) = 011110111001001100010101010110011100 +bit_concat(10010000001001001(73801),,0010001000110010000(70032)) = 100100000010010010010001000110010000 +bit_concat(00100011011111010(18170),,1001001100100000101(301317)) = 001000110111110101001001100100000101 +bit_concat(11010100111100110(109030),,1011011011100011010(374554)) = 110101001111001101011011011100011010 +bit_concat(11000110110000101(101765),,0111101101000001000(252424)) = 110001101100001010111101101000001000 +bit_concat(00011011111011110(14302),,0010111101101101100(97132)) = 000110111110111100010111101101101100 +bit_concat(01010110001001111(44111),,1001111000000001010(323594)) = 010101100010011111001111000000001010 +bit_concat(00000111000110001(3633),,1010010000101101111(336239)) = 000001110001100011010010000101101111 +bit_concat(00010000000100100(8228),,0000001111010110001(7857)) = 000100000001001000000001111010110001 +bit_concat(01111101011001101(64205),,1100101101001100010(416354)) = 011111010110011011100101101001100010 +bit_concat(10111101010001000(96904),,1001101011111101000(317416)) = 101111010100010001001101011111101000 +bit_concat(10001001101011000(70488),,0111100010110110111(247223)) = 100010011010110000111100010110110111 +bit_concat(11011011111011100(112604),,1000011100101110100(276852)) = 110110111110111001000011100101110100 +bit_concat(11110011101111110(124798),,0011101010111100011(120291)) = 111100111011111100011101010111100011 +bit_concat(00000011110111000(1976),,1100011100101010110(407894)) = 000000111101110001100011100101010110 +bit_concat(10001001101111001(70521),,1100110101110101100(420780)) = 100010011011110011100110101110101100 +bit_concat(00111110010100101(31909),,0100011111000000001(146945)) = 001111100101001010100011111000000001 +bit_concat(11010000011010000(106704),,0111111100100111101(260413)) = 110100000110100000111111100100111101 +bit_concat(10101000000100011(86051),,0100110101011111010(158458)) = 101010000001000110100110101011111010 +bit_concat(11011100111010011(113107),,1100001110001010000(400464)) = 110111001110100111100001110001010000 +bit_concat(11000101000101001(100905),,0100000101001000000(133696)) = 110001010001010010100000101001000000 +bit_concat(11111111011111111(130815),,1101000000000101011(426027)) = 111111110111111111101000000000101011 +bit_concat(00001001110010000(5008),,1001010100001100011(305251)) = 000010011100100001001010100001100011 +bit_concat(01010111110100001(44961),,1001001100101100110(301414)) = 010101111101000011001001100101100110 +bit_concat(00011010010100110(13478),,0010010100111001010(76234)) = 000110100101001100010010100111001010 +bit_concat(00001001010011011(4763),,1111100000100000010(508162)) = 000010010100110111111100000100000010 +bit_concat(11110000101011100(123228),,0010101101110101110(89006)) = 111100001010111000010101101110101110 +bit_concat(11001100000101000(104488),,0111100100111101100(248300)) = 110011000001010000111100100111101100 +bit_concat(00110100001000111(26695),,0110101111001001110(220750)) = 001101000010001110110101111001001110 +bit_concat(11011100011111010(112890),,0011111000011001000(127176)) = 110111000111110100011111000011001000 +bit_concat(00001011100101100(5932),,0110110110010010110(224406)) = 000010111001011000110110110010010110 +bit_concat(11101111001111010(122490),,1110011001110101000(471976)) = 111011110011110101110011001110101000 +bit_concat(11000111010100000(102048),,0100011101001100100(146020)) = 110001110101000000100011101001100100 +bit_concat(01110000000001000(57352),,0110011101011000010(211650)) = 011100000000010000110011101011000010 +bit_concat(01001000100100010(37154),,0000100000001000001(16449)) = 010010001001000100000100000001000001 +bit_concat(00111011010010001(30353),,0011011110110011010(114074)) = 001110110100100010011011110110011010 +bit_concat(00101001011011101(21213),,1000010011110110110(272310)) = 001010010110111011000010011110110110 +bit_concat(10111010111001001(95689),,1010010001111101000(336872)) = 101110101110010011010010001111101000 +bit_concat(01010110011101101(44269),,0000010100000000010(10242)) = 010101100111011010000010100000000010 +bit_concat(00101001111110110(21494),,0110010010011111000(206072)) = 001010011111101100110010010011111000 +bit_concat(00111000011011111(28895),,0111101010110110001(251313)) = 001110000110111110111101010110110001 +bit_concat(11110100011101010(125162),,0011100101000111111(117311)) = 111101000111010100011100101000111111 +bit_concat(01100110010000111(52359),,0010110100011010110(92374)) = 011001100100001110010110100011010110 +bit_concat(00100110101101001(19817),,1101111010000010110(455702)) = 001001101011010011101111010000010110 +bit_concat(00001011110001110(6030),,0001101100100000001(55553)) = 000010111100011100001101100100000001 +bit_concat(01100100010010001(51345),,0000000001101011111(863)) = 011001000100100010000000001101011111 +bit_concat(01001000001001011(36939),,0100011010111010001(144849)) = 010010000010010110100011010111010001 +bit_concat(00011111010100100(16036),,0100111000100011000(160024)) = 000111110101001000100111000100011000 +bit_concat(11110010001010110(123990),,0000011100000001111(14351)) = 111100100010101100000011100000001111 +bit_concat(10011100111111001(80377),,1101100100001110111(444535)) = 100111001111110011101100100001110111 +bit_concat(01100011111010101(51157),,1000000001010101001(262825)) = 011000111110101011000000001010101001 +bit_concat(01111010100001101(62733),,1011111001101100011(389987)) = 011110101000011011011111001101100011 +bit_concat(01111001111001001(62409),,1110000111110101011(462763)) = 011110011110010011110000111110101011 +bit_concat(01010001101010110(41814),,0011101111100000000(122624)) = 010100011010101100011101111100000000 +bit_concat(00100001001001110(16974),,0011101000010010010(118930)) = 001000010010011100011101000010010010 +bit_concat(00110010111110101(26101),,1010011000000000110(339974)) = 001100101111101011010011000000000110 +bit_concat(01010111101111011(44923),,0010110110110111101(93629)) = 010101111011110110010110110110111101 +bit_concat(01001111110011010(40858),,1111000011101001000(493384)) = 010011111100110101111000011101001000 +bit_concat(11101010110101011(120235),,0111001001100101100(234284)) = 111010101101010110111001001100101100 +bit_concat(11100111010010100(118420),,0100011011001011111(144991)) = 111001110100101000100011011001011111 +bit_concat(00011110100101011(15659),,1000100001100100111(279335)) = 000111101001010111000100001100100111 +bit_concat(00111111010000011(32387),,0100110101000101100(158252)) = 001111110100000110100110101000101100 +bit_concat(01110010011011010(58586),,1010110110000001011(355339)) = 011100100110110101010110110000001011 +bit_concat(00001100000000001(6145),,1000010111010011000(274072)) = 000011000000000011000010111010011000 +bit_concat(10101101101001001(88905),,1101010010110000101(435589)) = 101011011010010011101010010110000101 +bit_concat(01011111010011001(48793),,1010011010100001111(341263)) = 010111110100110011010011010100001111 +bit_concat(00011010110011011(13723),,1100110110101011000(421208)) = 000110101100110111100110110101011000 +bit_concat(11100111011000001(118465),,1000011110000011111(277535)) = 111001110110000011000011110000011111 +bit_concat(10111011011101111(95983),,1000000011101011111(264031)) = 101110110111011111000000011101011111 +bit_concat(10010000101111111(74111),,0011101011000100110(120358)) = 100100001011111110011101011000100110 +bit_concat(10110001010110100(90804),,1000101111110000110(286598)) = 101100010101101001000101111110000110 +bit_concat(11111010001011100(128092),,1111000000110111100(491964)) = 111110100010111001111000000110111100 +bit_concat(11111001111100010(127970),,0101010011100011101(173853)) = 111110011111000100101010011100011101 +bit_concat(10001110111111101(73213),,1110000001011100101(459493)) = 100011101111111011110000001011100101 +bit_concat(01110100010101000(59560),,0001100111101001011(53067)) = 011101000101010000001100111101001011 +bit_concat(11111001100100010(127778),,0010100001100110001(82737)) = 111110011001000100010100001100110001 +bit_concat(00000011110100001(1953),,0000111000011111110(28926)) = 000000111101000010000111000011111110 +bit_concat(01110100000101100(59436),,1101000110011010101(429269)) = 011101000001011001101000110011010101 +bit_concat(10110000100110000(90416),,0110111000110000110(225670)) = 101100001001100000110111000110000110 +bit_concat(10000001001000101(66117),,1101110111100100100(454436)) = 100000010010001011101110111100100100 +bit_concat(00100111101111100(20348),,0101011011100100111(177959)) = 001001111011111000101011011100100111 +bit_concat(00010100010111101(10429),,0001110100011111110(59646)) = 000101000101111010001110100011111110 +bit_concat(01011000011111110(45310),,0101100110001000011(183363)) = 010110000111111100101100110001000011 +bit_concat(11010100001000011(108611),,0001011110101111101(48509)) = 110101000010000110001011110101111101 +bit_concat(00100001010010010(17042),,1011011000110010011(373139)) = 001000010100100101011011000110010011 +bit_concat(01010010111111100(42492),,0100111110111000011(163267)) = 010100101111111000100111110111000011 +bit_concat(10101010100101100(87340),,0110111011100010110(227094)) = 101010101001011000110111011100010110 +bit_concat(10001101010101001(72361),,1111101100011001010(514250)) = 100011010101010011111101100011001010 +bit_concat(11000010110010001(99729),,0101100001110001001(181129)) = 110000101100100010101100001110001001 +bit_concat(01011000000101010(45098),,0001110110011110111(60663)) = 010110000001010100001110110011110111 +bit_concat(01101101001001010(55882),,0111011100101100001(244065)) = 011011010010010100111011100101100001 +bit_concat(00100011110110010(18354),,1011001011000000101(366085)) = 001000111101100101011001011000000101 +bit_concat(11001010011001110(103630),,0101001001110001000(168840)) = 110010100110011100101001001110001000 +bit_concat(01110010010011001(58521),,0001110111111111001(61433)) = 011100100100110010001110111111111001 +bit_concat(10011010110010000(79248),,1110001101001011000(465496)) = 100110101100100001110001101001011000 +bit_concat(01010110100111101(44349),,1111010011110011000(501656)) = 010101101001111011111010011110011000 +bit_concat(10010001011111001(74489),,0011011010111111101(112125)) = 100100010111110010011011010111111101 +bit_concat(00000011101000010(1858),,1000111010100001001(292105)) = 000000111010000101000111010100001001 +bit_concat(00010100101110111(10615),,1010100101001111101(346749)) = 000101001011101111010100101001111101 +bit_concat(10100101110001100(84876),,1111001110111001000(499144)) = 101001011100011001111001110111001000 +bit_concat(10100000111100010(82402),,0010101011111100100(88036)) = 101000001111000100010101011111100100 +bit_concat(10001111110100101(73637),,1110011101111101000(474088)) = 100011111101001011110011101111101000 +bit_concat(11111101011110110(129782),,0110010000101000111(205127)) = 111111010111101100110010000101000111 +bit_concat(11011100111110101(113141),,0010001101000111000(72248)) = 110111001111101010010001101000111000 +bit_concat(10010001011111000(74488),,1111011010110001011(505227)) = 100100010111110001111011010110001011 +bit_concat(00011001111100110(13286),,0101110011100000010(190210)) = 000110011111001100101110011100000010 +bit_concat(00101011000011001(22041),,1111001001101111010(496506)) = 001010110000110011111001001101111010 +bit_concat(00101100100011101(22813),,1101111000101100001(455009)) = 001011001000111011101111000101100001 +bit_concat(10100101110001010(84874),,1101111101101001101(457549)) = 101001011100010101101111101101001101 +bit_concat(01110101000101111(59951),,1101010010100101000(435496)) = 011101010001011111101010010100101000 +bit_concat(10110100100011001(92441),,1010010100000010101(337941)) = 101101001000110011010010100000010101 +bit_concat(11101100000011111(120863),,0100110011010101100(157356)) = 111011000000111110100110011010101100 exit 0 Index: llvm-test/SingleSource/UnitTests/Integer/bit_concat.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/bit_concat.reference_output:1.2 llvm-test/SingleSource/UnitTests/Integer/bit_concat.reference_output:1.3 --- llvm-test/SingleSource/UnitTests/Integer/bit_concat.reference_output:1.2 Mon Feb 12 13:07:49 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bit_concat.reference_output Tue Apr 17 18:12:36 2007 @@ -1,119 +1,119 @@ -bit_concat(00111100000001110,0010011010011011100) = 001111000000011100010011010011011100 -bit_concat(01011110001011010,0000001001101010000) = 010111100010110100000001001101010000 -bit_concat(01001100001011000,0101011010000011010) = 010011000010110000101011010000011010 -bit_concat(00000100110101110,0100100011111011011) = 000001001101011100100100011111011011 -bit_concat(01110100110111110,0100100001100001010) = 011101001101111100100100001100001010 -bit_concat(01000010101001000,0000111111111110111) = 010000101010010000000111111111110111 +bit_concat(00111100000001110,1010011010011011100) = 001111000000011101010011010011011100 +bit_concat(11011110001011010,1000001001101010000) = 110111100010110101000001001101010000 +bit_concat(11001100001011000,1101011010000011010) = 110011000010110001101011010000011010 +bit_concat(10000100110101110,0100100011111011011) = 100001001101011100100100011111011011 +bit_concat(01110100110111110,1100100001100001010) = 011101001101111101100100001100001010 +bit_concat(11000010101001000,0000111111111110111) = 110000101010010000000111111111110111 bit_concat(01111011100100110,0010101010110011100) = 011110111001001100010101010110011100 -bit_concat(00010000001001001,0010001000110010000) = 000100000010010010010001000110010000 -bit_concat(00100011011111010,0001001100100000101) = 001000110111110100001001100100000101 -bit_concat(01010100111100110,0011011011100011010) = 010101001111001100011011011100011010 -bit_concat(01000110110000101,0111101101000001000) = 010001101100001010111101101000001000 +bit_concat(10010000001001001,0010001000110010000) = 100100000010010010010001000110010000 +bit_concat(00100011011111010,1001001100100000101) = 001000110111110101001001100100000101 +bit_concat(11010100111100110,1011011011100011010) = 110101001111001101011011011100011010 +bit_concat(11000110110000101,0111101101000001000) = 110001101100001010111101101000001000 bit_concat(00011011111011110,0010111101101101100) = 000110111110111100010111101101101100 -bit_concat(01010110001001111,0001111000000001010) = 010101100010011110001111000000001010 -bit_concat(00000111000110001,0010010000101101111) = 000001110001100010010010000101101111 +bit_concat(01010110001001111,1001111000000001010) = 010101100010011111001111000000001010 +bit_concat(00000111000110001,1010010000101101111) = 000001110001100011010010000101101111 bit_concat(00010000000100100,0000001111010110001) = 000100000001001000000001111010110001 -bit_concat(01111101011001101,0100101101001100010) = 011111010110011010100101101001100010 -bit_concat(00111101010001000,0001101011111101000) = 001111010100010000001101011111101000 -bit_concat(00001001101011000,0111100010110110111) = 000010011010110000111100010110110111 -bit_concat(01011011111011100,0000011100101110100) = 010110111110111000000011100101110100 -bit_concat(01110011101111110,0011101010111100011) = 011100111011111100011101010111100011 -bit_concat(00000011110111000,0100011100101010110) = 000000111101110000100011100101010110 -bit_concat(00001001101111001,0100110101110101100) = 000010011011110010100110101110101100 +bit_concat(01111101011001101,1100101101001100010) = 011111010110011011100101101001100010 +bit_concat(10111101010001000,1001101011111101000) = 101111010100010001001101011111101000 +bit_concat(10001001101011000,0111100010110110111) = 100010011010110000111100010110110111 +bit_concat(11011011111011100,1000011100101110100) = 110110111110111001000011100101110100 +bit_concat(11110011101111110,0011101010111100011) = 111100111011111100011101010111100011 +bit_concat(00000011110111000,1100011100101010110) = 000000111101110001100011100101010110 +bit_concat(10001001101111001,1100110101110101100) = 100010011011110011100110101110101100 bit_concat(00111110010100101,0100011111000000001) = 001111100101001010100011111000000001 -bit_concat(01010000011010000,0111111100100111101) = 010100000110100000111111100100111101 -bit_concat(00101000000100011,0100110101011111010) = 001010000001000110100110101011111010 -bit_concat(01011100111010011,0100001110001010000) = 010111001110100110100001110001010000 -bit_concat(01000101000101001,0100000101001000000) = 010001010001010010100000101001000000 -bit_concat(01111111011111111,0101000000000101011) = 011111110111111110101000000000101011 -bit_concat(00001001110010000,0001010100001100011) = 000010011100100000001010100001100011 -bit_concat(01010111110100001,0001001100101100110) = 010101111101000010001001100101100110 +bit_concat(11010000011010000,0111111100100111101) = 110100000110100000111111100100111101 +bit_concat(10101000000100011,0100110101011111010) = 101010000001000110100110101011111010 +bit_concat(11011100111010011,1100001110001010000) = 110111001110100111100001110001010000 +bit_concat(11000101000101001,0100000101001000000) = 110001010001010010100000101001000000 +bit_concat(11111111011111111,1101000000000101011) = 111111110111111111101000000000101011 +bit_concat(00001001110010000,1001010100001100011) = 000010011100100001001010100001100011 +bit_concat(01010111110100001,1001001100101100110) = 010101111101000011001001100101100110 bit_concat(00011010010100110,0010010100111001010) = 000110100101001100010010100111001010 -bit_concat(00001001010011011,0111100000100000010) = 000010010100110110111100000100000010 -bit_concat(01110000101011100,0010101101110101110) = 011100001010111000010101101110101110 -bit_concat(01001100000101000,0111100100111101100) = 010011000001010000111100100111101100 +bit_concat(00001001010011011,1111100000100000010) = 000010010100110111111100000100000010 +bit_concat(11110000101011100,0010101101110101110) = 111100001010111000010101101110101110 +bit_concat(11001100000101000,0111100100111101100) = 110011000001010000111100100111101100 bit_concat(00110100001000111,0110101111001001110) = 001101000010001110110101111001001110 -bit_concat(01011100011111010,0011111000011001000) = 010111000111110100011111000011001000 +bit_concat(11011100011111010,0011111000011001000) = 110111000111110100011111000011001000 bit_concat(00001011100101100,0110110110010010110) = 000010111001011000110110110010010110 -bit_concat(01101111001111010,0110011001110101000) = 011011110011110100110011001110101000 -bit_concat(01000111010100000,0100011101001100100) = 010001110101000000100011101001100100 +bit_concat(11101111001111010,1110011001110101000) = 111011110011110101110011001110101000 +bit_concat(11000111010100000,0100011101001100100) = 110001110101000000100011101001100100 bit_concat(01110000000001000,0110011101011000010) = 011100000000010000110011101011000010 bit_concat(01001000100100010,0000100000001000001) = 010010001001000100000100000001000001 bit_concat(00111011010010001,0011011110110011010) = 001110110100100010011011110110011010 -bit_concat(00101001011011101,0000010011110110110) = 001010010110111010000010011110110110 -bit_concat(00111010111001001,0010010001111101000) = 001110101110010010010010001111101000 +bit_concat(00101001011011101,1000010011110110110) = 001010010110111011000010011110110110 +bit_concat(10111010111001001,1010010001111101000) = 101110101110010011010010001111101000 bit_concat(01010110011101101,0000010100000000010) = 010101100111011010000010100000000010 bit_concat(00101001111110110,0110010010011111000) = 001010011111101100110010010011111000 bit_concat(00111000011011111,0111101010110110001) = 001110000110111110111101010110110001 -bit_concat(01110100011101010,0011100101000111111) = 011101000111010100011100101000111111 +bit_concat(11110100011101010,0011100101000111111) = 111101000111010100011100101000111111 bit_concat(01100110010000111,0010110100011010110) = 011001100100001110010110100011010110 -bit_concat(00100110101101001,0101111010000010110) = 001001101011010010101111010000010110 +bit_concat(00100110101101001,1101111010000010110) = 001001101011010011101111010000010110 bit_concat(00001011110001110,0001101100100000001) = 000010111100011100001101100100000001 bit_concat(01100100010010001,0000000001101011111) = 011001000100100010000000001101011111 bit_concat(01001000001001011,0100011010111010001) = 010010000010010110100011010111010001 bit_concat(00011111010100100,0100111000100011000) = 000111110101001000100111000100011000 -bit_concat(01110010001010110,0000011100000001111) = 011100100010101100000011100000001111 -bit_concat(00011100111111001,0101100100001110111) = 000111001111110010101100100001110111 -bit_concat(01100011111010101,0000000001010101001) = 011000111110101010000000001010101001 -bit_concat(01111010100001101,0011111001101100011) = 011110101000011010011111001101100011 -bit_concat(01111001111001001,0110000111110101011) = 011110011110010010110000111110101011 +bit_concat(11110010001010110,0000011100000001111) = 111100100010101100000011100000001111 +bit_concat(10011100111111001,1101100100001110111) = 100111001111110011101100100001110111 +bit_concat(01100011111010101,1000000001010101001) = 011000111110101011000000001010101001 +bit_concat(01111010100001101,1011111001101100011) = 011110101000011011011111001101100011 +bit_concat(01111001111001001,1110000111110101011) = 011110011110010011110000111110101011 bit_concat(01010001101010110,0011101111100000000) = 010100011010101100011101111100000000 bit_concat(00100001001001110,0011101000010010010) = 001000010010011100011101000010010010 -bit_concat(00110010111110101,0010011000000000110) = 001100101111101010010011000000000110 +bit_concat(00110010111110101,1010011000000000110) = 001100101111101011010011000000000110 bit_concat(01010111101111011,0010110110110111101) = 010101111011110110010110110110111101 -bit_concat(01001111110011010,0111000011101001000) = 010011111100110100111000011101001000 -bit_concat(01101010110101011,0111001001100101100) = 011010101101010110111001001100101100 -bit_concat(01100111010010100,0100011011001011111) = 011001110100101000100011011001011111 -bit_concat(00011110100101011,0000100001100100111) = 000111101001010110000100001100100111 +bit_concat(01001111110011010,1111000011101001000) = 010011111100110101111000011101001000 +bit_concat(11101010110101011,0111001001100101100) = 111010101101010110111001001100101100 +bit_concat(11100111010010100,0100011011001011111) = 111001110100101000100011011001011111 +bit_concat(00011110100101011,1000100001100100111) = 000111101001010111000100001100100111 bit_concat(00111111010000011,0100110101000101100) = 001111110100000110100110101000101100 -bit_concat(01110010011011010,0010110110000001011) = 011100100110110100010110110000001011 -bit_concat(00001100000000001,0000010111010011000) = 000011000000000010000010111010011000 -bit_concat(00101101101001001,0101010010110000101) = 001011011010010010101010010110000101 -bit_concat(01011111010011001,0010011010100001111) = 010111110100110010010011010100001111 -bit_concat(00011010110011011,0100110110101011000) = 000110101100110110100110110101011000 -bit_concat(01100111011000001,0000011110000011111) = 011001110110000010000011110000011111 -bit_concat(00111011011101111,0000000011101011111) = 001110110111011110000000011101011111 -bit_concat(00010000101111111,0011101011000100110) = 000100001011111110011101011000100110 -bit_concat(00110001010110100,0000101111110000110) = 001100010101101000000101111110000110 -bit_concat(01111010001011100,0111000000110111100) = 011110100010111000111000000110111100 -bit_concat(01111001111100010,0101010011100011101) = 011110011111000100101010011100011101 -bit_concat(00001110111111101,0110000001011100101) = 000011101111111010110000001011100101 +bit_concat(01110010011011010,1010110110000001011) = 011100100110110101010110110000001011 +bit_concat(00001100000000001,1000010111010011000) = 000011000000000011000010111010011000 +bit_concat(10101101101001001,1101010010110000101) = 101011011010010011101010010110000101 +bit_concat(01011111010011001,1010011010100001111) = 010111110100110011010011010100001111 +bit_concat(00011010110011011,1100110110101011000) = 000110101100110111100110110101011000 +bit_concat(11100111011000001,1000011110000011111) = 111001110110000011000011110000011111 +bit_concat(10111011011101111,1000000011101011111) = 101110110111011111000000011101011111 +bit_concat(10010000101111111,0011101011000100110) = 100100001011111110011101011000100110 +bit_concat(10110001010110100,1000101111110000110) = 101100010101101001000101111110000110 +bit_concat(11111010001011100,1111000000110111100) = 111110100010111001111000000110111100 +bit_concat(11111001111100010,0101010011100011101) = 111110011111000100101010011100011101 +bit_concat(10001110111111101,1110000001011100101) = 100011101111111011110000001011100101 bit_concat(01110100010101000,0001100111101001011) = 011101000101010000001100111101001011 -bit_concat(01111001100100010,0010100001100110001) = 011110011001000100010100001100110001 +bit_concat(11111001100100010,0010100001100110001) = 111110011001000100010100001100110001 bit_concat(00000011110100001,0000111000011111110) = 000000111101000010000111000011111110 -bit_concat(01110100000101100,0101000110011010101) = 011101000001011000101000110011010101 -bit_concat(00110000100110000,0110111000110000110) = 001100001001100000110111000110000110 -bit_concat(00000001001000101,0101110111100100100) = 000000010010001010101110111100100100 +bit_concat(01110100000101100,1101000110011010101) = 011101000001011001101000110011010101 +bit_concat(10110000100110000,0110111000110000110) = 101100001001100000110111000110000110 +bit_concat(10000001001000101,1101110111100100100) = 100000010010001011101110111100100100 bit_concat(00100111101111100,0101011011100100111) = 001001111011111000101011011100100111 bit_concat(00010100010111101,0001110100011111110) = 000101000101111010001110100011111110 bit_concat(01011000011111110,0101100110001000011) = 010110000111111100101100110001000011 -bit_concat(01010100001000011,0001011110101111101) = 010101000010000110001011110101111101 -bit_concat(00100001010010010,0011011000110010011) = 001000010100100100011011000110010011 +bit_concat(11010100001000011,0001011110101111101) = 110101000010000110001011110101111101 +bit_concat(00100001010010010,1011011000110010011) = 001000010100100101011011000110010011 bit_concat(01010010111111100,0100111110111000011) = 010100101111111000100111110111000011 -bit_concat(00101010100101100,0110111011100010110) = 001010101001011000110111011100010110 -bit_concat(00001101010101001,0111101100011001010) = 000011010101010010111101100011001010 -bit_concat(01000010110010001,0101100001110001001) = 010000101100100010101100001110001001 +bit_concat(10101010100101100,0110111011100010110) = 101010101001011000110111011100010110 +bit_concat(10001101010101001,1111101100011001010) = 100011010101010011111101100011001010 +bit_concat(11000010110010001,0101100001110001001) = 110000101100100010101100001110001001 bit_concat(01011000000101010,0001110110011110111) = 010110000001010100001110110011110111 bit_concat(01101101001001010,0111011100101100001) = 011011010010010100111011100101100001 -bit_concat(00100011110110010,0011001011000000101) = 001000111101100100011001011000000101 -bit_concat(01001010011001110,0101001001110001000) = 010010100110011100101001001110001000 +bit_concat(00100011110110010,1011001011000000101) = 001000111101100101011001011000000101 +bit_concat(11001010011001110,0101001001110001000) = 110010100110011100101001001110001000 bit_concat(01110010010011001,0001110111111111001) = 011100100100110010001110111111111001 -bit_concat(00011010110010000,0110001101001011000) = 000110101100100000110001101001011000 -bit_concat(01010110100111101,0111010011110011000) = 010101101001111010111010011110011000 -bit_concat(00010001011111001,0011011010111111101) = 000100010111110010011011010111111101 -bit_concat(00000011101000010,0000111010100001001) = 000000111010000100000111010100001001 -bit_concat(00010100101110111,0010100101001111101) = 000101001011101110010100101001111101 -bit_concat(00100101110001100,0111001110111001000) = 001001011100011000111001110111001000 -bit_concat(00100000111100010,0010101011111100100) = 001000001111000100010101011111100100 -bit_concat(00001111110100101,0110011101111101000) = 000011111101001010110011101111101000 -bit_concat(01111101011110110,0110010000101000111) = 011111010111101100110010000101000111 -bit_concat(01011100111110101,0010001101000111000) = 010111001111101010010001101000111000 -bit_concat(00010001011111000,0111011010110001011) = 000100010111110000111011010110001011 +bit_concat(10011010110010000,1110001101001011000) = 100110101100100001110001101001011000 +bit_concat(01010110100111101,1111010011110011000) = 010101101001111011111010011110011000 +bit_concat(10010001011111001,0011011010111111101) = 100100010111110010011011010111111101 +bit_concat(00000011101000010,1000111010100001001) = 000000111010000101000111010100001001 +bit_concat(00010100101110111,1010100101001111101) = 000101001011101111010100101001111101 +bit_concat(10100101110001100,1111001110111001000) = 101001011100011001111001110111001000 +bit_concat(10100000111100010,0010101011111100100) = 101000001111000100010101011111100100 +bit_concat(10001111110100101,1110011101111101000) = 100011111101001011110011101111101000 +bit_concat(11111101011110110,0110010000101000111) = 111111010111101100110010000101000111 +bit_concat(11011100111110101,0010001101000111000) = 110111001111101010010001101000111000 +bit_concat(10010001011111000,1111011010110001011) = 100100010111110001111011010110001011 bit_concat(00011001111100110,0101110011100000010) = 000110011111001100101110011100000010 -bit_concat(00101011000011001,0111001001101111010) = 001010110000110010111001001101111010 -bit_concat(00101100100011101,0101111000101100001) = 001011001000111010101111000101100001 -bit_concat(00100101110001010,0101111101101001101) = 001001011100010100101111101101001101 -bit_concat(01110101000101111,0101010010100101000) = 011101010001011110101010010100101000 -bit_concat(00110100100011001,0010010100000010101) = 001101001000110010010010100000010101 -bit_concat(01101100000011111,0100110011010101100) = 011011000000111110100110011010101100 +bit_concat(00101011000011001,1111001001101111010) = 001010110000110011111001001101111010 +bit_concat(00101100100011101,1101111000101100001) = 001011001000111011101111000101100001 +bit_concat(10100101110001010,1101111101101001101) = 101001011100010101101111101101001101 +bit_concat(01110101000101111,1101010010100101000) = 011101010001011111101010010100101000 +bit_concat(10110100100011001,1010010100000010101) = 101101001000110011010010100000010101 +bit_concat(11101100000011111,0100110011010101100) = 111011000000111110100110011010101100 exit 0 From reid at x10sys.com Tue Apr 17 18:18:25 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 17 Apr 2007 18:18:25 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/bit_select.c Message-ID: <200704172318.l3HNIPOc026869@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: bit_select.c updated: 1.2 -> 1.3 --- Log message: Update to use bits.h --- Diffs of the changes: (+5 -6) bit_select.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/bit_select.c diff -u llvm-test/SingleSource/UnitTests/Integer/bit_select.c:1.2 llvm-test/SingleSource/UnitTests/Integer/bit_select.c:1.3 --- llvm-test/SingleSource/UnitTests/Integer/bit_select.c:1.2 Mon Feb 12 11:52:59 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bit_select.c Tue Apr 17 18:18:07 2007 @@ -11,15 +11,14 @@ //===----------------------------------------------------------------------===// #include +#include #ifdef ENABLE_LARGE_INTEGERS -typedef int __attribute__((bitwidth(250))) BitType; +typedef Int250 BitType; const BitType X = 0xAAAAAAAAAAAAAAAAULL; -int numbits = 250; #else -typedef int __attribute__((bitwidth(47))) BitType; +typedef Int47 BitType; const BitType X = 0xAAAAAAAAAAAAULL; -int numbits = 47; #endif int main(int argc, char** argv) @@ -33,8 +32,8 @@ BitType i; - for (i = numbits-1; i >= 0; --i) { - if (__builtin_bit_select(Y, i)) + for (i = bitwidthof(BitType); i > 0; --i) { + if (bit_select(Y, i-1)) printf("1"); else printf("0"); From evan.cheng at apple.com Tue Apr 17 18:33:56 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Apr 2007 18:33:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/MRegisterInfo.cpp Message-ID: <200704172333.l3HNXuQ4027124@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: MRegisterInfo.cpp updated: 1.23 -> 1.24 --- Log message: Oops. Didn't mean to check in a quick hack. --- Diffs of the changes: (+16 -8) MRegisterInfo.cpp | 24 ++++++++++++++++-------- 1 files changed, 16 insertions(+), 8 deletions(-) Index: llvm/lib/Target/MRegisterInfo.cpp diff -u llvm/lib/Target/MRegisterInfo.cpp:1.23 llvm/lib/Target/MRegisterInfo.cpp:1.24 --- llvm/lib/Target/MRegisterInfo.cpp:1.23 Tue Apr 17 15:23:34 2007 +++ llvm/lib/Target/MRegisterInfo.cpp Tue Apr 17 18:33:39 2007 @@ -34,18 +34,26 @@ MRegisterInfo::~MRegisterInfo() {} +/// getAllocatableSetForRC - Toggle the bits that represent allocatable +/// registers for the specific register class. +static void getAllocatableSetForRC(MachineFunction &MF, + const TargetRegisterClass *RC, BitVector &R){ + for (TargetRegisterClass::iterator I = RC->allocation_order_begin(MF), + E = RC->allocation_order_end(MF); I != E; ++I) + R.set(*I); +} + BitVector MRegisterInfo::getAllocatableSet(MachineFunction &MF, const TargetRegisterClass *RC) const { BitVector Allocatable(NumRegs); - for (MRegisterInfo::regclass_iterator I = regclass_begin(), - E = regclass_end(); I != E; ++I) { - const TargetRegisterClass *TRC = *I; - if (RC && TRC != RC) - continue; - for (TargetRegisterClass::iterator I = TRC->allocation_order_begin(MF), - E = TRC->allocation_order_end(MF); I != E; ++I) - Allocatable.set(*I); + if (RC) { + getAllocatableSetForRC(MF, RC, Allocatable); + return Allocatable; } + + for (MRegisterInfo::regclass_iterator I = regclass_begin(), + E = regclass_end(); I != E; ++I) + getAllocatableSetForRC(MF, *I, Allocatable); return Allocatable; } From alenhar2 at cs.uiuc.edu Tue Apr 17 18:38:22 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 17 Apr 2007 18:38:22 -0500 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Message-ID: <200704172338.l3HNcMY0027223@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: TransformFunctionBody.cpp updated: 1.62 -> 1.63 --- Log message: Fix --- Diffs of the changes: (+1 -1) TransformFunctionBody.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp diff -u llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.62 llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.63 --- llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.62 Wed Apr 11 12:27:53 2007 +++ llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Tue Apr 17 18:38:04 2007 @@ -654,7 +654,7 @@ Value *Align = ConstantInt::get(Type::Int32Ty,0); Value* Opts[3] = {ArgVal, ElSize, Align}; new CallInst(PAInfo.PoolInit, Opts, 3,"", TheCall); - new CallInst(PAInfo.PoolDestroy, ArgVal, "", TheCall->getNext()); + new CallInst(PAInfo.PoolDestroy, ArgVal, "", TheCall+1); } //probably need to update DSG // std::cerr << "WARNING: NULL POOL ARGUMENTS ARE PASSED IN!\n"; From alenhar2 at cs.uiuc.edu Tue Apr 17 18:41:29 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 17 Apr 2007 18:41:29 -0500 Subject: [llvm-commits] CVS: llvm-poolalloc/include/dsa/DSGraph.h DSNode.h Message-ID: <200704172341.l3HNfTse027308@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/include/dsa: DSGraph.h updated: 1.114 -> 1.115 DSNode.h updated: 1.61 -> 1.62 --- Log message: Normalize Flag names and functions, also add a couple informative ones --- Diffs of the changes: (+48 -43) DSGraph.h | 8 ++--- DSNode.h | 83 ++++++++++++++++++++++++++++++++------------------------------ 2 files changed, 48 insertions(+), 43 deletions(-) Index: llvm-poolalloc/include/dsa/DSGraph.h diff -u llvm-poolalloc/include/dsa/DSGraph.h:1.114 llvm-poolalloc/include/dsa/DSGraph.h:1.115 --- llvm-poolalloc/include/dsa/DSGraph.h:1.114 Wed Apr 11 12:37:43 2007 +++ llvm-poolalloc/include/dsa/DSGraph.h Tue Apr 17 18:41:06 2007 @@ -415,7 +415,7 @@ for (node_iterator I = node_begin(), E = node_end(); I != E; ++I) I->maskNodeTypes(Mask); } - void maskIncompleteMarkers() { maskNodeTypes(~DSNode::Incomplete); } + void maskIncompleteMarkers() { maskNodeTypes(~DSNode::IncompleteNode); } // markIncompleteNodes - Traverse the graph, identifying nodes that may be // modified by other functions that have not been resolved yet. This marks @@ -564,13 +564,13 @@ ReachabilityCloner(DSGraph &dest, const DSGraph &src, unsigned cloneFlags) : Dest(dest), Src(src), CloneFlags(cloneFlags) { assert(&Dest != &Src && "Cannot clone from graph to same graph!"); - BitsToKeep = ~DSNode::DEAD; + BitsToKeep = ~DSNode::DeadNode; if (CloneFlags & DSGraph::StripAllocaBit) BitsToKeep &= ~DSNode::AllocaNode; if (CloneFlags & DSGraph::StripModRefBits) - BitsToKeep &= ~(DSNode::Modified | DSNode::Read); + BitsToKeep &= ~(DSNode::ModifiedNode | DSNode::ReadNode); if (CloneFlags & DSGraph::StripIncompleteBit) - BitsToKeep &= ~DSNode::Incomplete; + BitsToKeep &= ~DSNode::IncompleteNode; } DSNodeHandle getClonedNH(const DSNodeHandle &SrcNH); Index: llvm-poolalloc/include/dsa/DSNode.h diff -u llvm-poolalloc/include/dsa/DSNode.h:1.61 llvm-poolalloc/include/dsa/DSNode.h:1.62 --- llvm-poolalloc/include/dsa/DSNode.h:1.61 Wed Dec 13 23:51:06 2006 +++ llvm-poolalloc/include/dsa/DSNode.h Tue Apr 17 18:41:06 2007 @@ -80,20 +80,23 @@ DSNode(const DSNode &); // DO NOT IMPLEMENT public: enum NodeTy { - ShadowNode = 0, // Nothing is known about this node... - AllocaNode = 1 << 0, // This node was allocated with alloca - HeapNode = 1 << 1, // This node was allocated with malloc - GlobalNode = 1 << 2, // This node was allocated by a global var decl - UnknownNode = 1 << 3, // This node points to unknown allocated memory - Incomplete = 1 << 4, // This node may not be complete + ShadowNode = 0, // Nothing is known about this node... + AllocaNode = 1 << 0, // This node was allocated with alloca + HeapNode = 1 << 1, // This node was allocated with malloc + GlobalNode = 1 << 2, // This node was allocated by a global var decl + UnknownNode = 1 << 3, // This node points to unknown allocated memory + IncompleteNode = 1 << 4, // This node may not be complete + + ModifiedNode = 1 << 5, // This node is modified in this context + ReadNode = 1 << 6, // This node is read in this context + + ArrayNode = 1 << 7, // This node is treated like an array + ExternalNode = 1 << 8, // This node comes from an external source + IntToPtrNode = 1 << 9, // This node comes from an int cast + PtrToIntNode = 1 << 10, // This node excapes to an int cast - Modified = 1 << 5, // This node is modified in this context - Read = 1 << 6, // This node is read in this context - - Array = 1 << 7, // This node is treated like an array - External = 1 << 8, // This node comes from an external source //#ifndef NDEBUG - DEAD = 1 << 9, // This node is dead and should not be pointed to + DeadNode = 1 << 11, // This node is dead and should not be pointed to //#endif Composition = AllocaNode | HeapNode | GlobalNode | UnknownNode @@ -147,7 +150,7 @@ /// const Type *getType() const { return Ty; } - bool isArray() const { return NodeType & Array; } + bool isArray() const { return NodeType & ArrayNode; } /// hasNoReferrers - Return true if nothing is pointing to this node at all. /// @@ -332,36 +335,38 @@ /// getNodeFlags - Return all of the flags set on the node. If the DEAD flag /// is set, hide it from the caller. /// - unsigned getNodeFlags() const { return NodeType & ~DEAD; } + unsigned getNodeFlags() const { return NodeType & ~DeadNode; } - bool isAllocaNode() const { return NodeType & AllocaNode; } - bool isHeapNode() const { return NodeType & HeapNode; } - bool isGlobalNode() const { return NodeType & GlobalNode; } - bool isUnknownNode() const { return NodeType & UnknownNode; } - - bool isModified() const { return NodeType & Modified; } - bool isRead() const { return NodeType & Read; } - - bool isIncomplete() const { return NodeType & Incomplete; } - bool isComplete() const { return !isIncomplete(); } - bool isDeadNode() const { return NodeType & DEAD; } - bool isExternalNode() const { return NodeType & External; } - - DSNode *setAllocaNodeMarker() { NodeType |= AllocaNode; return this; } - DSNode *setHeapNodeMarker() { NodeType |= HeapNode; return this; } - DSNode *setGlobalNodeMarker() { NodeType |= GlobalNode; return this; } - DSNode *setUnknownNodeMarker() { NodeType |= UnknownNode; return this; } - - DSNode *setExternalMarker() { NodeType |= External; return this; } - DSNode *setIncompleteMarker() { NodeType |= Incomplete; return this; } - DSNode *setModifiedMarker() { NodeType |= Modified; return this; } - DSNode *setReadMarker() { NodeType |= Read; return this; } - DSNode *setArrayMarker() { NodeType |= Array; return this; } + bool isAllocaNode() const { return NodeType & AllocaNode; } + bool isHeapNode() const { return NodeType & HeapNode; } + bool isGlobalNode() const { return NodeType & GlobalNode; } + bool isUnknownNode() const { return NodeType & UnknownNode; } + bool isModifiedNode() const { return NodeType & ModifiedNode; } + bool isReadNode() const { return NodeType & ReadNode; } + bool isArrayNode() const { return NodeType & ArrayNode; } + bool isIncompleteNode() const { return NodeType & IncompleteNode;} + bool isCompleteNode() const { return !isIncompleteNode(); } + bool isDeadNode() const { return NodeType & DeadNode; } + bool isExternalNode() const { return NodeType & ExternalNode; } + bool isIntToPtrNode() const { return NodeType & IntToPtrNode; } + bool isPtrToIntNode() const { return NodeType & PtrToIntNode; } + + DSNode* setAllocaMarker() { NodeType |= AllocaNode; return this; } + DSNode* setHeapMarker() { NodeType |= HeapNode; return this; } + DSNode* setGlobalMarker() { NodeType |= GlobalNode; return this; } + DSNode* setUnknownMarker() { NodeType |= UnknownNode; return this; } + DSNode* setModifiedMarker() { NodeType |= ModifiedNode; return this; } + DSNode* setReadMarker() { NodeType |= ReadNode; return this; } + DSNode* setArrayMarker() { NodeType |= ArrayNode; return this; } + DSNode* setIncompleteMarker() { NodeType |= IncompleteNode; return this; } + DSNode* setExternalMarker() { NodeType |= ExternalNode; return this; } + DSNode* setIntToPtrMarker() { NodeType |= IntToPtrNode; return this; } + DSNode* setPtrToIntMarker() { NodeType |= PtrToIntNode; return this; } void makeNodeDead() { Globals.clear(); assert(hasNoReferrers() && "Dead node shouldn't have refs!"); - NodeType = DEAD; + NodeType = DeadNode; } /// forwardNode - Mark this node as being obsolete, and all references to it @@ -463,7 +468,7 @@ Offset = 0; } } - assert(!N || ((N->NodeType & DSNode::DEAD) == 0)); + assert(!N || ((N->NodeType & DSNode::DeadNode) == 0)); assert((!N || Offset < N->Size || (N->Size == 0 && Offset == 0) || N->isForwarding()) && "Node handle offset out of range!"); } From alenhar2 at cs.uiuc.edu Tue Apr 17 18:41:30 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 17 Apr 2007 18:41:30 -0500 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/DSA/BottomUpClosure.cpp CallTargets.cpp DataStructure.cpp DataStructureAA.cpp DataStructureOpt.cpp DataStructureStats.cpp GraphChecker.cpp Local.cpp Printer.cpp Steensgaard.cpp TopDownClosure.cpp Message-ID: <200704172341.l3HNfUJd027333@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/DSA: BottomUpClosure.cpp updated: 1.131 -> 1.132 CallTargets.cpp updated: 1.11 -> 1.12 DataStructure.cpp updated: 1.260 -> 1.261 DataStructureAA.cpp updated: 1.42 -> 1.43 DataStructureOpt.cpp updated: 1.18 -> 1.19 DataStructureStats.cpp updated: 1.27 -> 1.28 GraphChecker.cpp updated: 1.24 -> 1.25 Local.cpp updated: 1.169 -> 1.170 Printer.cpp updated: 1.93 -> 1.94 Steensgaard.cpp updated: 1.70 -> 1.71 TopDownClosure.cpp updated: 1.99 -> 1.100 --- Log message: Normalize Flag names and functions, also add a couple informative ones --- Diffs of the changes: (+74 -78) BottomUpClosure.cpp | 4 ++-- CallTargets.cpp | 4 ++-- DataStructure.cpp | 38 +++++++++++++++++--------------------- DataStructureAA.cpp | 12 ++++++------ DataStructureOpt.cpp | 6 +++--- DataStructureStats.cpp | 2 +- GraphChecker.cpp | 16 ++++++++-------- Local.cpp | 42 +++++++++++++++++++++--------------------- Printer.cpp | 16 ++++++++-------- Steensgaard.cpp | 10 +++++----- TopDownClosure.cpp | 2 +- 11 files changed, 74 insertions(+), 78 deletions(-) Index: llvm-poolalloc/lib/DSA/BottomUpClosure.cpp diff -u llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.131 llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.132 --- llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.131 Wed Apr 11 12:37:43 2007 +++ llvm-poolalloc/lib/DSA/BottomUpClosure.cpp Tue Apr 17 18:41:06 2007 @@ -133,7 +133,7 @@ if (CS.isDirectCall()) { if (isResolvableFunc(CS.getCalleeFunc())) Callees.push_back(CS.getCalleeFunc()); - } else if (!CS.getCalleeNode()->isIncomplete()) { + } else if (!CS.getCalleeNode()->isIncompleteNode()) { // Get all callees. unsigned OldSize = Callees.size(); CS.getCalleeNode()->addFullFunctionList(Callees); @@ -313,7 +313,7 @@ // Free should take a single pointer argument, mark it as heap memory. DSNodeHandle N(new DSNode(0, DSG)); - N.getNode()->setHeapNodeMarker(); + N.getNode()->setHeapMarker(); DSG->getNodeForValue(F->arg_begin()).mergeWith(N); } else { Index: llvm-poolalloc/lib/DSA/CallTargets.cpp diff -u llvm-poolalloc/lib/DSA/CallTargets.cpp:1.11 llvm-poolalloc/lib/DSA/CallTargets.cpp:1.12 --- llvm-poolalloc/lib/DSA/CallTargets.cpp:1.11 Fri Feb 23 16:49:32 2007 +++ llvm-poolalloc/lib/DSA/CallTargets.cpp Tue Apr 17 18:41:06 2007 @@ -53,11 +53,11 @@ DSNode* N = T->getDSGraph(*cs.getCaller()) .getNodeForValue(cs.getCalledValue()).getNode(); N->addFullFunctionList(IndMap[cs]); - if (N->isComplete() && IndMap[cs].size()) { + if (N->isCompleteNode() && IndMap[cs].size()) { CompleteSites.insert(cs); ++CompleteInd; } - if (N->isComplete() && !IndMap[cs].size()) { + if (N->isCompleteNode() && !IndMap[cs].size()) { ++CompleteEmpty; cerr << "Call site empty: '" << cs.getInstruction()->getName() Index: llvm-poolalloc/lib/DSA/DataStructure.cpp diff -u llvm-poolalloc/lib/DSA/DataStructure.cpp:1.260 llvm-poolalloc/lib/DSA/DataStructure.cpp:1.261 --- llvm-poolalloc/lib/DSA/DataStructure.cpp:1.260 Wed Apr 11 12:37:43 2007 +++ llvm-poolalloc/lib/DSA/DataStructure.cpp Tue Apr 17 18:41:06 2007 @@ -182,7 +182,7 @@ void DSNode::assertOK() const { assert((Ty != Type::VoidTy || Ty == Type::VoidTy && (Size == 0 || - (NodeType & DSNode::Array))) && + (NodeType & DSNode::ArrayNode))) && "Node not OK!"); assert(ParentGraph && "Node has no parent?"); @@ -203,7 +203,7 @@ assert((Offset < To->Size || (Offset == To->Size && Offset == 0)) && "Forwarded offset is wrong!"); ForwardNH.setTo(To, Offset); - NodeType = DEAD; + NodeType = DeadNode; Size = 0; Ty = Type::VoidTy; @@ -252,7 +252,7 @@ // If this node has a size that is <= 1, we don't need to create a forwarding // node. if (getSize() <= 1) { - NodeType |= DSNode::Array; + NodeType |= DSNode::ArrayNode; Ty = Type::VoidTy; Size = 1; assert(Links.size() <= 1 && "Size is 1, but has more links?"); @@ -262,7 +262,7 @@ // some referrers may have an offset that is > 0. By forcing them to // forward, the forwarder has the opportunity to correct the offset. DSNode *DestNode = new DSNode(0, ParentGraph); - DestNode->NodeType = NodeType|DSNode::Array; + DestNode->NodeType = NodeType|DSNode::ArrayNode; DestNode->Ty = Type::VoidTy; DestNode->Size = 1; DestNode->Globals.swap(Globals); @@ -535,8 +535,8 @@ } Ty = NewTy; - NodeType &= ~Array; - if (WillBeArray) NodeType |= Array; + NodeType &= ~ArrayNode; + if (WillBeArray) NodeType |= ArrayNode; Size = NewTySize; // Calculate the number of outgoing links from this node. @@ -632,8 +632,8 @@ const Type *OldTy = Ty; Ty = NewTy; - NodeType &= ~Array; - if (WillBeArray) NodeType |= Array; + NodeType &= ~ArrayNode; + if (WillBeArray) NodeType |= ArrayNode; Size = NewTySize; // Must grow links to be the appropriate size... @@ -1510,9 +1510,9 @@ if (GlobalValue *GV = dyn_cast(Ptr)) { N->addGlobal(GV); } else if (isa(Ptr)) { - N->setHeapNodeMarker(); + N->setHeapMarker(); } else if (isa(Ptr)) { - N->setAllocaNodeMarker(); + N->setAllocaMarker(); } else { assert(0 && "Illegal memory object input!"); } @@ -1535,9 +1535,9 @@ // Remove alloca or mod/ref bits as specified... unsigned BitsToClear = ((CloneFlags & StripAllocaBit)? DSNode::AllocaNode : 0) - | ((CloneFlags & StripModRefBits)? (DSNode::Modified | DSNode::Read) : 0) - | ((CloneFlags & StripIncompleteBit)? DSNode::Incomplete : 0); - BitsToClear |= DSNode::DEAD; // Clear dead flag... + | ((CloneFlags & StripModRefBits)? (DSNode::ModifiedNode | DSNode::ReadNode) : 0) + | ((CloneFlags & StripIncompleteBit)? DSNode::IncompleteNode : 0); + BitsToClear |= DSNode::DeadNode; // Clear dead flag... for (node_const_iterator I = G.node_begin(), E = G.node_end(); I != E; ++I) { assert(!I->isForwarding() && @@ -1545,10 +1545,6 @@ DSNode *New = new DSNode(*I, this); New->maskNodeTypes(~BitsToClear); OldNodeMap[I] = New; -#ifdef LLVA_KERNEL - if (G.getPoolForNode(&*I)) - PoolDescriptors[New] = G.getPoolForNode(&*I); -#endif } #ifndef NDEBUG @@ -1925,7 +1921,7 @@ // static void markIncompleteNode(DSNode *N) { // Stop recursion if no node, or if node already marked... - if (N == 0 || N->isIncomplete()) return; + if (N == 0 || N->isIncompleteNode()) return; // Actually mark the node N->setIncompleteMarker(); @@ -1999,7 +1995,7 @@ if (DSNode *N = Edge.getNode()) // Is there an edge? if (N->getNumReferrers() == 1) // Does it point to a lonely node? // No interesting info? - if ((N->getNodeFlags() & ~DSNode::Incomplete) == 0 && + if ((N->getNodeFlags() & ~DSNode::IncompleteNode) == 0 && N->getType() == Type::VoidTy && !N->isNodeCompletelyFolded()) Edge.setTo(0, 0); // Kill the edge! } @@ -2037,7 +2033,7 @@ // If the Callee is a useless edge, this must be an unreachable call site, // eliminate it. - if (Callee->getNumReferrers() == 1 && Callee->isComplete() && + if (Callee->getNumReferrers() == 1 && Callee->isCompleteNode() && Callee->getGlobalsList().empty()) { // No useful info? DOUT << "WARNING: Useless call site found.\n"; Calls.erase(OldIt); @@ -2213,7 +2209,7 @@ continue; } - if (Node.isComplete() && !Node.isModified() && !Node.isRead()) { + if (Node.isCompleteNode() && !Node.isModifiedNode() && !Node.isReadNode()) { // This is a useless node if it has no mod/ref info (checked above), // outgoing edges (which it cannot, as it is not modified in this // context), and it has no incoming edges. If it is a global node it may Index: llvm-poolalloc/lib/DSA/DataStructureAA.cpp diff -u llvm-poolalloc/lib/DSA/DataStructureAA.cpp:1.42 llvm-poolalloc/lib/DSA/DataStructureAA.cpp:1.43 --- llvm-poolalloc/lib/DSA/DataStructureAA.cpp:1.42 Fri Feb 23 16:49:32 2007 +++ llvm-poolalloc/lib/DSA/DataStructureAA.cpp Tue Apr 17 18:41:06 2007 @@ -143,7 +143,7 @@ return AliasAnalysis::alias(V1, V1Size, V2, V2Size); // We can only make a judgment if one of the nodes is complete. - if (N1->isComplete() || N2->isComplete()) { + if (N1->isCompleteNode() || N2->isCompleteNode()) { if (N1 != N2) return NoAlias; // Completely different nodes. @@ -197,9 +197,9 @@ // track of aggregate mod/ref info. bool NeverReads = true, NeverWrites = true; for (; Range.first != Range.second; ++Range.first) { - if (Range.first->second->isModified()) + if (Range.first->second->isModifiedNode()) NeverWrites = false; - if (Range.first->second->isRead()) + if (Range.first->second->isReadNode()) NeverReads = false; if (NeverReads == false && NeverWrites == false) return AliasAnalysis::getModRefInfo(CS, P, Size); @@ -240,7 +240,7 @@ // If we found a node and it's complete, it cannot be passed out to the // called function. - if (NI->second.getNode()->isComplete()) + if (NI->second.getNode()->isCompleteNode()) return NoModRef; return AliasAnalysis::getModRefInfo(CS, P, Size); } @@ -270,9 +270,9 @@ // Otherwise, if the node is only M or R, return this. This can be // useful for globals that should be marked const but are not. DSNode *N = NI->second.getNode(); - if (!N->isModified()) + if (!N->isModifiedNode()) Result = (ModRefResult)(Result & ~Mod); - if (!N->isRead()) + if (!N->isReadNode()) Result = (ModRefResult)(Result & ~Ref); } } Index: llvm-poolalloc/lib/DSA/DataStructureOpt.cpp diff -u llvm-poolalloc/lib/DSA/DataStructureOpt.cpp:1.18 llvm-poolalloc/lib/DSA/DataStructureOpt.cpp:1.19 --- llvm-poolalloc/lib/DSA/DataStructureOpt.cpp:1.18 Fri Feb 23 16:49:32 2007 +++ llvm-poolalloc/lib/DSA/DataStructureOpt.cpp Tue Apr 17 18:41:06 2007 @@ -76,11 +76,11 @@ I->replaceAllUsesWith(Constant::getNullValue((Type*)I->getType())); ++NumGlobalsIsolated; } - } else if (GNode && GNode->isComplete()) { + } else if (GNode && GNode->isCompleteNode()) { // If the node has not been read or written, and it is not externally // visible, kill any references to it so it can be DCE'd. - if (!GNode->isModified() && !GNode->isRead() &&I->hasInternalLinkage()){ + if (!GNode->isModifiedNode() && !GNode->isReadNode() &&I->hasInternalLinkage()){ if (!I->use_empty()) { I->replaceAllUsesWith(Constant::getNullValue((Type*)I->getType())); ++NumGlobalsIsolated; @@ -90,7 +90,7 @@ // We expect that there will almost always be a node for this global. // If there is, and the node doesn't have the M bit set, we can set the // 'constant' bit on the global. - if (!GNode->isModified() && !I->isConstant()) { + if (!GNode->isModifiedNode() && !I->isConstant()) { I->setConstant(true); ++NumGlobalsConstanted; Changed = true; Index: llvm-poolalloc/lib/DSA/DataStructureStats.cpp diff -u llvm-poolalloc/lib/DSA/DataStructureStats.cpp:1.27 llvm-poolalloc/lib/DSA/DataStructureStats.cpp:1.28 --- llvm-poolalloc/lib/DSA/DataStructureStats.cpp:1.27 Wed Jan 10 13:59:52 2007 +++ llvm-poolalloc/lib/DSA/DataStructureStats.cpp Tue Apr 17 18:41:06 2007 @@ -118,7 +118,7 @@ bool DSGraphStats::isNodeForValueCollapsed(Value *V) { if (DSNode *N = getNodeForValue(V)) - return N->isNodeCompletelyFolded() || N->isIncomplete(); + return N->isNodeCompletelyFolded() || N->isIncompleteNode(); return false; } Index: llvm-poolalloc/lib/DSA/GraphChecker.cpp diff -u llvm-poolalloc/lib/DSA/GraphChecker.cpp:1.24 llvm-poolalloc/lib/DSA/GraphChecker.cpp:1.25 --- llvm-poolalloc/lib/DSA/GraphChecker.cpp:1.24 Wed Dec 13 23:51:06 2006 +++ llvm-poolalloc/lib/DSA/GraphChecker.cpp Tue Apr 17 18:41:06 2007 @@ -150,14 +150,14 @@ unsigned Flags = 0; for (unsigned C = ColonPos+1; C != I->size(); ++C) switch ((*I)[C]) { - case 'S': Flags |= DSNode::AllocaNode; break; - case 'H': Flags |= DSNode::HeapNode; break; - case 'G': Flags |= DSNode::GlobalNode; break; - case 'U': Flags |= DSNode::UnknownNode; break; - case 'I': Flags |= DSNode::Incomplete; break; - case 'M': Flags |= DSNode::Modified; break; - case 'R': Flags |= DSNode::Read; break; - case 'A': Flags |= DSNode::Array; break; + case 'S': Flags |= DSNode::AllocaNode; break; + case 'H': Flags |= DSNode::HeapNode; break; + case 'G': Flags |= DSNode::GlobalNode; break; + case 'U': Flags |= DSNode::UnknownNode; break; + case 'I': Flags |= DSNode::IncompleteNode; break; + case 'M': Flags |= DSNode::ModifiedNode; break; + case 'R': Flags |= DSNode::ReadNode; break; + case 'A': Flags |= DSNode::ArrayNode; break; default: cerr << "Invalid DSNode flag!\n"; abort(); } CheckFlagsM[std::string(I->begin(), I->begin()+ColonPos)] = Flags; Index: llvm-poolalloc/lib/DSA/Local.cpp diff -u llvm-poolalloc/lib/DSA/Local.cpp:1.169 llvm-poolalloc/lib/DSA/Local.cpp:1.170 --- llvm-poolalloc/lib/DSA/Local.cpp:1.169 Wed Apr 11 12:37:43 2007 +++ llvm-poolalloc/lib/DSA/Local.cpp Tue Apr 17 18:41:06 2007 @@ -101,14 +101,14 @@ friend class InstVisitor; void visitMallocInst(MallocInst &MI) - { setDestTo(MI, createNode()->setHeapNodeMarker()); } + { setDestTo(MI, createNode()->setHeapMarker()); } void visitAllocaInst(AllocaInst &AI) - { setDestTo(AI, createNode()->setAllocaNodeMarker()); } + { setDestTo(AI, createNode()->setAllocaMarker()); } void visitFreeInst(FreeInst &FI) { if (DSNode *N = getValueDest(*FI.getOperand(0)).getNode()) - N->setHeapNodeMarker(); + N->setHeapMarker(); } //the simple ones @@ -208,14 +208,14 @@ if (isa(CE->getOperand(0)->getType())) NH = getValueDest(*CE->getOperand(0)); else - NH = createNode()->setUnknownNodeMarker(); + NH = createNode()->setUnknownMarker(); } else if (CE->getOpcode() == Instruction::GetElementPtr) { visitGetElementPtrInst(*CE); assert(G.hasNodeForValue(CE) && "GEP didn't get processed right?"); NH = G.getNodeForValue(CE); } else { // This returns a conservative unknown node for any unhandled ConstExpr - return NH = createNode()->setUnknownNodeMarker(); + return NH = createNode()->setUnknownMarker(); } if (NH.isNull()) { // (getelementptr null, X) returns null G.eraseNodeForValue(V); @@ -339,12 +339,12 @@ } void GraphBuilder::visitIntToPtrInst(IntToPtrInst &I) { - setDestTo(I, createNode()->setUnknownNodeMarker()); //->setIntToPtrMarker()); + setDestTo(I, createNode()->setUnknownMarker()->setIntToPtrMarker()); } void GraphBuilder::visitPtrToIntInst(PtrToIntInst& I) { -// if (DSNode* N = getValueDest(*I.getOperand(0)).getNode()) -// N->setPtrToIntMarker(); + if (DSNode* N = getValueDest(*I.getOperand(0)).getNode()) + N->setPtrToIntMarker(); } @@ -519,7 +519,7 @@ bool GraphBuilder::visitIntrinsic(CallSite CS, Function *F) { switch (F->getIntrinsicID()) { case Intrinsic::vastart: - getValueDest(*CS.getInstruction()).getNode()->setAllocaNodeMarker(); + getValueDest(*CS.getInstruction()).getNode()->setAllocaMarker(); return true; case Intrinsic::vacopy: getValueDest(*CS.getInstruction()). @@ -561,14 +561,14 @@ || F->getName() == "posix_memalign" || F->getName() == "memalign" || F->getName() == "valloc") { setDestTo(*CS.getInstruction(), - createNode()->setHeapNodeMarker()->setModifiedMarker()); + createNode()->setHeapMarker()->setModifiedMarker()); return true; } else if (F->getName() == "realloc") { DSNodeHandle RetNH = getValueDest(*CS.getInstruction()); if (CS.arg_begin() != CS.arg_end()) RetNH.mergeWith(getValueDest(**CS.arg_begin())); if (DSNode *N = RetNH.getNode()) - N->setHeapNodeMarker()->setModifiedMarker()->setReadMarker(); + N->setHeapMarker()->setModifiedMarker()->setReadMarker(); return true; } else if (F->getName() == "memmove") { // Merge the first & second arguments, and mark the memory read and @@ -581,7 +581,7 @@ } else if (F->getName() == "free") { // Mark that the node is written to... if (DSNode *N = getValueDest(**CS.arg_begin()).getNode()) - N->setModifiedMarker()->setHeapNodeMarker(); + N->setModifiedMarker()->setHeapMarker(); } else if (F->getName() == "atoi" || F->getName() == "atof" || F->getName() == "atol" || F->getName() == "atoll" || F->getName() == "remove" || F->getName() == "unlink" || @@ -669,7 +669,7 @@ // descriptor. Also, merge the allocated type into the node. DSNodeHandle Result = getValueDest(*CS.getInstruction()); if (DSNode *N = Result.getNode()) { - N->setModifiedMarker()->setUnknownNodeMarker(); + N->setModifiedMarker()->setUnknownMarker(); const Type *RetTy = F->getFunctionType()->getReturnType(); if (const PointerType *PTy = dyn_cast(RetTy)) N->mergeTypeInfo(PTy->getElementType(), Result.getOffset()); @@ -689,7 +689,7 @@ // file descriptor. It merges the FILE type into the descriptor. DSNodeHandle H = getValueDest(**CS.arg_begin()); if (DSNode *N = H.getNode()) { - N->setReadMarker()->setUnknownNodeMarker(); + N->setReadMarker()->setUnknownMarker(); const Type *ArgTy = F->getFunctionType()->getParamType(0); if (const PointerType *PTy = dyn_cast(ArgTy)) N->mergeTypeInfo(PTy->getElementType(), H.getOffset()); @@ -965,7 +965,7 @@ DSNodeHandle RetNH = getValueDest(*CS.getInstruction()); RetNH.mergeWith(getValueDest(**CS.arg_begin())); if (DSNode *N = RetNH.getNode()) - N->setHeapNodeMarker()->setModifiedMarker()->setReadMarker(); + N->setHeapMarker()->setModifiedMarker()->setReadMarker(); //and read second pointer if (DSNode *N = getValueDest(**(CS.arg_begin() + 1)).getNode()) N->setReadMarker(); @@ -976,7 +976,7 @@ DSNodeHandle RetNH = getValueDest(*CS.getInstruction()); RetNH.mergeWith(getValueDest(**CS.arg_begin())); if (DSNode *N = RetNH.getNode()) - N->setHeapNodeMarker()->setModifiedMarker(); + N->setHeapMarker()->setModifiedMarker(); //and read second pointer if (DSNode *N = getValueDest(**(CS.arg_begin() + 1)).getNode()) N->setReadMarker(); @@ -989,7 +989,7 @@ // Create a new DSNode for this memory allocation DSNode *N = createNode(); - N->setHeapNodeMarker(); + N->setHeapMarker(); setDestTo(*CS.getInstruction(), N); // Get the pool handle @@ -1051,7 +1051,7 @@ // Create a DSNode for the memory allocated by this function call DSNode *N = createNode(); - N->setHeapNodeMarker(); + N->setHeapMarker(); setDestTo(*CS.getInstruction(), N); // Get the pool handle, if possible @@ -1146,7 +1146,7 @@ // allocation functions if (AllocList.end() != std::find(AllocList.begin(), AllocList.end(), F->getName())) { setDestTo(*CS.getInstruction(), - createNode()->setHeapNodeMarker()->setModifiedMarker()); + createNode()->setHeapMarker()->setModifiedMarker()); return; } @@ -1156,7 +1156,7 @@ F->getName())) { // Mark that the node is written to... if (DSNode *N = getValueDest(*(CS.getArgument(0))).getNode()) - N->setModifiedMarker()->setHeapNodeMarker(); + N->setModifiedMarker()->setHeapMarker(); return; } @@ -1222,7 +1222,7 @@ CurNode.mergeWith(getValueDest(**I)); if (DSNode *N = CurNode.getNode()) - N->setUnknownNodeMarker(); + N->setUnknownMarker(); } Index: llvm-poolalloc/lib/DSA/Printer.cpp diff -u llvm-poolalloc/lib/DSA/Printer.cpp:1.93 llvm-poolalloc/lib/DSA/Printer.cpp:1.94 --- llvm-poolalloc/lib/DSA/Printer.cpp:1.93 Wed Jan 10 12:10:32 2007 +++ llvm-poolalloc/lib/DSA/Printer.cpp Tue Apr 17 18:41:06 2007 @@ -64,15 +64,15 @@ } if (unsigned NodeType = N->getNodeFlags()) { OS << ": "; - if (NodeType & DSNode::AllocaNode ) OS << "S"; - if (NodeType & DSNode::HeapNode ) OS << "H"; - if (NodeType & DSNode::GlobalNode ) OS << "G"; - if (NodeType & DSNode::UnknownNode) OS << "U"; - if (NodeType & DSNode::Incomplete ) OS << "I"; - if (NodeType & DSNode::Modified ) OS << "M"; - if (NodeType & DSNode::Read ) OS << "R"; + if (NodeType & DSNode::AllocaNode ) OS << "S"; + if (NodeType & DSNode::HeapNode ) OS << "H"; + if (NodeType & DSNode::GlobalNode ) OS << "G"; + if (NodeType & DSNode::UnknownNode ) OS << "U"; + if (NodeType & DSNode::IncompleteNode ) OS << "I"; + if (NodeType & DSNode::ModifiedNode ) OS << "M"; + if (NodeType & DSNode::ReadNode ) OS << "R"; #ifndef NDEBUG - if (NodeType & DSNode::DEAD ) OS << ""; + if (NodeType & DSNode::DeadNode ) OS << ""; #endif OS << "\n"; } Index: llvm-poolalloc/lib/DSA/Steensgaard.cpp diff -u llvm-poolalloc/lib/DSA/Steensgaard.cpp:1.70 llvm-poolalloc/lib/DSA/Steensgaard.cpp:1.71 --- llvm-poolalloc/lib/DSA/Steensgaard.cpp:1.70 Wed Apr 11 12:37:43 2007 +++ llvm-poolalloc/lib/DSA/Steensgaard.cpp Tue Apr 17 18:41:06 2007 @@ -212,8 +212,8 @@ // this. If one is complete and the other isn't, then they are obviously // different nodes. If they are both complete, we can't say anything // useful. - if (I->second.getNode()->isComplete() || - J->second.getNode()->isComplete()) { + if (I->second.getNode()->isCompleteNode() || + J->second.getNode()->isCompleteNode()) { // If the two pointers point to different data structure graph nodes, they // cannot alias! if (V1H.getNode() != V2H.getNode()) @@ -251,7 +251,7 @@ if (I != GSM.end() && !I->second.isNull()) { DSNode *N = I->second.getNode(); - if (N->isComplete()) { + if (N->isCompleteNode()) { // If this is a direct call to an external function, and if the pointer // points to a complete node, the external function cannot modify or read // the value (we know it's not passed out of the program!). @@ -261,9 +261,9 @@ // Otherwise, if the node is complete, but it is only M or R, return this. // This can be useful for globals that should be marked const but are not. - if (!N->isModified()) + if (!N->isModifiedNode()) Result = (ModRefResult)(Result & ~Mod); - if (!N->isRead()) + if (!N->isReadNode()) Result = (ModRefResult)(Result & ~Ref); } } Index: llvm-poolalloc/lib/DSA/TopDownClosure.cpp diff -u llvm-poolalloc/lib/DSA/TopDownClosure.cpp:1.99 llvm-poolalloc/lib/DSA/TopDownClosure.cpp:1.100 --- llvm-poolalloc/lib/DSA/TopDownClosure.cpp:1.99 Wed Apr 11 12:37:43 2007 +++ llvm-poolalloc/lib/DSA/TopDownClosure.cpp Tue Apr 17 18:41:06 2007 @@ -73,7 +73,7 @@ for (DSScalarMap::global_iterator I=GGSM.global_begin(), E=GGSM.global_end(); I != E; ++I) { DSNode *N = GGSM.find(*I)->second.getNode(); - if (N->isIncomplete()) + if (N->isIncompleteNode()) markReachableFunctionsExternallyAccessible(N, Visited); } From sabre at nondot.org Tue Apr 17 18:43:49 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 18:43:49 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/2007-04-17-lsr-crash.ll Message-ID: <200704172343.l3HNhnId027467@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: 2007-04-17-lsr-crash.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+35 -0) 2007-04-17-lsr-crash.ll | 35 +++++++++++++++++++++++++++++++++++ 1 files changed, 35 insertions(+) Index: llvm/test/CodeGen/Generic/2007-04-17-lsr-crash.ll diff -c /dev/null llvm/test/CodeGen/Generic/2007-04-17-lsr-crash.ll:1.1 *** /dev/null Tue Apr 17 18:43:41 2007 --- llvm/test/CodeGen/Generic/2007-04-17-lsr-crash.ll Tue Apr 17 18:43:31 2007 *************** *** 0 **** --- 1,35 ---- + ; RUN: llvm-as < %s | llc + + define void @foo(i32 %inTextSize) { + entry: + br label %bb236.outer + + cond_next193: ; preds = %bb236 + %tmp211 = add i32 %inTextSize_addr.1.ph17, -2 ; [#uses=1] + br i1 false, label %cond_next232, label %cond_true227 + + cond_true227: ; preds = %cond_next193 + ret void + + cond_next232: ; preds = %cond_next193 + %indvar.next49 = add i32 %indvar48, 1 ; [#uses=1] + br label %bb236.outer + + bb236.outer: ; preds = %cond_next232, %entry + %indvar48 = phi i32 [ %indvar.next49, %cond_next232 ], [ 0, %entry ] ; [#uses=2] + %inTextSize_addr.1.ph17 = phi i32 [ %tmp211, %cond_next232 ], [ %inTextSize, %entry ] ; [#uses=3] + %tmp.50 = sub i32 0, %indvar48 ; [#uses=1] + %tmp219 = icmp eq i32 %tmp.50, 0 ; [#uses=1] + br i1 %tmp219, label %bb236.us, label %bb236 + + bb236.us: ; preds = %bb236.outer + %inTextSize_addr.1.us = add i32 0, %inTextSize_addr.1.ph17 ; [#uses=0] + ret void + + bb236: ; preds = %bb236.outer + %tmp238 = icmp eq i32 %inTextSize_addr.1.ph17, 0 ; [#uses=1] + br i1 %tmp238, label %exit, label %cond_next193 + + exit: ; preds = %bb236 + ret void + } From sabre at nondot.org Tue Apr 17 18:44:08 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 18:44:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolutionExpander.cpp Message-ID: <200704172344.l3HNi8HC027483@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ScalarEvolutionExpander.cpp updated: 1.16 -> 1.17 --- Log message: Be more careful when inserting reused instructions. This fixes CodeGen/Generic/2007-04-17-lsr-crash.ll --- Diffs of the changes: (+7 -2) ScalarEvolutionExpander.cpp | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) Index: llvm/lib/Analysis/ScalarEvolutionExpander.cpp diff -u llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.16 llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.17 --- llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.16 Fri Apr 13 00:04:18 2007 +++ llvm/lib/Analysis/ScalarEvolutionExpander.cpp Tue Apr 17 18:43:50 2007 @@ -71,15 +71,20 @@ /// InsertBinop - Insert the specified binary operator, doing a small amount /// of work to avoid inserting an obviously redundant operation. Value *SCEVExpander::InsertBinop(Instruction::BinaryOps Opcode, Value *LHS, - Value *RHS, Instruction *InsertPt) { + Value *RHS, Instruction *&InsertPt) { // Do a quick scan to see if we have this binop nearby. If so, reuse it. unsigned ScanLimit = 6; for (BasicBlock::iterator IP = InsertPt, E = InsertPt->getParent()->begin(); ScanLimit; --IP, --ScanLimit) { if (BinaryOperator *BinOp = dyn_cast(IP)) if (BinOp->getOpcode() == Opcode && BinOp->getOperand(0) == LHS && - BinOp->getOperand(1) == RHS) + BinOp->getOperand(1) == RHS) { + // If we found the instruction *at* the insert point, insert later + // instructions after it. + if (BinOp == InsertPt) + InsertPt = ++IP; return BinOp; + } if (IP == E) break; } From clattner at apple.com Tue Apr 17 18:55:56 2007 From: clattner at apple.com (Chris Lattner) Date: Tue, 17 Apr 2007 16:55:56 -0700 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp In-Reply-To: <200704172338.l3HNcMY0027223@zion.cs.uiuc.edu> References: <200704172338.l3HNcMY0027223@zion.cs.uiuc.edu> Message-ID: > @@ -654,7 +654,7 @@ > Value *Align = ConstantInt::get(Type::Int32Ty,0); > Value* Opts[3] = {ArgVal, ElSize, Align}; > new CallInst(PAInfo.PoolInit, Opts, 3,"", TheCall); > - new CallInst(PAInfo.PoolDestroy, ArgVal, "", TheCall->getNext > ()); > + new CallInst(PAInfo.PoolDestroy, ArgVal, "", TheCall+1); > } FWIW, this isn't right: you are passing in a pointer past the call instruction :) -Chris From alenhar2 at cs.uiuc.edu Tue Apr 17 19:29:19 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 17 Apr 2007 19:29:19 -0500 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Message-ID: <200704180029.l3I0TJ8G028283@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: TransformFunctionBody.cpp updated: 1.63 -> 1.64 --- Log message: This is really really ugly --- Diffs of the changes: (+2 -1) TransformFunctionBody.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp diff -u llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.63 llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.64 --- llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.63 Tue Apr 17 18:38:04 2007 +++ llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Tue Apr 17 19:29:02 2007 @@ -654,7 +654,8 @@ Value *Align = ConstantInt::get(Type::Int32Ty,0); Value* Opts[3] = {ArgVal, ElSize, Align}; new CallInst(PAInfo.PoolInit, Opts, 3,"", TheCall); - new CallInst(PAInfo.PoolDestroy, ArgVal, "", TheCall+1); + BasicBlock::iterator BBI = TheCall; + new CallInst(PAInfo.PoolDestroy, ArgVal, "", ++BBI); } //probably need to update DSG // std::cerr << "WARNING: NULL POOL ARGUMENTS ARE PASSED IN!\n"; From evan.cheng at apple.com Tue Apr 17 19:36:28 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Apr 2007 19:36:28 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/PHIElimination.cpp Message-ID: <200704180036.l3I0aSwX028400@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: PHIElimination.cpp updated: 1.55 -> 1.56 --- Log message: Increment use count of new virtuals created during PHI elimination. --- Diffs of the changes: (+3 -0) PHIElimination.cpp | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/CodeGen/PHIElimination.cpp diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.55 llvm/lib/CodeGen/PHIElimination.cpp:1.56 --- llvm/lib/CodeGen/PHIElimination.cpp:1.55 Sun Mar 18 04:02:31 2007 +++ llvm/lib/CodeGen/PHIElimination.cpp Tue Apr 17 19:36:11 2007 @@ -138,6 +138,9 @@ if (LV) { MachineInstr *PHICopy = prior(AfterPHIsIt); + // Increment use count of the newly created virtual register. + LV->getVarInfo(IncomingReg).NumUses++; + // 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 From sabre at nondot.org Tue Apr 17 19:43:22 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 19:43:22 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/ScalarEvolutionExpander.h Message-ID: <200704180043.l3I0hM3X028571@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: ScalarEvolutionExpander.h updated: 1.14 -> 1.15 --- Log message: what's an & between friends? --- Diffs of the changes: (+1 -1) ScalarEvolutionExpander.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Analysis/ScalarEvolutionExpander.h diff -u llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.14 llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.15 --- llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.14 Fri Apr 13 00:04:18 2007 +++ llvm/include/llvm/Analysis/ScalarEvolutionExpander.h Tue Apr 17 19:43:05 2007 @@ -92,7 +92,7 @@ /// InsertBinop - Insert the specified binary operator, doing a small amount /// of work to avoid inserting an obviously redundant operation. static Value *InsertBinop(Instruction::BinaryOps Opcode, Value *LHS, - Value *RHS, Instruction *InsertPt); + Value *RHS, Instruction *&InsertPt); protected: Value *expand(SCEV *S) { // Check to see if we already expanded this. From dpatel at apple.com Tue Apr 17 19:52:00 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 17 Apr 2007 19:52:00 -0500 Subject: [llvm-commits] CVS: llvm/test/Analysis/Dominators/2007-04-17-PostDominanceFrontier.ll Message-ID: <200704180052.l3I0q0WR028748@zion.cs.uiuc.edu> Changes in directory llvm/test/Analysis/Dominators: 2007-04-17-PostDominanceFrontier.ll added (r1.1) --- Log message: New test. --- Diffs of the changes: (+692 -0) 2007-04-17-PostDominanceFrontier.ll | 692 ++++++++++++++++++++++++++++++++++++ 1 files changed, 692 insertions(+) Index: llvm/test/Analysis/Dominators/2007-04-17-PostDominanceFrontier.ll diff -c /dev/null llvm/test/Analysis/Dominators/2007-04-17-PostDominanceFrontier.ll:1.1 *** /dev/null Tue Apr 17 19:51:53 2007 --- llvm/test/Analysis/Dominators/2007-04-17-PostDominanceFrontier.ll Tue Apr 17 19:51:43 2007 *************** *** 0 **** --- 1,692 ---- + ; RUN: llvm-upgrade < %s | llvm-as | opt -postdomfrontier -disable-output + + void @SManager() { + entry: + br label %bb.outer + + bb.outer: ; preds = %bb193, %entry + br label %bb.outer156 + + bb.loopexit: ; preds = %bb442 + br label %bb.outer156 + + bb.outer156: ; preds = %bb.loopexit, %bb.outer + br label %bb + + bb: ; preds = %bb.backedge, %bb.outer156 + br i1 false, label %cond_true, label %bb.cond_next_crit_edge + + bb.cond_next_crit_edge: ; preds = %bb + br label %cond_next + + cond_true: ; preds = %bb + br label %cond_next + + cond_next: ; preds = %cond_true, %bb.cond_next_crit_edge + br i1 false, label %cond_next.bb.backedge_crit_edge, label %cond_next107 + + cond_next.bb.backedge_crit_edge: ; preds = %cond_next + br label %bb.backedge + + bb.backedge: ; preds = %cond_true112.bb.backedge_crit_edge, %cond_next.bb.backedge_crit_edge + br label %bb + + cond_next107: ; preds = %cond_next + br i1 false, label %cond_true112, label %cond_next197 + + cond_true112: ; preds = %cond_next107 + br i1 false, label %cond_true118, label %cond_true112.bb.backedge_crit_edge + + cond_true112.bb.backedge_crit_edge: ; preds = %cond_true112 + br label %bb.backedge + + cond_true118: ; preds = %cond_true112 + br i1 false, label %bb123.preheader, label %cond_true118.bb148_crit_edge + + cond_true118.bb148_crit_edge: ; preds = %cond_true118 + br label %bb148 + + bb123.preheader: ; preds = %cond_true118 + br label %bb123 + + bb123: ; preds = %bb142.bb123_crit_edge, %bb123.preheader + br i1 false, label %bb123.bb142_crit_edge, label %cond_next.i57 + + bb123.bb142_crit_edge: ; preds = %bb123 + br label %bb142 + + cond_next.i57: ; preds = %bb123 + br i1 false, label %cond_true135, label %cond_next.i57.bb142_crit_edge + + cond_next.i57.bb142_crit_edge: ; preds = %cond_next.i57 + br label %bb142 + + cond_true135: ; preds = %cond_next.i57 + br label %bb142 + + bb142: ; preds = %cond_true135, %cond_next.i57.bb142_crit_edge, %bb123.bb142_crit_edge + br i1 false, label %bb148.loopexit, label %bb142.bb123_crit_edge + + bb142.bb123_crit_edge: ; preds = %bb142 + br label %bb123 + + bb148.loopexit: ; preds = %bb142 + br label %bb148 + + bb148: ; preds = %bb148.loopexit, %cond_true118.bb148_crit_edge + br i1 false, label %bb151.preheader, label %bb148.bb177_crit_edge + + bb148.bb177_crit_edge: ; preds = %bb148 + br label %bb177 + + bb151.preheader: ; preds = %bb148 + br label %bb151 + + bb151: ; preds = %bb171.bb151_crit_edge, %bb151.preheader + br i1 false, label %bb151.bb171_crit_edge, label %cond_next.i49 + + bb151.bb171_crit_edge: ; preds = %bb151 + br label %bb171 + + cond_next.i49: ; preds = %bb151 + br i1 false, label %cond_true164, label %cond_next.i49.bb171_crit_edge + + cond_next.i49.bb171_crit_edge: ; preds = %cond_next.i49 + br label %bb171 + + cond_true164: ; preds = %cond_next.i49 + br label %bb171 + + bb171: ; preds = %cond_true164, %cond_next.i49.bb171_crit_edge, %bb151.bb171_crit_edge + br i1 false, label %bb177.loopexit, label %bb171.bb151_crit_edge + + bb171.bb151_crit_edge: ; preds = %bb171 + br label %bb151 + + bb177.loopexit: ; preds = %bb171 + br label %bb177 + + bb177: ; preds = %bb177.loopexit, %bb148.bb177_crit_edge + br i1 false, label %bb180.preheader, label %bb177.bb193_crit_edge + + bb177.bb193_crit_edge: ; preds = %bb177 + br label %bb193 + + bb180.preheader: ; preds = %bb177 + br label %bb180 + + bb180: ; preds = %bb180.bb180_crit_edge, %bb180.preheader + br i1 false, label %bb193.loopexit, label %bb180.bb180_crit_edge + + bb180.bb180_crit_edge: ; preds = %bb180 + br label %bb180 + + bb193.loopexit: ; preds = %bb180 + br label %bb193 + + bb193: ; preds = %bb193.loopexit, %bb177.bb193_crit_edge + br label %bb.outer + + cond_next197: ; preds = %cond_next107 + br i1 false, label %cond_next210, label %cond_true205 + + cond_true205: ; preds = %cond_next197 + br i1 false, label %cond_true205.bb213_crit_edge, label %cond_true205.bb299_crit_edge + + cond_true205.bb299_crit_edge: ; preds = %cond_true205 + br label %bb299 + + cond_true205.bb213_crit_edge: ; preds = %cond_true205 + br label %bb213 + + cond_next210: ; preds = %cond_next197 + br label %bb293 + + bb213: ; preds = %bb293.bb213_crit_edge, %cond_true205.bb213_crit_edge + br i1 false, label %bb213.cond_next290_crit_edge, label %cond_true248 + + bb213.cond_next290_crit_edge: ; preds = %bb213 + br label %cond_next290 + + cond_true248: ; preds = %bb213 + br i1 false, label %cond_true248.cond_next290_crit_edge, label %cond_true255 + + cond_true248.cond_next290_crit_edge: ; preds = %cond_true248 + br label %cond_next290 + + cond_true255: ; preds = %cond_true248 + br i1 false, label %cond_true266, label %cond_true255.cond_next271_crit_edge + + cond_true255.cond_next271_crit_edge: ; preds = %cond_true255 + br label %cond_next271 + + cond_true266: ; preds = %cond_true255 + br label %cond_next271 + + cond_next271: ; preds = %cond_true266, %cond_true255.cond_next271_crit_edge + br label %cond_next290 + + cond_next290: ; preds = %cond_next271, %cond_true248.cond_next290_crit_edge, %bb213.cond_next290_crit_edge + br label %bb293 + + bb293: ; preds = %cond_next290, %cond_next210 + br i1 false, label %bb293.bb213_crit_edge, label %bb293.bb299_crit_edge + + bb293.bb299_crit_edge: ; preds = %bb293 + br label %bb299 + + bb293.bb213_crit_edge: ; preds = %bb293 + br label %bb213 + + bb299: ; preds = %bb293.bb299_crit_edge, %cond_true205.bb299_crit_edge + br i1 false, label %bb302.preheader, label %bb299.bb390_crit_edge + + bb299.bb390_crit_edge: ; preds = %bb299 + br label %bb390 + + bb302.preheader: ; preds = %bb299 + br label %bb302 + + bb302: ; preds = %bb384.bb302_crit_edge, %bb302.preheader + br i1 false, label %bb302.bb384_crit_edge, label %cond_true339 + + bb302.bb384_crit_edge: ; preds = %bb302 + br label %bb384 + + cond_true339: ; preds = %bb302 + br i1 false, label %cond_true339.bb384_crit_edge, label %cond_true346 + + cond_true339.bb384_crit_edge: ; preds = %cond_true339 + br label %bb384 + + cond_true346: ; preds = %cond_true339 + br i1 false, label %cond_true357, label %cond_true346.cond_next361_crit_edge + + cond_true346.cond_next361_crit_edge: ; preds = %cond_true346 + br label %cond_next361 + + cond_true357: ; preds = %cond_true346 + br label %cond_next361 + + cond_next361: ; preds = %cond_true357, %cond_true346.cond_next361_crit_edge + br label %bb384 + + bb384: ; preds = %cond_next361, %cond_true339.bb384_crit_edge, %bb302.bb384_crit_edge + br i1 false, label %bb390.loopexit, label %bb384.bb302_crit_edge + + bb384.bb302_crit_edge: ; preds = %bb384 + br label %bb302 + + bb390.loopexit: ; preds = %bb384 + br label %bb390 + + bb390: ; preds = %bb390.loopexit, %bb299.bb390_crit_edge + br i1 false, label %bb391.preheader, label %bb390.bb442.preheader_crit_edge + + bb390.bb442.preheader_crit_edge: ; preds = %bb390 + br label %bb442.preheader + + bb391.preheader: ; preds = %bb390 + br label %bb391 + + bb391: ; preds = %bb413.bb391_crit_edge, %bb391.preheader + br i1 false, label %bb391.bb413_crit_edge, label %cond_next404 + + bb391.bb413_crit_edge: ; preds = %bb391 + br label %bb413 + + cond_next404: ; preds = %bb391 + br i1 false, label %cond_next404.HWrite.exit_crit_edge, label %cond_next.i13 + + cond_next404.HWrite.exit_crit_edge: ; preds = %cond_next404 + br label %HWrite.exit + + cond_next.i13: ; preds = %cond_next404 + br i1 false, label %cond_next.i13.cond_next13.i_crit_edge, label %cond_true12.i + + cond_next.i13.cond_next13.i_crit_edge: ; preds = %cond_next.i13 + br label %cond_next13.i + + cond_true12.i: ; preds = %cond_next.i13 + br label %cond_next13.i + + cond_next13.i: ; preds = %cond_true12.i, %cond_next.i13.cond_next13.i_crit_edge + br i1 false, label %cond_next13.i.bb.i22_crit_edge, label %cond_next43.i + + cond_next13.i.bb.i22_crit_edge: ; preds = %cond_next13.i + br label %bb.i22 + + cond_next43.i: ; preds = %cond_next13.i + br i1 false, label %cond_next43.i.bb.i22_crit_edge, label %bb60.i + + cond_next43.i.bb.i22_crit_edge: ; preds = %cond_next43.i + br label %bb.i22 + + bb.i22: ; preds = %cond_next43.i.bb.i22_crit_edge, %cond_next13.i.bb.i22_crit_edge + br label %bb413 + + bb60.i: ; preds = %cond_next43.i + br i1 false, label %bb60.i.HWrite.exit_crit_edge, label %cond_true81.i + + bb60.i.HWrite.exit_crit_edge: ; preds = %bb60.i + br label %HWrite.exit + + cond_true81.i: ; preds = %bb60.i + br label %bb413 + + HWrite.exit: ; preds = %bb60.i.HWrite.exit_crit_edge, %cond_next404.HWrite.exit_crit_edge + br label %bb413 + + bb413: ; preds = %HWrite.exit, %cond_true81.i, %bb.i22, %bb391.bb413_crit_edge + br i1 false, label %bb442.preheader.loopexit, label %bb413.bb391_crit_edge + + bb413.bb391_crit_edge: ; preds = %bb413 + br label %bb391 + + bb442.preheader.loopexit: ; preds = %bb413 + br label %bb442.preheader + + bb442.preheader: ; preds = %bb442.preheader.loopexit, %bb390.bb442.preheader_crit_edge + br label %bb442.outer + + bb420: ; preds = %bb442 + br i1 false, label %bb439.loopexit, label %cond_next433 + + cond_next433: ; preds = %bb420 + br i1 false, label %cond_next433.HRead.exit.loopexit_crit_edge, label %cond_next.i + + cond_next433.HRead.exit.loopexit_crit_edge: ; preds = %cond_next433 + br label %HRead.exit.loopexit + + cond_next.i: ; preds = %cond_next433 + br i1 false, label %cond_true9.i, label %cond_false223.i + + cond_true9.i: ; preds = %cond_next.i + switch i32 0, label %cond_false.i [ + i32 1, label %cond_true9.i.cond_true15.i_crit_edge + i32 5, label %cond_true9.i.cond_true15.i_crit_edge9 + ] + + cond_true9.i.cond_true15.i_crit_edge9: ; preds = %cond_true9.i + br label %cond_true15.i + + cond_true9.i.cond_true15.i_crit_edge: ; preds = %cond_true9.i + br label %cond_true15.i + + cond_true15.i: ; preds = %cond_true9.i.cond_true15.i_crit_edge, %cond_true9.i.cond_true15.i_crit_edge9 + br i1 false, label %cond_true15.i.cond_true44.i_crit_edge, label %cond_true15.i.cond_false49.i_crit_edge + + cond_true15.i.cond_false49.i_crit_edge: ; preds = %cond_true15.i + br label %cond_false49.i + + cond_true15.i.cond_true44.i_crit_edge: ; preds = %cond_true15.i + br label %cond_true44.i + + cond_false.i: ; preds = %cond_true9.i + br i1 false, label %cond_false.i.cond_next39.i_crit_edge, label %cond_true30.i + + cond_false.i.cond_next39.i_crit_edge: ; preds = %cond_false.i + br label %cond_next39.i + + cond_true30.i: ; preds = %cond_false.i + br label %cond_next39.i + + cond_next39.i: ; preds = %cond_true30.i, %cond_false.i.cond_next39.i_crit_edge + br i1 false, label %cond_next39.i.cond_true44.i_crit_edge, label %cond_next39.i.cond_false49.i_crit_edge + + cond_next39.i.cond_false49.i_crit_edge: ; preds = %cond_next39.i + br label %cond_false49.i + + cond_next39.i.cond_true44.i_crit_edge: ; preds = %cond_next39.i + br label %cond_true44.i + + cond_true44.i: ; preds = %cond_next39.i.cond_true44.i_crit_edge, %cond_true15.i.cond_true44.i_crit_edge + br i1 false, label %cond_true44.i.cond_next70.i_crit_edge, label %cond_true44.i.cond_true61.i_crit_edge + + cond_true44.i.cond_true61.i_crit_edge: ; preds = %cond_true44.i + br label %cond_true61.i + + cond_true44.i.cond_next70.i_crit_edge: ; preds = %cond_true44.i + br label %cond_next70.i + + cond_false49.i: ; preds = %cond_next39.i.cond_false49.i_crit_edge, %cond_true15.i.cond_false49.i_crit_edge + br i1 false, label %cond_false49.i.cond_next70.i_crit_edge, label %cond_false49.i.cond_true61.i_crit_edge + + cond_false49.i.cond_true61.i_crit_edge: ; preds = %cond_false49.i + br label %cond_true61.i + + cond_false49.i.cond_next70.i_crit_edge: ; preds = %cond_false49.i + br label %cond_next70.i + + cond_true61.i: ; preds = %cond_false49.i.cond_true61.i_crit_edge, %cond_true44.i.cond_true61.i_crit_edge + br i1 false, label %cond_true61.i.cond_next70.i_crit_edge, label %cond_true67.i + + cond_true61.i.cond_next70.i_crit_edge: ; preds = %cond_true61.i + br label %cond_next70.i + + cond_true67.i: ; preds = %cond_true61.i + br label %cond_next70.i + + cond_next70.i: ; preds = %cond_true67.i, %cond_true61.i.cond_next70.i_crit_edge, %cond_false49.i.cond_next70.i_crit_edge, %cond_true44.i.cond_next70.i_crit_edge + br i1 false, label %cond_true77.i, label %cond_next81.i + + cond_true77.i: ; preds = %cond_next70.i + br label %bb442.outer.backedge + + cond_next81.i: ; preds = %cond_next70.i + br i1 false, label %cond_true87.i, label %cond_false94.i + + cond_true87.i: ; preds = %cond_next81.i + br i1 false, label %cond_true87.i.cond_true130.i_crit_edge, label %cond_true87.i.cond_next135.i_crit_edge + + cond_true87.i.cond_next135.i_crit_edge: ; preds = %cond_true87.i + br label %cond_next135.i + + cond_true87.i.cond_true130.i_crit_edge: ; preds = %cond_true87.i + br label %cond_true130.i + + cond_false94.i: ; preds = %cond_next81.i + switch i32 0, label %cond_false94.i.cond_next125.i_crit_edge [ + i32 1, label %cond_false94.i.cond_true100.i_crit_edge + i32 5, label %cond_false94.i.cond_true100.i_crit_edge10 + ] + + cond_false94.i.cond_true100.i_crit_edge10: ; preds = %cond_false94.i + br label %cond_true100.i + + cond_false94.i.cond_true100.i_crit_edge: ; preds = %cond_false94.i + br label %cond_true100.i + + cond_false94.i.cond_next125.i_crit_edge: ; preds = %cond_false94.i + br label %cond_next125.i + + cond_true100.i: ; preds = %cond_false94.i.cond_true100.i_crit_edge, %cond_false94.i.cond_true100.i_crit_edge10 + br i1 false, label %cond_true107.i, label %cond_true100.i.cond_next109.i_crit_edge + + cond_true100.i.cond_next109.i_crit_edge: ; preds = %cond_true100.i + br label %cond_next109.i + + cond_true107.i: ; preds = %cond_true100.i + br label %cond_next109.i + + cond_next109.i: ; preds = %cond_true107.i, %cond_true100.i.cond_next109.i_crit_edge + br i1 false, label %cond_next109.i.cond_next125.i_crit_edge, label %cond_true116.i + + cond_next109.i.cond_next125.i_crit_edge: ; preds = %cond_next109.i + br label %cond_next125.i + + cond_true116.i: ; preds = %cond_next109.i + br label %cond_next125.i + + cond_next125.i: ; preds = %cond_true116.i, %cond_next109.i.cond_next125.i_crit_edge, %cond_false94.i.cond_next125.i_crit_edge + br i1 false, label %cond_next125.i.cond_true130.i_crit_edge, label %cond_next125.i.cond_next135.i_crit_edge + + cond_next125.i.cond_next135.i_crit_edge: ; preds = %cond_next125.i + br label %cond_next135.i + + cond_next125.i.cond_true130.i_crit_edge: ; preds = %cond_next125.i + br label %cond_true130.i + + cond_true130.i: ; preds = %cond_next125.i.cond_true130.i_crit_edge, %cond_true87.i.cond_true130.i_crit_edge + br label %cond_next135.i + + cond_next135.i: ; preds = %cond_true130.i, %cond_next125.i.cond_next135.i_crit_edge, %cond_true87.i.cond_next135.i_crit_edge + br i1 false, label %cond_true142.i, label %cond_next135.i.cond_next149.i_crit_edge + + cond_next135.i.cond_next149.i_crit_edge: ; preds = %cond_next135.i + br label %cond_next149.i + + cond_true142.i: ; preds = %cond_next135.i + br label %cond_next149.i + + cond_next149.i: ; preds = %cond_true142.i, %cond_next135.i.cond_next149.i_crit_edge + br i1 false, label %cond_true156.i, label %cond_next149.i.cond_next163.i_crit_edge + + cond_next149.i.cond_next163.i_crit_edge: ; preds = %cond_next149.i + br label %cond_next163.i + + cond_true156.i: ; preds = %cond_next149.i + br label %cond_next163.i + + cond_next163.i: ; preds = %cond_true156.i, %cond_next149.i.cond_next163.i_crit_edge + br i1 false, label %cond_true182.i, label %cond_next163.i.cond_next380.i_crit_edge + + cond_next163.i.cond_next380.i_crit_edge: ; preds = %cond_next163.i + br label %cond_next380.i + + cond_true182.i: ; preds = %cond_next163.i + br i1 false, label %cond_true182.i.cond_next380.i_crit_edge, label %cond_true196.i + + cond_true182.i.cond_next380.i_crit_edge: ; preds = %cond_true182.i + br label %cond_next380.i + + cond_true196.i: ; preds = %cond_true182.i + br i1 false, label %cond_true210.i, label %cond_true196.i.cond_next380.i_crit_edge + + cond_true196.i.cond_next380.i_crit_edge: ; preds = %cond_true196.i + br label %cond_next380.i + + cond_true210.i: ; preds = %cond_true196.i + br i1 false, label %cond_true216.i, label %cond_true210.i.cond_next380.i_crit_edge + + cond_true210.i.cond_next380.i_crit_edge: ; preds = %cond_true210.i + br label %cond_next380.i + + cond_true216.i: ; preds = %cond_true210.i + br label %cond_next380.i + + cond_false223.i: ; preds = %cond_next.i + br i1 false, label %cond_true229.i, label %cond_false355.i + + cond_true229.i: ; preds = %cond_false223.i + br i1 false, label %cond_true229.i.HRead.exit.loopexit_crit_edge, label %cond_next243.i + + cond_true229.i.HRead.exit.loopexit_crit_edge: ; preds = %cond_true229.i + br label %HRead.exit.loopexit + + cond_next243.i: ; preds = %cond_true229.i + br i1 false, label %cond_true248.i, label %cond_false255.i + + cond_true248.i: ; preds = %cond_next243.i + br label %cond_next260.i + + cond_false255.i: ; preds = %cond_next243.i + br label %cond_next260.i + + cond_next260.i: ; preds = %cond_false255.i, %cond_true248.i + br i1 false, label %cond_true267.i, label %cond_next273.i + + cond_true267.i: ; preds = %cond_next260.i + br label %bb442.backedge + + bb442.backedge: ; preds = %bb.i, %cond_true267.i + br label %bb442 + + cond_next273.i: ; preds = %cond_next260.i + br i1 false, label %cond_true281.i, label %cond_next273.i.cond_next288.i_crit_edge + + cond_next273.i.cond_next288.i_crit_edge: ; preds = %cond_next273.i + br label %cond_next288.i + + cond_true281.i: ; preds = %cond_next273.i + br label %cond_next288.i + + cond_next288.i: ; preds = %cond_true281.i, %cond_next273.i.cond_next288.i_crit_edge + br i1 false, label %cond_true295.i, label %cond_next288.i.cond_next302.i_crit_edge + + cond_next288.i.cond_next302.i_crit_edge: ; preds = %cond_next288.i + br label %cond_next302.i + + cond_true295.i: ; preds = %cond_next288.i + br label %cond_next302.i + + cond_next302.i: ; preds = %cond_true295.i, %cond_next288.i.cond_next302.i_crit_edge + br i1 false, label %cond_next302.i.cond_next380.i_crit_edge, label %cond_true328.i + + cond_next302.i.cond_next380.i_crit_edge: ; preds = %cond_next302.i + br label %cond_next380.i + + cond_true328.i: ; preds = %cond_next302.i + br i1 false, label %cond_true343.i, label %cond_true328.i.cond_next380.i_crit_edge + + cond_true328.i.cond_next380.i_crit_edge: ; preds = %cond_true328.i + br label %cond_next380.i + + cond_true343.i: ; preds = %cond_true328.i + br i1 false, label %cond_true349.i, label %cond_true343.i.cond_next380.i_crit_edge + + cond_true343.i.cond_next380.i_crit_edge: ; preds = %cond_true343.i + br label %cond_next380.i + + cond_true349.i: ; preds = %cond_true343.i + br label %cond_next380.i + + cond_false355.i: ; preds = %cond_false223.i + br i1 false, label %cond_false355.i.bb.i_crit_edge, label %cond_next363.i + + cond_false355.i.bb.i_crit_edge: ; preds = %cond_false355.i + br label %bb.i + + cond_next363.i: ; preds = %cond_false355.i + br i1 false, label %bb377.i, label %cond_next363.i.bb.i_crit_edge + + cond_next363.i.bb.i_crit_edge: ; preds = %cond_next363.i + br label %bb.i + + bb.i: ; preds = %cond_next363.i.bb.i_crit_edge, %cond_false355.i.bb.i_crit_edge + br label %bb442.backedge + + bb377.i: ; preds = %cond_next363.i + br label %cond_next380.i + + cond_next380.i: ; preds = %bb377.i, %cond_true349.i, %cond_true343.i.cond_next380.i_crit_edge, %cond_true328.i.cond_next380.i_crit_edge, %cond_next302.i.cond_next380.i_crit_edge, %cond_true216.i, %cond_true210.i.cond_next380.i_crit_edge, %cond_true196.i.cond_next380.i_crit_edge, %cond_true182.i.cond_next380.i_crit_edge, %cond_next163.i.cond_next380.i_crit_edge + br i1 false, label %cond_next380.i.HRead.exit_crit_edge, label %cond_true391.i + + cond_next380.i.HRead.exit_crit_edge: ; preds = %cond_next380.i + br label %HRead.exit + + cond_true391.i: ; preds = %cond_next380.i + br label %bb442.outer.backedge + + bb442.outer.backedge: ; preds = %bb439, %cond_true391.i, %cond_true77.i + br label %bb442.outer + + HRead.exit.loopexit: ; preds = %cond_true229.i.HRead.exit.loopexit_crit_edge, %cond_next433.HRead.exit.loopexit_crit_edge + br label %HRead.exit + + HRead.exit: ; preds = %HRead.exit.loopexit, %cond_next380.i.HRead.exit_crit_edge + br label %bb439 + + bb439.loopexit: ; preds = %bb420 + br label %bb439 + + bb439: ; preds = %bb439.loopexit, %HRead.exit + br label %bb442.outer.backedge + + bb442.outer: ; preds = %bb442.outer.backedge, %bb442.preheader + br label %bb442 + + bb442: ; preds = %bb442.outer, %bb442.backedge + br i1 false, label %bb420, label %bb.loopexit + } + + void @Invalidate() { + entry: + br i1 false, label %cond_false, label %cond_true + + cond_true: ; preds = %entry + br i1 false, label %cond_true40, label %cond_true.cond_next_crit_edge + + cond_true.cond_next_crit_edge: ; preds = %cond_true + br label %cond_next + + cond_true40: ; preds = %cond_true + br label %cond_next + + cond_next: ; preds = %cond_true40, %cond_true.cond_next_crit_edge + br i1 false, label %cond_true68, label %cond_next.cond_next73_crit_edge + + cond_next.cond_next73_crit_edge: ; preds = %cond_next + br label %cond_next73 + + cond_true68: ; preds = %cond_next + br label %cond_next73 + + cond_next73: ; preds = %cond_true68, %cond_next.cond_next73_crit_edge + br i1 false, label %cond_true91, label %cond_next73.cond_next96_crit_edge + + cond_next73.cond_next96_crit_edge: ; preds = %cond_next73 + br label %cond_next96 + + cond_true91: ; preds = %cond_next73 + br label %cond_next96 + + cond_next96: ; preds = %cond_true91, %cond_next73.cond_next96_crit_edge + br i1 false, label %cond_next96.cond_next112_crit_edge, label %cond_true105 + + cond_next96.cond_next112_crit_edge: ; preds = %cond_next96 + br label %cond_next112 + + cond_true105: ; preds = %cond_next96 + br label %cond_next112 + + cond_next112: ; preds = %cond_true105, %cond_next96.cond_next112_crit_edge + br i1 false, label %cond_next112.cond_next127_crit_edge, label %cond_true119 + + cond_next112.cond_next127_crit_edge: ; preds = %cond_next112 + br label %cond_next127 + + cond_true119: ; preds = %cond_next112 + br label %cond_next127 + + cond_next127: ; preds = %cond_true119, %cond_next112.cond_next127_crit_edge + br i1 false, label %cond_next141, label %cond_true134 + + cond_true134: ; preds = %cond_next127 + br i1 false, label %cond_true134.bb161_crit_edge, label %cond_true134.bb_crit_edge + + cond_true134.bb_crit_edge: ; preds = %cond_true134 + br label %bb + + cond_true134.bb161_crit_edge: ; preds = %cond_true134 + br label %bb161 + + cond_next141: ; preds = %cond_next127 + br label %bb154 + + bb: ; preds = %bb154.bb_crit_edge, %cond_true134.bb_crit_edge + br label %bb154 + + bb154: ; preds = %bb, %cond_next141 + br i1 false, label %bb154.bb161_crit_edge, label %bb154.bb_crit_edge + + bb154.bb_crit_edge: ; preds = %bb154 + br label %bb + + bb154.bb161_crit_edge: ; preds = %bb154 + br label %bb161 + + bb161: ; preds = %bb154.bb161_crit_edge, %cond_true134.bb161_crit_edge + br i1 false, label %bb161.cond_next201_crit_edge, label %cond_true198 + + bb161.cond_next201_crit_edge: ; preds = %bb161 + br label %cond_next201 + + cond_true198: ; preds = %bb161 + br label %cond_next201 + + cond_next201: ; preds = %cond_true198, %bb161.cond_next201_crit_edge + br i1 false, label %cond_next212, label %cond_true206 + + cond_true206: ; preds = %cond_next201 + br label %UnifiedReturnBlock + + cond_false: ; preds = %entry + br label %UnifiedReturnBlock + + cond_next212: ; preds = %cond_next201 + br label %UnifiedReturnBlock + + UnifiedReturnBlock: ; preds = %cond_next212, %cond_false, %cond_true206 + ret void + } From dpatel at apple.com Tue Apr 17 19:53:18 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 17 Apr 2007 19:53:18 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/PostDominators.cpp Message-ID: <200704180053.l3I0rIGb028793@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: PostDominators.cpp updated: 1.65 -> 1.66 --- Log message: Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070416/047971.html --- Diffs of the changes: (+1 -1) PostDominators.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Analysis/PostDominators.cpp diff -u llvm/lib/Analysis/PostDominators.cpp:1.65 llvm/lib/Analysis/PostDominators.cpp:1.66 --- llvm/lib/Analysis/PostDominators.cpp:1.65 Sun Apr 15 18:14:18 2007 +++ llvm/lib/Analysis/PostDominators.cpp Tue Apr 17 19:53:01 2007 @@ -284,7 +284,7 @@ for (pred_iterator SI = pred_begin(BB), SE = pred_end(BB); SI != SE; ++SI) // Does Node immediately dominate this predecessor? - if (DT[*SI]->getIDom() != Node) + if (DT[*SI] && DT[*SI]->getIDom() != Node) S.insert(*SI); // At this point, S is DFlocal. Now we union in DFup's of our children... From reid at x10sys.com Tue Apr 17 19:54:07 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 17 Apr 2007 19:54:07 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/bit_set.c bit_set.reference_output bit_set_cpp.cpp bit_set_cpp.reference_output constval.cpp constval.reference_output arith.c array.c bigint.c bit_concat.c bit_concat_cpp.cpp bit_select.c bit_select_cpp.cpp bitbit.c bitlogic.c bits.h cppfield2.cpp matrix.c part_select.c part_select_cpp.cpp part_select_cpp.reference_output arith.h array.h bigint.h bitbit.h bitlogic.h matrix.h Message-ID: <200704180054.l3I0s7p5028858@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: bit_set.c added (r1.1) bit_set.reference_output added (r1.1) bit_set_cpp.cpp added (r1.1) bit_set_cpp.reference_output added (r1.1) constval.cpp added (r1.1) constval.reference_output added (r1.1) arith.c updated: 1.8 -> 1.9 array.c updated: 1.6 -> 1.7 bigint.c updated: 1.6 -> 1.7 bit_concat.c updated: 1.3 -> 1.4 bit_concat_cpp.cpp updated: 1.2 -> 1.3 bit_select.c updated: 1.3 -> 1.4 bit_select_cpp.cpp updated: 1.1 -> 1.2 bitbit.c updated: 1.6 -> 1.7 bitlogic.c updated: 1.6 -> 1.7 bits.h updated: 1.1 -> 1.2 cppfield2.cpp updated: 1.1 -> 1.2 matrix.c updated: 1.8 -> 1.9 part_select.c updated: 1.3 -> 1.4 part_select_cpp.cpp updated: 1.1 -> 1.2 part_select_cpp.reference_output updated: 1.1 -> 1.2 arith.h (r1.1) removed array.h (r1.1) removed bigint.h (r1.1) removed bitbit.h (r1.1) removed bitlogic.h (r1.1) removed matrix.h (r1.2) removed --- Log message: Clean this test suite up. Remove unnecessary header files. Make all the bit tests use standard typenaming conventions and macros for builtins. Add more tests for other bit manipulation intrinsics. --- Diffs of the changes: (+329 -121) arith.c | 2 array.c | 2 bigint.c | 3 - bit_concat.c | 10 ++-- bit_concat_cpp.cpp | 6 +- bit_select.c | 6 +- bit_select_cpp.cpp | 2 bit_set.c | 37 +++++++++++++++ bit_set.reference_output | 49 ++++++++++++++++++++ bit_set_cpp.cpp | 34 +++++++++++++ bit_set_cpp.reference_output | 49 ++++++++++++++++++++ bitbit.c | 2 bitlogic.c | 2 bits.h | 58 +++++++++++++++-------- constval.cpp | 28 +++++++++++ constval.reference_output | 3 + cppfield2.cpp | 13 ++--- matrix.c | 2 part_select.c | 20 ++------ part_select_cpp.cpp | 27 ++++------- part_select_cpp.reference_output | 95 +++++++++++++++++++-------------------- 21 files changed, 329 insertions(+), 121 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/bit_set.c diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/bit_set.c:1.1 *** /dev/null Tue Apr 17 19:54:00 2007 --- llvm-test/SingleSource/UnitTests/Integer/bit_set.c Tue Apr 17 19:53:49 2007 *************** *** 0 **** --- 1,37 ---- + //===--- bit_select.c --- Test The bit_select builtin ---------------------===// + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This test case tests the __builtin_bit_select builtin function llvm-gcc. + // bit_select selects one bit out of a larger + // + //===----------------------------------------------------------------------===// + + #include + #include "bits.h" + + #ifdef ENABLE_LARGE_INTEGERS + typedef uint250 BitType; + BitType X = 0; + #else + typedef uint47 BitType; + BitType X = 0; + #endif + + int main(int argc, char** argv) + { + + int i; + + printBits(X); + printf("\n"); + for (i = bitwidthof(BitType); i > 0; --i) { + X = bit_set(X, 1, i-1); + printBits(X); + printf("\n"); + } + return 0; + } Index: llvm-test/SingleSource/UnitTests/Integer/bit_set.reference_output diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/bit_set.reference_output:1.1 *** /dev/null Tue Apr 17 19:54:07 2007 --- llvm-test/SingleSource/UnitTests/Integer/bit_set.reference_output Tue Apr 17 19:53:49 2007 *************** *** 0 **** --- 1,49 ---- + 00000000000000000000000000000000000000000000000 + 10000000000000000000000000000000000000000000000 + 11000000000000000000000000000000000000000000000 + 11100000000000000000000000000000000000000000000 + 11110000000000000000000000000000000000000000000 + 11111000000000000000000000000000000000000000000 + 11111100000000000000000000000000000000000000000 + 11111110000000000000000000000000000000000000000 + 11111111000000000000000000000000000000000000000 + 11111111100000000000000000000000000000000000000 + 11111111110000000000000000000000000000000000000 + 11111111111000000000000000000000000000000000000 + 11111111111100000000000000000000000000000000000 + 11111111111110000000000000000000000000000000000 + 11111111111111000000000000000000000000000000000 + 11111111111111100000000000000000000000000000000 + 11111111111111110000000000000000000000000000000 + 11111111111111111000000000000000000000000000000 + 11111111111111111100000000000000000000000000000 + 11111111111111111110000000000000000000000000000 + 11111111111111111111000000000000000000000000000 + 11111111111111111111100000000000000000000000000 + 11111111111111111111110000000000000000000000000 + 11111111111111111111111000000000000000000000000 + 11111111111111111111111100000000000000000000000 + 11111111111111111111111110000000000000000000000 + 11111111111111111111111111000000000000000000000 + 11111111111111111111111111100000000000000000000 + 11111111111111111111111111110000000000000000000 + 11111111111111111111111111111000000000000000000 + 11111111111111111111111111111100000000000000000 + 11111111111111111111111111111110000000000000000 + 11111111111111111111111111111111000000000000000 + 11111111111111111111111111111111100000000000000 + 11111111111111111111111111111111110000000000000 + 11111111111111111111111111111111111000000000000 + 11111111111111111111111111111111111100000000000 + 11111111111111111111111111111111111110000000000 + 11111111111111111111111111111111111111000000000 + 11111111111111111111111111111111111111100000000 + 11111111111111111111111111111111111111110000000 + 11111111111111111111111111111111111111111000000 + 11111111111111111111111111111111111111111100000 + 11111111111111111111111111111111111111111110000 + 11111111111111111111111111111111111111111111000 + 11111111111111111111111111111111111111111111100 + 11111111111111111111111111111111111111111111110 + 11111111111111111111111111111111111111111111111 + exit 0 Index: llvm-test/SingleSource/UnitTests/Integer/bit_set_cpp.cpp diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/bit_set_cpp.cpp:1.1 *** /dev/null Tue Apr 17 19:54:07 2007 --- llvm-test/SingleSource/UnitTests/Integer/bit_set_cpp.cpp Tue Apr 17 19:53:49 2007 *************** *** 0 **** --- 1,34 ---- + //===--- bit_select.c --- Test The bit_select builtin ---------------------===// + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This test case tests the __builtin_bit_select builtin function llvm-gcc. + // bit_select selects one bit out of a larger + // + //===----------------------------------------------------------------------===// + + #include + #include "bits.h" + + #ifdef ENABLE_LARGE_INTEGERS + typedef uint250 BitType; + BitType X = 0; + #else + typedef uint47 BitType; + BitType X = 0; + #endif + + int main(int argc, char** argv) + { + printBits(X); + printf("\n"); + for (int i = bitwidthof(BitType); i > 0; --i) { + X = bit_set(X, 1, i-1); + printBits(X); + printf("\n"); + } + return 0; + } Index: llvm-test/SingleSource/UnitTests/Integer/bit_set_cpp.reference_output diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/bit_set_cpp.reference_output:1.1 *** /dev/null Tue Apr 17 19:54:07 2007 --- llvm-test/SingleSource/UnitTests/Integer/bit_set_cpp.reference_output Tue Apr 17 19:53:49 2007 *************** *** 0 **** --- 1,49 ---- + 00000000000000000000000000000000000000000000000 + 10000000000000000000000000000000000000000000000 + 11000000000000000000000000000000000000000000000 + 11100000000000000000000000000000000000000000000 + 11110000000000000000000000000000000000000000000 + 11111000000000000000000000000000000000000000000 + 11111100000000000000000000000000000000000000000 + 11111110000000000000000000000000000000000000000 + 11111111000000000000000000000000000000000000000 + 11111111100000000000000000000000000000000000000 + 11111111110000000000000000000000000000000000000 + 11111111111000000000000000000000000000000000000 + 11111111111100000000000000000000000000000000000 + 11111111111110000000000000000000000000000000000 + 11111111111111000000000000000000000000000000000 + 11111111111111100000000000000000000000000000000 + 11111111111111110000000000000000000000000000000 + 11111111111111111000000000000000000000000000000 + 11111111111111111100000000000000000000000000000 + 11111111111111111110000000000000000000000000000 + 11111111111111111111000000000000000000000000000 + 11111111111111111111100000000000000000000000000 + 11111111111111111111110000000000000000000000000 + 11111111111111111111111000000000000000000000000 + 11111111111111111111111100000000000000000000000 + 11111111111111111111111110000000000000000000000 + 11111111111111111111111111000000000000000000000 + 11111111111111111111111111100000000000000000000 + 11111111111111111111111111110000000000000000000 + 11111111111111111111111111111000000000000000000 + 11111111111111111111111111111100000000000000000 + 11111111111111111111111111111110000000000000000 + 11111111111111111111111111111111000000000000000 + 11111111111111111111111111111111100000000000000 + 11111111111111111111111111111111110000000000000 + 11111111111111111111111111111111111000000000000 + 11111111111111111111111111111111111100000000000 + 11111111111111111111111111111111111110000000000 + 11111111111111111111111111111111111111000000000 + 11111111111111111111111111111111111111100000000 + 11111111111111111111111111111111111111110000000 + 11111111111111111111111111111111111111111000000 + 11111111111111111111111111111111111111111100000 + 11111111111111111111111111111111111111111110000 + 11111111111111111111111111111111111111111111000 + 11111111111111111111111111111111111111111111100 + 11111111111111111111111111111111111111111111110 + 11111111111111111111111111111111111111111111111 + exit 0 Index: llvm-test/SingleSource/UnitTests/Integer/constval.cpp diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/constval.cpp:1.1 *** /dev/null Tue Apr 17 19:54:07 2007 --- llvm-test/SingleSource/UnitTests/Integer/constval.cpp Tue Apr 17 19:53:49 2007 *************** *** 0 **** --- 1,28 ---- + //===--- constval.c - Test constant APInt values --------------------------===// + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This is a general test parsing constant APInt values + // + //===----------------------------------------------------------------------===// + + #include "bits.h" + #include + + void my_test() + { + uint21 x = bitsFromString("123456", 21); + uint16 y = bitsFromString("123456", 16); + printf( "x = %d\n", int(x)); + printf( "y = %d\n", int(y)); + } + + int main(int argc, char** argv) + { + my_test(); + return 0; + } + Index: llvm-test/SingleSource/UnitTests/Integer/constval.reference_output diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/constval.reference_output:1.1 *** /dev/null Tue Apr 17 19:54:07 2007 --- llvm-test/SingleSource/UnitTests/Integer/constval.reference_output Tue Apr 17 19:53:49 2007 *************** *** 0 **** --- 1,3 ---- + x = 123456 + y = 57920 + exit 0 Index: llvm-test/SingleSource/UnitTests/Integer/arith.c diff -u llvm-test/SingleSource/UnitTests/Integer/arith.c:1.8 llvm-test/SingleSource/UnitTests/Integer/arith.c:1.9 --- llvm-test/SingleSource/UnitTests/Integer/arith.c:1.8 Fri Jan 26 21:02:13 2007 +++ llvm-test/SingleSource/UnitTests/Integer/arith.c Tue Apr 17 19:53:49 2007 @@ -9,7 +9,7 @@ // //===----------------------------------------------------------------------===// -#include "arith.h" +#include "bits.h" #include Index: llvm-test/SingleSource/UnitTests/Integer/array.c diff -u llvm-test/SingleSource/UnitTests/Integer/array.c:1.6 llvm-test/SingleSource/UnitTests/Integer/array.c:1.7 --- llvm-test/SingleSource/UnitTests/Integer/array.c:1.6 Mon Jan 22 18:17:21 2007 +++ llvm-test/SingleSource/UnitTests/Integer/array.c Tue Apr 17 19:53:49 2007 @@ -9,7 +9,7 @@ // //===----------------------------------------------------------------------===// -#include "array.h" +#include "bits.h" #include typedef enum bool{false=0, true=1} bool; Index: llvm-test/SingleSource/UnitTests/Integer/bigint.c diff -u llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.6 llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.7 --- llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.6 Mon Jan 22 18:17:21 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bigint.c Tue Apr 17 19:53:49 2007 @@ -8,7 +8,8 @@ // This is a general test for big integer type. // //===----------------------------------------------------------------------===// -#include "bigint.h" + +#include "bits.h" #include typedef enum bool{false=0, true=1} bool; Index: llvm-test/SingleSource/UnitTests/Integer/bit_concat.c diff -u llvm-test/SingleSource/UnitTests/Integer/bit_concat.c:1.3 llvm-test/SingleSource/UnitTests/Integer/bit_concat.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/bit_concat.c:1.3 Tue Apr 17 18:12:36 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bit_concat.c Tue Apr 17 19:53:49 2007 @@ -17,9 +17,9 @@ int main(int argc, char** argv) { - Int17 X = 0; - Int19 Y = 0; - Int36 Z = 0; + uint17 X = 0; + uint19 Y = 0; + uint36 Z = 0; int i, j; int count = (argc > 1 ? atoi(argv[1]) % 128 : 128); @@ -27,11 +27,11 @@ for (i = 0; i < count; i++) { Y = X = 0; - for (j = 0; j < bitwidthof(Int17); j++) { + for (j = 0; j < bitwidthof(uint17); j++) { X <<= 1; X += (rand() % 2 == 0 ? 0 : 1); } - for (j = 0; j < bitwidthof(Int19); j++) { + for (j = 0; j < bitwidthof(uint19); j++) { Y <<= 1; Y += (rand() % 2 == 0 ? 0 : 1); } Index: llvm-test/SingleSource/UnitTests/Integer/bit_concat_cpp.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/bit_concat_cpp.cpp:1.2 llvm-test/SingleSource/UnitTests/Integer/bit_concat_cpp.cpp:1.3 --- llvm-test/SingleSource/UnitTests/Integer/bit_concat_cpp.cpp:1.2 Tue Apr 17 18:12:36 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bit_concat_cpp.cpp Tue Apr 17 19:53:49 2007 @@ -18,9 +18,9 @@ { int count = (argc > 1 ? atoi(argv[1]) % 128 : 128); - Int17 X = 0; - Int19 Y = 0; - Int36 Z = 0; + uint17 X = 0; + uint19 Y = 0; + uint36 Z = 0; srand(count); Index: llvm-test/SingleSource/UnitTests/Integer/bit_select.c diff -u llvm-test/SingleSource/UnitTests/Integer/bit_select.c:1.3 llvm-test/SingleSource/UnitTests/Integer/bit_select.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/bit_select.c:1.3 Tue Apr 17 18:18:07 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bit_select.c Tue Apr 17 19:53:49 2007 @@ -11,13 +11,13 @@ //===----------------------------------------------------------------------===// #include -#include +#include "bits.h" #ifdef ENABLE_LARGE_INTEGERS -typedef Int250 BitType; +typedef uint250 BitType; const BitType X = 0xAAAAAAAAAAAAAAAAULL; #else -typedef Int47 BitType; +typedef uint47 BitType; const BitType X = 0xAAAAAAAAAAAAULL; #endif Index: llvm-test/SingleSource/UnitTests/Integer/bit_select_cpp.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/bit_select_cpp.cpp:1.1 llvm-test/SingleSource/UnitTests/Integer/bit_select_cpp.cpp:1.2 --- llvm-test/SingleSource/UnitTests/Integer/bit_select_cpp.cpp:1.1 Wed Mar 28 11:31:50 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bit_select_cpp.cpp Tue Apr 17 19:53:49 2007 @@ -34,7 +34,7 @@ BitType i; for (i = numbits-1; i >= 0; --i) { - if (__builtin_bit_select(Y, i)) + if (__builtin_bit_select(&Y, i)) printf("1"); else printf("0"); Index: llvm-test/SingleSource/UnitTests/Integer/bitbit.c diff -u llvm-test/SingleSource/UnitTests/Integer/bitbit.c:1.6 llvm-test/SingleSource/UnitTests/Integer/bitbit.c:1.7 --- llvm-test/SingleSource/UnitTests/Integer/bitbit.c:1.6 Mon Jan 22 18:17:21 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bitbit.c Tue Apr 17 19:53:49 2007 @@ -9,7 +9,7 @@ // //===----------------------------------------------------------------------===// -#include "bitbit.h" +#include "bits.h" #include Index: llvm-test/SingleSource/UnitTests/Integer/bitlogic.c diff -u llvm-test/SingleSource/UnitTests/Integer/bitlogic.c:1.6 llvm-test/SingleSource/UnitTests/Integer/bitlogic.c:1.7 --- llvm-test/SingleSource/UnitTests/Integer/bitlogic.c:1.6 Mon Jan 22 18:17:21 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bitlogic.c Tue Apr 17 19:53:49 2007 @@ -9,7 +9,7 @@ // //===----------------------------------------------------------------------===// -#include "bitlogic.h" +#include "bits.h" #include Index: llvm-test/SingleSource/UnitTests/Integer/bits.h diff -u llvm-test/SingleSource/UnitTests/Integer/bits.h:1.1 llvm-test/SingleSource/UnitTests/Integer/bits.h:1.2 --- llvm-test/SingleSource/UnitTests/Integer/bits.h:1.1 Tue Apr 17 18:10:20 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bits.h Tue Apr 17 19:53:49 2007 @@ -13,25 +13,38 @@ #include #include -typedef unsigned int __attribute__((bitwidth(1))) Int1; -typedef unsigned int __attribute__((bitwidth(2))) Int2; -typedef unsigned int __attribute__((bitwidth(3))) Int3; -typedef unsigned int __attribute__((bitwidth(4))) Int4; -typedef unsigned int __attribute__((bitwidth(5))) Int5; -typedef unsigned int __attribute__((bitwidth(6))) Int6; -typedef unsigned int __attribute__((bitwidth(7))) Int7; -typedef unsigned int __attribute__((bitwidth(8))) Int8; -typedef unsigned int __attribute__((bitwidth(16))) Int16; -typedef unsigned int __attribute__((bitwidth(17))) Int17; -typedef unsigned int __attribute__((bitwidth(19))) Int19; -typedef unsigned int __attribute__((bitwidth(17))) Int32; -typedef unsigned int __attribute__((bitwidth(36))) Int36; -typedef unsigned int __attribute__((bitwidth(47))) Int47; -typedef unsigned int __attribute__((bitwidth(48))) Int48; -typedef unsigned int __attribute__((bitwidth(64))) Int64; -typedef unsigned int __attribute__((bitwidth(65))) Int65; -typedef unsigned int __attribute__((bitwidth(128))) Int128; -/*typedef unsigned int __attribute__((bitwidth(256))) Int256; */ +typedef unsigned int __attribute__((bitwidth(1))) uint1; +typedef unsigned int __attribute__((bitwidth(2))) uint2; +typedef unsigned int __attribute__((bitwidth(3))) uint3; +typedef unsigned int __attribute__((bitwidth(4))) uint4; +typedef unsigned int __attribute__((bitwidth(5))) uint5; +typedef unsigned int __attribute__((bitwidth(6))) uint6; +typedef unsigned int __attribute__((bitwidth(7))) uint7; +typedef unsigned int __attribute__((bitwidth(8))) uint8; +typedef unsigned int __attribute__((bitwidth(9))) uint9; +typedef unsigned int __attribute__((bitwidth(10))) uint10; +typedef unsigned int __attribute__((bitwidth(16))) uint16; +typedef unsigned int __attribute__((bitwidth(17))) uint17; +typedef unsigned int __attribute__((bitwidth(19))) uint19; +typedef unsigned int __attribute__((bitwidth(21))) uint21; +typedef unsigned int __attribute__((bitwidth(17))) uint32; +typedef unsigned int __attribute__((bitwidth(36))) uint36; +typedef unsigned int __attribute__((bitwidth(47))) uint47; +typedef unsigned int __attribute__((bitwidth(48))) uint48; +typedef unsigned int __attribute__((bitwidth(64))) uint64; +typedef unsigned int __attribute__((bitwidth(65))) uint65; +typedef unsigned int __attribute__((bitwidth(128))) uint128; + +typedef int __attribute__ ((bitwidth(9))) int9; +typedef int __attribute__((bitwidth(10))) int10; +typedef int __attribute__((bitwidth(21))) int21; +typedef int __attribute__((bitwidth(24))) int24; +typedef int __attribute__((bitwidth(32))) int32; +typedef int __attribute__((bitwidth(33))) int33; + +typedef int __attribute__((bitwidth(169))) int169; +typedef unsigned int __attribute__((bitwidth(250))) Int250; +typedef unsigned int __attribute__((bitwidth(256))) Int256; #define bitwidthof(TORV) (__bitwidthof__(typeof(TORV))) @@ -52,7 +65,7 @@ typeof(Val) Result = 0; \ typeof(Val) Val2 = Val; \ typeof(Repl) Repl2 = Repl; \ - __builtin_bit_set(&Result, &Val2, &Repl, Bit); \ + __builtin_bit_set(&Result, &Val2, &Repl2, Bit); \ Result; \ }) @@ -87,3 +100,8 @@ } \ } +#define bitsFromString(str,bits) ({ \ + int __attribute__((bitwidth(bits))) Result; \ + __builtin_bit_from_string(&Result, str, 10); \ + Result; \ +}) Index: llvm-test/SingleSource/UnitTests/Integer/cppfield2.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/cppfield2.cpp:1.1 llvm-test/SingleSource/UnitTests/Integer/cppfield2.cpp:1.2 --- llvm-test/SingleSource/UnitTests/Integer/cppfield2.cpp:1.1 Mon Jan 29 18:48:44 2007 +++ llvm-test/SingleSource/UnitTests/Integer/cppfield2.cpp Tue Apr 17 19:53:49 2007 @@ -10,11 +10,8 @@ #include +#include "bits.h" -typedef unsigned char __attribute__ ((bitwidth(7))) int7; -typedef unsigned int __attribute__ ((bitwidth(17))) int17; -typedef unsigned int __attribute__ ((bitwidth(32))) int32; -typedef unsigned int __attribute__ ((bitwidth(8))) int8; class bitFieldStruct { public: @@ -26,10 +23,10 @@ class bitAccurateStruct { public: - int32 i; - int7 c : 7; - int17 s : 17; - int8 c2; + uint32 i; + uint7 c : 7; + uint17 s : 17; + uint8 c2; }; int main() Index: llvm-test/SingleSource/UnitTests/Integer/matrix.c diff -u llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.8 llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.9 --- llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.8 Thu Jan 25 21:10:17 2007 +++ llvm-test/SingleSource/UnitTests/Integer/matrix.c Tue Apr 17 19:53:49 2007 @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// -#include "matrix.h" +#include "bits.h" #include #include Index: llvm-test/SingleSource/UnitTests/Integer/part_select.c diff -u llvm-test/SingleSource/UnitTests/Integer/part_select.c:1.3 llvm-test/SingleSource/UnitTests/Integer/part_select.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/part_select.c:1.3 Mon Feb 12 17:17:34 2007 +++ llvm-test/SingleSource/UnitTests/Integer/part_select.c Tue Apr 17 19:53:49 2007 @@ -13,15 +13,14 @@ #include #include #include +#include "bits.h" #ifdef ENABLE_LARGE_INTEGERS -typedef unsigned __attribute__((bitwidth(256))) BitType; +typedef uint256 BitType; const BitType X = 0xFEDCBA9876543210ULL; -unsigned numbits = 256; #else -typedef unsigned __attribute__((bitwidth(47))) BitType; +typedef uint47 BitType; const BitType X = 0xFEDCBA9876543210ULL; -unsigned numbits = 47; #endif int main(int argc, char** argv) @@ -37,17 +36,12 @@ unsigned i, j; - for (i = 0; i < numbits; ++i) { - BitType left = rand() % numbits; + for (i = 0; i < bitwidthof(BitType); ++i) { + BitType left = rand() % bitwidthof(BitType); BitType right = i; printf("part_select(Y, %3u, %3u) = ", (unsigned)left, (unsigned)right); - BitType Z = __builtin_bit_part_select(Y, left, right); - for (j = numbits; j > 0; --j) { - if (__builtin_bit_select(Z, j-1)) - printf("1"); - else - printf("0"); - } + BitType Z = part_select(Y, right, left ); + printBits(Z); uint64_t val = Z; printf(" (%lx)", val); printf("\n"); Index: llvm-test/SingleSource/UnitTests/Integer/part_select_cpp.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/part_select_cpp.cpp:1.1 llvm-test/SingleSource/UnitTests/Integer/part_select_cpp.cpp:1.2 --- llvm-test/SingleSource/UnitTests/Integer/part_select_cpp.cpp:1.1 Wed Mar 28 11:31:50 2007 +++ llvm-test/SingleSource/UnitTests/Integer/part_select_cpp.cpp Tue Apr 17 19:53:49 2007 @@ -13,15 +13,14 @@ #include #include #include +#include "bits.h" #ifdef ENABLE_LARGE_INTEGERS -typedef unsigned __attribute__((bitwidth(256))) BitType; +typedef uint256 BitType; const BitType X = 0xFEDCBA9876543210ULL; -unsigned numbits = 256; #else -typedef unsigned __attribute__((bitwidth(47))) BitType; +typedef uint47 BitType; const BitType X = 0xFEDCBA9876543210ULL; -unsigned numbits = 47; #endif int main(int argc, char** argv) @@ -37,19 +36,17 @@ unsigned i, j; - for (i = 0; i < numbits; ++i) { - BitType left = rand() % numbits; + printf("Selecting bits from: "); + printBits(X); + printf("\n"); + for (i = 0; i < bitwidthof(BitType); ++i) { + BitType left = rand() % bitwidthof(BitType); BitType right = i; - printf("part_select(Y, %3u, %3u) = ", (unsigned)left, (unsigned)right); - BitType Z = __builtin_bit_part_select(Y, left, right); - for (j = numbits; j > 0; --j) { - if (__builtin_bit_select(Z, j-1)) - printf("1"); - else - printf("0"); - } + printf("part_select(Y,%3u,%3u) = ", (unsigned)right, (unsigned)left); + BitType Z = part_select(Y, right, left); + printBits(Z); uint64_t val = Z; - printf(" (%lx)", val); + printf(" (%llx)", val); printf("\n"); } Index: llvm-test/SingleSource/UnitTests/Integer/part_select_cpp.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/part_select_cpp.reference_output:1.1 llvm-test/SingleSource/UnitTests/Integer/part_select_cpp.reference_output:1.2 --- llvm-test/SingleSource/UnitTests/Integer/part_select_cpp.reference_output:1.1 Wed Mar 28 11:31:50 2007 +++ llvm-test/SingleSource/UnitTests/Integer/part_select_cpp.reference_output Tue Apr 17 19:53:49 2007 @@ -1,48 +1,49 @@ -part_select(Y, 38, 0) = 00000000001100001110110010101000011001000010000 (76543210) -part_select(Y, 4, 1) = 00000000000000000000000000000000000000000001000 (8) -part_select(Y, 18, 2) = 00000000000000000000000000000010000110010000100 (10c84) -part_select(Y, 23, 3) = 00000000000000000000000000010101000011001000010 (a8642) -part_select(Y, 17, 4) = 00000000000000000000000000000000000001100100001 (321) -part_select(Y, 26, 5) = 00000000000000000000000001100101010000110010000 (32a190) -part_select(Y, 16, 6) = 00000000000000000000000000000000000000011001000 (c8) -part_select(Y, 3, 7) = 00000000000000000000000000000000000000000001000 (8) -part_select(Y, 28, 8) = 00000000000000000000000000101100101010000110010 (165432) -part_select(Y, 28, 9) = 00000000000000000000000000010110010101000011001 (b2a19) -part_select(Y, 10, 10) = 00000000000000000000000000000000000000000000000 (0) -part_select(Y, 17, 11) = 00000000000000000000000000000000000000000000110 (6) -part_select(Y, 44, 12) = 00000000000000110101001100001110110010101000011 (a9876543) -part_select(Y, 28, 13) = 00000000000000000000000000000001011001010100001 (b2a1) -part_select(Y, 2, 14) = 00000000000000000000000000000000000010000100110 (426) -part_select(Y, 20, 15) = 00000000000000000000000000000000000000000101000 (28) -part_select(Y, 22, 16) = 00000000000000000000000000000000000000001010100 (54) -part_select(Y, 21, 17) = 00000000000000000000000000000000000000000001010 (a) -part_select(Y, 18, 18) = 00000000000000000000000000000000000000000000001 (1) -part_select(Y, 36, 19) = 00000000000000000000000000000110000111011001010 (30eca) -part_select(Y, 34, 20) = 00000000000000000000000000000000000011101100101 (765) -part_select(Y, 37, 21) = 00000000000000000000000000000001100001110110010 (c3b2) -part_select(Y, 18, 22) = 00000000000000000000000000000000000000000010101 (15) -part_select(Y, 38, 23) = 00000000000000000000000000000000011000011101100 (30ec) -part_select(Y, 20, 24) = 00000000000000000000000000000000000000000010100 (14) -part_select(Y, 1, 25) = 00000000000000000000000001000010011000010101001 (2130a9) -part_select(Y, 31, 26) = 00000000000000000000000000000000000000000011101 (1d) -part_select(Y, 17, 27) = 00000000000000000000000000000000000001010100110 (2a6) -part_select(Y, 20, 28) = 00000000000000000000000000000000000000101001101 (14d) -part_select(Y, 6, 29) = 00000000000000000000000000100110000101010011011 (130a9b) -part_select(Y, 27, 30) = 00000000000000000000000000000000000000000000111 (7) -part_select(Y, 37, 31) = 00000000000000000000000000000000000000000110000 (30) -part_select(Y, 11, 32) = 00000000000000000000000000110000101010011011100 (1854dc) -part_select(Y, 24, 33) = 00000000000000000000000000000000000000110111000 (1b8) -part_select(Y, 39, 34) = 00000000000000000000000000000000000000000100110 (26) -part_select(Y, 7, 35) = 00000000000000000000100110000101010011011100001 (4c2a6e1) -part_select(Y, 3, 36) = 00000000000000100001001100001010100110111000011 (9854dc3) -part_select(Y, 9, 37) = 00000000000000000010011000010101001101110000110 (130a9b86) -part_select(Y, 36, 38) = 00000000000000000000000000000000000000000000100 (4) -part_select(Y, 31, 39) = 00000000000000000000000000000000000000000011001 (19) -part_select(Y, 16, 40) = 00000000000000000000000010101001101110000110010 (54dc32) -part_select(Y, 46, 41) = 00000000000000000000000000000000000000000011101 (1d) -part_select(Y, 27, 42) = 00000000000000000000000000000000111000011001010 (70ca) -part_select(Y, 13, 43) = 00000000000000001000010101001101110000110010101 (42a6e195) -part_select(Y, 6, 44) = 00000000000100110000101010011011100001100101011 (854dc32b) -part_select(Y, 9, 45) = 00000000001001100001010100110111000011001010111 (a9b8657) -part_select(Y, 13, 46) = 00000000000001000010101001101110000110010101110 (15370cae) +Selecting bits from: 01110101001100001110110010101000011001000010000 +part_select(Y, 0, 38) = 00000000001100001110110010101000011001000010000 (1876543210) +part_select(Y, 1, 4) = 00000000000000000000000000000000000000000001000 (8) +part_select(Y, 2, 18) = 00000000000000000000000000000010000110010000100 (10c84) +part_select(Y, 3, 23) = 00000000000000000000000000010101000011001000010 (a8642) +part_select(Y, 4, 17) = 00000000000000000000000000000000000001100100001 (321) +part_select(Y, 5, 26) = 00000000000000000000000001100101010000110010000 (32a190) +part_select(Y, 6, 16) = 00000000000000000000000000000000000000011001000 (c8) +part_select(Y, 7, 3) = 00000000000000000000000000000000000000000001000 (8) +part_select(Y, 8, 28) = 00000000000000000000000000101100101010000110010 (165432) +part_select(Y, 9, 28) = 00000000000000000000000000010110010101000011001 (b2a19) +part_select(Y, 10, 10) = 00000000000000000000000000000000000000000000000 (0) +part_select(Y, 11, 17) = 00000000000000000000000000000000000000000000110 (6) +part_select(Y, 12, 44) = 00000000000000110101001100001110110010101000011 (1a9876543) +part_select(Y, 13, 28) = 00000000000000000000000000000001011001010100001 (b2a1) +part_select(Y, 14, 2) = 00000000000000000000000000000000000010000100110 (426) +part_select(Y, 15, 20) = 00000000000000000000000000000000000000000101000 (28) +part_select(Y, 16, 22) = 00000000000000000000000000000000000000001010100 (54) +part_select(Y, 17, 21) = 00000000000000000000000000000000000000000001010 (a) +part_select(Y, 18, 18) = 00000000000000000000000000000000000000000000001 (1) +part_select(Y, 19, 36) = 00000000000000000000000000000110000111011001010 (30eca) +part_select(Y, 20, 34) = 00000000000000000000000000000000000011101100101 (765) +part_select(Y, 21, 37) = 00000000000000000000000000000001100001110110010 (c3b2) +part_select(Y, 22, 18) = 00000000000000000000000000000000000000000010101 (15) +part_select(Y, 23, 38) = 00000000000000000000000000000000011000011101100 (30ec) +part_select(Y, 24, 20) = 00000000000000000000000000000000000000000010100 (14) +part_select(Y, 25, 1) = 00000000000000000000000001000010011000010101001 (2130a9) +part_select(Y, 26, 31) = 00000000000000000000000000000000000000000011101 (1d) +part_select(Y, 27, 17) = 00000000000000000000000000000000000001010100110 (2a6) +part_select(Y, 28, 20) = 00000000000000000000000000000000000000101001101 (14d) +part_select(Y, 29, 6) = 00000000000000000000000000100110000101010011011 (130a9b) +part_select(Y, 30, 27) = 00000000000000000000000000000000000000000000111 (7) +part_select(Y, 31, 37) = 00000000000000000000000000000000000000000110000 (30) +part_select(Y, 32, 11) = 00000000000000000000000000110000101010011011100 (1854dc) +part_select(Y, 33, 24) = 00000000000000000000000000000000000000110111000 (1b8) +part_select(Y, 34, 39) = 00000000000000000000000000000000000000000100110 (26) +part_select(Y, 35, 7) = 00000000000000000000100110000101010011011100001 (4c2a6e1) +part_select(Y, 36, 3) = 00000000000000100001001100001010100110111000011 (109854dc3) +part_select(Y, 37, 9) = 00000000000000000010011000010101001101110000110 (130a9b86) +part_select(Y, 38, 36) = 00000000000000000000000000000000000000000000100 (4) +part_select(Y, 39, 31) = 00000000000000000000000000000000000000000011001 (19) +part_select(Y, 40, 16) = 00000000000000000000000010101001101110000110010 (54dc32) +part_select(Y, 41, 46) = 00000000000000000000000000000000000000000011101 (1d) +part_select(Y, 42, 27) = 00000000000000000000000000000000111000011001010 (70ca) +part_select(Y, 43, 13) = 00000000000000001000010101001101110000110010101 (42a6e195) +part_select(Y, 44, 6) = 00000000000100110000101010011011100001100101011 (9854dc32b) +part_select(Y, 45, 9) = 00000000001001100001010100110111000011001010111 (130a9b8657) +part_select(Y, 46, 13) = 00000000000001000010101001101110000110010101110 (215370cae) exit 0 From sabre at nondot.org Tue Apr 17 19:57:40 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 19:57:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Message-ID: <200704180057.l3I0ve1l028942@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.269 -> 1.270 --- Log message: don't access argument list of prototypes --- Diffs of the changes: (+24 -7) AsmWriter.cpp | 31 ++++++++++++++++++++++++------- 1 files changed, 24 insertions(+), 7 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.269 llvm/lib/VMCore/AsmWriter.cpp:1.270 --- llvm/lib/VMCore/AsmWriter.cpp:1.269 Thu Apr 12 13:32:50 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Tue Apr 17 19:57:22 2007 @@ -970,13 +970,30 @@ // Loop over the arguments, printing them... unsigned Idx = 1; - for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); - I != E; ++I) { - // Insert commas as we go... the first arg doesn't get a comma - if (I != F->arg_begin()) Out << ", "; - printArgument(I, (Attrs ? Attrs->getParamAttrs(Idx) - : uint16_t(ParamAttr::None))); - Idx++; + if (!F->isDeclaration()) { + // If this isn't a declaration, print the argument names as well. + for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); + I != E; ++I) { + // Insert commas as we go... the first arg doesn't get a comma + if (I != F->arg_begin()) Out << ", "; + printArgument(I, (Attrs ? Attrs->getParamAttrs(Idx) + : uint16_t(ParamAttr::None))); + Idx++; + } + } else { + // Otherwise, print the types from the function type. + for (unsigned i = 0, e = FT->getNumParams(); i != e; ++i) { + // Insert commas as we go... the first arg doesn't get a comma + if (i) Out << ", "; + + // Output type... + printType(FT->getParamType(i)); + + unsigned ArgAttrs = ParamAttr::None; + if (Attrs) ArgAttrs = Attrs->getParamAttrs(i+1); + if (ArgAttrs != ParamAttr::None) + Out << ' ' << ParamAttrsList::getParamAttrsText(ArgAttrs); + } } // Finish printing arguments... From dpatel at apple.com Tue Apr 17 20:20:12 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 17 Apr 2007 20:20:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/PostDominators.cpp Message-ID: <200704180120.l3I1KCnI029303@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: PostDominators.cpp updated: 1.66 -> 1.67 --- Log message: Cache DT[*SI] lookup. --- Diffs of the changes: (+4 -2) PostDominators.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Analysis/PostDominators.cpp diff -u llvm/lib/Analysis/PostDominators.cpp:1.66 llvm/lib/Analysis/PostDominators.cpp:1.67 --- llvm/lib/Analysis/PostDominators.cpp:1.66 Tue Apr 17 19:53:01 2007 +++ llvm/lib/Analysis/PostDominators.cpp Tue Apr 17 20:19:55 2007 @@ -282,10 +282,12 @@ if (BB) for (pred_iterator SI = pred_begin(BB), SE = pred_end(BB); - SI != SE; ++SI) + SI != SE; ++SI) { // Does Node immediately dominate this predecessor? - if (DT[*SI] && DT[*SI]->getIDom() != Node) + DominatorTree::Node *SINode = DT[*SI]; + if (SINode && SINode->getIDom() != Node) S.insert(*SI); + } // At this point, S is DFlocal. Now we union in DFup's of our children... // Loop through and visit the nodes that Node immediately dominates (Node's From evan.cheng at apple.com Tue Apr 17 21:30:41 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Apr 2007 21:30:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Message-ID: <200704180230.l3I2UfPQ030548@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveIntervalAnalysis.cpp updated: 1.235 -> 1.236 --- Log message: Don't populate TryAgainList when coalescing only physical registers with virtual registers. --- Diffs of the changes: (+6 -6) LiveIntervalAnalysis.cpp | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.235 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.236 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.235 Tue Apr 17 15:32:26 2007 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Apr 17 21:30:19 2007 @@ -1473,7 +1473,7 @@ void LiveIntervals::CopyCoallesceInMBB(MachineBasicBlock *MBB, - std::vector &TryAgain, bool PhysOnly) { + std::vector *TryAgain, bool PhysOnly) { DOUT << ((Value*)MBB->getBasicBlock())->getName() << ":\n"; for (MachineBasicBlock::iterator MII = MBB->begin(), E = MBB->end(); @@ -1484,8 +1484,8 @@ unsigned SrcReg, DstReg; if (!tii_->isMoveInstr(*Inst, SrcReg, DstReg)) continue; - if (!JoinCopy(Inst, SrcReg, DstReg, PhysOnly)) - TryAgain.push_back(getCopyRec(Inst, SrcReg, DstReg)); + if (TryAgain && !JoinCopy(Inst, SrcReg, DstReg, PhysOnly)) + TryAgain->push_back(getCopyRec(Inst, SrcReg, DstReg)); } } @@ -1502,7 +1502,7 @@ // If there are no loops in the function, join intervals in function order. for (MachineFunction::iterator I = mf_->begin(), E = mf_->end(); I != E; ++I) - CopyCoallesceInMBB(I, TryAgainList); + CopyCoallesceInMBB(I, &TryAgainList); } else { // Otherwise, join intervals in inner loops before other intervals. // Unfortunately we can't just iterate over loop hierarchy here because @@ -1519,9 +1519,9 @@ // Finally, join intervals in loop nest order. for (unsigned i = 0, e = MBBs.size(); i != e; ++i) - CopyCoallesceInMBB(MBBs[i].second, TryAgainList, true); + CopyCoallesceInMBB(MBBs[i].second, NULL, true); for (unsigned i = 0, e = MBBs.size(); i != e; ++i) - CopyCoallesceInMBB(MBBs[i].second, TryAgainList, false); + CopyCoallesceInMBB(MBBs[i].second, &TryAgainList, false); } // Joining intervals can allow other intervals to be joined. Iteratively join From evan.cheng at apple.com Tue Apr 17 21:30:41 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Apr 2007 21:30:41 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h Message-ID: <200704180230.l3I2UfLW030545@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveIntervalAnalysis.h updated: 1.78 -> 1.79 --- Log message: Don't populate TryAgainList when coalescing only physical registers with virtual registers. --- Diffs of the changes: (+1 -1) LiveIntervalAnalysis.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h diff -u llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.78 llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.79 --- llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.78 Tue Apr 17 15:32:26 2007 +++ llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h Tue Apr 17 21:30:19 2007 @@ -205,7 +205,7 @@ /// CopyCoallesceInMBB - Coallsece copies in the specified MBB, putting /// copies that cannot yet be coallesced into the "TryAgain" list. void CopyCoallesceInMBB(MachineBasicBlock *MBB, - std::vector &TryAgain, bool PhysOnly = false); + std::vector *TryAgain, bool PhysOnly = false); /// JoinCopy - Attempt to join intervals corresponding to SrcReg/DstReg, /// which are the src/dst of the copy instruction CopyMI. This returns true From evan.cheng at apple.com Tue Apr 17 21:35:27 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Apr 2007 21:35:27 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/2007-04-17-LiveIntervalAssert.ll Message-ID: <200704180235.l3I2ZRYK030804@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: 2007-04-17-LiveIntervalAssert.ll added (r1.1) --- Log message: New crasher test case. --- Diffs of the changes: (+42 -0) 2007-04-17-LiveIntervalAssert.ll | 42 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 42 insertions(+) Index: llvm/test/CodeGen/X86/2007-04-17-LiveIntervalAssert.ll diff -c /dev/null llvm/test/CodeGen/X86/2007-04-17-LiveIntervalAssert.ll:1.1 *** /dev/null Tue Apr 17 21:35:20 2007 --- llvm/test/CodeGen/X86/2007-04-17-LiveIntervalAssert.ll Tue Apr 17 21:35:10 2007 *************** *** 0 **** --- 1,42 ---- + ; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -relocation-model=pic --disable-fp-elim + + %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 } + %struct.__sFILEX = type opaque + %struct.__sbuf = type { i8*, i32 } + %struct.partition_def = type { i32, [1 x %struct.partition_elem] } + %struct.partition_elem = type { i32, %struct.partition_elem*, i32 } + + define void @partition_print(%struct.partition_def* %part) { + entry: + br i1 false, label %bb.preheader, label %bb99 + + bb.preheader: ; preds = %entry + br i1 false, label %cond_true, label %cond_next90 + + cond_true: ; preds = %bb.preheader + br i1 false, label %bb32, label %bb87.critedge + + bb32: ; preds = %bb32, %cond_true + %i.2115.0 = phi i32 [ 0, %cond_true ], [ %indvar.next127, %bb32 ] ; [#uses=1] + %c.2112.0 = phi i32 [ 0, %cond_true ], [ %tmp49, %bb32 ] ; [#uses=1] + %tmp43 = getelementptr %struct.partition_def* %part, i32 0, i32 1, i32 %c.2112.0, i32 1 ; <%struct.partition_elem**> [#uses=1] + %tmp44 = load %struct.partition_elem** %tmp43 ; <%struct.partition_elem*> [#uses=1] + %tmp4445 = ptrtoint %struct.partition_elem* %tmp44 to i32 ; [#uses=1] + %tmp48 = sub i32 %tmp4445, 0 ; [#uses=1] + %tmp49 = sdiv i32 %tmp48, 12 ; [#uses=1] + %indvar.next127 = add i32 %i.2115.0, 1 ; [#uses=2] + %exitcond128 = icmp eq i32 %indvar.next127, 0 ; [#uses=1] + br i1 %exitcond128, label %bb58, label %bb32 + + bb58: ; preds = %bb32 + ret void + + bb87.critedge: ; preds = %cond_true + ret void + + cond_next90: ; preds = %bb.preheader + ret void + + bb99: ; preds = %entry + ret void + } From sabre at nondot.org Tue Apr 17 22:01:57 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 22:01:57 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Message-ID: <200704180301.l3I31vgc031368@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: TargetLowering.cpp updated: 1.111 -> 1.112 --- Log message: fix a pasto --- Diffs of the changes: (+1 -1) TargetLowering.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.111 llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.112 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.111 Tue Apr 17 17:53:02 2007 +++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Tue Apr 17 22:01:40 2007 @@ -583,7 +583,7 @@ SDOperand NewSA = TLO.DAG.getConstant(ShAmt-C1, Op.getOperand(1).getValueType()); MVT::ValueType VT = Op.getValueType(); - return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SRL, VT, + return TLO.CombineTo(Op, TLO.DAG.getNode(Opc, VT, InOp.getOperand(0), NewSA)); } } From sabre at nondot.org Tue Apr 17 22:04:55 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 22:04:55 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/shl_elim.ll Message-ID: <200704180304.l3I34twC031488@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: shl_elim.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+13 -0) shl_elim.ll | 13 +++++++++++++ 1 files changed, 13 insertions(+) Index: llvm/test/CodeGen/X86/shl_elim.ll diff -c /dev/null llvm/test/CodeGen/X86/shl_elim.ll:1.1 *** /dev/null Tue Apr 17 22:04:47 2007 --- llvm/test/CodeGen/X86/shl_elim.ll Tue Apr 17 22:04:37 2007 *************** *** 0 **** --- 1,13 ---- + ; RUN: llvm-as < %s | llc -march=x86 | grep {movl 8(.esp), %eax} + ; RUN: llvm-as < %s | llc -march=x86 | grep {shll .15, .eax} + ; RUN: llvm-as < %s | llc -march=x86 | grep {sarl .16, .eax} + + define i32 @test1(i64 %a) { + %tmp29 = lshr i64 %a, 24 ; [#uses=1] + %tmp23 = trunc i64 %tmp29 to i32 ; [#uses=1] + %tmp410 = lshr i32 %tmp23, 9 ; [#uses=1] + %tmp45 = trunc i32 %tmp410 to i16 ; [#uses=1] + %tmp456 = sext i16 %tmp45 to i32 ; [#uses=1] + ret i32 %tmp456 + } + From sabre at nondot.org Tue Apr 17 22:05:40 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 22:05:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200704180305.l3I35efP031508@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.291 -> 1.292 --- Log message: When replacing a node in SimplifyDemandedBits, if the old node used any single-use nodes, they will be dead soon. Make sure to remove them before processing other nodes. This implements CodeGen/X86/shl_elim.ll --- Diffs of the changes: (+8 -1) DAGCombiner.cpp | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.291 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.292 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.291 Tue Apr 17 14:03:21 2007 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Apr 17 22:05:22 2007 @@ -182,6 +182,13 @@ // something else needing this node. if (TLO.Old.Val->use_empty()) { removeFromWorkList(TLO.Old.Val); + + // If the operands of this node are only used by the node, they will now + // be dead. Make sure to visit them first to delete dead nodes early. + for (unsigned i = 0, e = TLO.Old.Val->getNumOperands(); i != e; ++i) + if (TLO.Old.Val->getOperand(i).Val->hasOneUse()) + AddToWorkList(TLO.Old.Val->getOperand(i).Val); + DAG.DeleteNode(TLO.Old.Val); } return true; @@ -1838,6 +1845,7 @@ // if (srl x, c) is known to be zero, return 0 if (N1C && TLI.MaskedValueIsZero(SDOperand(N, 0), ~0ULL >> (64-OpSizeInBits))) return DAG.getConstant(0, VT); + // fold (srl (srl x, c1), c2) -> 0 or (srl x, c1+c2) if (N1C && N0.getOpcode() == ISD::SRL && N0.getOperand(1).getOpcode() == ISD::Constant) { @@ -1899,7 +1907,6 @@ return DAG.getNode(ISD::XOR, VT, Op, DAG.getConstant(1, VT)); } } - return SDOperand(); } From sabre at nondot.org Tue Apr 17 22:07:07 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Apr 2007 22:07:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200704180307.l3I377cd031560@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.292 -> 1.293 --- Log message: allow SRL to simplify its operands, as it doesn't demand all bits as input. --- Diffs of the changes: (+7 -1) DAGCombiner.cpp | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.292 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.293 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.292 Tue Apr 17 22:05:22 2007 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Apr 17 22:06:49 2007 @@ -1728,7 +1728,7 @@ // if (shl x, c) is known to be zero, return 0 if (TLI.MaskedValueIsZero(SDOperand(N, 0), MVT::getIntVTBitMask(VT))) return DAG.getConstant(0, VT); - if (SimplifyDemandedBits(SDOperand(N, 0))) + if (N1C && SimplifyDemandedBits(SDOperand(N, 0))) return SDOperand(N, 0); // fold (shl (shl x, c1), c2) -> 0 or (shl x, c1+c2) if (N1C && N0.getOpcode() == ISD::SHL && @@ -1907,6 +1907,12 @@ return DAG.getNode(ISD::XOR, VT, Op, DAG.getConstant(1, VT)); } } + + // fold operands of srl based on knowledge that the low bits are not + // demanded. + if (N1C && SimplifyDemandedBits(SDOperand(N, 0))) + return SDOperand(N, 0); + return SDOperand(); } From resistor at mac.com Tue Apr 17 23:38:57 2007 From: resistor at mac.com (Owen Anderson) Date: Tue, 17 Apr 2007 23:38:57 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h Message-ID: <200704180438.l3I4cvA0000536@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: Dominators.h updated: 1.72 -> 1.73 --- Log message: Add an accessor to make ETForest more useful. --- Diffs of the changes: (+7 -0) Dominators.h | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/include/llvm/Analysis/Dominators.h diff -u llvm/include/llvm/Analysis/Dominators.h:1.72 llvm/include/llvm/Analysis/Dominators.h:1.73 --- llvm/include/llvm/Analysis/Dominators.h:1.72 Sun Apr 15 18:14:18 2007 +++ llvm/include/llvm/Analysis/Dominators.h Tue Apr 17 23:38:39 2007 @@ -320,6 +320,13 @@ return NULL; return Common->getData(); } + + /// Return the immediate dominator of A. + BasicBlock *getIDom(BasicBlock *A) { + ETNode *NodeA = getNode(A); + const ETNode *idom = NodeA->getFather(); + return idom ? idom->getData() : 0; + } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); From resistor at mac.com Tue Apr 17 23:39:49 2007 From: resistor at mac.com (Owen Anderson) Date: Tue, 17 Apr 2007 23:39:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/LCSSA.cpp Message-ID: <200704180439.l3I4dnEu000560@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: LCSSA.cpp updated: 1.36 -> 1.37 --- Log message: Use ETForest instead of DominatorTree. --- Diffs of the changes: (+18 -21) LCSSA.cpp | 39 ++++++++++++++++++--------------------- 1 files changed, 18 insertions(+), 21 deletions(-) Index: llvm/lib/Transforms/Utils/LCSSA.cpp diff -u llvm/lib/Transforms/Utils/LCSSA.cpp:1.36 llvm/lib/Transforms/Utils/LCSSA.cpp:1.37 --- llvm/lib/Transforms/Utils/LCSSA.cpp:1.36 Sat Apr 14 17:10:17 2007 +++ llvm/lib/Transforms/Utils/LCSSA.cpp Tue Apr 17 23:39:32 2007 @@ -49,7 +49,7 @@ struct VISIBILITY_HIDDEN LCSSA : public FunctionPass { // Cached analysis information for the current function. LoopInfo *LI; - DominatorTree *DT; + ETForest *ET; std::vector LoopBlocks; virtual bool runOnFunction(Function &F); @@ -66,14 +66,14 @@ AU.addRequiredID(LoopSimplifyID); AU.addPreservedID(LoopSimplifyID); AU.addRequired(); - AU.addRequired(); + AU.addRequired(); } private: void getLoopValuesUsedOutsideLoop(Loop *L, SetVector &AffectedValues); - Value *GetValueForBlock(DominatorTree::Node *BB, Instruction *OrigInst, - std::map &Phis); + Value *GetValueForBlock(BasicBlock *BB, Instruction *OrigInst, + std::map &Phis); /// inLoop - returns true if the given block is within the current loop const bool inLoop(BasicBlock* B) { @@ -92,7 +92,7 @@ bool changed = false; LI = &getAnalysis(); - DT = &getAnalysis(); + ET = &getAnalysis(); for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I) changed |= visitSubloop(*I); @@ -142,18 +142,17 @@ ++NumLCSSA; // We are applying the transformation // Keep track of the blocks that have the value available already. - std::map Phis; + std::map Phis; - DominatorTree::Node *InstrNode = DT->getNode(Instr->getParent()); + //ETNode *InstrNode = ET->getNodeForBlock(Instr->getParent()); // Insert the LCSSA phi's into the exit blocks (dominated by the value), and // add them to the Phi's map. for (std::vector::const_iterator BBI = exitBlocks.begin(), BBE = exitBlocks.end(); BBI != BBE; ++BBI) { BasicBlock *BB = *BBI; - DominatorTree::Node *ExitBBNode = DT->getNode(BB); - Value *&Phi = Phis[ExitBBNode]; - if (!Phi && InstrNode->dominates(ExitBBNode)) { + Value *&Phi = Phis[BB]; + if (!Phi && ET->dominates(Instr->getParent(), BB)) { PHINode *PN = new PHINode(Instr->getType(), Instr->getName()+".lcssa", BB->begin()); PN->reserveOperandSpace(std::distance(pred_begin(BB), pred_end(BB))); @@ -186,7 +185,7 @@ // Otherwise, patch up uses of the value with the appropriate LCSSA Phi, // inserting PHI nodes into join points where needed. - Value *Val = GetValueForBlock(DT->getNode(UserBB), Instr, Phis); + Value *Val = GetValueForBlock(UserBB, Instr, Phis); // Preincrement the iterator to avoid invalidating it when we change the // value. @@ -225,8 +224,8 @@ /// GetValueForBlock - Get the value to use within the specified basic block. /// available values are in Phis. -Value *LCSSA::GetValueForBlock(DominatorTree::Node *BB, Instruction *OrigInst, - std::map &Phis) { +Value *LCSSA::GetValueForBlock(BasicBlock *BB, Instruction *OrigInst, + std::map &Phis) { // If there is no dominator info for this BB, it is unreachable. if (BB == 0) return UndefValue::get(OrigInst->getType()); @@ -235,7 +234,7 @@ Value *&V = Phis[BB]; if (V) return V; - DominatorTree::Node *IDom = BB->getIDom(); + BasicBlock* IDom = ET->getIDom(BB); // Otherwise, there are two cases: we either have to insert a PHI node or we // don't. We need to insert a PHI node if this block is not dominated by one @@ -248,24 +247,22 @@ // dominate this block. Note that we *know* that the block defining the // original instruction is in the idom chain, because if it weren't, then the // original value didn't dominate this use. - if (!inLoop(IDom->getBlock())) { + if (!inLoop(IDom)) { // Idom is not in the loop, we must still be "below" the exit block and must // be fully dominated by the value live in the idom. return V = GetValueForBlock(IDom, OrigInst, Phis); } - BasicBlock *BBN = BB->getBlock(); - // 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 = new PHINode(OrigInst->getType(), OrigInst->getName()+".lcssa", - BBN->begin()); - PN->reserveOperandSpace(std::distance(pred_begin(BBN), pred_end(BBN))); + BB->begin()); + PN->reserveOperandSpace(std::distance(pred_begin(BB), pred_end(BB))); V = PN; // Fill in the incoming values for the block. - for (pred_iterator PI = pred_begin(BBN), E = pred_end(BBN); PI != E; ++PI) - PN->addIncoming(GetValueForBlock(DT->getNode(*PI), OrigInst, Phis), *PI); + for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) + PN->addIncoming(GetValueForBlock(*PI, OrigInst, Phis), *PI); return PN; } From resistor at mac.com Tue Apr 17 23:46:52 2007 From: resistor at mac.com (Owen Anderson) Date: Tue, 17 Apr 2007 23:46:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/CodeExtractor.cpp Message-ID: <200704180446.l3I4kq8r000671@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: CodeExtractor.cpp updated: 1.53 -> 1.54 --- Log message: Use new ETForest accessor. --- Diffs of the changes: (+4 -4) CodeExtractor.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Transforms/Utils/CodeExtractor.cpp diff -u llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.53 llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.54 --- llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.53 Mon Apr 16 13:10:23 2007 +++ llvm/lib/Transforms/Utils/CodeExtractor.cpp Tue Apr 17 23:46:35 2007 @@ -142,14 +142,14 @@ // Okay, update dominator sets. The blocks that dominate the new one are the // blocks that dominate TIBB plus the new block itself. if (EF) { - DominatorTree::Node* idom = DT->getNode(OldPred)->getIDom(); - DT->createNewNode(NewBB, idom); - EF->addNewBlock(NewBB, idom->getBlock()); + BasicBlock* idom = EF->getIDom(OldPred); + DT->createNewNode(NewBB, DT->getNode(idom)); + EF->addNewBlock(NewBB, idom); // Additionally, NewBB replaces OldPred as the immediate dominator of blocks Function *F = Header->getParent(); for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) - if (DT->getNode(I)->getIDom()->getBlock() == OldPred) { + if (EF->getIDom(I) == OldPred) { DT->changeImmediateDominator(DT->getNode(I), DT->getNode(NewBB)); EF->setImmediateDominator(I, NewBB); } From resistor at mac.com Tue Apr 17 23:55:51 2007 From: resistor at mac.com (Owen Anderson) Date: Tue, 17 Apr 2007 23:55:51 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp Message-ID: <200704180455.l3I4tpp0000825@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ADCE.cpp updated: 1.104 -> 1.105 --- Log message: Use ETForest instead of DominatorTree. --- Diffs of the changes: (+15 -19) ADCE.cpp | 34 +++++++++++++++------------------- 1 files changed, 15 insertions(+), 19 deletions(-) Index: llvm/lib/Transforms/Scalar/ADCE.cpp diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.104 llvm/lib/Transforms/Scalar/ADCE.cpp:1.105 --- llvm/lib/Transforms/Scalar/ADCE.cpp:1.104 Mon Feb 12 20:10:56 2007 +++ llvm/lib/Transforms/Scalar/ADCE.cpp Tue Apr 17 23:55:33 2007 @@ -68,7 +68,7 @@ // can be marked live that wouldn't necessarily be otherwise. AU.addRequired(); AU.addRequired(); - AU.addRequired(); + AU.addRequired(); AU.addRequired(); } @@ -246,8 +246,8 @@ // have any post-dominance information, thus we cannot perform our // transformations safely. // - PostDominatorTree &DT = getAnalysis(); - if (DT[&Func->getEntryBlock()] == 0) { + PostETForest &ET = getAnalysis(); + if (ET.getNodeForBlock(&Func->getEntryBlock()) == 0) { WorkList.clear(); return MadeChanges; } @@ -258,7 +258,7 @@ // function which unwinds, exits or has side-effects, we don't want to delete // the infinite loop or those blocks leading up to it. for (Function::iterator I = Func->begin(), E = Func->end(); I != E; ++I) - if (DT[I] == 0 && ReachableBBs.count(I)) + if (ET.getNodeForBlock(I) == 0 && ReachableBBs.count(I)) for (pred_iterator PI = pred_begin(I), E = pred_end(I); PI != E; ++PI) markInstructionLive((*PI)->getTerminator()); @@ -383,16 +383,16 @@ // postdominator that is alive, and the last postdominator that is // dead... // - PostDominatorTree::Node *LastNode = DT[TI->getSuccessor(i)]; - PostDominatorTree::Node *NextNode = 0; - - if (LastNode) { - NextNode = LastNode->getIDom(); - while (!AliveBlocks.count(NextNode->getBlock())) { - LastNode = NextNode; - NextNode = NextNode->getIDom(); - if (NextNode == 0) { - LastNode = 0; + BasicBlock *LastDead = TI->getSuccessor(i); + BasicBlock *NextAlive = 0; + + if (LastDead) { + NextAlive = ET.getIDom(LastDead); + while (!AliveBlocks.count(NextAlive)) { + LastDead = NextAlive; + NextAlive = ET.getIDom(NextAlive); + if (NextAlive == 0) { + LastDead = 0; break; } } @@ -406,7 +406,7 @@ // drawback of ADCE, so in the future if we choose to revisit the // decision, this is where it should be. // - if (LastNode == 0) { // No postdominator! + if (LastDead == 0) { // No postdominator! if (!isa(TI)) { // Call RemoveSuccessor to transmogrify the terminator instruction // to not contain the outgoing branch, or to create a new @@ -427,10 +427,6 @@ } } else { - // Get the basic blocks that we need... - BasicBlock *LastDead = LastNode->getBlock(); - BasicBlock *NextAlive = NextNode->getBlock(); - // Make the conditional branch now go to the next alive block... TI->getSuccessor(i)->removePredecessor(BB); TI->setSuccessor(i, NextAlive); From evan.cheng at apple.com Wed Apr 18 00:04:59 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 18 Apr 2007 00:04:59 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveVariables.h Message-ID: <200704180504.l3I54x0J000978@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveVariables.h updated: 1.37 -> 1.38 --- Log message: VarInfo::UsedBlocks is no longer used. Remove. --- Diffs of the changes: (+0 -4) LiveVariables.h | 4 ---- 1 files changed, 4 deletions(-) Index: llvm/include/llvm/CodeGen/LiveVariables.h diff -u llvm/include/llvm/CodeGen/LiveVariables.h:1.37 llvm/include/llvm/CodeGen/LiveVariables.h:1.38 --- llvm/include/llvm/CodeGen/LiveVariables.h:1.37 Tue Apr 17 15:22:11 2007 +++ llvm/include/llvm/CodeGen/LiveVariables.h Wed Apr 18 00:04:38 2007 @@ -79,10 +79,6 @@ /// BitVector AliveBlocks; - /// UsedBlocks - Set of blocks of which this value is actually used. This - /// is a bit set which uses the basic block number as an index. - BitVector UsedBlocks; - /// NumUses - Number of uses of this register across the entire function. /// unsigned NumUses; From evan.cheng at apple.com Wed Apr 18 00:05:00 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 18 Apr 2007 00:05:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp LiveVariables.cpp PHIElimination.cpp TwoAddressInstructionPass.cpp Message-ID: <200704180505.l3I550jl000989@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveIntervalAnalysis.cpp updated: 1.236 -> 1.237 LiveVariables.cpp updated: 1.72 -> 1.73 PHIElimination.cpp updated: 1.56 -> 1.57 TwoAddressInstructionPass.cpp updated: 1.46 -> 1.47 --- Log message: VarInfo::UsedBlocks is no longer used. Remove. --- Diffs of the changes: (+2 -17) LiveIntervalAnalysis.cpp | 3 +-- LiveVariables.cpp | 9 +-------- PHIElimination.cpp | 3 --- TwoAddressInstructionPass.cpp | 4 ---- 4 files changed, 2 insertions(+), 17 deletions(-) Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.236 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.237 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.236 Tue Apr 17 21:30:19 2007 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Wed Apr 18 00:04:38 2007 @@ -1058,10 +1058,9 @@ for (const unsigned *AS = mri_->getAliasSet(repDstReg); *AS; ++AS) getInterval(*AS).MergeInClobberRanges(SrcInt); } else { - // Merge UsedBlocks info if the destination is a virtual register. + // Merge use info if the destination is a virtual register. LiveVariables::VarInfo& dVI = lv_->getVarInfo(repDstReg); LiveVariables::VarInfo& sVI = lv_->getVarInfo(repSrcReg); - dVI.UsedBlocks |= sVI.UsedBlocks; dVI.NumUses += sVI.NumUses; } Index: llvm/lib/CodeGen/LiveVariables.cpp diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.72 llvm/lib/CodeGen/LiveVariables.cpp:1.73 --- llvm/lib/CodeGen/LiveVariables.cpp:1.72 Tue Apr 17 15:22:11 2007 +++ llvm/lib/CodeGen/LiveVariables.cpp Wed Apr 18 00:04:38 2007 @@ -48,9 +48,6 @@ cerr << " Alive in blocks: "; for (unsigned i = 0, e = AliveBlocks.size(); i != e; ++i) if (AliveBlocks[i]) cerr << i << ", "; - cerr << " Used in blocks: "; - for (unsigned i = 0, e = UsedBlocks.size(); i != e; ++i) - if (UsedBlocks[i]) cerr << i << ", "; cerr << "\n Killed by:"; if (Kills.empty()) cerr << " No instructions.\n"; @@ -73,7 +70,6 @@ } VarInfo &VI = VirtRegInfo[RegIdx]; VI.AliveBlocks.resize(MF->getNumBlockIDs()); - VI.UsedBlocks.resize(MF->getNumBlockIDs()); return VI; } @@ -138,9 +134,6 @@ MachineInstr *MI) { assert(VRInfo.DefInst && "Register use before def!"); - unsigned BBNum = MBB->getNumber(); - - VRInfo.UsedBlocks[BBNum] = true; VRInfo.NumUses++; // Check to see if this basic block is already a kill block... @@ -163,7 +156,7 @@ // If this virtual register is already marked as alive in this basic block, // that means it is alive in at least one of the successor block, it's not // a kill. - if (!VRInfo.AliveBlocks[BBNum]) + if (!VRInfo.AliveBlocks[MBB->getNumber()]) VRInfo.Kills.push_back(MI); // Update all dominating blocks to mark them known live. Index: llvm/lib/CodeGen/PHIElimination.cpp diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.56 llvm/lib/CodeGen/PHIElimination.cpp:1.57 --- llvm/lib/CodeGen/PHIElimination.cpp:1.56 Tue Apr 17 19:36:11 2007 +++ llvm/lib/CodeGen/PHIElimination.cpp Wed Apr 18 00:04:38 2007 @@ -163,8 +163,6 @@ // Realize that the destination register is defined by the PHI copy now, not // the PHI itself. LV->getVarInfo(DestReg).DefInst = PHICopy; - - LV->getVarInfo(IncomingReg).UsedBlocks[MBB.getNumber()] = true; } // Adjust the VRegPHIUseCount map to account for the removal of this PHI @@ -215,7 +213,6 @@ // 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 Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.46 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.47 --- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.46 Sun Mar 18 04:02:31 2007 +++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Wed Apr 18 00:04:38 2007 @@ -197,10 +197,6 @@ LiveVariables::VarInfo& varInfo = LV.getVarInfo(regA); varInfo.DefInst = prevMi; - // update live variables for regB - LiveVariables::VarInfo& varInfoB = LV.getVarInfo(regB); - // regB is used in this BB. - varInfoB.UsedBlocks[mbbi->getNumber()] = true; if (LV.removeVirtualRegisterKilled(regB, mbbi, mi)) LV.addVirtualRegisterKilled(regB, prevMi); From resistor at mac.com Wed Apr 18 00:25:27 2007 From: resistor at mac.com (Owen Anderson) Date: Wed, 18 Apr 2007 00:25:27 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h ET-Forest.h Message-ID: <200704180525.l3I5PRQ5001382@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: Dominators.h updated: 1.73 -> 1.74 ET-Forest.h updated: 1.9 -> 1.10 --- Log message: Add accessor to get the blocks immediately dominated by a given block to ETForest. --- Diffs of the changes: (+22 -0) Dominators.h | 14 ++++++++++++++ ET-Forest.h | 8 ++++++++ 2 files changed, 22 insertions(+) Index: llvm/include/llvm/Analysis/Dominators.h diff -u llvm/include/llvm/Analysis/Dominators.h:1.73 llvm/include/llvm/Analysis/Dominators.h:1.74 --- llvm/include/llvm/Analysis/Dominators.h:1.73 Tue Apr 17 23:38:39 2007 +++ llvm/include/llvm/Analysis/Dominators.h Wed Apr 18 00:25:09 2007 @@ -327,6 +327,20 @@ const ETNode *idom = NodeA->getFather(); return idom ? idom->getData() : 0; } + + void getChildren(BasicBlock *A, std::vector& children) { + ETNode *NodeA = getNode(A); + const ETNode* son = NodeA->getSon(); + + if (!son) return; + children.push_back(son->getData()); + + const ETNode* brother = son->getBrother(); + while (brother != son) { + children.push_back(brother->getData()); + brother = brother->getBrother(); + } + } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Index: llvm/include/llvm/Analysis/ET-Forest.h diff -u llvm/include/llvm/Analysis/ET-Forest.h:1.9 llvm/include/llvm/Analysis/ET-Forest.h:1.10 --- llvm/include/llvm/Analysis/ET-Forest.h:1.9 Wed Feb 21 13:57:33 2007 +++ llvm/include/llvm/Analysis/ET-Forest.h Wed Apr 18 00:25:09 2007 @@ -275,6 +275,14 @@ return DFSNumOut; } + const ETNode *getSon() const { + return Son; + } + + const ETNode *getBrother() const { + return Left; + } + private: // Data represented by the node void *data; From resistor at mac.com Wed Apr 18 00:26:00 2007 From: resistor at mac.com (Owen Anderson) Date: Wed, 18 Apr 2007 00:26:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp Message-ID: <200704180526.l3I5Q02K001401@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: CorrelatedExprs.cpp updated: 1.56 -> 1.57 --- Log message: Use ETForest instead of DominatorTree. --- Diffs of the changes: (+11 -11) CorrelatedExprs.cpp | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) Index: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp diff -u llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.56 llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.57 --- llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.56 Thu Mar 1 01:54:15 2007 +++ llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp Wed Apr 18 00:25:43 2007 @@ -224,14 +224,12 @@ std::map RankMap; std::map RegionInfoMap; ETForest *EF; - DominatorTree *DT; public: virtual bool runOnFunction(Function &F); // We don't modify the program, so we preserve all analyses virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); - AU.addRequired(); AU.addRequiredID(BreakCriticalEdgesID); }; @@ -302,7 +300,6 @@ // tree. Note that our traversal will not even touch unreachable basic // blocks. EF = &getAnalysis(); - DT = &getAnalysis(); std::set VisitedBlocks; bool Changed = TransformRegion(&F.getEntryBlock(), VisitedBlocks); @@ -349,14 +346,16 @@ // blocks that are dominated by this one, we can safely propagate the // information down now. // - DominatorTree::Node *BBN = (*DT)[BB]; - if (!RI.empty()) // Time opt: only propagate if we can change something - for (unsigned i = 0, e = BBN->getChildren().size(); i != e; ++i) { - BasicBlock *Dominated = BBN->getChildren()[i]->getBlock(); - assert(RegionInfoMap.find(Dominated) == RegionInfoMap.end() && + std::vector children; + EF->getChildren(BB, children); + if (!RI.empty()) { // Time opt: only propagate if we can change something + for (std::vector::iterator CI = children.begin(), E = children.end(); + CI != E; ++CI) { + assert(RegionInfoMap.find(*CI) == RegionInfoMap.end() && "RegionInfo should be calculated in dominanace order!"); - getRegionInfo(Dominated) = RI; + getRegionInfo(*CI) = RI; } + } // Now that all of our successors have information if they deserve it, // propagate any information our terminator instruction finds to our @@ -379,8 +378,9 @@ } // Now that all of our successors have information, recursively process them. - for (unsigned i = 0, e = BBN->getChildren().size(); i != e; ++i) - Changed |= TransformRegion(BBN->getChildren()[i]->getBlock(),VisitedBlocks); + for (std::vector::iterator CI = children.begin(), E = children.end(); + CI != E; ++CI) + Changed |= TransformRegion(*CI, VisitedBlocks); return Changed; } From reid at x10sys.com Wed Apr 18 00:40:29 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 18 Apr 2007 00:40:29 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/bigint.c bigint.reference_output Message-ID: <200704180540.l3I5eT2q001701@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: bigint.c updated: 1.7 -> 1.8 bigint.reference_output updated: 1.1 -> 1.2 --- Log message: Try bigger integer bit widths. --- Diffs of the changes: (+3 -3) bigint.c | 2 +- bigint.reference_output | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/bigint.c diff -u llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.7 llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.8 --- llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.7 Tue Apr 17 19:53:49 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bigint.c Wed Apr 18 00:40:12 2007 @@ -17,7 +17,7 @@ const uint10 bnd = 1023; -int169 x = 0xffffffffULL; +int500 x = 0xffffffffULL; int169 y = -0xabcdefdeULL; int my_test() Index: llvm-test/SingleSource/UnitTests/Integer/bigint.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/bigint.reference_output:1.1 llvm-test/SingleSource/UnitTests/Integer/bigint.reference_output:1.2 --- llvm-test/SingleSource/UnitTests/Integer/bigint.reference_output:1.1 Thu Jan 18 20:22:46 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bigint.reference_output Wed Apr 18 00:40:12 2007 @@ -1,3 +1,3 @@ -rem = -56805 -rem2 = -97569 +rem = 54392 +rem2 = 143376 exit 0 From resistor at mac.com Wed Apr 18 00:43:30 2007 From: resistor at mac.com (Owen Anderson) Date: Wed, 18 Apr 2007 00:43:30 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LICM.cpp Message-ID: <200704180543.l3I5hUM6001761@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LICM.cpp updated: 1.91 -> 1.92 --- Log message: Switch more uses of DominatorTree over to ETForest. --- Diffs of the changes: (+24 -22) LICM.cpp | 46 ++++++++++++++++++++++++---------------------- 1 files changed, 24 insertions(+), 22 deletions(-) Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.91 llvm/lib/Transforms/Scalar/LICM.cpp:1.92 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.91 Tue Apr 17 13:21:36 2007 +++ llvm/lib/Transforms/Scalar/LICM.cpp Wed Apr 18 00:43:13 2007 @@ -72,7 +72,8 @@ AU.setPreservesCFG(); AU.addRequiredID(LoopSimplifyID); AU.addRequired(); - AU.addRequired(); + AU.addRequired(); + AU.addRequired(); // For scalar promotion (mem2reg) AU.addRequired(); // For scalar promotion (mem2reg) AU.addRequired(); } @@ -86,6 +87,7 @@ // Various analyses that we use... AliasAnalysis *AA; // Current AliasAnalysis information LoopInfo *LI; // Current LoopInfo + ETForest *ET; // ETForest for the current Loop... DominatorTree *DT; // Dominator Tree for the current Loop... DominanceFrontier *DF; // Current Dominance Frontier @@ -98,19 +100,19 @@ /// SinkRegion - Walk the specified region of the CFG (defined by all blocks /// dominated by the specified block, and that are in the current loop) in - /// reverse depth first order w.r.t the DominatorTree. This allows us to + /// reverse depth first order w.r.t the ETForest. This allows us to /// visit uses before definitions, allowing us to sink a loop body in one /// pass without iteration. /// - void SinkRegion(DominatorTree::Node *N); + void SinkRegion(BasicBlock *BB); /// HoistRegion - Walk the specified region of the CFG (defined by all /// blocks dominated by the specified block, and that are in the current - /// loop) in depth first order w.r.t the DominatorTree. This allows us to + /// loop) in depth first order w.r.t the ETForest. This allows us to /// visit definitions before uses, allowing us to hoist a loop body in one /// pass without iteration. /// - void HoistRegion(DominatorTree::Node *N); + void HoistRegion(BasicBlock *BB); /// inSubLoop - Little predicate that returns true if the specified basic /// block is in a subloop of the current one, not the current one itself. @@ -135,21 +137,20 @@ if (BlockInLoop == LoopHeader) return true; - DominatorTree::Node *BlockInLoopNode = DT->getNode(BlockInLoop); - DominatorTree::Node *IDom = DT->getNode(ExitBlock); + BasicBlock *IDom = ExitBlock; // Because the exit block is not in the loop, we know we have to get _at // least_ its immediate dominator. do { // Get next Immediate Dominator. - IDom = IDom->getIDom(); + IDom = ET->getIDom(IDom); // If we have got to the header of the loop, then the instructions block // did not dominate the exit node, so we can't hoist it. - if (IDom->getBlock() == LoopHeader) + if (IDom == LoopHeader) return false; - } while (IDom != BlockInLoopNode); + } while (IDom != BlockInLoop); return true; } @@ -213,6 +214,7 @@ LI = &getAnalysis(); AA = &getAnalysis(); DF = &getAnalysis(); + ET = &getAnalysis(); DT = &getAnalysis(); CurAST = new AliasSetTracker(*AA); @@ -252,8 +254,8 @@ // us to sink instructions in one pass, without iteration. AFter sinking // instructions, we perform another pass to hoist them out of the loop. // - SinkRegion(DT->getNode(L->getHeader())); - HoistRegion(DT->getNode(L->getHeader())); + SinkRegion(L->getHeader()); + HoistRegion(L->getHeader()); // Now that all loop invariants have been removed from the loop, promote any // memory references to scalars that we can... @@ -270,19 +272,19 @@ /// SinkRegion - Walk the specified region of the CFG (defined by all blocks /// dominated by the specified block, and that are in the current loop) in -/// reverse depth first order w.r.t the DominatorTree. This allows us to visit +/// reverse depth first order w.r.t the ETForest. This allows us to visit /// uses before definitions, allowing us to sink a loop body in one pass without /// iteration. /// -void LICM::SinkRegion(DominatorTree::Node *N) { - assert(N != 0 && "Null dominator tree node?"); - BasicBlock *BB = N->getBlock(); +void LICM::SinkRegion(BasicBlock *BB) { + assert(BB != 0 && "Null sink block?"); // If this subregion is not in the top level loop at all, exit. if (!CurLoop->contains(BB)) return; // We are processing blocks in reverse dfo, so process children first... - const std::vector &Children = N->getChildren(); + std::vector Children; + ET->getChildren(BB, Children); for (unsigned i = 0, e = Children.size(); i != e; ++i) SinkRegion(Children[i]); @@ -311,9 +313,8 @@ /// first order w.r.t the DominatorTree. This allows us to visit definitions /// before uses, allowing us to hoist a loop body in one pass without iteration. /// -void LICM::HoistRegion(DominatorTree::Node *N) { - assert(N != 0 && "Null dominator tree node?"); - BasicBlock *BB = N->getBlock(); +void LICM::HoistRegion(BasicBlock *BB) { + assert(BB != 0 && "Null hoist block?"); // If this subregion is not in the top level loop at all, exit. if (!CurLoop->contains(BB)) return; @@ -333,7 +334,8 @@ hoist(I); } - const std::vector &Children = N->getChildren(); + std::vector Children; + ET->getChildren(BB, Children); for (unsigned i = 0, e = Children.size(); i != e; ++i) HoistRegion(Children[i]); } @@ -604,7 +606,7 @@ std::vector ExitBlocks; CurLoop->getExitBlocks(ExitBlocks); - // For each exit block, get the DT node and walk up the DT until the + // For each exit block, walk up the ET until the // instruction's basic block is found or we exit the loop. for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i) if (!isExitBlockDominatedByBlockInLoop(ExitBlocks[i], Inst.getParent())) From baldrick at free.fr Wed Apr 18 01:15:29 2007 From: baldrick at free.fr (Duncan Sands) Date: Wed, 18 Apr 2007 08:15:29 +0200 Subject: [llvm-commits] [126245] Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/ Week-of-Mon-20070416/047943.html In-Reply-To: References: <20070417202912.A40AFF24490E@src> <200704172242.06347.baldrick@free.fr> Message-ID: <200704180815.29808.baldrick@free.fr> Hi Devang, > if > (StartOffsetInBits > FirstUnallocatedByte*8) > > is true then > > (StartOffsetFromByteBoundry == 0) > > is always true. If so, we could simply this even further. In other > words, if we need pad bytes for a new field then it always starts at > byte boundary. Can you think of an example where this is not true ? yes, this need not be true in Ada, where bitfields can be placed wherever you like, for example type Second_Bitfield_Not_At_Bitoffset_Zero is record A : Character; B : Integer; end record; for Second_Bitfield_Not_At_Bitoffset_Zero use record A at 0 range 0 .. 7; B at 0 range 27 .. 64; end record; -- "gaps__second_bitfield_not_at_bitoffset_zero", size 72 -- Fields: -- "a", size 8, offset 0, bit offset 0 -- "b", size 32, offset 0, bit offset 27 Best wishes, Duncan. From resistor at mac.com Wed Apr 18 01:47:15 2007 From: resistor at mac.com (Owen Anderson) Date: Wed, 18 Apr 2007 01:47:15 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp Message-ID: <200704180647.l3I6lFGD002832@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ADCE.cpp updated: 1.105 -> 1.106 --- Log message: Revert changes that caused breakage. --- Diffs of the changes: (+19 -15) ADCE.cpp | 34 +++++++++++++++++++--------------- 1 files changed, 19 insertions(+), 15 deletions(-) Index: llvm/lib/Transforms/Scalar/ADCE.cpp diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.105 llvm/lib/Transforms/Scalar/ADCE.cpp:1.106 --- llvm/lib/Transforms/Scalar/ADCE.cpp:1.105 Tue Apr 17 23:55:33 2007 +++ llvm/lib/Transforms/Scalar/ADCE.cpp Wed Apr 18 01:46:57 2007 @@ -68,7 +68,7 @@ // can be marked live that wouldn't necessarily be otherwise. AU.addRequired(); AU.addRequired(); - AU.addRequired(); + AU.addRequired(); AU.addRequired(); } @@ -246,8 +246,8 @@ // have any post-dominance information, thus we cannot perform our // transformations safely. // - PostETForest &ET = getAnalysis(); - if (ET.getNodeForBlock(&Func->getEntryBlock()) == 0) { + PostDominatorTree &DT = getAnalysis(); + if (DT[&Func->getEntryBlock()] == 0) { WorkList.clear(); return MadeChanges; } @@ -258,7 +258,7 @@ // function which unwinds, exits or has side-effects, we don't want to delete // the infinite loop or those blocks leading up to it. for (Function::iterator I = Func->begin(), E = Func->end(); I != E; ++I) - if (ET.getNodeForBlock(I) == 0 && ReachableBBs.count(I)) + if (DT[I] == 0 && ReachableBBs.count(I)) for (pred_iterator PI = pred_begin(I), E = pred_end(I); PI != E; ++PI) markInstructionLive((*PI)->getTerminator()); @@ -383,16 +383,16 @@ // postdominator that is alive, and the last postdominator that is // dead... // - BasicBlock *LastDead = TI->getSuccessor(i); - BasicBlock *NextAlive = 0; - - if (LastDead) { - NextAlive = ET.getIDom(LastDead); - while (!AliveBlocks.count(NextAlive)) { - LastDead = NextAlive; - NextAlive = ET.getIDom(NextAlive); - if (NextAlive == 0) { - LastDead = 0; + PostDominatorTree::Node *LastNode = DT[TI->getSuccessor(i)]; + PostDominatorTree::Node *NextNode = 0; + + if (LastNode) { + NextNode = LastNode->getIDom(); + while (!AliveBlocks.count(NextNode->getBlock())) { + LastNode = NextNode; + NextNode = NextNode->getIDom(); + if (NextNode == 0) { + LastNode = 0; break; } } @@ -406,7 +406,7 @@ // drawback of ADCE, so in the future if we choose to revisit the // decision, this is where it should be. // - if (LastDead == 0) { // No postdominator! + if (LastNode == 0) { // No postdominator! if (!isa(TI)) { // Call RemoveSuccessor to transmogrify the terminator instruction // to not contain the outgoing branch, or to create a new @@ -427,6 +427,10 @@ } } else { + // Get the basic blocks that we need... + BasicBlock *LastDead = LastNode->getBlock(); + BasicBlock *NextAlive = NextNode->getBlock(); + // Make the conditional branch now go to the next alive block... TI->getSuccessor(i)->removePredecessor(BB); TI->setSuccessor(i, NextAlive); From djg at cray.com Wed Apr 18 09:09:32 2007 From: djg at cray.com (Dan Gohman) Date: Wed, 18 Apr 2007 09:09:32 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrSSE.td Message-ID: <200704181409.l3IE9W8j021632@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrSSE.td updated: 1.180 -> 1.181 --- Log message: Fix the spelling of the prefetchnta instruction. --- Diffs of the changes: (+1 -1) X86InstrSSE.td | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86InstrSSE.td diff -u llvm/lib/Target/X86/X86InstrSSE.td:1.180 llvm/lib/Target/X86/X86InstrSSE.td:1.181 --- llvm/lib/Target/X86/X86InstrSSE.td:1.180 Tue Apr 10 17:10:25 2007 +++ llvm/lib/Target/X86/X86InstrSSE.td Wed Apr 18 09:09:14 2007 @@ -1645,7 +1645,7 @@ def PREFETCHT0 : PSI<0x18, MRM1m, (ops i8mem:$src), "prefetcht0 $src", []>; def PREFETCHT1 : PSI<0x18, MRM2m, (ops i8mem:$src), "prefetcht1 $src", []>; def PREFETCHT2 : PSI<0x18, MRM3m, (ops i8mem:$src), "prefetcht2 $src", []>; -def PREFETCHTNTA : PSI<0x18, MRM0m, (ops i8mem:$src), "prefetchtnta $src", []>; +def PREFETCHNTA : PSI<0x18, MRM0m, (ops i8mem:$src), "prefetchnta $src", []>; // Non-temporal stores def MOVNTPSmr : PSI<0x2B, MRMDestMem, (ops i128mem:$dst, VR128:$src), From jeffc at jolt-lang.org Wed Apr 18 12:26:31 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Wed, 18 Apr 2007 12:26:31 -0500 Subject: [llvm-commits] CVS: llvm/docs/GarbageCollection.html Message-ID: <200704181726.l3IHQVV6024889@zion.cs.uiuc.edu> Changes in directory llvm/docs: GarbageCollection.html updated: 1.9 -> 1.10 --- Log message: Provide link. --- Diffs of the changes: (+4 -3) GarbageCollection.html | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/docs/GarbageCollection.html diff -u llvm/docs/GarbageCollection.html:1.9 llvm/docs/GarbageCollection.html:1.10 --- llvm/docs/GarbageCollection.html:1.9 Fri Mar 30 07:22:09 2007 +++ llvm/docs/GarbageCollection.html Wed Apr 18 12:26:14 2007 @@ -65,8 +65,9 @@

    Conservative garbage collection often does not require any special support from either the language or the compiler: it can handle non-type-safe programming languages (such as C/C++) and does not require any special -information from the compiler. The [LINK] Boehm collector is an example of a -state-of-the-art conservative collector.

    +information from the compiler. The +Boehm collector is +an example of a state-of-the-art conservative collector.

    Accurate garbage collection requires the ability to identify all pointers in the program at run-time (which requires that the source-language be type-safe in @@ -526,7 +527,7 @@ Chris Lattner
    LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/03/30 12:22:09 $ + Last modified: $Date: 2007/04/18 17:26:14 $ From evan.cheng at apple.com Wed Apr 18 17:39:30 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 18 Apr 2007 17:39:30 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/LCSSA.cpp Message-ID: <200704182239.l3IMdU5R005991@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: LCSSA.cpp updated: 1.37 -> 1.38 --- Log message: Revert Owen's last check-in. This is breaking Mac OS X / PPC llvm-gcc bootstrap. --- Diffs of the changes: (+21 -18) LCSSA.cpp | 39 +++++++++++++++++++++------------------ 1 files changed, 21 insertions(+), 18 deletions(-) Index: llvm/lib/Transforms/Utils/LCSSA.cpp diff -u llvm/lib/Transforms/Utils/LCSSA.cpp:1.37 llvm/lib/Transforms/Utils/LCSSA.cpp:1.38 --- llvm/lib/Transforms/Utils/LCSSA.cpp:1.37 Tue Apr 17 23:39:32 2007 +++ llvm/lib/Transforms/Utils/LCSSA.cpp Wed Apr 18 17:39:00 2007 @@ -49,7 +49,7 @@ struct VISIBILITY_HIDDEN LCSSA : public FunctionPass { // Cached analysis information for the current function. LoopInfo *LI; - ETForest *ET; + DominatorTree *DT; std::vector LoopBlocks; virtual bool runOnFunction(Function &F); @@ -66,14 +66,14 @@ AU.addRequiredID(LoopSimplifyID); AU.addPreservedID(LoopSimplifyID); AU.addRequired(); - AU.addRequired(); + AU.addRequired(); } private: void getLoopValuesUsedOutsideLoop(Loop *L, SetVector &AffectedValues); - Value *GetValueForBlock(BasicBlock *BB, Instruction *OrigInst, - std::map &Phis); + Value *GetValueForBlock(DominatorTree::Node *BB, Instruction *OrigInst, + std::map &Phis); /// inLoop - returns true if the given block is within the current loop const bool inLoop(BasicBlock* B) { @@ -92,7 +92,7 @@ bool changed = false; LI = &getAnalysis(); - ET = &getAnalysis(); + DT = &getAnalysis(); for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I) changed |= visitSubloop(*I); @@ -142,17 +142,18 @@ ++NumLCSSA; // We are applying the transformation // Keep track of the blocks that have the value available already. - std::map Phis; + std::map Phis; - //ETNode *InstrNode = ET->getNodeForBlock(Instr->getParent()); + DominatorTree::Node *InstrNode = DT->getNode(Instr->getParent()); // Insert the LCSSA phi's into the exit blocks (dominated by the value), and // add them to the Phi's map. for (std::vector::const_iterator BBI = exitBlocks.begin(), BBE = exitBlocks.end(); BBI != BBE; ++BBI) { BasicBlock *BB = *BBI; - Value *&Phi = Phis[BB]; - if (!Phi && ET->dominates(Instr->getParent(), BB)) { + DominatorTree::Node *ExitBBNode = DT->getNode(BB); + Value *&Phi = Phis[ExitBBNode]; + if (!Phi && InstrNode->dominates(ExitBBNode)) { PHINode *PN = new PHINode(Instr->getType(), Instr->getName()+".lcssa", BB->begin()); PN->reserveOperandSpace(std::distance(pred_begin(BB), pred_end(BB))); @@ -185,7 +186,7 @@ // Otherwise, patch up uses of the value with the appropriate LCSSA Phi, // inserting PHI nodes into join points where needed. - Value *Val = GetValueForBlock(UserBB, Instr, Phis); + Value *Val = GetValueForBlock(DT->getNode(UserBB), Instr, Phis); // Preincrement the iterator to avoid invalidating it when we change the // value. @@ -224,8 +225,8 @@ /// GetValueForBlock - Get the value to use within the specified basic block. /// available values are in Phis. -Value *LCSSA::GetValueForBlock(BasicBlock *BB, Instruction *OrigInst, - std::map &Phis) { +Value *LCSSA::GetValueForBlock(DominatorTree::Node *BB, Instruction *OrigInst, + std::map &Phis) { // If there is no dominator info for this BB, it is unreachable. if (BB == 0) return UndefValue::get(OrigInst->getType()); @@ -234,7 +235,7 @@ Value *&V = Phis[BB]; if (V) return V; - BasicBlock* IDom = ET->getIDom(BB); + DominatorTree::Node *IDom = BB->getIDom(); // Otherwise, there are two cases: we either have to insert a PHI node or we // don't. We need to insert a PHI node if this block is not dominated by one @@ -247,22 +248,24 @@ // dominate this block. Note that we *know* that the block defining the // original instruction is in the idom chain, because if it weren't, then the // original value didn't dominate this use. - if (!inLoop(IDom)) { + if (!inLoop(IDom->getBlock())) { // Idom is not in the loop, we must still be "below" the exit block and must // be fully dominated by the value live in the idom. return V = GetValueForBlock(IDom, OrigInst, Phis); } + BasicBlock *BBN = BB->getBlock(); + // 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 = new PHINode(OrigInst->getType(), OrigInst->getName()+".lcssa", - BB->begin()); - PN->reserveOperandSpace(std::distance(pred_begin(BB), pred_end(BB))); + BBN->begin()); + PN->reserveOperandSpace(std::distance(pred_begin(BBN), pred_end(BBN))); V = PN; // Fill in the incoming values for the block. - for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) - PN->addIncoming(GetValueForBlock(*PI, OrigInst, Phis), *PI); + for (pred_iterator PI = pred_begin(BBN), E = pred_end(BBN); PI != E; ++PI) + PN->addIncoming(GetValueForBlock(DT->getNode(*PI), OrigInst, Phis), *PI); return PN; } From asl at math.spbu.ru Wed Apr 18 18:53:42 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Thu, 19 Apr 2007 03:53:42 +0400 Subject: [llvm-commits] Function aliases Message-ID: <1176940422.13159.87.camel@asl.dorms.spbu.ru> Hello Everyone. This is LLVM part of patch, which enable function aliases for LLVM. The syntax is pretty simple: it just "mimics" the "section" keyword. I'm currently working on gcc part of the patch. Please note, that patch breaks bytecode format (llvm-dev message will follow). Documentation updates & testcases will be added just after this patch landed. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: llvm-aliases.diff Type: text/x-patch Size: 21672 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070419/86e2bc2c/attachment.bin From asl at math.spbu.ru Wed Apr 18 18:58:12 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Thu, 19 Apr 2007 03:58:12 +0400 Subject: [llvm-commits] Function aliases In-Reply-To: <1176940422.13159.87.camel.SS22753SS@asl.dorms.spbu.ru> References: <1176940422.13159.87.camel.SS22753SS@asl.dorms.spbu.ru> Message-ID: <1176940692.13159.91.camel@asl.dorms.spbu.ru> > This is LLVM part of patch, which enable function aliases for LLVM. Forgot to add: this is patch for review :) -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From jeffc at jolt-lang.org Wed Apr 18 21:04:26 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Wed, 18 Apr 2007 21:04:26 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/SmallVector.h Message-ID: <200704190204.l3J24QIa009115@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: SmallVector.h updated: 1.27 -> 1.28 --- Log message: Fix some VC++ warnings. --- Diffs of the changes: (+4 -4) SmallVector.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/include/llvm/ADT/SmallVector.h diff -u llvm/include/llvm/ADT/SmallVector.h:1.27 llvm/include/llvm/ADT/SmallVector.h:1.28 --- llvm/include/llvm/ADT/SmallVector.h:1.27 Mon Mar 5 11:22:33 2007 +++ llvm/include/llvm/ADT/SmallVector.h Wed Apr 18 21:04:09 2007 @@ -308,8 +308,8 @@ // Define this out-of-line to dissuade the C++ compiler from inlining it. template void SmallVectorImpl::grow(unsigned MinSize) { - unsigned CurCapacity = Capacity-Begin; - unsigned CurSize = size(); + unsigned CurCapacity = unsigned(Capacity-Begin); + unsigned CurSize = unsigned(size()); unsigned NewCapacity = 2*CurCapacity; if (NewCapacity < MinSize) NewCapacity = MinSize; @@ -376,8 +376,8 @@ // If we already have sufficient space, assign the common elements, then // destroy any excess. - unsigned RHSSize = RHS.size(); - unsigned CurSize = size(); + unsigned RHSSize = unsigned(RHS.size()); + unsigned CurSize = unsigned(size()); if (CurSize >= RHSSize) { // Assign common elements. iterator NewEnd = std::copy(RHS.Begin, RHS.Begin+RHSSize, Begin); From clattner at apple.com Thu Apr 19 00:16:50 2007 From: clattner at apple.com (Chris Lattner) Date: Wed, 18 Apr 2007 22:16:50 -0700 Subject: [llvm-commits] Function aliases In-Reply-To: <1176940422.13159.87.camel@asl.dorms.spbu.ru> References: <1176940422.13159.87.camel@asl.dorms.spbu.ru> Message-ID: On Apr 18, 2007, at 4:53 PM, Anton Korobeynikov wrote: > Hello Everyone. > > This is LLVM part of patch, which enable function aliases for LLVM. > The > syntax is pretty simple: it just "mimics" the "section" keyword. I'm > currently working on gcc part of the patch. Please note, that patch > breaks bytecode format (llvm-dev message will follow). > > Documentation updates & testcases will be added just after this patch > landed. Questions questions :) First, you are changing the LLVM language. When you do this, please submit a patch for langref before you write code :). In this case, I'd like to see the patch so that I understand the semantics of what you're proposing. The BC format documents can come later after it lands. Do aliases only apply to function-like things, or can they also apply to global vars? Specific code comments: +class FunctionAlias : public Function { +private: This needs a block comment above it for doxygen, explaining what it is. Also, you have FunctionAlias. Is there also a GlobalVariableAlias? Why does this inherit from Function? Can FunctionAliases have a body? If not, it shouldn't inherit from Function. Minor stuff: + std::string getTarget() const { return Target; } Should return a const& to the string. + if (TAI->getSetDirective()) { + if (FunctionAliases.begin() != FunctionAliases.end()) if (!FunctionAliases.empty()) + FunctionAlias* SA = dyn_cast(Src); + if (SA) { if (FunctionAlias* SA = dyn_cast(Src)) { Other stuff: should the verifier reject aliases with no name? How do aliases interact with the Linker? I'd like Reid to review the BC reader/writer changes. Please resend the patch with updates (particularly to langref). Thanks Anton, it will be great to get alias support! -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070418/7e876f4c/attachment.html From sabre at nondot.org Thu Apr 19 00:21:00 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 19 Apr 2007 00:21:00 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704190521.l3J5L0fR012573@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.111 -> 1.112 --- Log message: adjust entry --- Diffs of the changes: (+2 -2) DevMtgMay2007.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.111 llvm-www/DevMtgMay2007.html:1.112 --- llvm-www/DevMtgMay2007.html:1.111 Tue Apr 17 16:27:27 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 19 00:20:43 2007 @@ -332,7 +332,7 @@

    - +
    Unconfirmed Attendees
    NameOrganization
    Sarah ThompsonNASA, Ames Research Center
    Bill WendlingApple Inc.
    Marcel WeiherMetaObject
    Calum Wilkie
    Microchip Technology
    Calum WilkieMicrochip Technology
    @@ -355,6 +355,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/17 21:27:27 $ +
    Last modified: $Date: 2007/04/19 05:20:43 $ From zhousheng00 at gmail.com Thu Apr 19 00:35:18 2007 From: zhousheng00 at gmail.com (Zhou Sheng) Date: Thu, 19 Apr 2007 00:35:18 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp Message-ID: <200704190535.l3J5ZIf3012869@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: PredicateSimplifier.cpp updated: 1.67 -> 1.68 --- Log message: Make the operations of APInt variables more efficient. --- Diffs of the changes: (+21 -27) PredicateSimplifier.cpp | 48 +++++++++++++++++++++--------------------------- 1 files changed, 21 insertions(+), 27 deletions(-) Index: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp diff -u llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.67 llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.68 --- llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.67 Sat Apr 14 18:32:02 2007 +++ llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp Thu Apr 19 00:35:00 2007 @@ -747,35 +747,34 @@ case ICmpInst::ICMP_SLT: return ConstantRange(APInt::getSignedMinValue(W), CR.getSignedMax()); case ICmpInst::ICMP_ULE: { - APInt UMax = CR.getUnsignedMax(); + APInt UMax(CR.getUnsignedMax()); if (UMax == APInt::getMaxValue(W)) return ConstantRange(W); return ConstantRange(APInt::getMinValue(W), UMax + 1); } case ICmpInst::ICMP_SLE: { - APInt SMax = CR.getSignedMax(); + APInt SMax(CR.getSignedMax()); if (SMax == APInt::getSignedMaxValue(W) || SMax + 1 == APInt::getSignedMaxValue(W)) return ConstantRange(W); return ConstantRange(APInt::getSignedMinValue(W), SMax + 1); } case ICmpInst::ICMP_UGT: - return ConstantRange(CR.getUnsignedMin() + 1, - APInt::getMaxValue(W) + 1); + return ConstantRange(CR.getUnsignedMin() + 1, APInt::getNullValue(W)); case ICmpInst::ICMP_SGT: return ConstantRange(CR.getSignedMin() + 1, - APInt::getSignedMaxValue(W) + 1); + APInt::getSignedMinValue(W)); case ICmpInst::ICMP_UGE: { - APInt UMin = CR.getUnsignedMin(); + APInt UMin(CR.getUnsignedMin()); if (UMin == APInt::getMinValue(W)) return ConstantRange(W); - return ConstantRange(UMin, APInt::getMaxValue(W) + 1); + return ConstantRange(UMin, APInt::getNullValue(W)); } case ICmpInst::ICMP_SGE: { - APInt SMin = CR.getSignedMin(); + APInt SMin(CR.getSignedMin()); if (SMin == APInt::getSignedMinValue(W)) return ConstantRange(W); - return ConstantRange(SMin, APInt::getSignedMaxValue(W) + 1); + return ConstantRange(SMin, APInt::getSignedMinValue(W)); } } } @@ -969,16 +968,16 @@ ConstantRange NewCR2(CR1.getUpper(), CR1.getLower()); applyRange(V2, NewCR2, Subtree, VRP); } else if (*I == CR2.getLower()) { - APInt NewLower = CR2.getLower() + 1, - NewUpper = CR2.getUpper(); + APInt NewLower(CR2.getLower() + 1), + NewUpper(CR2.getUpper()); if (NewLower == NewUpper) NewLower = NewUpper = APInt::getMinValue(W); ConstantRange NewCR2(NewLower, NewUpper); applyRange(V2, NewCR2, Subtree, VRP); } else if (*I == CR2.getUpper() - 1) { - APInt NewLower = CR2.getLower(), - NewUpper = CR2.getUpper() - 1; + APInt NewLower(CR2.getLower()), + NewUpper(CR2.getUpper() - 1); if (NewLower == NewUpper) NewLower = NewUpper = APInt::getMinValue(W); @@ -992,16 +991,16 @@ ConstantRange NewCR1(CR2.getUpper(), CR2.getLower()); applyRange(V1, NewCR1, Subtree, VRP); } else if (*I == CR1.getLower()) { - APInt NewLower = CR1.getLower() + 1, - NewUpper = CR1.getUpper(); + APInt NewLower(CR1.getLower() + 1), + NewUpper(CR1.getUpper()); if (NewLower == NewUpper) NewLower = NewUpper = APInt::getMinValue(W); ConstantRange NewCR1(NewLower, NewUpper); applyRange(V1, NewCR1, Subtree, VRP); } else if (*I == CR1.getUpper() - 1) { - APInt NewLower = CR1.getLower(), - NewUpper = CR1.getUpper() - 1; + APInt NewLower(CR1.getLower()), + NewUpper(CR1.getUpper() - 1); if (NewLower == NewUpper) NewLower = NewUpper = APInt::getMinValue(W); @@ -2242,10 +2241,8 @@ VRPSolver VRP(IG, UB, VR, PS->Forest, PS->modified, &SI); uint32_t SrcBitWidth = cast(SI.getSrcTy())->getBitWidth(); uint32_t DstBitWidth = cast(SI.getDestTy())->getBitWidth(); - APInt Min(APInt::getSignedMinValue(SrcBitWidth)); - APInt Max(APInt::getSignedMaxValue(SrcBitWidth)); - Min.sext(DstBitWidth); - Max.sext(DstBitWidth); + APInt Min(APInt::getHighBitsSet(DstBitWidth, DstBitWidth-SrcBitWidth+1)); + APInt Max(APInt::getLowBitsSet(DstBitWidth, SrcBitWidth-1)); VRP.add(ConstantInt::get(Min), &SI, ICmpInst::ICMP_SLE); VRP.add(ConstantInt::get(Max), &SI, ICmpInst::ICMP_SGE); VRP.solve(); @@ -2255,8 +2252,7 @@ VRPSolver VRP(IG, UB, VR, PS->Forest, PS->modified, &ZI); uint32_t SrcBitWidth = cast(ZI.getSrcTy())->getBitWidth(); uint32_t DstBitWidth = cast(ZI.getDestTy())->getBitWidth(); - APInt Max(APInt::getMaxValue(SrcBitWidth)); - Max.zext(DstBitWidth); + APInt Max(APInt::getLowBitsSet(DstBitWidth, SrcBitWidth)); VRP.add(ConstantInt::get(Max), &ZI, ICmpInst::ICMP_UGE); VRP.solve(); } @@ -2353,14 +2349,12 @@ case ICmpInst::ICMP_SLT: case ICmpInst::ICMP_ULT: if (Op1->getValue() != 0) - NextVal = cast(ConstantExpr::getSub( - Op1, ConstantInt::get(Op1->getType(), 1))); + NextVal = ConstantInt::get(Op1->getValue()-1); break; case ICmpInst::ICMP_SGT: case ICmpInst::ICMP_UGT: if (!Op1->getValue().isAllOnesValue()) - NextVal = cast(ConstantExpr::getAdd( - Op1, ConstantInt::get(Op1->getType(), 1))); + NextVal = ConstantInt::get(Op1->getValue()+1); break; } From zhousheng00 at gmail.com Thu Apr 19 00:39:34 2007 From: zhousheng00 at gmail.com (Zhou Sheng) Date: Thu, 19 Apr 2007 00:39:34 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <200704190539.l3J5dYFh013062@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: BasicAliasAnalysis.cpp updated: 1.107 -> 1.108 --- Log message: Make use of ConstantInt::isZero instead of ConstantInt::isNullValue. --- Diffs of the changes: (+1 -1) BasicAliasAnalysis.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.107 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.108 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.107 Wed Feb 14 20:26:09 2007 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Thu Apr 19 00:39:12 2007 @@ -620,7 +620,7 @@ if (NumGEP1Ops > MinOperands) { for (unsigned i = FirstConstantOper; i != MaxOperands; ++i) if (isa(GEP1Ops[i]) && - !cast(GEP1Ops[i])->isNullValue()) { + !cast(GEP1Ops[i])->isZero()) { // Yup, there's a constant in the tail. Set all variables to // constants in the GEP instruction to make it suiteable for // TargetData::getIndexedOffset. From zhousheng00 at gmail.com Thu Apr 19 00:39:35 2007 From: zhousheng00 at gmail.com (Zhou Sheng) Date: Thu, 19 Apr 2007 00:39:35 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp ScalarReplAggregates.cpp Message-ID: <200704190539.l3J5dZ9I013069@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.748 -> 1.749 ScalarReplAggregates.cpp updated: 1.84 -> 1.85 --- Log message: Make use of ConstantInt::isZero instead of ConstantInt::isNullValue. --- Diffs of the changes: (+5 -5) InstructionCombining.cpp | 8 ++++---- ScalarReplAggregates.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.748 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.749 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.748 Sat Apr 14 20:02:18 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Apr 19 00:39:12 2007 @@ -2224,7 +2224,7 @@ // 0 - (X sdiv C) -> (X sdiv -C) if (Op1I->getOpcode() == Instruction::SDiv) if (ConstantInt *CSI = dyn_cast(Op0)) - if (CSI->isNullValue()) + if (CSI->isZero()) if (Constant *DivRHS = dyn_cast(Op1I->getOperand(1))) return BinaryOperator::createSDiv(Op1I->getOperand(0), ConstantExpr::getNeg(DivRHS)); @@ -2268,7 +2268,7 @@ switch (pred) { case ICmpInst::ICMP_SLT: // True if LHS s< RHS and RHS == 0 - return RHS->isNullValue(); + return RHS->isZero(); case ICmpInst::ICMP_SLE: // True if LHS s<= RHS and RHS == -1 return RHS->isAllOnesValue(); @@ -2303,7 +2303,7 @@ return BinaryOperator::createMul(SI->getOperand(0), ConstantExpr::getShl(CI, ShOp)); - if (CI->isNullValue()) + if (CI->isZero()) return ReplaceInstUsesWith(I, Op1); // X * 0 == 0 if (CI->equalsInt(1)) // X * 1 == X return ReplaceInstUsesWith(I, Op0); @@ -8131,7 +8131,7 @@ // input pointer, it just changes its type. if (AllZeroIndices) { if (ConstantInt *CI = dyn_cast(GEP.getOperand(i))) - AllZeroIndices = CI->isNullValue(); + AllZeroIndices = CI->isZero(); else AllZeroIndices = false; } Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.84 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.85 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.84 Wed Apr 11 10:45:25 2007 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Thu Apr 19 00:39:12 2007 @@ -834,7 +834,7 @@ } else if (GEP->getNumOperands() == 3 && isa(GEP->getOperand(1)) && isa(GEP->getOperand(2)) && - cast(GEP->getOperand(1))->isNullValue()) { + cast(GEP->getOperand(1))->isZero()) { // We are stepping into an element, e.g. a structure or an array: // GEP Ptr, int 0, uint C const Type *AggTy = PTy->getElementType(); From asl at math.spbu.ru Thu Apr 19 02:05:02 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Thu, 19 Apr 2007 11:05:02 +0400 Subject: [llvm-commits] Function aliases In-Reply-To: References: <1176940422.13159.87.camel@asl.dorms.spbu.ru> Message-ID: <1176966302.13159.117.camel@asl.dorms.spbu.ru> Hello, Chris. > First, you are changing the LLVM language. When you do this, please > submit a patch for langref before you write code :). In this case, > I'd like to see the patch so that I understand the semantics of what > you're proposing. Ok. However language semantics was already discussed with you and Reid some time ago :) The syntax itself is: declare %i32 foo(...) alias "bar" > Do aliases only apply to function-like things, or can they also apply > to global vars? Aliases are "hacks". I don't see any field, where they can be useful, except gcc support. GCC doesn't allow variable aliases and I don't know how they should look (and work!). That's why I'm focusing on function aliases only. > This needs a block comment above it for doxygen, explaining what it > is. Also, you have FunctionAlias. Is there also a > GlobalVariableAlias? Why does this inherit from Function? Can > FunctionAliases have a body? If not, it shouldn't inherit from > Function. FunctionAliases are actually Functions declarations with some "extra" information. That's why they should be inherited from Function. Another reason: this will allow all optimization passes think about FunctionAliases as Functions and use casts if they actually need alias target > + if (TAI->getSetDirective()) { > + if (FunctionAliases.begin() != FunctionAliases.end()) > if (!FunctionAliases.empty()) I saw such idiom many time in the current LLVM code. That's why I selected it :) > Other stuff: should the verifier reject aliases with no name? Yes, I've forgotten about this. > How do aliases interact with the Linker? Linker patch was included. Currently we're linking two aliases only if they have same name and go to the same destination. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From dpatel at apple.com Thu Apr 19 12:48:57 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 19 Apr 2007 10:48:57 -0700 Subject: [llvm-commits] [126245] Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/ Week-of-Mon-20070416/047943.html In-Reply-To: <200704180815.29808.baldrick@free.fr> References: <20070417202912.A40AFF24490E@src> <200704172242.06347.baldrick@free.fr> <200704180815.29808.baldrick@free.fr> Message-ID: On Apr 17, 2007, at 11:15 PM, Duncan Sands wrote: > Hi Devang, > >> if >> (StartOffsetInBits > FirstUnallocatedByte*8) >> >> is true then >> >> (StartOffsetFromByteBoundry == 0) >> >> is always true. If so, we could simply this even further. In other >> words, if we need pad bytes for a new field then it always starts at >> byte boundary. Can you think of an example where this is not true ? > > yes, this need not be true in Ada, where bitfields can be placed > wherever you like, Is it true for very first bitfield also ? > for example > > type Second_Bitfield_Not_At_Bitoffset_Zero is record > A : Character; > B : Integer; > end record; > for Second_Bitfield_Not_At_Bitoffset_Zero use record > A at 0 range 0 .. 7; > B at 0 range 27 .. 64; > end record; so here, range is not value range. In that case size of B should be 64. No? - Devang > > -- "gaps__second_bitfield_not_at_bitoffset_zero", size 72 > -- Fields: > -- "a", size 8, offset 0, bit offset 0 > -- "b", size 32, offset 0, bit offset 27 > > Best wishes, > > Duncan. From dpatel at apple.com Thu Apr 19 13:10:18 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 19 Apr 2007 11:10:18 -0700 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h In-Reply-To: <200704180438.l3I4cvA0000536@zion.cs.uiuc.edu> References: <200704180438.l3I4cvA0000536@zion.cs.uiuc.edu> Message-ID: <90F5B0F3-0DC5-4B4C-947E-F0C6CD937AF4@apple.com> On Apr 17, 2007, at 9:38 PM, Owen Anderson wrote: > Index: llvm/include/llvm/Analysis/Dominators.h > diff -u llvm/include/llvm/Analysis/Dominators.h:1.72 llvm/include/ > llvm/Analysis/Dominators.h:1.73 > --- llvm/include/llvm/Analysis/Dominators.h:1.72 Sun Apr 15 18:14:18 > 2007 > +++ llvm/include/llvm/Analysis/Dominators.h Tue Apr 17 23:38:39 2007 > @@ -320,6 +320,13 @@ > return NULL; > return Common->getData(); > } > + > + /// Return the immediate dominator of A. > + BasicBlock *getIDom(BasicBlock *A) { > + ETNode *NodeA = getNode(A); Please add an assert to check that NodeA is not null. Thanks! - Devang > > + const ETNode *idom = NodeA->getFather(); > + return idom ? idom->getData() : 0; > + } > > virtual void getAnalysisUsage(AnalysisUsage &AU) const { > AU.setPreservesAll(); > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From christopher.lamb at gmail.com Thu Apr 19 13:34:01 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Thu, 19 Apr 2007 13:34:01 -0500 Subject: [llvm-commits] Message cleanup Message-ID: This patch just cleans up some messages in LLVM. This is my first patch, and internally at Ageia we're already using subversion so these patches were created using a non-standard process and I want to make sure that the patches will apply easily. If they'll work I've got changes for PR400 and PR1294 I'd like to submit. -- Christopher Lamb ? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070419/7b3cc34a/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: message_cleanup.patch Type: application/octet-stream Size: 1558 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070419/7b3cc34a/attachment.obj -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070419/7b3cc34a/attachment-0001.html From clattner at apple.com Thu Apr 19 13:43:37 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 19 Apr 2007 11:43:37 -0700 Subject: [llvm-commits] Message cleanup In-Reply-To: References: Message-ID: On Apr 19, 2007, at 11:34 AM, Christopher Lamb wrote: > This patch just cleans up some messages in LLVM. This is my first > patch, and internally at Ageia we're already using subversion so > these patches were created using a non-standard process and I want > to make sure that the patches will apply easily. > > -- > Christopher Lamb > > The first hunk applied fine, the second failed with: patch unexpectedly ends in middle of line Hunk #1 FAILED at 33. 1 out of 1 hunk FAILED -- saving rejects to file include/llvm/Support/ OutputBuffer.h.rej Would this be easier if you had CVS commit access? > If they'll work I've got changes for PR400 and PR1294 I'd like to > submit. Great! -Chris From christopher.lamb at gmail.com Thu Apr 19 13:44:15 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Thu, 19 Apr 2007 13:44:15 -0500 Subject: [llvm-commits] Message cleanup In-Reply-To: References: Message-ID: <46925892-1AE8-4419-BA0D-50E23619404C@gmail.com> On Apr 19, 2007, at 1:34 PM, Christopher Lamb wrote: > This patch just cleans up some messages in LLVM. This is my first > patch, and internally at Ageia we're already using subversion so > these patches were created using a non-standard process and I want > to make sure that the patches will apply easily. > > If they'll work I've got changes for PR400 and PR1294 I'd like to > submit. > I see that the patch had the wrong file extension... -- Christopher Lamb -------------- next part -------------- A non-text attachment was scrubbed... Name: message_cleanup.diff Type: application/octet-stream Size: 1558 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070419/7220d7bd/attachment.obj -------------- next part -------------- From clattner at apple.com Thu Apr 19 13:45:35 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 19 Apr 2007 11:45:35 -0700 Subject: [llvm-commits] Message cleanup In-Reply-To: <46925892-1AE8-4419-BA0D-50E23619404C@gmail.com> References: <46925892-1AE8-4419-BA0D-50E23619404C@gmail.com> Message-ID: On Apr 19, 2007, at 11:44 AM, Christopher Lamb wrote: > > On Apr 19, 2007, at 1:34 PM, Christopher Lamb wrote: > >> This patch just cleans up some messages in LLVM. This is my first >> patch, and internally at Ageia we're already using subversion so >> these patches were created using a non-standard process and I want >> to make sure that the patches will apply easily. >> >> If they'll work I've got changes for PR400 and PR1294 I'd like to >> submit. >> > > I see that the patch had the wrong file extension... The extension is ok, but the diff looks funky: assert(Boundary && (Boundary & (Boundary - 1)) == 0 && - "Must alitypedef std::vector DataBuffer;gn to 2^k boundary"); + "Must align to 2^k boundary"); size_t Size = Output.size(); -Chris From clattner at apple.com Thu Apr 19 13:51:30 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 19 Apr 2007 11:51:30 -0700 Subject: [llvm-commits] Function aliases In-Reply-To: <1176966302.13159.117.camel@asl.dorms.spbu.ru> References: <1176940422.13159.87.camel@asl.dorms.spbu.ru> <1176966302.13159.117.camel@asl.dorms.spbu.ru> Message-ID: <8D3B8F3B-CE41-4905-8A85-264406EFC7DD@apple.com> >> First, you are changing the LLVM language. When you do this, please >> submit a patch for langref before you write code :). In this case, >> I'd like to see the patch so that I understand the semantics of what >> you're proposing. > Ok. However language semantics was already discussed with you and Reid > some time ago :) The syntax itself is: > > declare %i32 foo(...) alias "bar" Ok, does this also apply to functions with bodies? >> Do aliases only apply to function-like things, or can they also apply >> to global vars? > Aliases are "hacks". I don't see any field, where they can be useful, > except gcc support. GCC doesn't allow variable aliases and I don't > know > how they should look (and work!). That's why I'm focusing on function > aliases only. Ok >> This needs a block comment above it for doxygen, explaining what it >> is. Also, you have FunctionAlias. Is there also a >> GlobalVariableAlias? Why does this inherit from Function? Can >> FunctionAliases have a body? If not, it shouldn't inherit from >> Function. > FunctionAliases are actually Functions declarations with some "extra" > information. That's why they should be inherited from Function. > Another > reason: this will allow all optimization passes think about > FunctionAliases as Functions and use casts if they actually need alias > target If they can have bodies, why not just make this an instance variable in the Function class? If the string is empty, there is no alias. >> + if (TAI->getSetDirective()) { >> + if (FunctionAliases.begin() != FunctionAliases.end()) >> if (!FunctionAliases.empty()) > I saw such idiom many time in the current LLVM code. That's why I > selected it :) Ok, they should be fixed! :) >> Other stuff: should the verifier reject aliases with no name? > Yes, I've forgotten about this. Ok >> How do aliases interact with the Linker? > Linker patch was included. Currently we're linking two aliases only if > they have same name and go to the same destination. The question is, what happens if we link something like this: void foo() alias bar {} --- extern void bar(); void baz() { bar(); } Do the two functions (the extern of bar and the decl of foo) get linked up? What happens if the foo declaration was a prototype with no body? -Chris From baldrick at free.fr Thu Apr 19 13:51:58 2007 From: baldrick at free.fr (Duncan Sands) Date: Thu, 19 Apr 2007 20:51:58 +0200 Subject: [llvm-commits] [126245] Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/ Week-of-Mon-20070416/047943.html In-Reply-To: References: <20070417202912.A40AFF24490E@src> <200704180815.29808.baldrick@free.fr> Message-ID: <200704192051.58283.baldrick@free.fr> Hi Devang, > > yes, this need not be true in Ada, where bitfields can be placed > > wherever you like, > > Is it true for very first bitfield also ? yes, it is true for all bitfields including the first. > > for example > > > > type Second_Bitfield_Not_At_Bitoffset_Zero is record > > A : Character; > > B : Integer; > > end record; > > for Second_Bitfield_Not_At_Bitoffset_Zero use record > > A at 0 range 0 .. 7; > > B at 0 range 27 .. 64; > > end record; > > so here, range is not value range. In that case size of B > should be 64. No? Here the range for B is 38 bits, which is enough to contain the 32 bits of an integer. The bit range needs to be at least as wide as the type, it cannot be smaller. This code is perfectly legal and works fine with gcc. That said, it was a typo, I didn't mean to write 27..64, but 27..58. Ciao, Duncan. From christopher.lamb at gmail.com Thu Apr 19 13:53:05 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Thu, 19 Apr 2007 13:53:05 -0500 Subject: [llvm-commits] Message cleanup In-Reply-To: References: <46925892-1AE8-4419-BA0D-50E23619404C@gmail.com> Message-ID: <81DE17A2-3D70-43B8-BD1D-9DDE9DC6A752@gmail.com> On Apr 19, 2007, at 1:45 PM, Chris Lattner wrote: > > On Apr 19, 2007, at 11:44 AM, Christopher Lamb wrote: > >> >> On Apr 19, 2007, at 1:34 PM, Christopher Lamb wrote: >> >>> This patch just cleans up some messages in LLVM. This is my first >>> patch, and internally at Ageia we're already using subversion so >>> these patches were created using a non-standard process and I want >>> to make sure that the patches will apply easily. >>> >>> If they'll work I've got changes for PR400 and PR1294 I'd like to >>> submit. >>> >> >> I see that the patch had the wrong file extension... > > The extension is ok, but the diff looks funky: > > assert(Boundary && (Boundary & (Boundary - 1)) == 0 && > - "Must alitypedef std::vector > DataBuffer;gn to 2^k boundary"); > + "Must align to 2^k boundary"); > size_t Size = Output.size(); > By funky do you mean the line break? It's not in the file I sent, nor in the file as saved on the commits archive site. -- Christopher Lamb -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070419/9387fa3f/attachment.html From christopher.lamb at gmail.com Thu Apr 19 13:56:04 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Thu, 19 Apr 2007 13:56:04 -0500 Subject: [llvm-commits] Message cleanup In-Reply-To: References: Message-ID: <0F2CD02D-D66A-40FB-8C46-E6E420DCA6FB@gmail.com> On Apr 19, 2007, at 1:43 PM, Chris Lattner wrote: > > On Apr 19, 2007, at 11:34 AM, Christopher Lamb wrote: > >> This patch just cleans up some messages in LLVM. This is my first >> patch, and internally at Ageia we're already using subversion so >> these patches were created using a non-standard process and I want >> to make sure that the patches will apply easily. >> >> -- >> Christopher Lamb >> >> > > The first hunk applied fine, the second failed with: > > patch unexpectedly ends in middle of line > Hunk #1 FAILED at 33. > 1 out of 1 hunk FAILED -- saving rejects to file include/llvm/Support/ > OutputBuffer.h.rej > > Would this be easier if you had CVS commit access? I talked with our config manager here and it sounds like commit access would be helpful, but more so after the SVN migration. -- Christopher Lamb -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070419/c5691adf/attachment.html From clattner at apple.com Thu Apr 19 13:57:53 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 19 Apr 2007 11:57:53 -0700 Subject: [llvm-commits] Message cleanup In-Reply-To: <81DE17A2-3D70-43B8-BD1D-9DDE9DC6A752@gmail.com> References: <46925892-1AE8-4419-BA0D-50E23619404C@gmail.com> <81DE17A2-3D70-43B8-BD1D-9DDE9DC6A752@gmail.com> Message-ID: <9E2EDD10-5356-4BAE-ABA0-FA30130795D3@apple.com> >>> I see that the patch had the wrong file extension... >> >> The extension is ok, but the diff looks funky: >> >> assert(Boundary && (Boundary & (Boundary - 1)) == 0 && >> - "Must alitypedef std::vector >> DataBuffer;gn to 2^k boundary"); >> + "Must align to 2^k boundary"); >> size_t Size = Output.size(); >> > > By funky do you mean the line break? It's not in the file I sent, > nor in the file as saved on the commits archive site. Okay, I figured out what is happening. The code looks like this: "Must alitypedef std::vector DataBuffer;gn to 2^k boundary"); size_t Size = Output.size(); if (Size & (Boundary - 1)) { // Add padding to get alignment to the correct place. The blank line (in CVS) has several spaces in it. In your patch there are no spaces, so the patch doesn't apply. Is something stripping off trailing spaces here? -Chris From asl at math.spbu.ru Thu Apr 19 14:03:45 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Thu, 19 Apr 2007 23:03:45 +0400 Subject: [llvm-commits] Function aliases In-Reply-To: <8D3B8F3B-CE41-4905-8A85-264406EFC7DD.SS2300SS@apple.com> References: <1176940422.13159.87.camel@asl.dorms.spbu.ru> <1176966302.13159.117.camel@asl.dorms.spbu.ru> <8D3B8F3B-CE41-4905-8A85-264406EFC7DD.SS2300SS@apple.com> Message-ID: <1177009425.13159.133.camel@asl.dorms.spbu.ru> Chris, > Ok, does this also apply to functions with bodies? No. Declarations only. AsmParser takes care of this. > If they can have bodies, why not just make this an instance variable > in the Function class? If the string is empty, there is no alias. :) This was my initial proposal (some week ago), you've responded something like "this will be waste of space and memory, since only few functions will use this feature". > Ok, they should be fixed! :) Ok. > void foo() alias bar {} This isn't allowed. foo acts as bar's mirror, so body of foo is redefinition. > Do the two functions (the extern of bar and the decl of foo) get > linked up? What happens if the foo declaration was a prototype with > no body? They won't be linked. External functions can still call foo(); -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From christopher.lamb at gmail.com Thu Apr 19 14:15:57 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Thu, 19 Apr 2007 14:15:57 -0500 Subject: [llvm-commits] Message cleanup In-Reply-To: <9E2EDD10-5356-4BAE-ABA0-FA30130795D3@apple.com> References: <46925892-1AE8-4419-BA0D-50E23619404C@gmail.com> <81DE17A2-3D70-43B8-BD1D-9DDE9DC6A752@gmail.com> <9E2EDD10-5356-4BAE-ABA0-FA30130795D3@apple.com> Message-ID: <6687A258-A75B-45F5-A519-D28D8A9E59FF@gmail.com> On Apr 19, 2007, at 1:57 PM, Chris Lattner wrote: >>>> I see that the patch had the wrong file extension... >>> >>> The extension is ok, but the diff looks funky: >>> >>> assert(Boundary && (Boundary & (Boundary - 1)) == 0 && >>> - "Must alitypedef std::vector >>> DataBuffer;gn to 2^k boundary"); >>> + "Must align to 2^k boundary"); >>> size_t Size = Output.size(); >>> >> >> By funky do you mean the line break? It's not in the file I sent, >> nor in the file as saved on the commits archive site. > > Okay, I figured out what is happening. The code looks like this: > > "Must alitypedef std::vector > DataBuffer;gn to 2^k boundary"); > size_t Size = Output.size(); > > if (Size & (Boundary - 1)) { > // Add padding to get alignment to the correct place. > > The blank line (in CVS) has several spaces in it. In your patch > there are no spaces, so the patch doesn't apply. Is something > stripping off trailing spaces here? I had edited the patches in TextMate, which does some whitespace stripping in certain instances, apparently. This patch should have the needed whitespace. -- Christopher Lamb ? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070419/d402c2c7/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: message_cleanup.diff Type: application/octet-stream Size: 1579 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070419/d402c2c7/attachment.obj -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070419/d402c2c7/attachment-0001.html From djg at cray.com Thu Apr 19 15:51:57 2007 From: djg at cray.com (Dan Gohman) Date: Thu, 19 Apr 2007 15:51:57 -0500 Subject: [llvm-commits] Function aliases In-Reply-To: <1176966302.13159.117.camel@asl.dorms.spbu.ru> Message-ID: <20070419205157.GQ5062@village.us.cray.com> > GCC doesn't allow variable aliases and I don't know > how they should look (and work!). That's why I'm focusing on function > aliases only. Actually, GCC does accept variable aliases, at least on i686-pc-linux-gnu and several other targets. This code compiles and has two symbols in the output: int x = 2; extern int y __attribute__((alias("x"))); Dan -- Dan Gohman, Cray Inc. From christopher.lamb at gmail.com Thu Apr 19 16:12:29 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Thu, 19 Apr 2007 16:12:29 -0500 Subject: [llvm-commits] PR400 align attribute Message-ID: <09A11957-044B-41A1-AAE6-3EDEFB2907C8@gmail.com> This patch is a bytecode change. It takes the volatile load/store pseudo instructions and turns them into attributed load/store instructions. Current attributes are either volatile and/or an alignment. The change is assembly format backwards compatible. The change should require no changes in the front end, but the front end does not currently use the align attribute. -- Christopher Lamb ? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070419/d6bf2479/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: PR400_align.diff Type: application/octet-stream Size: 44705 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070419/d6bf2479/attachment.obj -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070419/d6bf2479/attachment-0001.html From dpatel at apple.com Thu Apr 19 17:05:17 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Thu, 19 Apr 2007 15:05:17 -0700 (PDT) Subject: [llvm-commits] [126319] Enable loop rotation. Message-ID: <20070419220517.EA88DF914EE0@src> Revision: 126319 Author: dpatel Date: 2007-04-19 15:05:17 -0700 (Thu, 19 Apr 2007) Log Message: ----------- Enable loop rotation. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-backend.cpp apple-local/branches/llvm/gcc/llvm-linker-hack.cpp Modified: apple-local/branches/llvm/gcc/llvm-backend.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-04-19 21:20:06 UTC (rev 126318) +++ apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-04-19 22:05:17 UTC (rev 126319) @@ -315,6 +315,7 @@ PM->add(createTailCallEliminationPass()); // Eliminate tail calls PM->add(createCFGSimplificationPass()); // Merge & remove BBs PM->add(createReassociatePass()); // Reassociate expressions + PM->add(createLoopRotatePass()); // Rotate Loop PM->add(createLICMPass()); // Hoist loop invariants PM->add(createLoopUnswitchPass()); // Unswitch loops. PM->add(createInstructionCombiningPass()); // Clean up after LICM/reassoc Modified: apple-local/branches/llvm/gcc/llvm-linker-hack.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-linker-hack.cpp 2007-04-19 21:20:06 UTC (rev 126318) +++ apple-local/branches/llvm/gcc/llvm-linker-hack.cpp 2007-04-19 22:05:17 UTC (rev 126319) @@ -53,6 +53,7 @@ llvm::createLinearScanRegisterAllocator(); llvm::createGCSEPass(); + llvm::createLoopRotatePass(); llvm::createLICMPass(); llvm::createSCCPPass(); llvm::createPruneEHPass(); From rspencer at reidspencer.com Thu Apr 19 19:26:56 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Thu, 19 Apr 2007 17:26:56 -0700 Subject: [llvm-commits] Function aliases In-Reply-To: <1177009425.13159.133.camel@asl.dorms.spbu.ru> References: <1176940422.13159.87.camel@asl.dorms.spbu.ru> <1176966302.13159.117.camel@asl.dorms.spbu.ru> <8D3B8F3B-CE41-4905-8A85-264406EFC7DD.SS2300SS@apple.com> <1177009425.13159.133.camel@asl.dorms.spbu.ru> Message-ID: Chris/Anton, I don't understand why we need a subclass of Function for this? Can't we just derive an "Alias" class from a smart pointer to Value? Then the Alias object is what is placed in the symbol table and the overhead only occurs if you use the feature. Reid. On Thu, 19 Apr 2007 23:03:45 +0400 Anton Korobeynikov wrote: > Chris, > >> Ok, does this also apply to functions with bodies? > No. Declarations only. AsmParser takes care of this. > >> If they can have bodies, why not just make this an >>instance variable >> in the Function class? If the string is empty, there is >>no alias. > :) This was my initial proposal (some week ago), you've >responded > something like "this will be waste of space and memory, >since only few > functions will use this feature". > >> Ok, they should be fixed! :) > Ok. > >> void foo() alias bar {} > This isn't allowed. foo acts as bar's mirror, so body of >foo is > redefinition. > >> Do the two functions (the extern of bar and the decl of >>foo) get >> linked up? What happens if the foo declaration was a >>prototype with >> no body? > They won't be linked. External functions can still call >foo(); > > -- > With best regards, Anton Korobeynikov. > >Faculty of Mathematics & Mechanics, Saint Petersburg >State University. > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From clattner at apple.com Thu Apr 19 22:28:00 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 19 Apr 2007 20:28:00 -0700 Subject: [llvm-commits] Message cleanup In-Reply-To: <6687A258-A75B-45F5-A519-D28D8A9E59FF@gmail.com> References: <46925892-1AE8-4419-BA0D-50E23619404C@gmail.com> <81DE17A2-3D70-43B8-BD1D-9DDE9DC6A752@gmail.com> <9E2EDD10-5356-4BAE-ABA0-FA30130795D3@apple.com> <6687A258-A75B-45F5-A519-D28D8A9E59FF@gmail.com> Message-ID: <4BFA7739-3C4F-4E4C-A51D-EBC449640DF6@apple.com> >> >> if (Size & (Boundary - 1)) { >> // Add padding to get alignment to the correct place. >> >> The blank line (in CVS) has several spaces in it. In your patch >> there are no spaces, so the patch doesn't apply. Is something >> stripping off trailing spaces here? > > I had edited the patches in TextMate, which does some whitespace > stripping in certain instances, apparently. This patch should have > the needed whitespace. > Yep, that did it! -Chris From clattner at apple.com Fri Apr 20 00:12:14 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 19 Apr 2007 22:12:14 -0700 Subject: [llvm-commits] PR400 align attribute In-Reply-To: <09A11957-044B-41A1-AAE6-3EDEFB2907C8@gmail.com> References: <09A11957-044B-41A1-AAE6-3EDEFB2907C8@gmail.com> Message-ID: <0CE59B23-2C66-46D0-9CF8-3C32991D2325@apple.com> On Apr 19, 2007, at 2:12 PM, Christopher Lamb wrote: > This patch is a bytecode change. It takes the volatile load/store > pseudo instructions and turns them into attributed load/store > instructions. Current attributes are either volatile and/or an > alignment. > > The change is assembly format backwards compatible. > > The change should require no changes in the front end, but the > front end does not currently use the align attribute. Overall this looks really great. Please get Reid to review the bc format changes when he gets back (likely after the patch goes in). Some requests: This adds an extra word to LoadInst and StoreInst. Since alignments must be a power of two, I suggest representing them as a shift amount (e.g, an alignment of 16 is stored as 4, 1<<4 == 16). Given this, we don't need a large number of bits to support very large shift amounts. Given this, you can store it in the "SubClassData" member of Value (which is 16 bits wide), to avoid using the word. Load and StoreInst currently store a bit in that word. The only trick here is that we want power-of-two-plus one, so that "0" represents an alignment of zero, not an alignment of 1. Please don't #include MathExtras.h in Instructions.h + LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false, + Instruction *InsertBefore = 0, unsigned Align = 0); The instruction* to insert before should be the last member. In the case of alignment, I don't think we need a helper constructor for this (in fact, we probably don't need one for volatile either). Any clients that want to create a load instruction with a specific alignment can create it, then use setAlignment() :) SDOperand SelectionDAGLowering::getLoadFrom(const Type *Ty, SDOperand Ptr, const Value *SV, SDOperand Root, bool isVolatile, unsigned Alignment) { ... } else { - L = DAG.getLoad(TLI.getValueType(Ty), Root, Ptr, SV, 0, isVolatile); + L = DAG.getLoad(TLI.getValueType(Ty), Root, Ptr, SV, 0, isVolatile, Alignment); } Please ensure the code stays within 80 columns. @@ -2526,11 +2548,10 @@ SDOperand DAGCombiner::visitTRUNCATE(SDN // if the source and dest are the same type, we can drop both the extend // and the truncate return N0.getOperand(0); } - // fold (truncate (load x)) -> (smaller load x) // fold (truncate (srl (load x), c)) -> (smaller load (x+c/evtbits)) return ReduceLoadWidth(N); } You don't like this line? :) @@ -742,10 +738,34 @@ void BytecodeWriter::outputInstruction(c ... + if (LI->getAlignment() || LI->isVolatile()) { + NumOperands = 2; + Slots[1] = ((Log2_32(LI->getAlignment())+1)<<1) + (LI- >isVolatile() ? 1 : 0); Long line ... + // We need to encode the attributes of the store instruction as the third + // operand. Its not really a slot, but we don't want to break the + // instruction format for these instructions. + if (SI->getAlignment() || SI->isVolatile()) { + NumOperands = 3; + Slots[2] = ((Log2_32(SI->getAlignment())+1)<<1) + (SI- >isVolatile() ? 1 : 0); Long line. Please also update LangRef.html and the Bytecodeformat.html document as well. The patch looks great. Please update it the include the above, then commit it when you're ready. Thanks! -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070419/fe338999/attachment.html From clattner at apple.com Fri Apr 20 00:22:10 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 19 Apr 2007 22:22:10 -0700 Subject: [llvm-commits] Function aliases In-Reply-To: <1177021495.13159.147.camel@asl.dorms.spbu.ru> References: <20070419205157.GQ5062.SS386SS@village.us.cray.com> <1177021495.13159.147.camel@asl.dorms.spbu.ru> Message-ID: On Apr 19, 2007, at 3:24 PM, Anton Korobeynikov wrote: > Hello, Dan. > >> int x = 2; >> extern int y __attribute__((alias("x"))); > Funny. This isn't mentioned in gcc docs. This slightly changes the > situation. Thanks Dan, I had a sneaking suspicion that this was the case :) > Chris, maybe in this situation it will be better to spare 4 bytes at > GlobalValue object to store pointer to alias string there? I don't think that really makes sense. Aliases aren't really global variables or functions themselves, they are a third kind of object. What do you think about making a new GlobalAlias class, which derives from GlobalValue. Module would contain a list of these, just like it has a list of functions and gvars? This would clearly solve the memory use issue and I think it would be a cleaner design (obvious they can't have bodies, etc). What do you think? -Chris From clattner at apple.com Fri Apr 20 00:24:23 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 19 Apr 2007 22:24:23 -0700 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h In-Reply-To: <90F5B0F3-0DC5-4B4C-947E-F0C6CD937AF4@apple.com> References: <200704180438.l3I4cvA0000536@zion.cs.uiuc.edu> <90F5B0F3-0DC5-4B4C-947E-F0C6CD937AF4@apple.com> Message-ID: On Apr 19, 2007, at 11:10 AM, Devang Patel wrote: > > On Apr 17, 2007, at 9:38 PM, Owen Anderson wrote: > >> Index: llvm/include/llvm/Analysis/Dominators.h >> diff -u llvm/include/llvm/Analysis/Dominators.h:1.72 llvm/include/ >> llvm/Analysis/Dominators.h:1.73 >> --- llvm/include/llvm/Analysis/Dominators.h:1.72 Sun Apr 15 18:14:18 >> 2007 >> +++ llvm/include/llvm/Analysis/Dominators.h Tue Apr 17 23:38:39 2007 >> @@ -320,6 +320,13 @@ >> return NULL; >> return Common->getData(); >> } >> + >> + /// Return the immediate dominator of A. >> + BasicBlock *getIDom(BasicBlock *A) { >> + ETNode *NodeA = getNode(A); > > Please add an assert to check that NodeA is not null. Thanks! Also, please mark this method const :) -Chris From clattner at apple.com Fri Apr 20 00:27:16 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 19 Apr 2007 22:27:16 -0700 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h In-Reply-To: <200704180438.l3I4cvA0000536@zion.cs.uiuc.edu> References: <200704180438.l3I4cvA0000536@zion.cs.uiuc.edu> Message-ID: <84A81E3B-712B-4DC6-8A21-A9B3AF172F06@apple.com> > + /// Return the immediate dominator of A. > + BasicBlock *getIDom(BasicBlock *A) { > + ETNode *NodeA = getNode(A); > + const ETNode *idom = NodeA->getFather(); > + return idom ? idom->getData() : 0; > + } Random other question: Why does ETNode have a template accessor to get its data? Is the Data pointer every anything other than a BasicBlock*? If not, why not just type the pointer as BasicBlock* and rename getData() -> getBasicBlock() ? -Chris From christopher.lamb at gmail.com Fri Apr 20 00:32:47 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Fri, 20 Apr 2007 00:32:47 -0500 Subject: [llvm-commits] PR400 align attribute In-Reply-To: <0CE59B23-2C66-46D0-9CF8-3C32991D2325@apple.com> References: <09A11957-044B-41A1-AAE6-3EDEFB2907C8@gmail.com> <0CE59B23-2C66-46D0-9CF8-3C32991D2325@apple.com> Message-ID: On Apr 20, 2007, at 12:12 AM, Chris Lattner wrote: > > On Apr 19, 2007, at 2:12 PM, Christopher Lamb wrote: > >> This patch is a bytecode change. It takes the volatile load/store >> pseudo instructions and turns them into attributed load/store >> instructions. Current attributes are either volatile and/or an >> alignment. >> >> The change is assembly format backwards compatible. >> >> The change should require no changes in the front end, but the >> front end does not currently use the align attribute. > > Overall this looks really great. Please get Reid to review the bc > format changes when he gets back (likely after the patch goes in). > > Some requests: > > This adds an extra word to LoadInst and StoreInst. Since > alignments must be a power of two, I suggest representing them as a > shift amount (e.g, an alignment of 16 is stored as 4, 1<<4 == 16). > Given this, we don't need a large number of bits to support very > large shift amounts. Given this, you can store it in the > "SubClassData" member of Value (which is 16 bits wide), to avoid > using the word. Load and StoreInst currently store a bit in that > word. The only trick here is that we want power-of-two-plus one, > so that "0" represents an alignment of zero, not an alignment of 1. Yeah, I thought about that. It's not a bit problem, I'll encode the alignment the same way it's encoded in the BC which has this same issue. > Please don't #include MathExtras.h in Instructions.h No prob. I'll have to move the accessor methods to the .cpp file and include MathExtras there to use the Log2_32 function, though. > > > + LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = > false, > + Instruction *InsertBefore = 0, unsigned Align = 0); > > The instruction* to insert before should be the last member. In > the case of alignment, I don't think we need a helper constructor > for this (in fact, we probably don't need one for volatile > either). Any clients that want to create a load instruction with a > specific alignment can create it, then use setAlignment() :) These helper constructors were used quite prolifically in the lowering passes, like the hunk below. Do you prefer them to be changed to set the attribute directly? > SDOperand SelectionDAGLowering::getLoadFrom(const Type *Ty, > SDOperand Ptr, > const Value *SV, > SDOperand Root, > bool isVolatile, > unsigned Alignment) { > ... > } else { > - L = DAG.getLoad(TLI.getValueType(Ty), Root, Ptr, SV, 0, > isVolatile); > + L = DAG.getLoad(TLI.getValueType(Ty), Root, Ptr, SV, 0, > isVolatile, Alignment); > } > > Please ensure the code stays within 80 columns. > > > @@ -2526,11 +2548,10 @@ SDOperand DAGCombiner::visitTRUNCATE(SDN > // if the source and dest are the same type, we can drop > both the extend > // and the truncate > return N0.getOperand(0); > } > > - // fold (truncate (load x)) -> (smaller load x) > // fold (truncate (srl (load x), c)) -> (smaller load (x+c/ > evtbits)) > return ReduceLoadWidth(N); > } > > You don't like this line? :) > > > @@ -742,10 +738,34 @@ void BytecodeWriter::outputInstruction(c > ... > + if (LI->getAlignment() || LI->isVolatile()) { > + NumOperands = 2; > + Slots[1] = ((Log2_32(LI->getAlignment())+1)<<1) + (LI- > >isVolatile() ? 1 : 0); > > Long line > > ... > + // We need to encode the attributes of the store instruction > as the third > + // operand. Its not really a slot, but we don't want to > break the > + // instruction format for these instructions. > + if (SI->getAlignment() || SI->isVolatile()) { > + NumOperands = 3; > + Slots[2] = ((Log2_32(SI->getAlignment())+1)<<1) + (SI- > >isVolatile() ? 1 : 0); > > Long line. > > > Please also update LangRef.html and the Bytecodeformat.html > document as well. > > > The patch looks great. Please update it the include the above, > then commit it when you're ready. Thanks! No problem. -- Christopher Lamb -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070420/28ce609d/attachment.html From clattner at apple.com Fri Apr 20 00:35:40 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 19 Apr 2007 22:35:40 -0700 Subject: [llvm-commits] PR400 align attribute In-Reply-To: References: <09A11957-044B-41A1-AAE6-3EDEFB2907C8@gmail.com> <0CE59B23-2C66-46D0-9CF8-3C32991D2325@apple.com> Message-ID: <2567EA8D-A445-4B7B-98FB-2EF51C971E1B@apple.com> >> >> This adds an extra word to LoadInst and StoreInst. Since >> alignments must be a power of two, I suggest representing them as >> a shift amount (e.g, an alignment of 16 is stored as 4, 1<<4 == >> 16). Given this, we don't need a large number of bits to support >> very large shift amounts. Given this, you can store it in the >> "SubClassData" member of Value (which is 16 bits wide), to avoid >> using the word. Load and StoreInst currently store a bit in that >> word. The only trick here is that we want power-of-two-plus one, >> so that "0" represents an alignment of zero, not an alignment of 1. > > Yeah, I thought about that. It's not a bit problem, I'll encode the > alignment the same way it's encoded in the BC which has this same > issue. sounds good. >> Please don't #include MathExtras.h in Instructions.h > > No prob. I'll have to move the accessor methods to the .cpp file > and include MathExtras there to use the Log2_32 function, though. Ok. The "getter" should be inlined (it just uses <<, nothing exotic like log :). >> + LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = >> false, >> + Instruction *InsertBefore = 0, unsigned Align = 0); >> >> The instruction* to insert before should be the last member. In >> the case of alignment, I don't think we need a helper constructor >> for this (in fact, we probably don't need one for volatile >> either). Any clients that want to create a load instruction with >> a specific alignment can create it, then use setAlignment() :) > > These helper constructors were used quite prolifically in the > lowering passes, like the hunk below. Do you prefer them to be > changed to set the attribute directly? All of the codegen stuff looks good and should stay as you wrote it, I'm just talking about the LLVM level stuff. If you think that having an alignment-taking-ctor is useful, feel free to keep it, but move the instruction-to-insert-before to the end of the operand list. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070419/7058e8de/attachment.html From asl at math.spbu.ru Fri Apr 20 01:17:29 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 20 Apr 2007 10:17:29 +0400 Subject: [llvm-commits] Function aliases In-Reply-To: References: <20070419205157.GQ5062.SS386SS@village.us.cray.com> <1177021495.13159.147.camel@asl.dorms.spbu.ru> Message-ID: <1177049849.13159.160.camel@asl.dorms.spbu.ru> Chris, > I don't think that really makes sense. Aliases aren't really global > variables or functions themselves, they are a third kind of object. Why the third? They definitely *are* either external functions or GVs. For example, function aliases can be called, we can take address of them, etc. The only difference is absence of body (because they are "external") and two symbols they're emitting. > What do you think about making a new GlobalAlias class, which derives > from GlobalValue. And after subdivide into FunctionAlias & GlobalVariableAlias? This will lead to code duplication, since almost all methods of Functions should go to FunctionAlias, the same for GVs. This will also require to carefully check all other places, where GVs and Functions are used and change corresponding logic. Considre for example CallInst. For it we should at least resolve issue with getCalledFunction(), which nowadays return Function* and we should probably add new method called getCalledFunctionAlias() or resolved the two possible return type issues otherwise. I don't think it's worth to do so invasive changes everywhere for such small feature. > This would clearly solve the memory use issue At least this will lead to code duplication in many places. It seems to me, there are two suitable solutions: either subclass from Function & GlobalVariable or add instance variable to them. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From asl at math.spbu.ru Fri Apr 20 01:17:42 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 20 Apr 2007 10:17:42 +0400 Subject: [llvm-commits] Function aliases In-Reply-To: References: <20070419205157.GQ5062.SS386SS@village.us.cray.com> <1177021495.13159.147.camel@asl.dorms.spbu.ru> Message-ID: <1177049862.13159.162.camel@asl.dorms.spbu.ru> Chris, > I don't think that really makes sense. Aliases aren't really global > variables or functions themselves, they are a third kind of object. Why the third? They definitely *are* either external functions or GVs. For example, function aliases can be called, we can take address of them, etc. The only difference is absence of body (because they are "external") and two symbols they're emitting. > What do you think about making a new GlobalAlias class, which derives > from GlobalValue. And after subdivide into FunctionAlias & GlobalVariableAlias? This will lead to code duplication, since almost all methods of Functions should go to FunctionAlias, the same for GVs. This will also require to carefully check all other places, where GVs and Functions are used and change corresponding logic. Considre for example CallInst. For it we should at least resolve issue with getCalledFunction(), which nowadays return Function* and we should probably add new method called getCalledFunctionAlias() or resolved the two possible return type issues otherwise. I don't think it's worth to do so invasive changes everywhere for such small feature. > This would clearly solve the memory use issue At least this will lead to code duplication in many places. It seems to me, there are two suitable solutions: either subclass from Function & GlobalVariable or add instance variable to them. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From asl at math.spbu.ru Fri Apr 20 01:20:20 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 20 Apr 2007 10:20:20 +0400 Subject: [llvm-commits] Function aliases In-Reply-To: References: <1176940422.13159.87.camel@asl.dorms.spbu.ru> <1176966302.13159.117.camel@asl.dorms.spbu.ru> <8D3B8F3B-CE41-4905-8A85-264406EFC7DD.SS2300SS@apple.com> <1177009425.13159.133.camel@asl.dorms.spbu.ru> Message-ID: <1177050020.13159.166.camel@asl.dorms.spbu.ru> Hello, Reid. > I don't understand why we need a subclass of Function for > this? Can't we just derive an "Alias" class from a smart > pointer to Value? Because Aliases are either Function's or GlobalVariable's. They can be called, used in the expressions, etc. The same way as all normal external functions/global variables. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From gordonhenriksen at mac.com Fri Apr 20 08:51:33 2007 From: gordonhenriksen at mac.com (Gordon Henriksen) Date: Fri, 20 Apr 2007 09:51:33 -0400 Subject: [llvm-commits] Function aliases In-Reply-To: References: <20070419205157.GQ5062.SS386SS@village.us.cray.com> <1177021495.13159.147.camel@asl.dorms.spbu.ru> Message-ID: <179C5B28-90DA-4A73-9570-922AE95925CE@mac.com> On 2007-04-20, at 01:22, Chris Lattner wrote: > On Apr 19, 2007, at 3:24 PM, Anton Korobeynikov wrote: > >> Chris, maybe in this situation it will be better to spare 4 bytes >> at GlobalValue object to store pointer to alias string there? > > I don't think that really makes sense. Aliases aren't really > global variables or functions themselves, they are a third kind of > object. > > What do you think about making a new GlobalAlias class, which > derives from GlobalValue. Module would contain a list of these, > just like it has a list of functions and gvars? > > This would clearly solve the memory use issue and I think it would > be a cleaner design (obvious they can't have bodies, etc). > > What do you think? Chris, Why not simply reinsert the aliased GV into the symbol table under the alias name? In this manner, alias objects would not need to derive from GlobalValue at all. Aliases could be stored in a list on the side as you describe, solving the memory usage problem. The majority of code could remain ignorant of them, resolving the code duplication Anton was worried about. ? Gordon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070420/5cd6ee13/attachment.html From asl at math.spbu.ru Fri Apr 20 13:12:48 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 20 Apr 2007 22:12:48 +0400 Subject: [llvm-commits] Function aliases In-Reply-To: <179C5B28-90DA-4A73-9570-922AE95925CE.SS9237SS@mac.com> References: <20070419205157.GQ5062.SS386SS@village.us.cray.com> <1177021495.13159.147.camel@asl.dorms.spbu.ru> <179C5B28-90DA-4A73-9570-922AE95925CE.SS9237SS@mac.com> Message-ID: <1177092768.13159.171.camel@asl.dorms.spbu.ru> Gordon, > Why not simply reinsert the aliased GV into the symbol table under the > alias name? In this manner, alias objects would not need to derive > from GlobalValue at all. Aliases could be stored in a list on the side > as you describe, solving the memory usage problem. The majority of > code could remain ignorant of them, The main problem is that code should not ignore them :( Also, they should be codegen'ed in some funky way, when we're needed both names: alias and it's target at one place. Such information can be unavailable if we'll put aliases in the separate table. I don't think, there is some "direct" way to query symbol table at codegen-level. However, this can be good idea: to have some module-level map, which stores alias targets. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From rspencer at reidspencer.com Fri Apr 20 15:03:22 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Fri, 20 Apr 2007 13:03:22 -0700 Subject: [llvm-commits] Function aliases In-Reply-To: <1177050020.13159.166.camel@asl.dorms.spbu.ru> References: <1176940422.13159.87.camel@asl.dorms.spbu.ru> <1176966302.13159.117.camel@asl.dorms.spbu.ru> <8D3B8F3B-CE41-4905-8A85-264406EFC7DD.SS2300SS@apple.com> <1177009425.13159.133.camel@asl.dorms.spbu.ru> <1177050020.13159.166.camel@asl.dorms.spbu.ru> Message-ID: <1177099402.17774.12.camel@bashful.x10sys.com> On Fri, 2007-04-20 at 10:20 +0400, Anton Korobeynikov wrote: > Hello, Reid. > > > I don't understand why we need a subclass of Function for > > this? Can't we just derive an "Alias" class from a smart > > pointer to Value? > Because Aliases are either Function's or GlobalVariable's. They can be > called, used in the expressions, etc. The same way as all normal > external functions/global variables. I'm saying don't do that. Alias is a "pointer with a name". Its an object that says: "I'm just like that thing over there except I'm named this". So, why not model it that way? It incurs cost only if its used. What this does mean is that places where Functions and GVars are used, we would also have to check for Aliases (if we cared). I assume that we don't care in that many places. The aliasing mechanism doesn't make two functions, there's only one function with two names. So why would we want to instantiate two function objects? If we instantiate an alias object that acts like a smart pointer for the actual things, isn't that good enough? Reid. > From rspencer at reidspencer.com Fri Apr 20 15:04:32 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Fri, 20 Apr 2007 13:04:32 -0700 Subject: [llvm-commits] Function aliases In-Reply-To: <179C5B28-90DA-4A73-9570-922AE95925CE@mac.com> References: <20070419205157.GQ5062.SS386SS@village.us.cray.com> <1177021495.13159.147.camel@asl.dorms.spbu.ru> <179C5B28-90DA-4A73-9570-922AE95925CE@mac.com> Message-ID: <1177099472.17774.14.camel@bashful.x10sys.com> On Fri, 2007-04-20 at 09:51 -0400, Gordon Henriksen wrote: > On 2007-04-20, at 01:22, Chris Lattner wrote: > > > On Apr 19, 2007, at 3:24 PM, Anton Korobeynikov wrote: > > > > > > > Chris, maybe in this situation it will be better to spare 4 bytes > > > at GlobalValue object to store pointer to alias string there? > > > > > > I don't think that really makes sense. Aliases aren't really > > global variables or functions themselves, they are a third kind of > > object. > > > > > > What do you think about making a new GlobalAlias class, which > > derives from GlobalValue. Module would contain a list of these, > > just like it has a list of functions and gvars? > > > > > > This would clearly solve the memory use issue and I think it would > > be a cleaner design (obvious they can't have bodies, etc). > > > > > > What do you think? > > > Chris, > > > Why not simply reinsert the aliased GV into the symbol table under the > alias name? In this manner, alias objects would not need to derive > from GlobalValue at all. Aliases could be stored in a list on the side > as you describe, solving the memory usage problem. The majority of > code could remain ignorant of them, resolving the code duplication > Anton was worried about. Right, that's along the same lines as what I'm thinking. We should never want to create two GlobalValues (of any kind) to represent aliases. The only distinguishing thing is the name. > > > ? Gordon > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From rspencer at reidspencer.com Fri Apr 20 15:07:44 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Fri, 20 Apr 2007 13:07:44 -0700 Subject: [llvm-commits] Function aliases In-Reply-To: <1177092768.13159.171.camel@asl.dorms.spbu.ru> References: <20070419205157.GQ5062.SS386SS@village.us.cray.com> <1177021495.13159.147.camel@asl.dorms.spbu.ru> <179C5B28-90DA-4A73-9570-922AE95925CE.SS9237SS@mac.com> <1177092768.13159.171.camel@asl.dorms.spbu.ru> Message-ID: <1177099664.17774.18.camel@bashful.x10sys.com> On Fri, 2007-04-20 at 22:12 +0400, Anton Korobeynikov wrote: > Gordon, > > > Why not simply reinsert the aliased GV into the symbol table under the > > alias name? In this manner, alias objects would not need to derive > > from GlobalValue at all. Aliases could be stored in a list on the side > > as you describe, solving the memory usage problem. The majority of > > code could remain ignorant of them, > The main problem is that code should not ignore them :( 90% of LLVM *should* ignore them. The only time that they are needed is at codegen time. > Also, they > should be codegen'ed in some funky way, when we're needed both names: > alias and it's target at one place. Right. But, why impose a new concept on all of LLVM just for this very limited code gen situation. I would rather have the CodeGen library simply look for GVars or Functions that have two names. > Such information can be unavailable > if we'll put aliases in the separate table. Certainly the codegen can be augmented to query a separate table. > I don't think, there is some > "direct" way to query symbol table at codegen-level. It could be arrange in SelectionDAGISel.cpp during the lowering. > However, this can > be good idea: to have some module-level map, which stores alias targets. The "module-level map" is just the symtab. When SelectionDAGISel lowers the IR to machine level it just needs to have a way to associate multiple names with a given Function or GVar node. Reid. > From sabre at nondot.org Fri Apr 20 16:12:19 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 20 Apr 2007 14:12:19 -0700 (PDT) Subject: [llvm-commits] test Message-ID: foo? -Chris -- http://nondot.org/sabre/ http://llvm.org/ From asl at math.spbu.ru Fri Apr 20 15:43:37 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 21 Apr 2007 00:43:37 +0400 Subject: [llvm-commits] test In-Reply-To: References: Message-ID: <1177101817.13159.206.camel@asl.dorms.spbu.ru> > foo? bar -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From sabre at nondot.org Fri Apr 20 15:42:54 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 20 Apr 2007 15:42:54 -0500 Subject: [llvm-commits] CVS: llvm/README.txt Message-ID: <200704202042.l3KKgsfP020952@zion.cs.uiuc.edu> Changes in directory llvm: README.txt updated: 1.7 -> 1.8 --- Log message: test commit --- Diffs of the changes: (+1 -0) README.txt | 1 + 1 files changed, 1 insertion(+) Index: llvm/README.txt diff -u llvm/README.txt:1.7 llvm/README.txt:1.8 --- llvm/README.txt:1.7 Thu Sep 2 17:49:27 2004 +++ llvm/README.txt Fri Apr 20 15:42:36 2007 @@ -10,3 +10,4 @@ Please see the HTML documentation provided in docs/index.html for further assistance with LLVM. + From sabre at nondot.org Fri Apr 20 15:19:01 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 20 Apr 2007 15:19:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/README.txt Message-ID: <200704202019.l3KKJ1jW020339@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: README.txt updated: 1.22 -> 1.23 --- Log message: add a crazy idea --- Diffs of the changes: (+12 -0) README.txt | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: llvm/lib/Target/ARM/README.txt diff -u llvm/lib/Target/ARM/README.txt:1.22 llvm/lib/Target/ARM/README.txt:1.23 --- llvm/lib/Target/ARM/README.txt:1.22 Tue Apr 17 13:03:00 2007 +++ llvm/lib/Target/ARM/README.txt Fri Apr 20 15:18:43 2007 @@ -17,6 +17,18 @@ //===---------------------------------------------------------------------===// +Crazy idea: Consider code that uses lots of 8-bit or 16-bit values. By the +time regalloc happens, these values are now in a 32-bit register, usually with +the top-bits known to be sign or zero extended. If spilled, we should be able +to spill these to a 8-bit or 16-bit stack slot, zero or sign extending as part +of the reload. + +Doing this reduces the size of the stack frame (important for thumb etc), and +also increases the likelihood that we will be able to reload multiple values +from the stack with a single load. + +//===---------------------------------------------------------------------===// + The constant island pass is in good shape. Some cleanups might be desirable, but there is unlikely to be much improvement in the generated code. From sabre at nondot.org Fri Apr 20 15:49:42 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 20 Apr 2007 15:49:42 -0500 Subject: [llvm-commits] CVS: llvm/README.txt Message-ID: <200704202049.l3KKnggQ021132@zion.cs.uiuc.edu> Changes in directory llvm: README.txt updated: 1.9 -> 1.10 --- Log message: test --- Diffs of the changes: (+1 -0) README.txt | 1 + 1 files changed, 1 insertion(+) Index: llvm/README.txt diff -u llvm/README.txt:1.9 llvm/README.txt:1.10 --- llvm/README.txt:1.9 Fri Apr 20 15:46:43 2007 +++ llvm/README.txt Fri Apr 20 15:49:25 2007 @@ -10,3 +10,4 @@ Please see the HTML documentation provided in docs/index.html for further assistance with LLVM. + From sabre at nondot.org Fri Apr 20 15:47:00 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 20 Apr 2007 15:47:00 -0500 Subject: [llvm-commits] CVS: llvm/README.txt Message-ID: <200704202047.l3KKl0pw021050@zion.cs.uiuc.edu> Changes in directory llvm: README.txt updated: 1.8 -> 1.9 --- Log message: test commit --- Diffs of the changes: (+0 -1) README.txt | 1 - 1 files changed, 1 deletion(-) Index: llvm/README.txt diff -u llvm/README.txt:1.8 llvm/README.txt:1.9 --- llvm/README.txt:1.8 Fri Apr 20 15:42:36 2007 +++ llvm/README.txt Fri Apr 20 15:46:43 2007 @@ -10,4 +10,3 @@ Please see the HTML documentation provided in docs/index.html for further assistance with LLVM. - From dpatel at apple.com Fri Apr 20 15:04:55 2007 From: dpatel at apple.com (Devang Patel) Date: Fri, 20 Apr 2007 15:04:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/LoopSimplify.cpp Message-ID: <200704202004.l3KK4tHW020117@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: LoopSimplify.cpp updated: 1.91 -> 1.92 --- Log message: Avoid recursion. --- Diffs of the changes: (+13 -6) LoopSimplify.cpp | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.91 llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.92 --- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.91 Sun Apr 15 03:47:27 2007 +++ llvm/lib/Transforms/Utils/LoopSimplify.cpp Fri Apr 20 15:04:37 2007 @@ -407,13 +407,20 @@ /// AddBlockAndPredsToSet - Add the specified block, and all of its /// predecessors, to the specified set, if it's not already in there. Stop /// predecessor traversal when we reach StopBlock. -static void AddBlockAndPredsToSet(BasicBlock *BB, BasicBlock *StopBlock, +static void AddBlockAndPredsToSet(BasicBlock *InputBB, BasicBlock *StopBlock, std::set &Blocks) { - if (!Blocks.insert(BB).second) return; // already processed. - if (BB == StopBlock) return; // Stop here! - - for (pred_iterator I = pred_begin(BB), E = pred_end(BB); I != E; ++I) - AddBlockAndPredsToSet(*I, StopBlock, Blocks); + std::vector WorkList; + WorkList.push_back(InputBB); + do { + BasicBlock *BB = WorkList.back(); WorkList.pop_back(); + if (Blocks.insert(BB).second && BB != StopBlock) + // If BB is not already processed and it is not a stop block then + // insert its predecessor in the work list + for (pred_iterator I = pred_begin(BB), E = pred_end(BB); I != E; ++I) { + BasicBlock *WBB = *I; + WorkList.push_back(WBB); + } + } while(!WorkList.empty()); } /// FindPHIToPartitionLoops - The first part of loop-nestification is to find a From resistor at mac.com Fri Apr 20 01:27:34 2007 From: resistor at mac.com (Owen Anderson) Date: Fri, 20 Apr 2007 01:27:34 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/Mem2Reg.cpp PromoteMemoryToRegister.cpp Message-ID: <200704200627.l3K6RY33025845@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: Mem2Reg.cpp updated: 1.23 -> 1.24 PromoteMemoryToRegister.cpp updated: 1.96 -> 1.97 --- Log message: Move more passes to using ETForest instead of DominatorTree. --- Diffs of the changes: (+12 -13) Mem2Reg.cpp | 6 +++--- PromoteMemoryToRegister.cpp | 19 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) Index: llvm/lib/Transforms/Utils/Mem2Reg.cpp diff -u llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.23 llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.24 --- llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.23 Mon Apr 16 13:10:23 2007 +++ llvm/lib/Transforms/Utils/Mem2Reg.cpp Fri Apr 20 01:27:13 2007 @@ -36,7 +36,7 @@ // getAnalysisUsage - We need dominance frontiers // virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); + AU.addRequired(); AU.addRequired(); AU.addRequired(); AU.setPreservesCFG(); @@ -60,7 +60,7 @@ bool Changed = false; - DominatorTree &DT = getAnalysis(); + ETForest &ET = getAnalysis(); DominanceFrontier &DF = getAnalysis(); while (1) { @@ -75,7 +75,7 @@ if (Allocas.empty()) break; - PromoteMemToReg(Allocas, DT, DF, TD); + PromoteMemToReg(Allocas, ET, DF, TD); NumPromoted += Allocas.size(); Changed = true; } Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.96 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.97 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.96 Mon Mar 26 18:19:29 2007 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Fri Apr 20 01:27:13 2007 @@ -88,7 +88,7 @@ /// std::vector Allocas; SmallVector &RetryList; - DominatorTree &DT; + ETForest &ET; DominanceFrontier &DF; const TargetData &TD; @@ -127,10 +127,10 @@ public: PromoteMem2Reg(const std::vector &A, - SmallVector &Retry, DominatorTree &dt, + SmallVector &Retry, ETForest &et, DominanceFrontier &df, const TargetData &td, AliasSetTracker *ast) - : Allocas(A), RetryList(Retry), DT(dt), DF(df), TD(td), AST(ast) {} + : Allocas(A), RetryList(Retry), ET(et), DF(df), TD(td), AST(ast) {} void run(); @@ -139,13 +139,13 @@ bool properlyDominates(Instruction *I1, Instruction *I2) const { if (InvokeInst *II = dyn_cast(I1)) I1 = II->getNormalDest()->begin(); - return DT[I1->getParent()]->properlyDominates(DT[I2->getParent()]); + return ET.properlyDominates(I1->getParent(), I2->getParent()); } /// dominates - Return true if BB1 dominates BB2 using the DominatorTree. /// bool dominates(BasicBlock *BB1, BasicBlock *BB2) const { - return DT[BB1]->dominates(DT[BB2]); + return ET.dominates(BB1, BB2); } private: @@ -534,8 +534,7 @@ SmallPtrSet &DeadPHINodes) { // Scan the immediate dominators of this block looking for a block which has a // PHI node for Alloca num. If we find it, mark the PHI node as being alive! - for (DominatorTree::Node *N = DT[BB]; N; N = N->getIDom()) { - BasicBlock *DomBB = N->getBlock(); + for (BasicBlock* DomBB = BB; DomBB; DomBB = ET.getIDom(DomBB)) { DenseMap, PHINode*>::iterator I = NewPhiNodes.find(std::make_pair(DomBB, AllocaNum)); if (I != NewPhiNodes.end()) { @@ -806,13 +805,13 @@ /// made to the IR. /// void llvm::PromoteMemToReg(const std::vector &Allocas, - DominatorTree &DT, DominanceFrontier &DF, + ETForest &ET, DominanceFrontier &DF, const TargetData &TD, AliasSetTracker *AST) { // If there is nothing to do, bail out... if (Allocas.empty()) return; SmallVector RetryList; - PromoteMem2Reg(Allocas, RetryList, DT, DF, TD, AST).run(); + PromoteMem2Reg(Allocas, RetryList, ET, DF, TD, AST).run(); // PromoteMem2Reg may not have been able to promote all of the allocas in one // pass, run it again if needed. @@ -830,7 +829,7 @@ NewAllocas.assign(RetryList.begin(), RetryList.end()); RetryList.clear(); - PromoteMem2Reg(NewAllocas, RetryList, DT, DF, TD, AST).run(); + PromoteMem2Reg(NewAllocas, RetryList, ET, DF, TD, AST).run(); NewAllocas.clear(); } } From resistor at mac.com Fri Apr 20 01:27:35 2007 From: resistor at mac.com (Owen Anderson) Date: Fri, 20 Apr 2007 01:27:35 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LICM.cpp ScalarReplAggregates.cpp Message-ID: <200704200627.l3K6RZwR025849@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LICM.cpp updated: 1.92 -> 1.93 ScalarReplAggregates.cpp updated: 1.85 -> 1.86 --- Log message: Move more passes to using ETForest instead of DominatorTree. --- Diffs of the changes: (+5 -8) LICM.cpp | 7 ++----- ScalarReplAggregates.cpp | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-) Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.92 llvm/lib/Transforms/Scalar/LICM.cpp:1.93 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.92 Wed Apr 18 00:43:13 2007 +++ llvm/lib/Transforms/Scalar/LICM.cpp Fri Apr 20 01:27:13 2007 @@ -73,7 +73,6 @@ AU.addRequiredID(LoopSimplifyID); AU.addRequired(); AU.addRequired(); - AU.addRequired(); // For scalar promotion (mem2reg) AU.addRequired(); // For scalar promotion (mem2reg) AU.addRequired(); } @@ -88,7 +87,6 @@ AliasAnalysis *AA; // Current AliasAnalysis information LoopInfo *LI; // Current LoopInfo ETForest *ET; // ETForest for the current Loop... - DominatorTree *DT; // Dominator Tree for the current Loop... DominanceFrontier *DF; // Current Dominance Frontier // State that is updated as we process loops @@ -215,7 +213,6 @@ AA = &getAnalysis(); DF = &getAnalysis(); ET = &getAnalysis(); - DT = &getAnalysis(); CurAST = new AliasSetTracker(*AA); // Collect Alias info frmo subloops @@ -554,7 +551,7 @@ if (AI) { std::vector Allocas; Allocas.push_back(AI); - PromoteMemToReg(Allocas, *DT, *DF, AA->getTargetData(), CurAST); + PromoteMemToReg(Allocas, *ET, *DF, AA->getTargetData(), CurAST); } } } @@ -735,7 +732,7 @@ PromotedAllocas.reserve(PromotedValues.size()); for (unsigned i = 0, e = PromotedValues.size(); i != e; ++i) PromotedAllocas.push_back(PromotedValues[i].first); - PromoteMemToReg(PromotedAllocas, *DT, *DF, AA->getTargetData(), CurAST); + PromoteMemToReg(PromotedAllocas, *ET, *DF, AA->getTargetData(), CurAST); } /// FindPromotableValuesInLoop - Check the current loop for stores to definite Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.85 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.86 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.85 Thu Apr 19 00:39:12 2007 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Fri Apr 20 01:27:13 2007 @@ -53,7 +53,7 @@ // getAnalysisUsage - This pass does not require any passes, but we know it // will not alter the CFG, so say so. virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); + AU.addRequired(); AU.addRequired(); AU.addRequired(); AU.setPreservesCFG(); @@ -100,7 +100,7 @@ bool SROA::performPromotion(Function &F) { std::vector Allocas; const TargetData &TD = getAnalysis(); - DominatorTree &DT = getAnalysis(); + ETForest &ET = getAnalysis(); DominanceFrontier &DF = getAnalysis(); BasicBlock &BB = F.getEntryBlock(); // Get the entry node for the function @@ -119,7 +119,7 @@ if (Allocas.empty()) break; - PromoteMemToReg(Allocas, DT, DF, TD); + PromoteMemToReg(Allocas, ET, DF, TD); NumPromoted += Allocas.size(); Changed = true; } From resistor at mac.com Fri Apr 20 01:27:35 2007 From: resistor at mac.com (Owen Anderson) Date: Fri, 20 Apr 2007 01:27:35 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h Message-ID: <200704200627.l3K6RZ7Y025851@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms/Utils: PromoteMemToReg.h updated: 1.9 -> 1.10 --- Log message: Move more passes to using ETForest instead of DominatorTree. --- Diffs of the changes: (+2 -2) PromoteMemToReg.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h diff -u llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h:1.9 llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h:1.10 --- llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h:1.9 Sun Nov 5 13:31:28 2006 +++ llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h Fri Apr 20 01:27:13 2007 @@ -20,7 +20,7 @@ namespace llvm { class AllocaInst; -class DominatorTree; +class ETForest; class DominanceFrontier; class TargetData; class AliasSetTracker; @@ -39,7 +39,7 @@ /// made to the IR. /// void PromoteMemToReg(const std::vector &Allocas, - DominatorTree &DT, DominanceFrontier &DF, + ETForest &ET, DominanceFrontier &DF, const TargetData &TD, AliasSetTracker *AST = 0); } // End llvm namespace From sabre at nondot.org Thu Apr 19 23:46:18 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 19 Apr 2007 23:46:18 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/opt.cpp Message-ID: <200704200446.l3K4kIj3024342@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: opt.cpp updated: 1.133 -> 1.134 --- Log message: remove cruft --- Diffs of the changes: (+0 -3) opt.cpp | 3 --- 1 files changed, 3 deletions(-) Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.133 llvm/tools/opt/opt.cpp:1.134 --- llvm/tools/opt/opt.cpp:1.133 Tue Apr 10 10:43:36 2007 +++ llvm/tools/opt/opt.cpp Thu Apr 19 23:45:58 2007 @@ -27,7 +27,6 @@ #include "llvm/Support/PluginLoader.h" #include "llvm/Support/Streams.h" #include "llvm/Support/SystemUtils.h" -#include "llvm/Support/Timer.h" #include "llvm/LinkAllPasses.h" #include "llvm/LinkAllVMCore.h" #include @@ -95,8 +94,6 @@ static cl::opt AnalyzeOnly("analyze", cl::desc("Only perform analysis, no optimization")); -static Timer BytecodeLoadTimer("Bytecode Loader"); - // ---------- Define Printers for module and function passes ------------ namespace { From evan.cheng at apple.com Thu Apr 19 19:45:54 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 19 Apr 2007 19:45:54 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/isel-sink.ll Message-ID: <200704200045.l3K0js4n020534@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: isel-sink.ll updated: 1.2 -> 1.3 --- Log message: Fix test. --- Diffs of the changes: (+1 -1) isel-sink.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CodeGen/X86/isel-sink.ll diff -u llvm/test/CodeGen/X86/isel-sink.ll:1.2 llvm/test/CodeGen/X86/isel-sink.ll:1.3 --- llvm/test/CodeGen/X86/isel-sink.ll:1.2 Sun Apr 15 17:16:46 2007 +++ llvm/test/CodeGen/X86/isel-sink.ll Thu Apr 19 19:45:36 2007 @@ -1,6 +1,6 @@ ; RUN: llvm-as < %s | llc -march=x86 | not grep lea ; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-apple-darwin8 | \ -; RUN: grep {movl \$4, (%ecx,%eax,4)} +; RUN: grep {movl \$4, (.*,.*,4)} define i32 @test(i32* %X, i32 %B) { ; This gep should be sunk out of this block into the load/store users. From christopher.lamb at gmail.com Fri Apr 20 00:05:42 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Fri, 20 Apr 2007 00:05:42 -0500 Subject: [llvm-commits] CVS: llvm/test/Assembler/select.ll Message-ID: <200704200505.l3K55guR024654@zion.cs.uiuc.edu> Changes in directory llvm/test/Assembler: select.ll updated: 1.3 -> 1.4 --- Log message: Test check in --- Diffs of the changes: (+0 -1) select.ll | 1 - 1 files changed, 1 deletion(-) Index: llvm/test/Assembler/select.ll diff -u llvm/test/Assembler/select.ll:1.3 llvm/test/Assembler/select.ll:1.4 --- llvm/test/Assembler/select.ll:1.3 Sat Dec 2 14:34:08 2006 +++ llvm/test/Assembler/select.ll Fri Apr 20 00:05:24 2007 @@ -1,7 +1,6 @@ ; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f - int %test(bool %C, int %V1, int %V2) { %X = select bool true, bool false, bool true %V = select bool %X, int %V1, int %V2 From resistor at mac.com Fri Apr 20 00:44:33 2007 From: resistor at mac.com (Owen Anderson) Date: Fri, 20 Apr 2007 00:44:33 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h Message-ID: <200704200544.l3K5iXc8025200@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: Dominators.h updated: 1.74 -> 1.75 --- Log message: Add null checks and const-ify these accessors. --- Diffs of the changes: (+5 -2) Dominators.h | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Analysis/Dominators.h diff -u llvm/include/llvm/Analysis/Dominators.h:1.74 llvm/include/llvm/Analysis/Dominators.h:1.75 --- llvm/include/llvm/Analysis/Dominators.h:1.74 Wed Apr 18 00:25:09 2007 +++ llvm/include/llvm/Analysis/Dominators.h Fri Apr 20 00:44:16 2007 @@ -322,13 +322,16 @@ } /// Return the immediate dominator of A. - BasicBlock *getIDom(BasicBlock *A) { + BasicBlock *getIDom(BasicBlock *A) const { + if (!A) return 0; + ETNode *NodeA = getNode(A); const ETNode *idom = NodeA->getFather(); return idom ? idom->getData() : 0; } - void getChildren(BasicBlock *A, std::vector& children) { + void getChildren(BasicBlock *A, std::vector& children) const { + if (!A) return; ETNode *NodeA = getNode(A); const ETNode* son = NodeA->getSon(); From evan.cheng at apple.com Fri Apr 20 16:15:38 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 20 Apr 2007 16:15:38 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.td Message-ID: <200704202115.l3KLFctA022646@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86RegisterInfo.td updated: 1.41 -> 1.42 --- Log message: Specify sub-register relations. e.g. RAX: [EAX], EAX: [AX], AX: [AL,AH]. --- Diffs of the changes: (+76 -76) X86RegisterInfo.td | 152 ++++++++++++++++++++++++++--------------------------- 1 files changed, 76 insertions(+), 76 deletions(-) Index: llvm/lib/Target/X86/X86RegisterInfo.td diff -u llvm/lib/Target/X86/X86RegisterInfo.td:1.41 llvm/lib/Target/X86/X86RegisterInfo.td:1.42 --- llvm/lib/Target/X86/X86RegisterInfo.td:1.41 Mon Mar 26 02:53:08 2007 +++ llvm/lib/Target/X86/X86RegisterInfo.td Fri Apr 20 16:15:21 2007 @@ -24,91 +24,91 @@ // AL aliases AX if we tell it that AX aliased AL (for example). // FIXME: X86-64 have different Dwarf numbers. - // 64-bit registers, X86-64 only - def RAX : Register<"RAX">, DwarfRegNum<0>; - def RDX : Register<"RDX">, DwarfRegNum<1>; - def RCX : Register<"RCX">, DwarfRegNum<2>; - def RBX : Register<"RBX">, DwarfRegNum<3>; - def RSI : Register<"RSI">, DwarfRegNum<4>; - def RDI : Register<"RDI">, DwarfRegNum<5>; - def RBP : Register<"RBP">, DwarfRegNum<6>; - def RSP : Register<"RSP">, DwarfRegNum<7>; - - def R8 : Register<"R8">, DwarfRegNum<8>; - def R9 : Register<"R9">, DwarfRegNum<9>; - def R10 : Register<"R10">, DwarfRegNum<10>; - def R11 : Register<"R11">, DwarfRegNum<11>; - def R12 : Register<"R12">, DwarfRegNum<12>; - def R13 : Register<"R13">, DwarfRegNum<13>; - def R14 : Register<"R14">, DwarfRegNum<14>; - def R15 : Register<"R15">, DwarfRegNum<15>; + // 8-bit registers + // Low registers + def AL : Register<"AL">, DwarfRegNum<0>; + def CL : Register<"CL">, DwarfRegNum<1>; + def DL : Register<"DL">, DwarfRegNum<2>; + def BL : Register<"BL">, DwarfRegNum<3>; - // 32-bit registers - def EAX : RegisterGroup<"EAX", [RAX]>, DwarfRegNum<0>; - def ECX : RegisterGroup<"ECX", [RCX]>, DwarfRegNum<1>; - def EDX : RegisterGroup<"EDX", [RDX]>, DwarfRegNum<2>; - def EBX : RegisterGroup<"EBX", [RBX]>, DwarfRegNum<3>; - def ESP : RegisterGroup<"ESP", [RSP]>, DwarfRegNum<4>; - def EBP : RegisterGroup<"EBP", [RBP]>, DwarfRegNum<5>; - def ESI : RegisterGroup<"ESI", [RSI]>, DwarfRegNum<6>; - def EDI : RegisterGroup<"EDI", [RDI]>, DwarfRegNum<7>; - // X86-64 only - def R8D : RegisterGroup<"R8D", [R8]>, DwarfRegNum<8>; - def R9D : RegisterGroup<"R9D", [R9]>, DwarfRegNum<9>; - def R10D : RegisterGroup<"R10D", [R10]>, DwarfRegNum<10>; - def R11D : RegisterGroup<"R11D", [R11]>, DwarfRegNum<11>; - def R12D : RegisterGroup<"R12D", [R12]>, DwarfRegNum<12>; - def R13D : RegisterGroup<"R13D", [R13]>, DwarfRegNum<13>; - def R14D : RegisterGroup<"R14D", [R14]>, DwarfRegNum<14>; - def R15D : RegisterGroup<"R15D", [R15]>, DwarfRegNum<15>; + def SIL : Register<"SIL">, DwarfRegNum<4>; + def DIL : Register<"DIL">, DwarfRegNum<5>; + def BPL : Register<"BPL">, DwarfRegNum<6>; + def SPL : Register<"SPL">, DwarfRegNum<7>; + def R8B : Register<"R8B">, DwarfRegNum<8>; + def R9B : Register<"R9B">, DwarfRegNum<9>; + def R10B : Register<"R10B">, DwarfRegNum<10>; + def R11B : Register<"R11B">, DwarfRegNum<11>; + def R12B : Register<"R12B">, DwarfRegNum<12>; + def R13B : Register<"R13B">, DwarfRegNum<13>; + def R14B : Register<"R14B">, DwarfRegNum<14>; + def R15B : Register<"R15B">, DwarfRegNum<15>; + + // High registers X86-32 only + def AH : Register<"AH">, DwarfRegNum<0>; + def CH : Register<"CH">, DwarfRegNum<1>; + def DH : Register<"DH">, DwarfRegNum<2>; + def BH : Register<"BH">, DwarfRegNum<3>; // 16-bit registers - def AX : RegisterGroup<"AX", [EAX,RAX]>, DwarfRegNum<0>; - def CX : RegisterGroup<"CX", [ECX,RCX]>, DwarfRegNum<1>; - def DX : RegisterGroup<"DX", [EDX,RDX]>, DwarfRegNum<2>; - def BX : RegisterGroup<"BX", [EBX,RBX]>, DwarfRegNum<3>; - def SP : RegisterGroup<"SP", [ESP,RSP]>, DwarfRegNum<4>; - def BP : RegisterGroup<"BP", [EBP,RBP]>, DwarfRegNum<5>; - def SI : RegisterGroup<"SI", [ESI,RSI]>, DwarfRegNum<6>; - def DI : RegisterGroup<"DI", [EDI,RDI]>, DwarfRegNum<7>; + def AX : RegisterWithSubRegs<"AX", [AH,AL]>, DwarfRegNum<0>; + def CX : RegisterWithSubRegs<"CX", [CH,CL]>, DwarfRegNum<1>; + def DX : RegisterWithSubRegs<"DX", [DH,DL]>, DwarfRegNum<2>; + def BX : RegisterWithSubRegs<"BX", [BH,BL]>, DwarfRegNum<3>; + def SP : RegisterWithSubRegs<"SP", [SPL]>, DwarfRegNum<4>; + def BP : RegisterWithSubRegs<"BP", [BPL]>, DwarfRegNum<5>; + def SI : RegisterWithSubRegs<"SI", [SIL]>, DwarfRegNum<6>; + def DI : RegisterWithSubRegs<"DI", [DIL]>, DwarfRegNum<7>; // X86-64 only - def R8W : RegisterGroup<"R8W", [R8D,R8]>, DwarfRegNum<8>; - def R9W : RegisterGroup<"R9W", [R9D,R9]>, DwarfRegNum<9>; - def R10W : RegisterGroup<"R10W", [R10D,R10]>, DwarfRegNum<10>; - def R11W : RegisterGroup<"R11W", [R11D,R11]>, DwarfRegNum<11>; - def R12W : RegisterGroup<"R12W", [R12D,R12]>, DwarfRegNum<12>; - def R13W : RegisterGroup<"R13W", [R13D,R13]>, DwarfRegNum<13>; - def R14W : RegisterGroup<"R14W", [R14D,R14]>, DwarfRegNum<14>; - def R15W : RegisterGroup<"R15W", [R15D,R15]>, DwarfRegNum<15>; - - // 8-bit registers - // Low registers - def AL : RegisterGroup<"AL", [AX,EAX,RAX]>, DwarfRegNum<0>; - def CL : RegisterGroup<"CL", [CX,ECX,RCX]>, DwarfRegNum<1>; - def DL : RegisterGroup<"DL", [DX,EDX,RDX]>, DwarfRegNum<2>; - def BL : RegisterGroup<"BL", [BX,EBX,RBX]>, DwarfRegNum<3>; + def R8W : RegisterWithSubRegs<"R8W", [R8B]>, DwarfRegNum<8>; + def R9W : RegisterWithSubRegs<"R9W", [R9B]>, DwarfRegNum<9>; + def R10W : RegisterWithSubRegs<"R10W", [R10B]>, DwarfRegNum<10>; + def R11W : RegisterWithSubRegs<"R11W", [R11B]>, DwarfRegNum<11>; + def R12W : RegisterWithSubRegs<"R12W", [R12B]>, DwarfRegNum<12>; + def R13W : RegisterWithSubRegs<"R13W", [R13B]>, DwarfRegNum<13>; + def R14W : RegisterWithSubRegs<"R14W", [R14B]>, DwarfRegNum<14>; + def R15W : RegisterWithSubRegs<"R15W", [R15B]>, DwarfRegNum<15>; + // 32-bit registers + def EAX : RegisterWithSubRegs<"EAX", [AX]>, DwarfRegNum<0>; + def ECX : RegisterWithSubRegs<"ECX", [CX]>, DwarfRegNum<1>; + def EDX : RegisterWithSubRegs<"EDX", [DX]>, DwarfRegNum<2>; + def EBX : RegisterWithSubRegs<"EBX", [BX]>, DwarfRegNum<3>; + def ESP : RegisterWithSubRegs<"ESP", [SP]>, DwarfRegNum<4>; + def EBP : RegisterWithSubRegs<"EBP", [BP]>, DwarfRegNum<5>; + def ESI : RegisterWithSubRegs<"ESI", [SI]>, DwarfRegNum<6>; + def EDI : RegisterWithSubRegs<"EDI", [DI]>, DwarfRegNum<7>; + // X86-64 only - def SIL : RegisterGroup<"SIL", [SI,ESI,RSI]>, DwarfRegNum<4>; - def DIL : RegisterGroup<"DIL", [DI,EDI,RDI]>, DwarfRegNum<5>; - def BPL : RegisterGroup<"BPL", [BP,EBP,RBP]>, DwarfRegNum<6>; - def SPL : RegisterGroup<"SPL", [SP,ESP,RSP]>, DwarfRegNum<7>; - def R8B : RegisterGroup<"R8B", [R8W,R8D,R8]>, DwarfRegNum<8>; - def R9B : RegisterGroup<"R9B", [R9W,R9D,R9]>, DwarfRegNum<9>; - def R10B : RegisterGroup<"R10B", [R10W,R10D,R10]>, DwarfRegNum<10>; - def R11B : RegisterGroup<"R11B", [R11W,R11D,R11]>, DwarfRegNum<11>; - def R12B : RegisterGroup<"R12B", [R12W,R12D,R12]>, DwarfRegNum<12>; - def R13B : RegisterGroup<"R13B", [R13W,R13D,R13]>, DwarfRegNum<13>; - def R14B : RegisterGroup<"R14B", [R14W,R14D,R14]>, DwarfRegNum<14>; - def R15B : RegisterGroup<"R15B", [R15W,R15D,R15]>, DwarfRegNum<15>; + def R8D : RegisterWithSubRegs<"R8D", [R8W]>, DwarfRegNum<8>; + def R9D : RegisterWithSubRegs<"R9D", [R9W]>, DwarfRegNum<9>; + def R10D : RegisterWithSubRegs<"R10D", [R10W]>, DwarfRegNum<10>; + def R11D : RegisterWithSubRegs<"R11D", [R11W]>, DwarfRegNum<11>; + def R12D : RegisterWithSubRegs<"R12D", [R12W]>, DwarfRegNum<12>; + def R13D : RegisterWithSubRegs<"R13D", [R13W]>, DwarfRegNum<13>; + def R14D : RegisterWithSubRegs<"R14D", [R14W]>, DwarfRegNum<14>; + def R15D : RegisterWithSubRegs<"R15D", [R15W]>, DwarfRegNum<15>; - // High registers X86-32 only - def AH : RegisterGroup<"AH", [AX,EAX,RAX]>, DwarfRegNum<0>; - def CH : RegisterGroup<"CH", [CX,ECX,RCX]>, DwarfRegNum<1>; - def DH : RegisterGroup<"DH", [DX,EDX,RDX]>, DwarfRegNum<2>; - def BH : RegisterGroup<"BH", [BX,EBX,RBX]>, DwarfRegNum<3>; + // 64-bit registers, X86-64 only + def RAX : RegisterWithSubRegs<"RAX", [EAX]>, DwarfRegNum<0>; + def RDX : RegisterWithSubRegs<"RDX", [EDX]>, DwarfRegNum<1>; + def RCX : RegisterWithSubRegs<"RCX", [ECX]>, DwarfRegNum<2>; + def RBX : RegisterWithSubRegs<"RBX", [EBX]>, DwarfRegNum<3>; + def RSI : RegisterWithSubRegs<"RSI", [ESI]>, DwarfRegNum<4>; + def RDI : RegisterWithSubRegs<"RDI", [EDI]>, DwarfRegNum<5>; + def RBP : RegisterWithSubRegs<"RBP", [EBP]>, DwarfRegNum<6>; + def RSP : RegisterWithSubRegs<"RSP", [ESP]>, DwarfRegNum<7>; + + def R8 : RegisterWithSubRegs<"R8", [R8D]>, DwarfRegNum<8>; + def R9 : RegisterWithSubRegs<"R9", [R9D]>, DwarfRegNum<9>; + def R10 : RegisterWithSubRegs<"R10", [R10D]>, DwarfRegNum<10>; + def R11 : RegisterWithSubRegs<"R11", [R11D]>, DwarfRegNum<11>; + def R12 : RegisterWithSubRegs<"R12", [R12D]>, DwarfRegNum<12>; + def R13 : RegisterWithSubRegs<"R13", [R13D]>, DwarfRegNum<13>; + def R14 : RegisterWithSubRegs<"R14", [R14D]>, DwarfRegNum<14>; + def R15 : RegisterWithSubRegs<"R15", [R15D]>, DwarfRegNum<15>; // MMX Registers. These are actually aliased to ST0 .. ST7 def MM0 : Register<"MM0">, DwarfRegNum<29>; From evan.cheng at apple.com Fri Apr 20 16:20:28 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 20 Apr 2007 16:20:28 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.td Message-ID: <200704202120.l3KLKSNV022746@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.td updated: 1.15 -> 1.16 --- Log message: Specify S registers as D registers' sub-registers. --- Diffs of the changes: (+2 -2) ARMRegisterInfo.td | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.td diff -u llvm/lib/Target/ARM/ARMRegisterInfo.td:1.15 llvm/lib/Target/ARM/ARMRegisterInfo.td:1.16 --- llvm/lib/Target/ARM/ARMRegisterInfo.td:1.15 Wed Mar 7 20:56:40 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.td Fri Apr 20 16:20:10 2007 @@ -13,10 +13,10 @@ //===----------------------------------------------------------------------===// // Registers are identified with 4-bit ID numbers. -class ARMReg num, string n, list aliases = []> : Register { +class ARMReg num, string n, list subregs = []> : Register { field bits<4> Num; let Namespace = "ARM"; - let Aliases = aliases; + let SubRegs = subregs; } class ARMFReg num, string n> : Register { From dpatel at apple.com Fri Apr 20 16:24:19 2007 From: dpatel at apple.com (Devang Patel) Date: Fri, 20 Apr 2007 16:24:19 -0500 Subject: [llvm-commits] CVS: llvm/test/lib/llvm.exp Message-ID: <200704202124.l3KLOJre022850@zion.cs.uiuc.edu> Changes in directory llvm/test/lib: llvm.exp updated: 1.15 -> 1.16 --- Log message: Enable Objective-C tests. --- Diffs of the changes: (+14 -0) llvm.exp | 14 ++++++++++++++ 1 files changed, 14 insertions(+) Index: llvm/test/lib/llvm.exp diff -u llvm/test/lib/llvm.exp:1.15 llvm/test/lib/llvm.exp:1.16 --- llvm/test/lib/llvm.exp:1.15 Mon Apr 16 16:19:45 2007 +++ llvm/test/lib/llvm.exp Fri Apr 20 16:24:01 2007 @@ -187,3 +187,17 @@ } } } + +proc llvm_gcc_supports_objc { } { + global llvmgcc + catch { set file_h [ open "/tmp/llvm_obj_check.m" w] } + set R [ catch { exec $llvmgcc -c "/tmp/llvm_obj_check.m" -o /dev/null >& /tmp/llvm_obj_check.out } ] + set RESULT [ file size "/tmp/llvm_obj_check.out" ] + catch { file delete "/tmp/llvm_obj_check.m" } + if { $RESULT == 0 } { + return 1 + } else { + return 0 + } +} + From dpatel at apple.com Fri Apr 20 16:24:21 2007 From: dpatel at apple.com (Devang Patel) Date: Fri, 20 Apr 2007 16:24:21 -0500 Subject: [llvm-commits] CVS: llvm/test/FrontendObjC/dg.exp Message-ID: <200704202124.l3KLOLGn022856@zion.cs.uiuc.edu> Changes in directory llvm/test/FrontendObjC: dg.exp added (r1.1) --- Log message: Enable Objective-C tests. --- Diffs of the changes: (+6 -0) dg.exp | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/test/FrontendObjC/dg.exp diff -c /dev/null llvm/test/FrontendObjC/dg.exp:1.1 *** /dev/null Fri Apr 20 16:24:11 2007 --- llvm/test/FrontendObjC/dg.exp Fri Apr 20 16:24:01 2007 *************** *** 0 **** --- 1,6 ---- + load_lib llvm.exp + + if [ llvm_gcc_supports_objc ] then { + RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{m}]] + } + From evan.cheng at apple.com Fri Apr 20 16:28:22 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 20 Apr 2007 16:28:22 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h Message-ID: <200704202128.l3KLSM0X022934@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: MRegisterInfo.h updated: 1.104 -> 1.105 --- Log message: Add sub-registers set accessor. --- Diffs of the changes: (+8 -0) MRegisterInfo.h | 8 ++++++++ 1 files changed, 8 insertions(+) Index: llvm/include/llvm/Target/MRegisterInfo.h diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.104 llvm/include/llvm/Target/MRegisterInfo.h:1.105 --- llvm/include/llvm/Target/MRegisterInfo.h:1.104 Fri Apr 20 16:11:22 2007 +++ llvm/include/llvm/Target/MRegisterInfo.h Fri Apr 20 16:28:05 2007 @@ -270,6 +270,14 @@ return get(RegNo).AliasSet; } + /// getSubRegisters - Return the set of registers that are sub-registers of + // the specified register, or a null list of there are none. The list + /// returned is zero terminated. + /// + const unsigned *getSubRegisters(unsigned RegNo) const { + return get(RegNo).SubRegs; + } + /// getName - Return the symbolic target specific name for the specified /// physical register. const char *getName(unsigned RegNo) const { From sabre at nondot.org Thu Apr 19 22:27:54 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 19 Apr 2007 22:27:54 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/OutputBuffer.h Message-ID: <200704200327.l3K3RseL023092@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: OutputBuffer.h updated: 1.4 -> 1.5 --- Log message: Fix a very strange assertion message, patch by Christopher Lamb CVS: ---------------------------------------------------------------------- --- Diffs of the changes: (+1 -1) OutputBuffer.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Support/OutputBuffer.h diff -u llvm/include/llvm/Support/OutputBuffer.h:1.4 llvm/include/llvm/Support/OutputBuffer.h:1.5 --- llvm/include/llvm/Support/OutputBuffer.h:1.4 Sun Feb 4 20:37:07 2007 +++ llvm/include/llvm/Support/OutputBuffer.h Thu Apr 19 22:27:36 2007 @@ -35,7 +35,7 @@ // aligned to the specified power of two boundary. void align(unsigned Boundary) { assert(Boundary && (Boundary & (Boundary - 1)) == 0 && - "Must alitypedef std::vector DataBuffer;gn to 2^k boundary"); + "Must align to 2^k boundary"); size_t Size = Output.size(); if (Size & (Boundary - 1)) { From clattner at apple.com Fri Apr 20 16:33:35 2007 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Apr 2007 14:33:35 -0700 Subject: [llvm-commits] CVS: llvm/test/FrontendObjC/dg.exp In-Reply-To: <200704202124.l3KLOLGn022856@zion.cs.uiuc.edu> References: <200704202124.l3KLOLGn022856@zion.cs.uiuc.edu> Message-ID: > Enable Objective-C tests. Oooh, nice! Duncan, can you do the same for the Ada tests? -Chris > > --- > Diffs of the changes: (+6 -0) > > dg.exp | 6 ++++++ > 1 files changed, 6 insertions(+) > > > Index: llvm/test/FrontendObjC/dg.exp > diff -c /dev/null llvm/test/FrontendObjC/dg.exp:1.1 > *** /dev/null Fri Apr 20 16:24:11 2007 > --- llvm/test/FrontendObjC/dg.exp Fri Apr 20 16:24:01 2007 > *************** > *** 0 **** > --- 1,6 ---- > + load_lib llvm.exp > + > + if [ llvm_gcc_supports_objc ] then { > + RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{m}]] > + } > + > > > > _______________________________________________ > 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 Fri Apr 20 16:11:40 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 20 Apr 2007 16:11:40 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h Message-ID: <200704202111.l3KLBexw022523@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: MRegisterInfo.h updated: 1.103 -> 1.104 --- Log message: Add sub-register sets. --- Diffs of the changes: (+3 -0) MRegisterInfo.h | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/include/llvm/Target/MRegisterInfo.h diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.103 llvm/include/llvm/Target/MRegisterInfo.h:1.104 --- llvm/include/llvm/Target/MRegisterInfo.h:1.103 Tue Apr 17 15:23:34 2007 +++ llvm/include/llvm/Target/MRegisterInfo.h Fri Apr 20 16:11:22 2007 @@ -38,10 +38,13 @@ /// to a Zero terminated array of registers that this register aliases. This is /// needed for architectures like X86 which have AL alias AX alias EAX. /// Registers that this does not apply to simply should set this to null. +/// The SubRegs field is a zero terminated array of registers that are +/// sub-registers of the specific register, e.g. AL, AH are sub-registers of AX. /// struct TargetRegisterDesc { const char *Name; // Assembly language name for the register const unsigned *AliasSet; // Register Alias Set, described above + const unsigned *SubRegs; // Sub-register set, described above }; class TargetRegisterClass { From lauro.venancio at gmail.com Fri Apr 20 16:38:35 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Fri, 20 Apr 2007 16:38:35 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h Message-ID: <200704202138.l3KLcZP6023226@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.146 -> 1.147 SelectionDAGNodes.h updated: 1.184 -> 1.185 --- Log message: Implement "general dynamic", "initial exec" and "local exec" TLS models for X86 32 bits. --- Diffs of the changes: (+16 -4) SelectionDAG.h | 3 +++ SelectionDAGNodes.h | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.146 llvm/include/llvm/CodeGen/SelectionDAG.h:1.147 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.146 Fri Jan 26 15:22:28 2007 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Fri Apr 20 16:38:10 2007 @@ -398,6 +398,9 @@ SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, SDOperand Op1, SDOperand Op2); + SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, + MVT::ValueType VT2, MVT::ValueType VT3, + SDOperand Op1, SDOperand Op2, SDOperand Op3); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, const SDOperand *Ops, unsigned NumOps); Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.184 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.185 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.184 Tue Apr 17 04:20:00 2007 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Fri Apr 20 16:38:10 2007 @@ -19,6 +19,7 @@ #ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H #define LLVM_CODEGEN_SELECTIONDAGNODES_H +#include "llvm/GlobalVariable.h" #include "llvm/Value.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/GraphTraits.h" @@ -95,7 +96,8 @@ // Various leaf nodes. STRING, BasicBlock, VALUETYPE, CONDCODE, Register, Constant, ConstantFP, - GlobalAddress, FrameIndex, JumpTable, ConstantPool, ExternalSymbol, + GlobalAddress, GlobalTLSAddress, FrameIndex, + JumpTable, ConstantPool, ExternalSymbol, // The address of the GOT GLOBAL_OFFSET_TABLE, @@ -124,6 +126,7 @@ // anything else with this node, and this is valid in the target-specific // dag, turning into a GlobalAddress operand. TargetGlobalAddress, + TargetGlobalTLSAddress, TargetFrameIndex, TargetJumpTable, TargetConstantPool, @@ -1164,7 +1167,12 @@ friend class SelectionDAG; GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT, int o = 0) - : SDNode(isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress, + : SDNode(dyn_cast(GA) && + dyn_cast(GA)->isThreadLocal() ? + // Thread Local + (isTarget ? ISD::TargetGlobalTLSAddress : ISD::GlobalTLSAddress) : + // Non Thread Local + (isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress), getSDVTList(VT)), Offset(o) { TheGlobal = const_cast(GA); } @@ -1176,11 +1184,12 @@ static bool classof(const GlobalAddressSDNode *) { return true; } static bool classof(const SDNode *N) { return N->getOpcode() == ISD::GlobalAddress || - N->getOpcode() == ISD::TargetGlobalAddress; + N->getOpcode() == ISD::TargetGlobalAddress || + N->getOpcode() == ISD::GlobalTLSAddress || + N->getOpcode() == ISD::TargetGlobalTLSAddress; } }; - class FrameIndexSDNode : public SDNode { int FI; virtual void ANCHOR(); // Out-of-line virtual method to give class a home. From lauro.venancio at gmail.com Fri Apr 20 16:38:40 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Fri, 20 Apr 2007 16:38:40 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetAsmInfo.h Message-ID: <200704202138.l3KLceu7023232@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetAsmInfo.h updated: 1.28 -> 1.29 --- Log message: Implement "general dynamic", "initial exec" and "local exec" TLS models for X86 32 bits. --- Diffs of the changes: (+15 -1) TargetAsmInfo.h | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Target/TargetAsmInfo.h diff -u llvm/include/llvm/Target/TargetAsmInfo.h:1.28 llvm/include/llvm/Target/TargetAsmInfo.h:1.29 --- llvm/include/llvm/Target/TargetAsmInfo.h:1.28 Wed Mar 7 19:00:38 2007 +++ llvm/include/llvm/Target/TargetAsmInfo.h Fri Apr 20 16:38:10 2007 @@ -43,7 +43,15 @@ /// target doesn't support a BSS section. /// const char *BSSSection; // Default to ".bss". - + + /// TLSDataSection - Section directive for Thread Local data. + /// + const char *TLSDataSection;// Defaults to ".section .tdata,"awT", at progbits". + + /// TLSBSSSection - Section directive for Thread Local uninitialized data. + /// Null if this target doesn't support a BSS section. + /// + const char *TLSBSSSection;// Default to ".section .tbss,"awT", at nobits". /// ZeroFillDirective - Directive for emitting a global to the ZeroFill /// section on this target. Null if this target doesn't support zerofill. const char *ZeroFillDirective; // Default is null. @@ -362,6 +370,12 @@ const char *getBSSSection() const { return BSSSection; } + const char *getTLSDataSection() const { + return TLSDataSection; + } + const char *getTLSBSSSection() const { + return TLSBSSSection; + } const char *getZeroFillDirective() const { return ZeroFillDirective; } From lauro.venancio at gmail.com Fri Apr 20 16:38:41 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Fri, 20 Apr 2007 16:38:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp X86ISelLowering.cpp X86ISelLowering.h X86InstrInfo.td Message-ID: <200704202138.l3KLcfxe023245@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ATTAsmPrinter.cpp updated: 1.100 -> 1.101 X86AsmPrinter.cpp updated: 1.239 -> 1.240 X86ISelLowering.cpp updated: 1.393 -> 1.394 X86ISelLowering.h updated: 1.98 -> 1.99 X86InstrInfo.td updated: 1.302 -> 1.303 --- Log message: Implement "general dynamic", "initial exec" and "local exec" TLS models for X86 32 bits. --- Diffs of the changes: (+122 -6) X86ATTAsmPrinter.cpp | 16 +++++++++- X86AsmPrinter.cpp | 10 ++++-- X86ISelLowering.cpp | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++ X86ISelLowering.h | 5 ++- X86InstrInfo.td | 22 ++++++++++++++ 5 files changed, 122 insertions(+), 6 deletions(-) Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.100 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.101 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.100 Tue Apr 17 12:21:52 2007 +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Fri Apr 20 16:38:10 2007 @@ -272,9 +272,13 @@ case MachineOperand::MO_GlobalAddress: { bool isCallOp = Modifier && !strcmp(Modifier, "call"); bool isMemOp = Modifier && !strcmp(Modifier, "mem"); - if (!isMemOp && !isCallOp) O << '$'; GlobalValue *GV = MO.getGlobal(); + GlobalVariable *GVar = dyn_cast(GV); + bool isThreadLocal = GVar && GVar->isThreadLocal(); + + if (!isMemOp && !isCallOp && !isThreadLocal) O << '$'; + std::string Name = Mang->getValueName(GV); X86SharedAsmPrinter::decorateName(Name, GV); @@ -328,7 +332,15 @@ else if (Offset < 0) O << Offset; - if (isMemOp) { + if (isThreadLocal) { + if (TM.getRelocationModel() == Reloc::PIC_) + O << "@TLSGD"; // general dynamic TLS model + else + if (GV->isDeclaration()) + O << "@INDNTPOFF"; // initial exec TLS model + else + O << "@NTPOFF"; // local exec TLS model + } else if (isMemOp) { if (printGOT(TM, Subtarget)) { if (Subtarget->GVRequiresExtraLoad(GV, TM, false)) O << "@GOT"; Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.239 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.240 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.239 Tue Apr 17 12:21:52 2007 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Fri Apr 20 16:38:10 2007 @@ -171,7 +171,7 @@ } } - if (!I->hasSection() && + if (!I->hasSection() && !I->isThreadLocal() && (I->hasInternalLinkage() || I->hasWeakLinkage() || I->hasLinkOnceLinkage())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. @@ -256,9 +256,13 @@ SwitchToDataSection(SectionName.c_str()); } else { if (C->isNullValue() && !NoZerosInBSS && TAI->getBSSSection()) - SwitchToDataSection(TAI->getBSSSection(), I); + SwitchToDataSection(I->isThreadLocal() ? TAI->getTLSBSSSection() : + TAI->getBSSSection(), I); else if (!I->isConstant()) - SwitchToDataSection(TAI->getDataSection(), I); + SwitchToDataSection(I->isThreadLocal() ? TAI->getTLSDataSection() : + TAI->getDataSection(), I); + else if (I->isThreadLocal()) + SwitchToDataSection(TAI->getTLSDataSection()); else { // Read-only data. bool HasReloc = C->ContainsRelocations(); Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.393 llvm/lib/Target/X86/X86ISelLowering.cpp:1.394 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.393 Tue Apr 17 14:34:00 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Fri Apr 20 16:38:10 2007 @@ -20,6 +20,7 @@ #include "llvm/CallingConv.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" +#include "llvm/GlobalVariable.h" #include "llvm/Function.h" #include "llvm/Intrinsics.h" #include "llvm/ADT/VectorExtras.h" @@ -200,6 +201,7 @@ setOperationAction(ISD::ConstantPool , MVT::i32 , Custom); setOperationAction(ISD::JumpTable , MVT::i32 , Custom); setOperationAction(ISD::GlobalAddress , MVT::i32 , Custom); + setOperationAction(ISD::GlobalTLSAddress, MVT::i32 , Custom); setOperationAction(ISD::ExternalSymbol , MVT::i32 , Custom); if (Subtarget->is64Bit()) { setOperationAction(ISD::ConstantPool , MVT::i64 , Custom); @@ -2943,6 +2945,76 @@ return Result; } +// Lower ISD::GlobalTLSAddress using the "general dynamic" model +static SDOperand +LowerToTLSGeneralDynamicModel(GlobalAddressSDNode *GA, SelectionDAG &DAG, + const MVT::ValueType PtrVT) { + SDOperand InFlag; + SDOperand Chain = DAG.getCopyToReg(DAG.getEntryNode(), X86::EBX, + DAG.getNode(X86ISD::GlobalBaseReg, + PtrVT), InFlag); + InFlag = Chain.getValue(1); + + // emit leal symbol at TLSGD(,%ebx,1), %eax + SDVTList NodeTys = DAG.getVTList(PtrVT, MVT::Other, MVT::Flag); + SDOperand TGA = DAG.getTargetGlobalAddress(GA->getGlobal(), + GA->getValueType(0), + GA->getOffset()); + SDOperand Ops[] = { Chain, TGA, InFlag }; + SDOperand Result = DAG.getNode(X86ISD::TLSADDR, NodeTys, Ops, 3); + InFlag = Result.getValue(2); + Chain = Result.getValue(1); + + // call ___tls_get_addr. This function receives its argument in + // the register EAX. + Chain = DAG.getCopyToReg(Chain, X86::EAX, Result, InFlag); + InFlag = Chain.getValue(1); + + NodeTys = DAG.getVTList(MVT::Other, MVT::Flag); + SDOperand Ops1[] = { Chain, + DAG.getTargetExternalSymbol("___tls_get_addr", + PtrVT), + DAG.getRegister(X86::EAX, PtrVT), + DAG.getRegister(X86::EBX, PtrVT), + InFlag }; + Chain = DAG.getNode(X86ISD::CALL, NodeTys, Ops1, 5); + InFlag = Chain.getValue(1); + + return DAG.getCopyFromReg(Chain, X86::EAX, PtrVT, InFlag); +} + +// Lower ISD::GlobalTLSAddress using the "initial exec" (for no-pic) or +// "local exec" model. +static SDOperand +LowerToTLSExecModel(GlobalAddressSDNode *GA, SelectionDAG &DAG, + const MVT::ValueType PtrVT) { + // Get the Thread Pointer + SDOperand ThreadPointer = DAG.getNode(X86ISD::THREAD_POINTER, PtrVT); + // emit "addl x at ntpoff,%eax" (local exec) or "addl x at indntpoff,%eax" (initial + // exec) + SDOperand TGA = DAG.getTargetGlobalAddress(GA->getGlobal(), + GA->getValueType(0), + GA->getOffset()); + SDOperand Offset = DAG.getNode(X86ISD::Wrapper, PtrVT, TGA); + // The address of the thread local variable is the add of the thread + // pointer with the offset of the variable. + return DAG.getNode(ISD::ADD, PtrVT, ThreadPointer, Offset); +} + +SDOperand +X86TargetLowering::LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG) { + // TODO: implement the "local dynamic" model + // TODO: implement the "initial exec"model for pic executables + assert(!Subtarget->is64Bit() && "TLS not implemented for X86_64"); + GlobalAddressSDNode *GA = cast(Op); + // If the relocation model is PIC, use the "General Dynamic" TLS Model, + // otherwise use the "Local Exec"TLS Model + if (getTargetMachine().getRelocationModel() == Reloc::PIC_) + return LowerToTLSGeneralDynamicModel(GA, DAG, getPointerTy()); + else + return LowerToTLSExecModel(GA, DAG, getPointerTy()); +} + SDOperand X86TargetLowering::LowerExternalSymbol(SDOperand Op, SelectionDAG &DAG) { const char *Sym = cast(Op)->getSymbol(); @@ -4022,6 +4094,7 @@ case ISD::SCALAR_TO_VECTOR: return LowerSCALAR_TO_VECTOR(Op, DAG); case ISD::ConstantPool: return LowerConstantPool(Op, DAG); case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG); + case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG); case ISD::ExternalSymbol: return LowerExternalSymbol(Op, DAG); case ISD::SHL_PARTS: case ISD::SRA_PARTS: @@ -4090,6 +4163,8 @@ case X86ISD::PINSRW: return "X86ISD::PINSRW"; case X86ISD::FMAX: return "X86ISD::FMAX"; case X86ISD::FMIN: return "X86ISD::FMIN"; + case X86ISD::TLSADDR: return "X86ISD::TLSADDR"; + case X86ISD::THREAD_POINTER: return "X86ISD::THREAD_POINTER"; } } Index: llvm/lib/Target/X86/X86ISelLowering.h diff -u llvm/lib/Target/X86/X86ISelLowering.h:1.98 llvm/lib/Target/X86/X86ISelLowering.h:1.99 --- llvm/lib/Target/X86/X86ISelLowering.h:1.98 Tue Apr 17 04:20:00 2007 +++ llvm/lib/Target/X86/X86ISelLowering.h Fri Apr 20 16:38:10 2007 @@ -176,7 +176,9 @@ /// FMAX, FMIN - Floating point max and min. /// - FMAX, FMIN + FMAX, FMIN, + // Thread Local Storage + TLSADDR, THREAD_POINTER }; } @@ -386,6 +388,7 @@ SDOperand LowerSCALAR_TO_VECTOR(SDOperand Op, SelectionDAG &DAG); SDOperand LowerConstantPool(SDOperand Op, SelectionDAG &DAG); SDOperand LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG); + SDOperand LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG); SDOperand LowerExternalSymbol(SDOperand Op, SelectionDAG &DAG); SDOperand LowerShift(SDOperand Op, SelectionDAG &DAG); SDOperand LowerSINT_TO_FP(SDOperand Op, SelectionDAG &DAG); Index: llvm/lib/Target/X86/X86InstrInfo.td diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.302 llvm/lib/Target/X86/X86InstrInfo.td:1.303 --- llvm/lib/Target/X86/X86InstrInfo.td:1.302 Tue Apr 17 04:20:00 2007 +++ llvm/lib/Target/X86/X86InstrInfo.td Fri Apr 20 16:38:10 2007 @@ -47,6 +47,10 @@ def SDTX86Wrapper : SDTypeProfile<1, 1, [SDTCisSameAs<0, 1>, SDTCisPtrTy<0>]>; +def SDT_X86TLSADDR : SDTypeProfile<1, 1, [SDTCisPtrTy<0>, SDTCisInt<1>]>; + +def SDT_X86TLSTP : SDTypeProfile<1, 0, [SDTCisPtrTy<0>]>; + def X86shld : SDNode<"X86ISD::SHLD", SDTIntShiftDOp>; def X86shrd : SDNode<"X86ISD::SHRD", SDTIntShiftDOp>; @@ -87,6 +91,11 @@ def X86Wrapper : SDNode<"X86ISD::Wrapper", SDTX86Wrapper>; def X86WrapperRIP : SDNode<"X86ISD::WrapperRIP", SDTX86Wrapper>; +def X86tlsaddr : SDNode<"X86ISD::TLSADDR", SDT_X86TLSADDR, + [SDNPHasChain, SDNPInFlag, SDNPOutFlag]>; +def X86TLStp : SDNode<"X86ISD::THREAD_POINTER", SDT_X86TLSTP, []>; + + //===----------------------------------------------------------------------===// // X86 Operand Definitions. // @@ -2449,6 +2458,19 @@ "mov{l} {$src, $dst|$dst, $src}", []>; //===----------------------------------------------------------------------===// +// Thread Local Storage Instructions +// + +def TLS_addr : I<0, Pseudo, (ops GR32:$dst, i32imm:$sym), + "leal $sym(,%ebx,1), $dst", + [(set GR32:$dst, (X86tlsaddr tglobaltlsaddr:$sym))]>, + Imp<[EBX],[]>; + +def TLS_tp : I<0, Pseudo, (ops GR32:$dst), + "movl %gs:0, $dst", + [(set GR32:$dst, X86TLStp)]>; + +//===----------------------------------------------------------------------===// // DWARF Pseudo Instructions // From lauro.venancio at gmail.com Fri Apr 20 16:38:42 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Fri, 20 Apr 2007 16:38:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetAsmInfo.cpp TargetSelectionDAG.td Message-ID: <200704202138.l3KLcgcX023252@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetAsmInfo.cpp updated: 1.21 -> 1.22 TargetSelectionDAG.td updated: 1.78 -> 1.79 --- Log message: Implement "general dynamic", "initial exec" and "local exec" TLS models for X86 32 bits. --- Diffs of the changes: (+6 -0) TargetAsmInfo.cpp | 2 ++ TargetSelectionDAG.td | 4 ++++ 2 files changed, 6 insertions(+) Index: llvm/lib/Target/TargetAsmInfo.cpp diff -u llvm/lib/Target/TargetAsmInfo.cpp:1.21 llvm/lib/Target/TargetAsmInfo.cpp:1.22 --- llvm/lib/Target/TargetAsmInfo.cpp:1.21 Wed Mar 7 19:00:38 2007 +++ llvm/lib/Target/TargetAsmInfo.cpp Fri Apr 20 16:38:10 2007 @@ -20,6 +20,8 @@ TextSection(".text"), DataSection(".data"), BSSSection(".bss"), + TLSDataSection("\t.section .tdata,\"awT\", at progbits"), + TLSBSSSection("\t.section .tbss,\"awT\", at nobits"), ZeroFillDirective(0), AddressSize(4), NeedsSet(false), Index: llvm/lib/Target/TargetSelectionDAG.td diff -u llvm/lib/Target/TargetSelectionDAG.td:1.78 llvm/lib/Target/TargetSelectionDAG.td:1.79 --- llvm/lib/Target/TargetSelectionDAG.td:1.78 Fri Jan 26 08:34:51 2007 +++ llvm/lib/Target/TargetSelectionDAG.td Fri Apr 20 16:38:10 2007 @@ -211,6 +211,10 @@ "GlobalAddressSDNode">; def tglobaladdr : SDNode<"ISD::TargetGlobalAddress", SDTPtrLeaf, [], "GlobalAddressSDNode">; +def globaltlsaddr : SDNode<"ISD::GlobalTLSAddress", SDTPtrLeaf, [], + "GlobalAddressSDNode">; +def tglobaltlsaddr : SDNode<"ISD::TargetGlobalTLSAddress", SDTPtrLeaf, [], + "GlobalAddressSDNode">; def constpool : SDNode<"ISD::ConstantPool", SDTPtrLeaf, [], "ConstantPoolSDNode">; def tconstpool : SDNode<"ISD::TargetConstantPool", SDTPtrLeaf, [], From lauro.venancio at gmail.com Fri Apr 20 16:38:43 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Fri, 20 Apr 2007 16:38:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp SelectionDAG.cpp Message-ID: <200704202138.l3KLchWX023264@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.486 -> 1.487 SelectionDAG.cpp updated: 1.397 -> 1.398 --- Log message: Implement "general dynamic", "initial exec" and "local exec" TLS models for X86 32 bits. --- Diffs of the changes: (+22 -2) LegalizeDAG.cpp | 2 ++ SelectionDAG.cpp | 22 ++++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.486 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.487 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.486 Mon Apr 2 16:36:32 2007 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Apr 20 16:38:10 2007 @@ -622,6 +622,7 @@ case ISD::TargetConstantFP: case ISD::TargetConstantPool: case ISD::TargetGlobalAddress: + case ISD::TargetGlobalTLSAddress: case ISD::TargetExternalSymbol: case ISD::VALUETYPE: case ISD::SRCVALUE: @@ -653,6 +654,7 @@ assert(0 && "Do not know how to legalize this operator!"); abort(); case ISD::GlobalAddress: + case ISD::GlobalTLSAddress: case ISD::ExternalSymbol: case ISD::ConstantPool: case ISD::JumpTable: // Nothing to do. Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.397 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.398 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.397 Thu Apr 12 00:58:43 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Fri Apr 20 16:38:10 2007 @@ -14,6 +14,7 @@ #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/Constants.h" #include "llvm/GlobalValue.h" +#include "llvm/GlobalVariable.h" #include "llvm/Intrinsics.h" #include "llvm/Assembly/Writer.h" #include "llvm/CodeGen/MachineBasicBlock.h" @@ -296,7 +297,9 @@ ID.AddDouble(cast(N)->getValue()); break; case ISD::TargetGlobalAddress: - case ISD::GlobalAddress: { + case ISD::GlobalAddress: + case ISD::TargetGlobalTLSAddress: + case ISD::GlobalTLSAddress: { GlobalAddressSDNode *GA = cast(N); ID.AddPointer(GA->getGlobal()); ID.AddInteger(GA->getOffset()); @@ -692,7 +695,12 @@ SDOperand SelectionDAG::getGlobalAddress(const GlobalValue *GV, MVT::ValueType VT, int Offset, bool isTargetGA) { - unsigned Opc = isTargetGA ? ISD::TargetGlobalAddress : ISD::GlobalAddress; + const GlobalVariable *GVar = dyn_cast(GV); + unsigned Opc; + if (GVar && GVar->isThreadLocal()) + Opc = isTargetGA ? ISD::TargetGlobalTLSAddress : ISD::GlobalTLSAddress; + else + Opc = isTargetGA ? ISD::TargetGlobalAddress : ISD::GlobalAddress; FoldingSetNodeID ID; AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0); ID.AddPointer(GV); @@ -2282,6 +2290,14 @@ SDOperand Ops[] = { Op1, Op2 }; return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 2).Val; } +SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, + MVT::ValueType VT2, MVT::ValueType VT3, + SDOperand Op1, SDOperand Op2, + SDOperand Op3) { + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); + SDOperand Ops[] = { Op1, Op2, Op3 }; + return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 3).Val; +} SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, const SDOperand *Ops, unsigned NumOps) { @@ -2702,6 +2718,7 @@ case ISD::Constant: return "Constant"; case ISD::ConstantFP: return "ConstantFP"; case ISD::GlobalAddress: return "GlobalAddress"; + case ISD::GlobalTLSAddress: return "GlobalTLSAddress"; case ISD::FrameIndex: return "FrameIndex"; case ISD::JumpTable: return "JumpTable"; case ISD::GLOBAL_OFFSET_TABLE: return "GLOBAL_OFFSET_TABLE"; @@ -2725,6 +2742,7 @@ case ISD::TargetConstant: return "TargetConstant"; case ISD::TargetConstantFP:return "TargetConstantFP"; case ISD::TargetGlobalAddress: return "TargetGlobalAddress"; + case ISD::TargetGlobalTLSAddress: return "TargetGlobalTLSAddress"; case ISD::TargetFrameIndex: return "TargetFrameIndex"; case ISD::TargetJumpTable: return "TargetJumpTable"; case ISD::TargetConstantPool: return "TargetConstantPool"; From lauro.venancio at gmail.com Fri Apr 20 16:38:42 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Fri, 20 Apr 2007 16:38:42 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200704202138.l3KLcgOI023257@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.292 -> 1.293 --- Log message: Implement "general dynamic", "initial exec" and "local exec" TLS models for X86 32 bits. --- Diffs of the changes: (+5 -2) DAGISelEmitter.cpp | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.292 llvm/utils/TableGen/DAGISelEmitter.cpp:1.293 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.292 Fri Jan 26 17:00:54 2007 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Fri Apr 20 16:38:10 2007 @@ -2654,10 +2654,12 @@ } else { NodeOps.push_back(Val); } - } else if (!N->isLeaf() && N->getOperator()->getName() == "tglobaladdr") { + } else if (!N->isLeaf() && (N->getOperator()->getName() == "tglobaladdr" + || N->getOperator()->getName() == "tglobaltlsaddr")) { Record *Op = OperatorMap[N->getName()]; // Transform GlobalAddress to TargetGlobalAddress - if (Op && Op->getName() == "globaladdr") { + if (Op && (Op->getName() == "globaladdr" || + Op->getName() == "globaltlsaddr")) { emitCode("SDOperand Tmp" + utostr(ResNo) + " = CurDAG->getTarget" "GlobalAddress(cast(" + Val + ")->getGlobal(), " + getEnumName(N->getTypeNum(0)) + @@ -3716,6 +3718,7 @@ << " case ISD::TargetConstantPool:\n" << " case ISD::TargetFrameIndex:\n" << " case ISD::TargetJumpTable:\n" + << " case ISD::TargetGlobalTLSAddress:\n" << " case ISD::TargetGlobalAddress: {\n" << " return NULL;\n" << " }\n" From sabre at nondot.org Fri Apr 20 16:48:27 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 20 Apr 2007 16:48:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Verifier.cpp Message-ID: <200704202148.l3KLmRNf023453@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Verifier.cpp updated: 1.203 -> 1.204 --- Log message: catch a case that was biting jeffc --- Diffs of the changes: (+7 -1) Verifier.cpp | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.203 llvm/lib/VMCore/Verifier.cpp:1.204 --- llvm/lib/VMCore/Verifier.cpp:1.203 Tue Apr 17 12:36:12 2007 +++ llvm/lib/VMCore/Verifier.cpp Fri Apr 20 16:48:08 2007 @@ -867,12 +867,17 @@ // taken. Assert1(!F->isIntrinsic() || (i == 0 && isa(I)), "Cannot take the address of an intrinsic!", &I); + Assert1(F->getParent() == Mod, "Referencing function in another module!", + &I); } else if (BasicBlock *OpBB = dyn_cast(I.getOperand(i))) { Assert1(OpBB->getParent() == BB->getParent(), "Referring to a basic block in another function!", &I); } else if (Argument *OpArg = dyn_cast(I.getOperand(i))) { Assert1(OpArg->getParent() == BB->getParent(), "Referring to an argument in another function!", &I); + } else if (GlobalValue *GV = dyn_cast(I.getOperand(i))) { + Assert1(GV->getParent() == Mod, "Referencing global in another module!", + &I); } else if (Instruction *Op = dyn_cast(I.getOperand(i))) { BasicBlock *OpBlock = Op->getParent(); @@ -952,7 +957,8 @@ /// void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) { Function *IF = CI.getCalledFunction(); - Assert1(IF->isDeclaration(), "Intrinsic functions should never be defined!", IF); + Assert1(IF->isDeclaration(), "Intrinsic functions should never be defined!", + IF); #define GET_INTRINSIC_VERIFIER #include "llvm/Intrinsics.gen" From jeffc at jolt-lang.org Thu Apr 19 19:34:23 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Thu, 19 Apr 2007 19:34:23 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp Message-ID: <200704200034.l3K0YNqQ020353@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86IntelAsmPrinter.cpp updated: 1.70 -> 1.71 --- Log message: Make Microsoft assembler and linker happy. --- Diffs of the changes: (+4 -0) X86IntelAsmPrinter.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.70 llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.71 --- llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.70 Tue Apr 17 12:21:52 2007 +++ llvm/lib/Target/X86/X86IntelAsmPrinter.cpp Thu Apr 19 19:33:54 2007 @@ -355,6 +355,10 @@ if (I->hasDLLImportLinkage()) { O << "__imp_"; } + // Microsoft sticks an extra _ in front of "_write" (whether LLVM should + // hard-code usage of a Unix API is another question). + if (Name == "_write") + Name = "__write"; O << Name << ":near\n"; } From evan.cheng at apple.com Fri Apr 20 16:14:03 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 20 Apr 2007 16:14:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Target.td Message-ID: <200704202114.l3KLE3EK022602@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: Target.td updated: 1.95 -> 1.96 --- Log message: Add sub-registers sets. --- Diffs of the changes: (+16 -1) Target.td | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletion(-) Index: llvm/lib/Target/Target.td diff -u llvm/lib/Target/Target.td:1.95 llvm/lib/Target/Target.td:1.96 --- llvm/lib/Target/Target.td:1.95 Mon Mar 19 01:22:07 2007 +++ llvm/lib/Target/Target.td Fri Apr 20 16:13:46 2007 @@ -41,9 +41,14 @@ // Aliases - A list of registers that this register overlaps with. A read or // modification of this register can potentially read or modify the aliased // registers. - // list Aliases = []; + // SubRegs - A list of registers that are parts of this register. Note these + // are "immediate" sub-registers and the registers within the list do not + // themselves overlap. e.g. For X86, EAX's SubRegs list contains only [AX], + // not [AX, AH, AL]. + list SubRegs = []; + // DwarfNumber - Number used internally by gcc/gdb to identify the register. // These values can be determined by locating the .h file in the // directory llvmgcc/gcc/config// and looking for REGISTER_NAMES. The @@ -52,6 +57,16 @@ int DwarfNumber = -1; } +// RegisterWithSubRegs - This can be used to define instances of Register which +// need to specify sub-registers. +// List "subregs" specifies which registers are sub-registers to this one. This +// is used to populate the SubRegs and AliasSet fields of TargetRegisterDesc. +// This allows the code generator to be careful not to put two values with +// overlapping live ranges into registers which alias. +class RegisterWithSubRegs subregs> : Register { + let SubRegs = subregs; +} + // RegisterGroup - This can be used to define instances of Register which // need to specify aliases. // List "aliases" specifies which registers are aliased to this one. This From clattner at apple.com Fri Apr 20 16:53:08 2007 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Apr 2007 14:53:08 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp In-Reply-To: <200704200034.l3K0YNqQ020353@zion.cs.uiuc.edu> References: <200704200034.l3K0YNqQ020353@zion.cs.uiuc.edu> Message-ID: <20D18692-6944-41DB-9665-4171DFC64BC5@apple.com> This isn't the right place to do this. Is LLVM synthesizing references to write? Where is the reference coming from? -Chris On Apr 19, 2007, at 5:34 PM, Jeff Cohen wrote: > > > Changes in directory llvm/lib/Target/X86: > > X86IntelAsmPrinter.cpp updated: 1.70 -> 1.71 > --- > Log message: > > Make Microsoft assembler and linker happy. > > --- > Diffs of the changes: (+4 -0) > > X86IntelAsmPrinter.cpp | 4 ++++ > 1 files changed, 4 insertions(+) > > > Index: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp > diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.70 llvm/lib/ > Target/X86/X86IntelAsmPrinter.cpp:1.71 > --- llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.70 Tue Apr 17 > 12:21:52 2007 > +++ llvm/lib/Target/X86/X86IntelAsmPrinter.cpp Thu Apr 19 19:33:54 > 2007 > @@ -355,6 +355,10 @@ > if (I->hasDLLImportLinkage()) { > O << "__imp_"; > } > + // Microsoft sticks an extra _ in front of "_write" (whether > LLVM should > + // hard-code usage of a Unix API is another question). > + if (Name == "_write") > + Name = "__write"; > O << Name << ":near\n"; > } > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From clattner at apple.com Fri Apr 20 16:10:33 2007 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Apr 2007 14:10:33 -0700 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h In-Reply-To: <200704200544.l3K5iXc8025200@zion.cs.uiuc.edu> References: <200704200544.l3K5iXc8025200@zion.cs.uiuc.edu> Message-ID: > /// Return the immediate dominator of A. > - BasicBlock *getIDom(BasicBlock *A) { > + BasicBlock *getIDom(BasicBlock *A) const { > + if (!A) return 0; > + > ETNode *NodeA = getNode(A); A can't be null here, please check that NodeA isn't null instead (i.e. that A is reachable). -Chris > const ETNode *idom = NodeA->getFather(); > return idom ? idom->getData() : 0; > } > > - void getChildren(BasicBlock *A, std::vector& > children) { > + void getChildren(BasicBlock *A, std::vector& > children) const { > + if (!A) return; > ETNode *NodeA = getNode(A); > const ETNode* son = NodeA->getSon(); > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From jeffc at jolt-lang.org Fri Apr 20 17:01:06 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Fri, 20 Apr 2007 15:01:06 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp In-Reply-To: <20D18692-6944-41DB-9665-4171DFC64BC5@apple.com> References: <200704200034.l3K0YNqQ020353@zion.cs.uiuc.edu> <20D18692-6944-41DB-9665-4171DFC64BC5@apple.com> Message-ID: <46293822.7080505@jolt-lang.org> Chris Lattner wrote: > This isn't the right place to do this. Is LLVM synthesizing > references to write? Where is the reference coming from? > > -Chris > Transforms\Utils\LowerInvoke.cpp, line 152 Analysis\IPA\Andersens.cpp line 617 Yeah, I was afraid of that, but I'm just trying to get it to work at this point (at least code that doesn't actually call write() ). It's also synthesizing references to abort() as well. > On Apr 19, 2007, at 5:34 PM, Jeff Cohen wrote: > > >> Changes in directory llvm/lib/Target/X86: >> >> X86IntelAsmPrinter.cpp updated: 1.70 -> 1.71 >> --- >> Log message: >> >> Make Microsoft assembler and linker happy. >> >> --- >> Diffs of the changes: (+4 -0) >> >> X86IntelAsmPrinter.cpp | 4 ++++ >> 1 files changed, 4 insertions(+) >> >> >> Index: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp >> diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.70 llvm/lib/ >> Target/X86/X86IntelAsmPrinter.cpp:1.71 >> --- llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.70 Tue Apr 17 >> 12:21:52 2007 >> +++ llvm/lib/Target/X86/X86IntelAsmPrinter.cpp Thu Apr 19 19:33:54 >> 2007 >> @@ -355,6 +355,10 @@ >> if (I->hasDLLImportLinkage()) { >> O << "__imp_"; >> } >> + // Microsoft sticks an extra _ in front of "_write" (whether >> LLVM should >> + // hard-code usage of a Unix API is another question). >> + if (Name == "_write") >> + Name = "__write"; >> O << Name << ":near\n"; >> } >> >> >> >> >> _______________________________________________ >> 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 > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070420/c96b0c8d/attachment.html From lauro.venancio at gmail.com Thu Apr 19 09:09:56 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 19 Apr 2007 09:09:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp Message-ID: <200704191409.l3JE9uNo030604@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.cpp updated: 1.86 -> 1.87 --- Log message: Fix a bug in getFrameRegister. Reported by Raul Herbster. --- Diffs of the changes: (+4 -1) ARMRegisterInfo.cpp | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.86 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.87 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.86 Mon Apr 16 13:10:22 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Thu Apr 19 09:09:38 2007 @@ -1474,7 +1474,10 @@ } unsigned ARMRegisterInfo::getFrameRegister(MachineFunction &MF) const { - return STI.useThumbBacktraces() ? ARM::R7 : ARM::R11; + if (STI.isTargetDarwin() || hasFP(MF)) + return STI.useThumbBacktraces() ? ARM::R7 : ARM::R11; + else + return ARM::SP; } unsigned ARMRegisterInfo::getEHExceptionRegister() const { From alenhar2 at cs.uiuc.edu Thu Apr 19 11:02:39 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Thu, 19 Apr 2007 11:02:39 -0500 Subject: [llvm-commits] CVS: llvm-poolalloc/include/dsa/DSNode.h DataStructure.h Message-ID: <200704191602.l3JG2def003193@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/include/dsa: DSNode.h updated: 1.62 -> 1.63 DataStructure.h updated: 1.100 -> 1.101 --- Log message: First algorithmic change. This is partially to make kernel work easier, and partially to make poolalloc better. All functions, even externals (but not intrinsics) get graphs. Graphs for externals are such that they cause similar behavior to what is happening now, namely that the args are marked as external, and no type inference happens, etc. Then, recognizing libc functions is split into its own pass. A similar pass could be written for any work involving a set of known externals (aka the llva linux kernel work). Thus the core DSA only knows about what is in llvm proper. (there is some regressions here, I didn't carry all the libc stuff over into the new pass). This helps PA, since inlining during BU is just dependent on the completeness of the function pointer, not on the completeness and having no externals around. One of the major problems with PA, functionality wise, is hitting functions that haven't been resolved. Inlining earlier tends to put enough information in each node that BU based transforms get things right more often. Still some issues here. As a bonus, special case logic gets removed from some passes. Also, externals like qsort can have graphs fabricated for them that reflect their calls back into the program. --- Diffs of the changes: (+35 -12) DSNode.h | 4 ++++ DataStructure.h | 43 +++++++++++++++++++++++++++++++------------ 2 files changed, 35 insertions(+), 12 deletions(-) Index: llvm-poolalloc/include/dsa/DSNode.h diff -u llvm-poolalloc/include/dsa/DSNode.h:1.62 llvm-poolalloc/include/dsa/DSNode.h:1.63 --- llvm-poolalloc/include/dsa/DSNode.h:1.62 Tue Apr 17 18:41:06 2007 +++ llvm-poolalloc/include/dsa/DSNode.h Thu Apr 19 11:02:19 2007 @@ -337,6 +337,10 @@ /// unsigned getNodeFlags() const { return NodeType & ~DeadNode; } + /// clearNodeFlags - Useful for completely resetting a node, + /// used in external recognizers + DSNode* clearNodeFlags() { NodeType = 0; return this; } + bool isAllocaNode() const { return NodeType & AllocaNode; } bool isHeapNode() const { return NodeType & HeapNode; } bool isGlobalNode() const { return NodeType & GlobalNode; } Index: llvm-poolalloc/include/dsa/DataStructure.h diff -u llvm-poolalloc/include/dsa/DataStructure.h:1.100 llvm-poolalloc/include/dsa/DataStructure.h:1.101 --- llvm-poolalloc/include/dsa/DataStructure.h:1.100 Wed Apr 11 12:37:43 2007 +++ llvm-poolalloc/include/dsa/DataStructure.h Thu Apr 19 11:02:19 2007 @@ -76,6 +76,8 @@ void formGlobalECs(); + DataStructures() :TD(0), GraphSource(0), GlobalsGraph(0) {} + public: bool hasGraph(const Function &F) const { @@ -114,6 +116,7 @@ // class LocalDataStructures : public DataStructures { public: + LocalDataStructures() :DataStructures() {} ~LocalDataStructures() { releaseMemory(); } virtual bool runOnModule(Module &M); @@ -135,6 +138,31 @@ } }; +// StdLibDataStructures - This analysis recognizes common standard c library +// functions and generates graphs for them. +class StdLibDataStructures : public DataStructures { +public: + StdLibDataStructures() :DataStructures() {} + ~StdLibDataStructures() { releaseMemory(); } + + virtual bool runOnModule(Module &M); + + /// print - Print out the analysis results... + /// + void print(std::ostream &O, const Module *M) const; + + /// releaseMemory - if the pass pipeline is done with this pass, we can + /// release our memory... + /// + virtual void releaseMemory(); + + /// getAnalysisUsage - This obviously provides a data structure graph. + /// + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.setPreservesAll(); + AU.addRequired(); + } +}; /// BUDataStructures - The analysis that computes the interprocedurally closed /// data structure graphs for all of the functions in the program. This pass @@ -149,6 +177,7 @@ std::pair > > *IndCallGraphMap; public: + BUDataStructures() : DataStructures() {} ~BUDataStructures() { releaseMyMemory(); } virtual bool runOnModule(Module &M); @@ -170,7 +199,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); - AU.addRequired(); + AU.addRequired(); } typedef std::set > ActualCalleesTy; @@ -232,20 +261,11 @@ std::map, DSGraph*> IndCallMap; public: + TDDataStructures() :DataStructures() {} ~TDDataStructures() { releaseMyMemory(); } virtual bool runOnModule(Module &M); - /// getDSGraph - Return the data structure graph for the specified function. - /// - DSGraph &getDSGraph(const Function &F) const { - hash_map::const_iterator I = - DSInfo.find(const_cast(&F)); - if (I != DSInfo.end()) return *I->second; - return const_cast(this)-> - getOrCreateDSGraph(const_cast(F)); - } - /// deleteValue/copyValue - Interfaces to update the DSGraphs in the program. /// These correspond to the interfaces defined in the AliasAnalysis class. void deleteValue(Value *V); @@ -271,7 +291,6 @@ hash_set &Visited); void InlineCallersIntoGraph(DSGraph &G); - DSGraph &getOrCreateDSGraph(Function &F); void ComputePostOrder(Function &F, hash_set &Visited, std::vector &PostOrder); }; From alenhar2 at cs.uiuc.edu Thu Apr 19 11:02:40 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Thu, 19 Apr 2007 11:02:40 -0500 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/DSA/StdLibPass.cpp BottomUpClosure.cpp Local.cpp Printer.cpp TopDownClosure.cpp Message-ID: <200704191602.l3JG2eOH003203@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/DSA: StdLibPass.cpp added (r1.1) BottomUpClosure.cpp updated: 1.132 -> 1.133 Local.cpp updated: 1.170 -> 1.171 Printer.cpp updated: 1.94 -> 1.95 TopDownClosure.cpp updated: 1.100 -> 1.101 --- Log message: First algorithmic change. This is partially to make kernel work easier, and partially to make poolalloc better. All functions, even externals (but not intrinsics) get graphs. Graphs for externals are such that they cause similar behavior to what is happening now, namely that the args are marked as external, and no type inference happens, etc. Then, recognizing libc functions is split into its own pass. A similar pass could be written for any work involving a set of known externals (aka the llva linux kernel work). Thus the core DSA only knows about what is in llvm proper. (there is some regressions here, I didn't carry all the libc stuff over into the new pass). This helps PA, since inlining during BU is just dependent on the completeness of the function pointer, not on the completeness and having no externals around. One of the major problems with PA, functionality wise, is hitting functions that haven't been resolved. Inlining earlier tends to put enough information in each node that BU based transforms get things right more often. Still some issues here. As a bonus, special case logic gets removed from some passes. Also, externals like qsort can have graphs fabricated for them that reflect their calls back into the program. --- Diffs of the changes: (+234 -759) BottomUpClosure.cpp | 43 --- Local.cpp | 665 +++------------------------------------------------- Printer.cpp | 9 StdLibPass.cpp | 159 ++++++++++++ TopDownClosure.cpp | 117 +-------- 5 files changed, 234 insertions(+), 759 deletions(-) Index: llvm-poolalloc/lib/DSA/StdLibPass.cpp diff -c /dev/null llvm-poolalloc/lib/DSA/StdLibPass.cpp:1.1 *** /dev/null Thu Apr 19 11:02:29 2007 --- llvm-poolalloc/lib/DSA/StdLibPass.cpp Thu Apr 19 11:02:19 2007 *************** *** 0 **** --- 1,159 ---- + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // Recognize common standard c library functions and generate graphs for them + // + //===----------------------------------------------------------------------===// + + #include "llvm/ADT/Statistic.h" + #include "dsa/DataStructure.h" + #include "dsa/DSGraph.h" + #include "llvm/Constants.h" + #include "llvm/DerivedTypes.h" + #include "llvm/Instructions.h" + #include "llvm/Intrinsics.h" + #include "llvm/Support/GetElementPtrTypeIterator.h" + #include "llvm/Target/TargetData.h" + #include "llvm/Support/CommandLine.h" + #include "llvm/Support/Debug.h" + #include "llvm/Support/Timer.h" + #include + #include "llvm/Module.h" + + using namespace llvm; + + static RegisterPass + X("dsa-stdlib", "Standard Library Local Data Structure Analysis"); + + bool StdLibDataStructures::runOnModule(Module &M) { + LocalDataStructures &LocalDSA = getAnalysis(); + setGraphSource(&LocalDSA); + setTargetData(LocalDSA.getTargetData()); + setGraphClone(false); + GlobalECs = LocalDSA.getGlobalECs(); + + GlobalsGraph = new DSGraph(LocalDSA.getGlobalsGraph(), GlobalECs); + GlobalsGraph->setPrintAuxCalls(); + + // Calculate all of the graphs... + for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { + DSGraph &Graph = getOrCreateGraph(&*I); + //If this is an true external, check it out + if (I->isDeclaration() && !I->isIntrinsic()) { + const std::string& Name = I->getName(); + if (Name == "calloc" || + Name == "malloc" || + Name == "valloc" || + Name == "memalign") { + Graph.getReturnNodeFor(*I).getNode()->clearNodeFlags() + ->setHeapMarker()->setModifiedMarker(); + } else if (Name == "realloc") { + Graph.getReturnNodeFor(*I).getNode()->clearNodeFlags() + ->setHeapMarker()->setModifiedMarker(); + Graph.getNodeForValue(I->arg_begin()).getNode()->clearNodeFlags() + ->mergeWith(Graph.getReturnNodeFor(*I), 0); + } else if (Name == "free") { + Graph.getNodeForValue(&*I->arg_begin()).getNode()->clearNodeFlags() + ->setHeapMarker()->setModifiedMarker(); + } else if (Name == "atoi" || Name == "atof" || + Name == "atol" || Name == "atoll" || + Name == "remove" || Name == "unlink" || + Name == "rename" || Name == "memcmp" || + Name == "strcmp" || Name == "strncmp" || + Name == "execl" || Name == "execlp" || + Name == "execle" || Name == "execv" || + Name == "execvp" || Name == "chmod" || + Name == "puts" || Name == "write" || + Name == "open" || Name == "create" || + Name == "truncate" || Name == "chdir" || + Name == "mkdir" || Name == "rmdir" || + Name == "strlen") { + for (Function::arg_iterator AI = I->arg_begin(), E = I->arg_end(); + AI != E; ++AI) { + if (isa(AI->getType())) + Graph.getNodeForValue(&*AI).getNode()->clearNodeFlags() + ->setReadMarker(); + } + } else if (Name == "read" || Name == "pipe" || + Name == "wait" || Name == "time" || + Name == "getrusage") { + for (Function::arg_iterator AI = I->arg_begin(), E = I->arg_end(); + AI != E; ++AI) { + if (isa(AI->getType())) + Graph.getNodeForValue(&*AI).getNode()->clearNodeFlags() + ->setModifiedMarker(); + } + } else if (Name == "memchr" || Name == "memrchr") { + DSNodeHandle RetNH = Graph.getReturnNodeFor(*I); + DSNodeHandle Result = Graph.getNodeForValue(&*I->arg_begin()); + RetNH.mergeWith(Result); + RetNH.getNode()->clearNodeFlags()->setReadMarker(); + } else if (Name == "memmove") { + // Merge the first & second arguments, and mark the memory read and + // modified. + DSNodeHandle& RetNH = Graph.getNodeForValue(&*I->arg_begin()); + RetNH.mergeWith(Graph.getNodeForValue(&*(++(I->arg_begin())))); + RetNH.getNode()->clearNodeFlags()->setModifiedMarker()->setReadMarker(); + } else if (Name == "stat" || Name == "fstat" || Name == "lstat") { + // These functions read their first operand if its a pointer. + Function::arg_iterator AI = I->arg_begin(); + if (isa(AI->getType())) + Graph.getNodeForValue(&*AI).getNode() + ->clearNodeFlags()->setReadMarker(); + // Then they write into the stat buffer. + DSNodeHandle StatBuf = Graph.getNodeForValue(&*++AI); + DSNode *N = StatBuf.getNode(); + N->setModifiedMarker(); + const Type *StatTy = I->getFunctionType()->getParamType(1); + if (const PointerType *PTy = dyn_cast(StatTy)) + N->mergeTypeInfo(PTy->getElementType(), StatBuf.getOffset()); + } else if (Name == "strtod" || Name == "strtof" || Name == "strtold") { + // These functions read the first pointer + DSNodeHandle& Str = Graph.getNodeForValue(&*I->arg_begin()); + Str.getNode()->clearNodeFlags()->setReadMarker(); + // If the second parameter is passed, it will point to the first + // argument node. + DSNodeHandle& EndNH = Graph.getNodeForValue(&*(++(I->arg_begin()))); + EndNH.getNode()->clearNodeFlags()->setModifiedMarker(); + EndNH.getNode()->mergeTypeInfo(PointerType::get(Type::Int8Ty), + EndNH.getOffset(), false); + DSNodeHandle &Link = EndNH.getLink(0); + Link.mergeWith(Str); + } else { + //ignore pointer free functions + bool hasPtr = isa(I->getReturnType()); + for (Function::const_arg_iterator AI = I->arg_begin(), AE = I->arg_end(); + AI != AE && !hasPtr; ++AI) + if (isa(AI->getType())) + hasPtr = true; + if (hasPtr) + std::cerr << "Unhandled External: " << Name << "\n"; + } + } + } + + return false; + } + + // releaseMemory - If the pass pipeline is done with this pass, we can release + // our memory... here... + // + void StdLibDataStructures::releaseMemory() { + for (hash_map::iterator I = DSInfo.begin(), + E = DSInfo.end(); I != E; ++I) { + I->second->getReturnNodes().erase(I->first); + if (I->second->getReturnNodes().empty()) + delete I->second; + } + + // Empty map so next time memory is released, data structures are not + // re-deleted. + DSInfo.clear(); + delete GlobalsGraph; + GlobalsGraph = 0; + } + Index: llvm-poolalloc/lib/DSA/BottomUpClosure.cpp diff -u llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.132 llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.133 --- llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.132 Tue Apr 17 18:41:06 2007 +++ llvm-poolalloc/lib/DSA/BottomUpClosure.cpp Thu Apr 19 11:02:19 2007 @@ -38,7 +38,7 @@ // program. // bool BUDataStructures::runOnModule(Module &M) { - LocalDataStructures &LocalDSA = getAnalysis(); + StdLibDataStructures &LocalDSA = getAnalysis(); setGraphSource(&LocalDSA); setTargetData(LocalDSA.getTargetData()); setGraphClone(false); @@ -116,34 +116,13 @@ return false; } -static bool isVAHackFn(const Function *F) { - return F->getName() == "printf" || F->getName() == "sscanf" || - F->getName() == "fprintf" || F->getName() == "open" || - F->getName() == "sprintf" || F->getName() == "fputs" || - F->getName() == "fscanf" || F->getName() == "malloc" || - F->getName() == "free"; -} - -static bool isResolvableFunc(const Function* callee) { - return !callee->isDeclaration() || isVAHackFn(callee); -} - static void GetAllCallees(const DSCallSite &CS, std::vector &Callees) { if (CS.isDirectCall()) { - if (isResolvableFunc(CS.getCalleeFunc())) - Callees.push_back(CS.getCalleeFunc()); + Callees.push_back(CS.getCalleeFunc()); } else if (!CS.getCalleeNode()->isIncompleteNode()) { // Get all callees. - unsigned OldSize = Callees.size(); CS.getCalleeNode()->addFullFunctionList(Callees); - - // If any of the callees are unresolvable, remove the whole batch! - for (unsigned i = OldSize, e = Callees.size(); i != e; ++i) - if (!isResolvableFunc(Callees[i])) { - Callees.erase(Callees.begin()+OldSize, Callees.end()); - return; - } } } @@ -164,16 +143,6 @@ ValMap[F] = Min; Stack.push_back(F); - // FIXME! This test should be generalized to be any function that we have - // already processed, in the case when there isn't a main or there are - // unreachable functions! - if (F->isDeclaration()) { // sprintf, fprintf, sscanf, etc... - // No callees! - Stack.pop_back(); - ValMap[F] = ~0; - return Min; - } - DSGraph &Graph = getOrCreateGraph(F); // Find all callee functions. @@ -202,11 +171,10 @@ DOUT << "Visiting single node SCC #: " << MyID << " fn: " << F->getName() << "\n"; Stack.pop_back(); - DSGraph &G = getDSGraph(*F); DOUT << " [BU] Calculating graph for: " << F->getName()<< "\n"; - calculateGraph(G); + calculateGraph(Graph); DOUT << " [BU] Done inlining: " << F->getName() << " [" - << G.getGraphSize() << "+" << G.getAuxFunctionCalls().size() + << Graph.getGraphSize() << "+" << Graph.getAuxFunctionCalls().size() << "]\n"; if (MaxSCC < 1) MaxSCC = 1; @@ -373,9 +341,6 @@ if (CS.getRetVal().isNull() && CS.getNumPtrArgs() == 0) { TempFCs.erase(TempFCs.begin()); continue; - } else if (CS.isDirectCall() && isVAHackFn(CS.getCalleeFunc())) { - TempFCs.erase(TempFCs.begin()); - continue; } GetAllCallees(CS, CalledFuncs); Index: llvm-poolalloc/lib/DSA/Local.cpp diff -u llvm-poolalloc/lib/DSA/Local.cpp:1.170 llvm-poolalloc/lib/DSA/Local.cpp:1.171 --- llvm-poolalloc/lib/DSA/Local.cpp:1.170 Tue Apr 17 18:41:06 2007 +++ llvm-poolalloc/lib/DSA/Local.cpp Thu Apr 19 11:02:19 2007 @@ -37,10 +37,6 @@ static RegisterPass X("dsa-local", "Local Data Structure Analysis"); -static cl::opt -IgnoreSetCC("dsa-ignore-setcc", cl::Hidden, - cl::desc("If this is set, do nothing at pointer comparisons")); - static cl::list AllocList("dsa-alloc-list", cl::value_desc("list"), @@ -121,6 +117,7 @@ void visitIntToPtrInst(IntToPtrInst &I); void visitPtrToIntInst(PtrToIntInst &I); void visitBitCastInst(BitCastInst &I); + void visitCmpInst(CmpInst &I); //the nasty ones void visitGetElementPtrInst(User &GEP); @@ -129,7 +126,6 @@ void visitInstruction(Instruction &I); bool visitIntrinsic(CallSite CS, Function* F); - bool visitExternal(llvm::CallSite, llvm::Function*); void visitCallSite(CallSite CS); public: @@ -141,8 +137,11 @@ if (isa(I->getType())) { DSNode * Node = getValueDest(*I).getNode(); - if (!(f.hasInternalLinkage())) { + if (!f.hasInternalLinkage() || f.isDeclaration()) { Node->setExternalMarker(); + //pecimistic assumptions on externals + if (f.isDeclaration()) + Node->setReadMarker()->setModifiedMarker(); } } } @@ -150,18 +149,25 @@ // Create an entry for the return, which tracks which functions are in the graph g.getOrCreateReturnNodeFor(f); - visit(f); // Single pass over the function + if (!f.isDeclaration()) { + visit(f); // Single pass over the function - // If there are any constant globals referenced in this function, merge their - // initializers into the local graph from the globals graph. - if (g.getScalarMap().global_begin() != g.getScalarMap().global_end()) { - ReachabilityCloner RC(g, *g.getGlobalsGraph(), 0); - - for (DSScalarMap::global_iterator I = g.getScalarMap().global_begin(); - I != g.getScalarMap().global_end(); ++I) - if (GlobalVariable *GV = dyn_cast(*I)) - if (!GV->isDeclaration() && GV->isConstant()) - RC.merge(g.getNodeForValue(GV), g.getGlobalsGraph()->getNodeForValue(GV)); + // If there are any constant globals referenced in this function, merge their + // initializers into the local graph from the globals graph. + if (g.getScalarMap().global_begin() != g.getScalarMap().global_end()) { + ReachabilityCloner RC(g, *g.getGlobalsGraph(), 0); + + for (DSScalarMap::global_iterator I = g.getScalarMap().global_begin(); + I != g.getScalarMap().global_end(); ++I) + if (GlobalVariable *GV = dyn_cast(*I)) + if (!GV->isDeclaration() && GV->isConstant()) + RC.merge(g.getNodeForValue(GV), g.getGlobalsGraph()->getNodeForValue(GV)); + } + } else { + DSNodeHandle& RNH = g.getOrCreateReturnNodeFor(f); + //Make sure return values from externals are marked as such + if (isa(f.getReturnType())) + RNH.mergeWith(createNode()->setReadMarker()->setModifiedMarker()->setExternalMarker()); } g.markIncompleteNodes(DSGraph::MarkFormalArgs); @@ -355,6 +361,10 @@ setDestTo(I, Ptr); } +void GraphBuilder::visitCmpInst(CmpInst &I) { + //Should this merge or not? I don't think so. +} + void GraphBuilder::visitGetElementPtrInst(User &GEP) { DSNodeHandle Value = getValueDest(*GEP.getOperand(0)); if (Value.isNull()) @@ -548,589 +558,23 @@ if (DSNode *N = getValueDest(**CS.arg_begin()).getNode()) N->setModifiedMarker(); return true; - default: + default: { + //ignore pointer free intrinsics + if (!isa(F->getReturnType())) { + bool hasPtr = false; + for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); + I != E && !hasPtr; ++I) + if (isa(I->getType())) + hasPtr = true; + if (!hasPtr) + return true; + } + + assert(0 && "Unhandled intrinsic"); DOUT << "[dsa:local] Unhandled intrinsic: " << F->getName() << "\n"; return false; } -} - -/// returns true if the external is a recognized libc function with a -/// known (and generated) graph -bool GraphBuilder::visitExternal(CallSite CS, Function *F) { - if (F->getName() == "calloc" - || F->getName() == "posix_memalign" - || F->getName() == "memalign" || F->getName() == "valloc") { - setDestTo(*CS.getInstruction(), - createNode()->setHeapMarker()->setModifiedMarker()); - return true; - } else if (F->getName() == "realloc") { - DSNodeHandle RetNH = getValueDest(*CS.getInstruction()); - if (CS.arg_begin() != CS.arg_end()) - RetNH.mergeWith(getValueDest(**CS.arg_begin())); - if (DSNode *N = RetNH.getNode()) - N->setHeapMarker()->setModifiedMarker()->setReadMarker(); - return true; - } else if (F->getName() == "memmove") { - // Merge the first & second arguments, and mark the memory read and - // modified. - DSNodeHandle RetNH = getValueDest(**CS.arg_begin()); - RetNH.mergeWith(getValueDest(**(CS.arg_begin()+1))); - if (DSNode *N = RetNH.getNode()) - N->setModifiedMarker()->setReadMarker(); - return true; - } else if (F->getName() == "free") { - // Mark that the node is written to... - if (DSNode *N = getValueDest(**CS.arg_begin()).getNode()) - N->setModifiedMarker()->setHeapMarker(); - } else if (F->getName() == "atoi" || F->getName() == "atof" || - F->getName() == "atol" || F->getName() == "atoll" || - F->getName() == "remove" || F->getName() == "unlink" || - F->getName() == "rename" || F->getName() == "memcmp" || - F->getName() == "strcmp" || F->getName() == "strncmp" || - F->getName() == "execl" || F->getName() == "execlp" || - F->getName() == "execle" || F->getName() == "execv" || - F->getName() == "execvp" || F->getName() == "chmod" || - F->getName() == "puts" || F->getName() == "write" || - F->getName() == "open" || F->getName() == "create" || - F->getName() == "truncate" || F->getName() == "chdir" || - F->getName() == "mkdir" || F->getName() == "rmdir" || - F->getName() == "strlen") { - // These functions read all of their pointer operands. - for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); - AI != E; ++AI) { - if (isa((*AI)->getType())) - if (DSNode *N = getValueDest(**AI).getNode()) - N->setReadMarker(); - } - return true; - } else if (F->getName() == "memchr") { - DSNodeHandle RetNH = getValueDest(**CS.arg_begin()); - DSNodeHandle Result = getValueDest(*CS.getInstruction()); - RetNH.mergeWith(Result); - if (DSNode *N = RetNH.getNode()) - N->setReadMarker(); - return true; - } else if (F->getName() == "read" || F->getName() == "pipe" || - F->getName() == "wait" || F->getName() == "time" || - F->getName() == "getrusage") { - // These functions write all of their pointer operands. - for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); - AI != E; ++AI) { - if (isa((*AI)->getType())) - if (DSNode *N = getValueDest(**AI).getNode()) - N->setModifiedMarker(); - } - return true; - } else if (F->getName() == "stat" || F->getName() == "fstat" || - F->getName() == "lstat") { - // These functions read their first operand if its a pointer. - CallSite::arg_iterator AI = CS.arg_begin(); - if (isa((*AI)->getType())) { - DSNodeHandle Path = getValueDest(**AI); - if (DSNode *N = Path.getNode()) N->setReadMarker(); - } - - // Then they write into the stat buffer. - DSNodeHandle StatBuf = getValueDest(**++AI); - if (DSNode *N = StatBuf.getNode()) { - N->setModifiedMarker(); - const Type *StatTy = F->getFunctionType()->getParamType(1); - if (const PointerType *PTy = dyn_cast(StatTy)) - N->mergeTypeInfo(PTy->getElementType(), StatBuf.getOffset()); - } - return true; - } else if (F->getName() == "strtod" || F->getName() == "strtof" || - F->getName() == "strtold") { - // These functions read the first pointer - if (DSNode *Str = getValueDest(**CS.arg_begin()).getNode()) { - Str->setReadMarker(); - // If the second parameter is passed, it will point to the first - // argument node. - const DSNodeHandle &EndPtrNH = getValueDest(**(CS.arg_begin()+1)); - if (DSNode *End = EndPtrNH.getNode()) { - End->mergeTypeInfo(PointerType::get(Type::Int8Ty), - EndPtrNH.getOffset(), false); - End->setModifiedMarker(); - DSNodeHandle &Link = getLink(EndPtrNH); - Link.mergeWith(getValueDest(**CS.arg_begin())); - } - } - return true; - } else if (F->getName() == "fopen" || F->getName() == "fdopen" || - F->getName() == "freopen") { - // These functions read all of their pointer operands. - for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); - AI != E; ++AI) - if (isa((*AI)->getType())) - if (DSNode *N = getValueDest(**AI).getNode()) - N->setReadMarker(); - - // fopen allocates in an unknown way and writes to the file - // descriptor. Also, merge the allocated type into the node. - DSNodeHandle Result = getValueDest(*CS.getInstruction()); - if (DSNode *N = Result.getNode()) { - N->setModifiedMarker()->setUnknownMarker(); - const Type *RetTy = F->getFunctionType()->getReturnType(); - if (const PointerType *PTy = dyn_cast(RetTy)) - N->mergeTypeInfo(PTy->getElementType(), Result.getOffset()); - } - - // If this is freopen, merge the file descriptor passed in with the - // result. - if (F->getName() == "freopen") { - // ICC doesn't handle getting the iterator, decrementing and - // dereferencing it in one operation without error. Do it in 2 steps - CallSite::arg_iterator compit = CS.arg_end(); - Result.mergeWith(getValueDest(**--compit)); - } - return true; - } else if (F->getName() == "fclose" && CS.arg_end()-CS.arg_begin() ==1){ - // fclose reads and deallocates the memory in an unknown way for the - // file descriptor. It merges the FILE type into the descriptor. - DSNodeHandle H = getValueDest(**CS.arg_begin()); - if (DSNode *N = H.getNode()) { - N->setReadMarker()->setUnknownMarker(); - const Type *ArgTy = F->getFunctionType()->getParamType(0); - if (const PointerType *PTy = dyn_cast(ArgTy)) - N->mergeTypeInfo(PTy->getElementType(), H.getOffset()); - } - return true; - } else if (CS.arg_end()-CS.arg_begin() == 1 && - (F->getName() == "fflush" || F->getName() == "feof" || - F->getName() == "fileno" || F->getName() == "clearerr" || - F->getName() == "rewind" || F->getName() == "ftell" || - F->getName() == "ferror" || F->getName() == "fgetc" || - F->getName() == "fgetc" || F->getName() == "_IO_getc")) { - // fflush reads and writes the memory for the file descriptor. It - // merges the FILE type into the descriptor. - DSNodeHandle H = getValueDest(**CS.arg_begin()); - if (DSNode *N = H.getNode()) { - N->setReadMarker()->setModifiedMarker(); - - const Type *ArgTy = F->getFunctionType()->getParamType(0); - if (const PointerType *PTy = dyn_cast(ArgTy)) - N->mergeTypeInfo(PTy->getElementType(), H.getOffset()); - } - return true; - } else if (CS.arg_end()-CS.arg_begin() == 4 && - (F->getName() == "fwrite" || F->getName() == "fread")) { - // fread writes the first operand, fwrite reads it. They both - // read/write the FILE descriptor, and merges the FILE type. - CallSite::arg_iterator compit = CS.arg_end(); - DSNodeHandle H = getValueDest(**--compit); - if (DSNode *N = H.getNode()) { - N->setReadMarker()->setModifiedMarker(); - const Type *ArgTy = F->getFunctionType()->getParamType(3); - if (const PointerType *PTy = dyn_cast(ArgTy)) - N->mergeTypeInfo(PTy->getElementType(), H.getOffset()); - } - - H = getValueDest(**CS.arg_begin()); - if (DSNode *N = H.getNode()) - if (F->getName() == "fwrite") - N->setReadMarker(); - else - N->setModifiedMarker(); - return true; - } else if (F->getName() == "fgets" && CS.arg_end()-CS.arg_begin() == 3){ - // fgets reads and writes the memory for the file descriptor. It - // merges the FILE type into the descriptor, and writes to the - // argument. It returns the argument as well. - CallSite::arg_iterator AI = CS.arg_begin(); - DSNodeHandle H = getValueDest(**AI); - if (DSNode *N = H.getNode()) - N->setModifiedMarker(); // Writes buffer - H.mergeWith(getValueDest(*CS.getInstruction())); // Returns buffer - ++AI; ++AI; - - // Reads and writes file descriptor, merge in FILE type. - H = getValueDest(**AI); - if (DSNode *N = H.getNode()) { - N->setReadMarker()->setModifiedMarker(); - const Type *ArgTy = F->getFunctionType()->getParamType(2); - if (const PointerType *PTy = dyn_cast(ArgTy)) - N->mergeTypeInfo(PTy->getElementType(), H.getOffset()); - } - return true; - } else if (F->getName() == "ungetc" || F->getName() == "fputc" || - F->getName() == "fputs" || F->getName() == "putc" || - F->getName() == "ftell" || F->getName() == "rewind" || - F->getName() == "_IO_putc") { - // These functions read and write the memory for the file descriptor, - // which is passes as the last argument. - CallSite::arg_iterator compit = CS.arg_end(); - DSNodeHandle H = getValueDest(**--compit); - if (DSNode *N = H.getNode()) { - N->setReadMarker()->setModifiedMarker(); - FunctionType::param_iterator compit2 = F->getFunctionType()->param_end(); - const Type *ArgTy = *--compit2; - if (const PointerType *PTy = dyn_cast(ArgTy)) - N->mergeTypeInfo(PTy->getElementType(), H.getOffset()); - } - - // Any pointer arguments are read. - for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); - AI != E; ++AI) - if (isa((*AI)->getType())) - if (DSNode *N = getValueDest(**AI).getNode()) - N->setReadMarker(); - return true; - } else if (F->getName() == "fseek" || F->getName() == "fgetpos" || - F->getName() == "fsetpos") { - // These functions read and write the memory for the file descriptor, - // and read/write all other arguments. - DSNodeHandle H = getValueDest(**CS.arg_begin()); - if (DSNode *N = H.getNode()) { - FunctionType::param_iterator compit2 = F->getFunctionType()->param_end(); - const Type *ArgTy = *--compit2; - if (const PointerType *PTy = dyn_cast(ArgTy)) - N->mergeTypeInfo(PTy->getElementType(), H.getOffset()); - } - - // Any pointer arguments are read. - for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); - AI != E; ++AI) - if (isa((*AI)->getType())) - if (DSNode *N = getValueDest(**AI).getNode()) - N->setReadMarker()->setModifiedMarker(); - return true; - } else if (F->getName() == "printf" || F->getName() == "fprintf" || - F->getName() == "sprintf") { - CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); - - if (F->getName() == "fprintf") { - // fprintf reads and writes the FILE argument, and applies the type - // to it. - DSNodeHandle H = getValueDest(**AI); - if (DSNode *N = H.getNode()) { - N->setModifiedMarker(); - const Type *ArgTy = (*AI)->getType(); - if (const PointerType *PTy = dyn_cast(ArgTy)) - N->mergeTypeInfo(PTy->getElementType(), H.getOffset()); - } - } else if (F->getName() == "sprintf") { - // sprintf writes the first string argument. - DSNodeHandle H = getValueDest(**AI++); - if (DSNode *N = H.getNode()) { - N->setModifiedMarker(); - const Type *ArgTy = (*AI)->getType(); - if (const PointerType *PTy = dyn_cast(ArgTy)) - N->mergeTypeInfo(PTy->getElementType(), H.getOffset()); - } - } - - for (; AI != E; ++AI) { - // printf reads all pointer arguments. - if (isa((*AI)->getType())) - if (DSNode *N = getValueDest(**AI).getNode()) - N->setReadMarker(); - } - return true; - } else if (F->getName() == "vprintf" || F->getName() == "vfprintf" || - F->getName() == "vsprintf") { - CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); - - if (F->getName() == "vfprintf") { - // ffprintf reads and writes the FILE argument, and applies the type - // to it. - DSNodeHandle H = getValueDest(**AI); - if (DSNode *N = H.getNode()) { - N->setModifiedMarker()->setReadMarker(); - const Type *ArgTy = (*AI)->getType(); - if (const PointerType *PTy = dyn_cast(ArgTy)) - N->mergeTypeInfo(PTy->getElementType(), H.getOffset()); - } - ++AI; - } else if (F->getName() == "vsprintf") { - // vsprintf writes the first string argument. - DSNodeHandle H = getValueDest(**AI++); - if (DSNode *N = H.getNode()) { - N->setModifiedMarker(); - const Type *ArgTy = (*AI)->getType(); - if (const PointerType *PTy = dyn_cast(ArgTy)) - N->mergeTypeInfo(PTy->getElementType(), H.getOffset()); - } - } - - // Read the format - if (AI != E) { - if (isa((*AI)->getType())) - if (DSNode *N = getValueDest(**AI).getNode()) - N->setReadMarker(); - ++AI; - } - - // Read the valist, and the pointed-to objects. - if (AI != E && isa((*AI)->getType())) { - const DSNodeHandle &VAList = getValueDest(**AI); - if (DSNode *N = VAList.getNode()) { - N->setReadMarker(); - N->mergeTypeInfo(PointerType::get(Type::Int8Ty), - VAList.getOffset(), false); - - DSNodeHandle &VAListObjs = getLink(VAList); - VAListObjs.getNode()->setReadMarker(); - } - } - - return true; - } else if (F->getName() == "scanf" || F->getName() == "fscanf" || - F->getName() == "sscanf") { - CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); - - if (F->getName() == "fscanf") { - // fscanf reads and writes the FILE argument, and applies the type - // to it. - DSNodeHandle H = getValueDest(**AI); - if (DSNode *N = H.getNode()) { - N->setReadMarker(); - const Type *ArgTy = (*AI)->getType(); - if (const PointerType *PTy = dyn_cast(ArgTy)) - N->mergeTypeInfo(PTy->getElementType(), H.getOffset()); - } - } else if (F->getName() == "sscanf") { - // sscanf reads the first string argument. - DSNodeHandle H = getValueDest(**AI++); - if (DSNode *N = H.getNode()) { - N->setReadMarker(); - const Type *ArgTy = (*AI)->getType(); - if (const PointerType *PTy = dyn_cast(ArgTy)) - N->mergeTypeInfo(PTy->getElementType(), H.getOffset()); - } - } - - for (; AI != E; ++AI) { - // scanf writes all pointer arguments. - if (isa((*AI)->getType())) - if (DSNode *N = getValueDest(**AI).getNode()) - N->setModifiedMarker(); - } - return true; - } else if (F->getName() == "strtok") { - // strtok reads and writes the first argument, returning it. It reads - // its second arg. FIXME: strtok also modifies some hidden static - // data. Someday this might matter. - CallSite::arg_iterator AI = CS.arg_begin(); - DSNodeHandle H = getValueDest(**AI++); - if (DSNode *N = H.getNode()) { - N->setReadMarker()->setModifiedMarker(); // Reads/Writes buffer - const Type *ArgTy = F->getFunctionType()->getParamType(0); - if (const PointerType *PTy = dyn_cast(ArgTy)) - N->mergeTypeInfo(PTy->getElementType(), H.getOffset()); - } - H.mergeWith(getValueDest(*CS.getInstruction())); // Returns buffer - - H = getValueDest(**AI); // Reads delimiter - if (DSNode *N = H.getNode()) { - N->setReadMarker(); - const Type *ArgTy = F->getFunctionType()->getParamType(1); - if (const PointerType *PTy = dyn_cast(ArgTy)) - N->mergeTypeInfo(PTy->getElementType(), H.getOffset()); - } - return true; - } else if (F->getName() == "strchr" || F->getName() == "strrchr" || - F->getName() == "strstr") { - // These read their arguments, and return the first one - DSNodeHandle H = getValueDest(**CS.arg_begin()); - H.mergeWith(getValueDest(*CS.getInstruction())); // Returns buffer - - for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); - AI != E; ++AI) - if (isa((*AI)->getType())) - if (DSNode *N = getValueDest(**AI).getNode()) - N->setReadMarker(); - - if (DSNode *N = H.getNode()) - N->setReadMarker(); - return true; - } else if (F->getName() == "__assert_fail") { - for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); - AI != E; ++AI) - if (isa((*AI)->getType())) - if (DSNode *N = getValueDest(**AI).getNode()) - N->setReadMarker(); - return true; - } else if (F->getName() == "modf" && CS.arg_end()-CS.arg_begin() == 2) { - // This writes its second argument, and forces it to double. - CallSite::arg_iterator compit = CS.arg_end(); - DSNodeHandle H = getValueDest(**--compit); - if (DSNode *N = H.getNode()) { - N->setModifiedMarker(); - N->mergeTypeInfo(Type::DoubleTy, H.getOffset()); - } - return true; - } else if (F->getName() == "strcat" || F->getName() == "strncat") { - //This might be making unsafe assumptions about usage - //Merge return and first arg - DSNodeHandle RetNH = getValueDest(*CS.getInstruction()); - RetNH.mergeWith(getValueDest(**CS.arg_begin())); - if (DSNode *N = RetNH.getNode()) - N->setHeapMarker()->setModifiedMarker()->setReadMarker(); - //and read second pointer - if (DSNode *N = getValueDest(**(CS.arg_begin() + 1)).getNode()) - N->setReadMarker(); - return true; - } else if (F->getName() == "strcpy" || F->getName() == "strncpy") { - //This might be making unsafe assumptions about usage - //Merge return and first arg - DSNodeHandle RetNH = getValueDest(*CS.getInstruction()); - RetNH.mergeWith(getValueDest(**CS.arg_begin())); - if (DSNode *N = RetNH.getNode()) - N->setHeapMarker()->setModifiedMarker(); - //and read second pointer - if (DSNode *N = getValueDest(**(CS.arg_begin() + 1)).getNode()) - N->setReadMarker(); - return true; -#ifdef LLVA_KERNEL_0 - } else if (F->getName() == "kmem_cache_alloc") { - DEBUG(std::cerr << "LLVA: kmem_cache_alloc" << std::endl); - // Update the statistics count - ++CacheAllocs; - - // Create a new DSNode for this memory allocation - DSNode *N = createNode(); - N->setHeapMarker(); - setDestTo(*CS.getInstruction(), N); - - // Get the pool handle - if (CS.arg_begin() == CS.arg_end()) { - abort(); //Hanlde this later - // Treat it as a kmalloc - N->foldNodeCompletely(); - //This becomes a kmalloc pool - MetaPoolHandle* tmpvh = new MetaPoolHandle(new MetaPool(KMallocPool)); - G.getPoolDescriptorsMap()[N] = tmpvh; - } else { - Value *actualPD = *(CS.arg_begin()); - if (!isa(actualPD)) { - std::cerr << "WARNING: Pool is not global. Function = " << CS.getCaller()->getName() << "\n"; - } else { - ++GlobalPools; - } - Value *TheMetaPool = actualPD; - if (G.getPoolDescriptorsMap().count(N)== 0) { - //Here we insert a global meta pool - //Get the Module first - Module * M = F->getParent(); - //Now create a meta pool for this value, DSN Node - const Type * VoidPtrType = PointerType::get(Type::Int8Ty); - TheMetaPool = new GlobalVariable( - /*type=*/ VoidPtrType, - /*isConstant=*/ false, - /*Linkage=*/ GlobalValue::InternalLinkage, - /*initializer=*/ Constant::getNullValue(VoidPtrType), - /*name=*/ "_metaPool_", - /*parent=*/ M ); - //Inserted a global meta pool - } - //Now insert a function call that takes care of adding this pool to the global pool - - //First get the Insert point - Instruction *InsertPoint = CS.getInstruction(); - - //Assumes AddPoolDescToMetaPool is in the module - CastInst *CastMetaPool = - CastInst::createPointerCast (TheMetaPool, - PointerType::get(Type::Int8Ty), "metapool.casted", InsertPoint); - CastInst *CastActualPD = - CastInst::createPointerCast (actualPD, - PointerType::get(Type::Int8Ty), "poolhandle.lscasted", InsertPoint); - - // Create the call to AddPoolDescToMetaPool - std::vector args(1,CastMetaPool); - args.push_back(CastActualPD); - new CallInst(AddPoolDescToMetaPool,args,"", InsertPoint); - MetaPoolHandle* tmpvh = new MetaPoolHandle(new MetaPool(TheMetaPool)); - G.getPoolDescriptorsMap()[N] = tmpvh; - } - } else if (F->getName() == "poolalloc") { - if (CS.getCaller()->getName() == "kmem_cache_alloc") - return; - // Update the statistics - ++KMallocs; - - // Create a DSNode for the memory allocated by this function call - DSNode *N = createNode(); - N->setHeapMarker(); - setDestTo(*CS.getInstruction(), N); - - // Get the pool handle, if possible - if (CS.arg_begin() == CS.arg_end()) { - abort(); //handle later - // Treat it as kmalloc - N->foldNodeCompletely(); - //This becomes a kmalloc pool - //So get the kmalloc pool - MetaPoolHandle* tmpvh = new MetaPoolHandle(new MetaPool(KMallocPool)); - G.getPoolDescriptorsMap()[N] = tmpvh; - } else { - Value *actualPD = *(CS.arg_begin()); - if (!isa(actualPD)) { - std::cerr << "WARNING: Pool is not global. Function = " << CS.getCaller()->getName() << "\n"; - } else { - ++GlobalPools; - } - Value *TheMetaPool = actualPD; - if (G.getPoolDescriptorsMap().count(N)== 0) { - //Here we insert a global meta pool - //Get the Module first - Module * M = F->getParent(); - //Now create a meta pool for this value, DSN Node - const Type * VoidPtrType = PointerType::get(Type::Int8Ty); - TheMetaPool = new GlobalVariable( - /*type=*/ VoidPtrType, - /*isConstant=*/ false, - /*Linkage=*/ GlobalValue::InternalLinkage, - /*initializer=*/ Constant::getNullValue(VoidPtrType), - /*name=*/ "_metaPool_", - /*parent=*/ M ); - //Inserted a global meta pool - } - //Now insert a function call that takes care of adding this pool to the global pool - //First get the Insert point - Instruction *InsertPoint = CS.getInstruction(); - - //Assumes AddPoolDescToMetaPool is in the module - CastInst *CastMetaPool = - CastInst::createPointerCast (TheMetaPool, - PointerType::get(Type::Int8Ty), "metapool.casted", InsertPoint); - CastInst *CastActualPD = - CastInst::createPointerCast (actualPD, - PointerType::get(Type::Int8Ty), "poolhandle.lscasted", InsertPoint); - - // Create the call to AddPoolDescToMetaPool - std::vector args(1,CastMetaPool); - args.push_back(CastActualPD); - new CallInst(AddPoolDescToMetaPool,args,"", InsertPoint); - MetaPoolHandle* tmpvh = new MetaPoolHandle(new MetaPool(TheMetaPool)); - G.getPoolDescriptorsMap()[N] = tmpvh; - } -#endif -#ifdef LLVA_KERNEL - } else if (F->getName() == "llva_memcpy") { - if (CS.getCaller()->getName() == "kmem_cache_alloc") - return false; - // Merge the first & second arguments, and mark the memory read and - // modified. - DSNodeHandle RetNH = getValueDest(**CS.arg_begin()); - RetNH.mergeWith(getValueDest(**(CS.arg_begin()+1))); - if (DSNode *N = RetNH.getNode()) - N->setModifiedMarker()->setReadMarker(); - return true; - } else if (F->getName() == "__generic_copy_from_user") { - if (CS.getCaller()->getName() == "kmem_cache_alloc") - return false; - // Merge the first & second arguments, and mark the memory read and - // modified. - DSNodeHandle RetNH = getValueDest(**CS.arg_begin()); - RetNH.mergeWith(getValueDest(**(CS.arg_begin()+1))); - if (DSNode *N = RetNH.getNode()) - N->setModifiedMarker()->setReadMarker(); - return true; -#endif } - - return false; } void GraphBuilder::visitCallSite(CallSite CS) { @@ -1159,24 +603,6 @@ N->setModifiedMarker()->setHeapMarker(); return; } - - if (visitExternal(CS,F)) - return; - - // Unknown function, warn if it returns a pointer type or takes a - // pointer argument. - bool Warn = isa(CS.getInstruction()->getType()); - if (!Warn) - for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); - I != E; ++I) - if (isa((*I)->getType())) { - Warn = true; - break; - } - if (Warn) { - DOUT << "WARNING: Call to unknown external function '" - << F->getName() << "' will cause pessimistic results!\n"; - } } // Set up the return value... @@ -1301,12 +727,11 @@ formGlobalECs(); // Calculate all of the graphs... - for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isDeclaration()) { - DSGraph* G = new DSGraph(GlobalECs, getTargetData(), GlobalsGraph); - GraphBuilder GGB(*I, *G); - DSInfo.insert(std::make_pair(I, G)); - } + for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { + DSGraph* G = new DSGraph(GlobalECs, getTargetData(), GlobalsGraph); + GraphBuilder GGB(*I, *G); + DSInfo.insert(std::make_pair(I, G)); + } GlobalsGraph->removeTriviallyDeadNodes(); GlobalsGraph->markIncompleteNodes(DSGraph::MarkFormalArgs); Index: llvm-poolalloc/lib/DSA/Printer.cpp diff -u llvm-poolalloc/lib/DSA/Printer.cpp:1.94 llvm-poolalloc/lib/DSA/Printer.cpp:1.95 --- llvm-poolalloc/lib/DSA/Printer.cpp:1.94 Tue Apr 17 18:41:06 2007 +++ llvm-poolalloc/lib/DSA/Printer.cpp Thu Apr 19 11:02:19 2007 @@ -71,6 +71,10 @@ if (NodeType & DSNode::IncompleteNode ) OS << "I"; if (NodeType & DSNode::ModifiedNode ) OS << "M"; if (NodeType & DSNode::ReadNode ) OS << "R"; + if (NodeType & DSNode::ExternalNode ) OS << "E"; + if (NodeType & DSNode::IntToPtrNode ) OS << "P"; + if (NodeType & DSNode::PtrToIntNode ) OS << "2"; + #ifndef NDEBUG if (NodeType & DSNode::DeadNode ) OS << ""; #endif @@ -333,6 +337,11 @@ printCollection(*this, O, M, "ds."); } +void StdLibDataStructures::print(std::ostream &O, const Module *M) const { + if (DontPrintAnything) return; + printCollection(*this, O, M, "ds."); +} + void BUDataStructures::print(std::ostream &O, const Module *M) const { if (DontPrintAnything) return; printCollection(*this, O, M, "bu."); Index: llvm-poolalloc/lib/DSA/TopDownClosure.cpp diff -u llvm-poolalloc/lib/DSA/TopDownClosure.cpp:1.100 llvm-poolalloc/lib/DSA/TopDownClosure.cpp:1.101 --- llvm-poolalloc/lib/DSA/TopDownClosure.cpp:1.100 Tue Apr 17 18:41:06 2007 +++ llvm-poolalloc/lib/DSA/TopDownClosure.cpp Thu Apr 19 11:02:19 2007 @@ -60,6 +60,10 @@ // bool TDDataStructures::runOnModule(Module &M) { BUInfo = &getAnalysis(); + setGraphSource(BUInfo); + setTargetData(BUInfo->getTargetData()); + setGraphClone(true); + GlobalECs = BUInfo->getGlobalECs(); GlobalsGraph = new DSGraph(BUInfo->getGlobalsGraph(), GlobalECs); GlobalsGraph->setPrintAuxCalls(); @@ -89,7 +93,7 @@ // Functions without internal linkage also have unknown incoming arguments! for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isDeclaration() && !I->hasInternalLinkage()) + if (!I->hasInternalLinkage()) ArgsRemainIncomplete.insert(I); // We want to traverse the call graph in reverse post-order. To do this, we @@ -102,8 +106,7 @@ // Visit each of the graphs in reverse post-order now! for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isDeclaration()) - getOrCreateDSGraph(*I); + getOrCreateGraph(*I); return false; } #endif @@ -117,7 +120,8 @@ // Next calculate the graphs for each unreachable function... for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - ComputePostOrder(*I, VisitedGraph, PostOrder); + if (!I->isDeclaration()) + ComputePostOrder(*I, VisitedGraph, PostOrder); VisitedGraph.clear(); // Release memory! } @@ -145,30 +149,9 @@ } -DSGraph &TDDataStructures::getOrCreateDSGraph(Function &F) { - DSGraph *&G = DSInfo[&F]; - if (G == 0) { // Not created yet? Clone BU graph... - G = new DSGraph(getAnalysis().getDSGraph(F), GlobalECs, - DSGraph::DontCloneAuxCallNodes); - assert(G->getAuxFunctionCalls().empty() && "Cloned aux calls?"); - G->setPrintAuxCalls(); - G->setGlobalsGraph(GlobalsGraph); - - // Note that this graph is the graph for ALL of the function in the SCC, not - // just F. - for (DSGraph::retnodes_iterator RI = G->retnodes_begin(), - E = G->retnodes_end(); RI != E; ++RI) - if (RI->first != &F) - DSInfo[RI->first] = G; - } - return *G; -} - - void TDDataStructures::ComputePostOrder(Function &F,hash_set &Visited, std::vector &PostOrder) { - if (F.isDeclaration()) return; - DSGraph &G = getOrCreateDSGraph(F); + DSGraph &G = getOrCreateGraph(&F); if (Visited.count(&G)) return; Visited.insert(&G); @@ -312,9 +295,8 @@ // Handle direct calls efficiently. if (CI->isDirectCall()) { - if (!CI->getCalleeFunc()->isDeclaration() && - !DSG.getReturnNodes().count(CI->getCalleeFunc())) - CallerEdges[&getDSGraph(*CI->getCalleeFunc())] + if (!DSG.getReturnNodes().count(CI->getCalleeFunc())) + CallerEdges[&getOrCreateGraph(CI->getCalleeFunc())] .push_back(CallerCallEdge(&DSG, &*CI, CI->getCalleeFunc())); continue; } @@ -325,7 +307,7 @@ BUInfo->callee_begin(CallI), IPE = BUInfo->callee_end(CallI); // Skip over all calls to this graph (SCC calls). - while (IPI != IPE && &getDSGraph(*IPI->second) == &DSG) + while (IPI != IPE && &getOrCreateGraph(IPI->second) == &DSG) ++IPI; // All SCC calls? @@ -335,15 +317,14 @@ ++IPI; // Skip over more SCC calls. - while (IPI != IPE && &getDSGraph(*IPI->second) == &DSG) + while (IPI != IPE && &getOrCreateGraph(IPI->second) == &DSG) ++IPI; // If there is exactly one callee from this call site, remember the edge in // CallerEdges. if (IPI == IPE) { - if (!FirstCallee->isDeclaration()) - CallerEdges[&getDSGraph(*FirstCallee)] - .push_back(CallerCallEdge(&DSG, &*CI, FirstCallee)); + CallerEdges[&getOrCreateGraph(FirstCallee)] + .push_back(CallerCallEdge(&DSG, &*CI, FirstCallee)); continue; } @@ -356,8 +337,7 @@ for (BUDataStructures::ActualCalleesTy::const_iterator I = BUInfo->callee_begin(CallI), E = BUInfo->callee_end(CallI); I != E; ++I) - if (!I->second->isDeclaration()) - Callees.push_back(I->second); + Callees.push_back(I->second); std::sort(Callees.begin(), Callees.end()); std::map, DSGraph*>::iterator IndCallRecI = @@ -388,7 +368,7 @@ // exactly once. DSCallSite *NCS = &IndCallGraph->getFunctionCalls().front(); for (unsigned i = 0, e = Callees.size(); i != e; ++i) { - DSGraph& CalleeGraph = getDSGraph(*Callees[i]); + DSGraph& CalleeGraph = getOrCreateGraph(Callees[i]); if (&CalleeGraph != &DSG) CallerEdges[&CalleeGraph].push_back(CallerCallEdge(IndCallGraph, NCS, Callees[i])); @@ -401,66 +381,3 @@ RC.mergeCallSite(IndCallGraph->getFunctionCalls().front(), *CI); } } - - -static const Function *getFnForValue(const Value *V) { - if (const Instruction *I = dyn_cast(V)) - return I->getParent()->getParent(); - else if (const Argument *A = dyn_cast(V)) - return A->getParent(); - else if (const BasicBlock *BB = dyn_cast(V)) - return BB->getParent(); - return 0; -} - -void TDDataStructures::deleteValue(Value *V) { - if (const Function *F = getFnForValue(V)) { // Function local value? - // If this is a function local value, just delete it from the scalar map! - getDSGraph(*F).getScalarMap().eraseIfExists(V); - return; - } - - if (Function *F = dyn_cast(V)) { - assert(getDSGraph(*F).getReturnNodes().size() == 1 && - "cannot handle scc's"); - delete DSInfo[F]; - DSInfo.erase(F); - return; - } - - assert(!isa(V) && "Do not know how to delete GV's yet!"); -} - -void TDDataStructures::copyValue(Value *From, Value *To) { - if (From == To) return; - if (const Function *F = getFnForValue(From)) { // Function local value? - // If this is a function local value, just delete it from the scalar map! - getDSGraph(*F).getScalarMap().copyScalarIfExists(From, To); - return; - } - - if (Function *FromF = dyn_cast(From)) { - Function *ToF = cast(To); - assert(!DSInfo.count(ToF) && "New Function already exists!"); - DSGraph *NG = new DSGraph(getDSGraph(*FromF), GlobalECs); - DSInfo[ToF] = NG; - assert(NG->getReturnNodes().size() == 1 && "Cannot copy SCC's yet!"); - - // Change the Function* is the returnnodes map to the ToF. - DSNodeHandle Ret = NG->retnodes_begin()->second; - NG->getReturnNodes().clear(); - NG->getReturnNodes()[ToF] = Ret; - return; - } - - if (const Function *F = getFnForValue(To)) { - DSGraph &G = getDSGraph(*F); - G.getScalarMap().copyScalarIfExists(From, To); - return; - } - - DOUT << *From; - DOUT << *To; - assert(0 && "Do not know how to copy this yet!"); - abort(); -} From sabre at nondot.org Thu Apr 19 13:42:56 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 19 Apr 2007 13:42:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetMachine.cpp Message-ID: <200704191842.l3JIguGQ022815@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetMachine.cpp updated: 1.61 -> 1.62 --- Log message: Fix a message, patch by Christopher Lamb. --- Diffs of the changes: (+1 -1) TargetMachine.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/TargetMachine.cpp diff -u llvm/lib/Target/TargetMachine.cpp:1.61 llvm/lib/Target/TargetMachine.cpp:1.62 --- llvm/lib/Target/TargetMachine.cpp:1.61 Mon Jan 29 16:40:03 2007 +++ llvm/lib/Target/TargetMachine.cpp Thu Apr 19 13:42:38 2007 @@ -93,7 +93,7 @@ cl::opt DefCodeModel( "code-model", - cl::desc("Choose relocation model"), + cl::desc("Choose code model"), cl::location(CMModel), cl::init(CodeModel::Default), cl::values( From evan.cheng at apple.com Fri Apr 20 16:13:07 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 20 Apr 2007 16:13:07 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/RegisterInfoEmitter.cpp Message-ID: <200704202113.l3KLD7G3022574@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: RegisterInfoEmitter.cpp updated: 1.50 -> 1.51 --- Log message: Add sub-registers sets. --- Diffs of the changes: (+61 -6) RegisterInfoEmitter.cpp | 67 +++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 61 insertions(+), 6 deletions(-) Index: llvm/utils/TableGen/RegisterInfoEmitter.cpp diff -u llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.50 llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.51 --- llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.50 Sun Feb 25 21:34:38 2007 +++ llvm/utils/TableGen/RegisterInfoEmitter.cpp Fri Apr 20 16:12:49 2007 @@ -107,6 +107,27 @@ return true; } +static void addSubReg(Record *R, Record *S, + std::map > &SubRegs, + std::map > &Aliases, + RegisterInfoEmitter &RIE) { + if (R == S) { + cerr << "Error: recursive sub-register relationship between" + << " register " << RIE.getQualifiedName(R) + << " and its sub-registers?\n"; + abort(); + } + + if (!SubRegs[R].insert(S).second) + return; + Aliases[R].insert(S); + Aliases[S].insert(R); + if (SubRegs.count(S)) + for (std::set::iterator I = SubRegs[S].begin(), + E = SubRegs[S].end(); I != E; ++I) + addSubReg(R, *I, SubRegs, Aliases, RIE); +} + // RegisterInfoEmitter::run - Main register file description emitter. // void RegisterInfoEmitter::run(std::ostream &OS) { @@ -273,7 +294,8 @@ << "RegClass,\n"; OS << " };\n"; - // Emit register class aliases... + // Emit register sub-registers / aliases... + std::map > RegisterSubRegs; std::map > RegisterAliases; const std::vector &Regs = Target.getRegisters(); @@ -298,6 +320,20 @@ } } + for (unsigned i = 0, e = Regs.size(); i != e; ++i) { + Record *R = Regs[i].TheDef; + std::vector LI = Regs[i].TheDef->getValueAsListOfDefs("SubRegs"); + // Process sub-register set and add aliases information. + for (unsigned j = 0, e = LI.size(); j != e; ++j) { + Record *SubReg = LI[j]; + if (RegisterSubRegs[R].count(SubReg)) + cerr << "Warning: register " << getQualifiedName(SubReg) + << " specified as a sub-register of " << getQualifiedName(R) + << " multiple times!\n"; + addSubReg(R, SubReg, RegisterSubRegs, RegisterAliases, *this); + } + } + if (!RegisterAliases.empty()) OS << "\n\n // Register Alias Sets...\n"; @@ -314,12 +350,27 @@ OS << "0 };\n"; } + if (!RegisterSubRegs.empty()) + OS << "\n\n // Register Sub-registers Sets...\n"; + + // Emit the empty sub-registers list + OS << " const unsigned Empty_SubRegsSet[] = { 0 };\n"; + // Loop over all of the registers which have sub-registers, emitting the + // sub-registers list to memory. + for (std::map >::iterator + I = RegisterSubRegs.begin(), E = RegisterSubRegs.end(); I != E; ++I) { + OS << " const unsigned " << I->first->getName() << "_SubRegsSet[] = { "; + for (std::set::iterator ASI = I->second.begin(), + E = I->second.end(); ASI != E; ++ASI) + OS << getQualifiedName(*ASI) << ", "; + OS << "0 };\n"; + } OS<<"\n const TargetRegisterDesc RegisterDescriptors[] = { // Descriptors\n"; - OS << " { \"NOREG\",\t0 },\n"; + OS << " { \"NOREG\",\t0,\t0 },\n"; - // Now that register alias sets have been emitted, emit the register - // descriptors now. + // Now that register alias and sub-registers sets have been emitted, emit the + // register descriptors now. const std::vector &Registers = Target.getRegisters(); for (unsigned i = 0, e = Registers.size(); i != e; ++i) { const CodeGenRegister &Reg = Registers[i]; @@ -330,9 +381,13 @@ OS << Reg.getName(); OS << "\",\t"; if (RegisterAliases.count(Reg.TheDef)) - OS << Reg.getName() << "_AliasSet },\n"; + OS << Reg.getName() << "_AliasSet,\t"; + else + OS << "Empty_AliasSet,\t"; + if (RegisterSubRegs.count(Reg.TheDef)) + OS << Reg.getName() << "_SubRegsSet },\n"; else - OS << "Empty_AliasSet },\n"; + OS << "Empty_SubRegsSet },\n"; } OS << " };\n"; // End of register descriptors... OS << "}\n\n"; // End of anonymous namespace... From clattner at apple.com Fri Apr 20 17:24:04 2007 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Apr 2007 15:24:04 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp In-Reply-To: <46293822.7080505@jolt-lang.org> References: <200704200034.l3K0YNqQ020353@zion.cs.uiuc.edu> <20D18692-6944-41DB-9665-4171DFC64BC5@apple.com> <46293822.7080505@jolt-lang.org> Message-ID: <14CF6BC7-C94D-4620-B5EA-49E510E8DE8D@apple.com> On Apr 20, 2007, at 3:01 PM, Jeff Cohen wrote: > Chris Lattner wrote: >> This isn't the right place to do this. Is LLVM synthesizing >> references to write? Where is the reference coming from? -Chris > > Analysis\IPA\Andersens.cpp line 617 This code is "research quality" anyway, I wouldn't worry about it. > Transforms\Utils\LowerInvoke.cpp, line 152 Interesting. I'd be fine with just removing the calls to write, this code is going away in the next month or two anyway. I'd rather remove the "nice" message than have code in the asmprinter to munge the name. > Yeah, I was afraid of that, but I'm just trying to get it to work > at this point (at least code that doesn't actually call write() ). > It's also synthesizing references to abort() as well. Sure, but finding the right solution is still important :). Please remove the asmprinter code and remove the write stuff from lowerinvoke, and I think we're good, Thanks Jeff! -Chris >> On Apr 19, 2007, at 5:34 PM, Jeff Cohen wrote: >>> Changes in directory llvm/lib/Target/X86: X86IntelAsmPrinter.cpp >>> updated: 1.70 -> 1.71 --- Log message: Make Microsoft assembler >>> and linker happy. --- Diffs of the changes: (+4 -0) >>> X86IntelAsmPrinter.cpp | 4 ++++ 1 files changed, 4 insertions(+) >>> Index: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp diff -u llvm/ >>> lib/Target/X86/X86IntelAsmPrinter.cpp:1.70 llvm/lib/ Target/X86/ >>> X86IntelAsmPrinter.cpp:1.71 --- llvm/lib/Target/X86/ >>> X86IntelAsmPrinter.cpp:1.70 Tue Apr 17 12:21:52 2007 +++ llvm/lib/ >>> Target/X86/X86IntelAsmPrinter.cpp Thu Apr 19 19:33:54 2007 @@ >>> -355,6 +355,10 @@ if (I->hasDLLImportLinkage()) { O << >>> "__imp_"; } + // Microsoft sticks an extra _ in front of >>> "_write" (whether LLVM should + // hard-code usage of a Unix API >>> is another question). + if (Name == "_write") + Name = "__write"; >>> O << Name << ":near\n"; } >>> _______________________________________________ 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 sabre at nondot.org Fri Apr 20 17:34:10 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 20 Apr 2007 17:34:10 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Type.h Message-ID: <200704202234.l3KMYAng024340@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Type.h updated: 1.106 -> 1.107 --- Log message: Fix a problem where primitive types lose their name after llvm_shutdown is called. This also reduces the amount of work done at static construction time. --- Diffs of the changes: (+0 -1) Type.h | 1 - 1 files changed, 1 deletion(-) Index: llvm/include/llvm/Type.h diff -u llvm/include/llvm/Type.h:1.106 llvm/include/llvm/Type.h:1.107 --- llvm/include/llvm/Type.h:1.106 Thu Apr 5 21:02:19 2007 +++ llvm/include/llvm/Type.h Fri Apr 20 17:33:47 2007 @@ -107,7 +107,6 @@ void destroy() const; // const is a lie, this does "delete this"! protected: - Type(const char *Name, TypeID id); explicit Type(TypeID id) : ID(id), Abstract(false), SubclassData(0), RefCount(0), ForwardType(0), NumContainedTys(0), ContainedTys(0) {} From sabre at nondot.org Fri Apr 20 17:34:10 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 20 Apr 2007 17:34:10 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Type.cpp Message-ID: <200704202234.l3KMYABF024345@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Type.cpp updated: 1.183 -> 1.184 --- Log message: Fix a problem where primitive types lose their name after llvm_shutdown is called. This also reduces the amount of work done at static construction time. --- Diffs of the changes: (+16 -12) Type.cpp | 28 ++++++++++++++++------------ 1 files changed, 16 insertions(+), 12 deletions(-) Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.183 llvm/lib/VMCore/Type.cpp:1.184 --- llvm/lib/VMCore/Type.cpp:1.183 Mon Apr 16 22:26:42 2007 +++ llvm/lib/VMCore/Type.cpp Fri Apr 20 17:33:47 2007 @@ -63,13 +63,6 @@ static ManagedStatic > AbstractTypeDescriptions; -Type::Type(const char *Name, TypeID id) - : ID(id), Abstract(false), SubclassData(0), RefCount(0), ForwardType(0), - NumContainedTys(0), ContainedTys(0) { - assert(Name && Name[0] && "Should use other ctor if no name!"); - (*ConcreteTypeDescriptions)[this] = Name; -} - /// Because of the way Type subclasses are allocated, this function is necessary /// to use the correct kind of "delete" operator to deallocate the Type object. /// Some type objects (FunctionTy, StructTy) allocate additional space after @@ -250,7 +243,18 @@ if (!Ty->isAbstract()) { // Base case for the recursion std::map::iterator I = ConcreteTypeDescriptions->find(Ty); - if (I != ConcreteTypeDescriptions->end()) return I->second; + if (I != ConcreteTypeDescriptions->end()) + return I->second; + + if (Ty->isPrimitiveType()) { + switch (Ty->getTypeID()) { + default: assert(0 && "Unknown prim type!"); + case Type::VoidTyID: return (*ConcreteTypeDescriptions)[Ty] = "void"; + case Type::FloatTyID: return (*ConcreteTypeDescriptions)[Ty] = "float"; + case Type::DoubleTyID: return (*ConcreteTypeDescriptions)[Ty] = "double"; + case Type::LabelTyID: return (*ConcreteTypeDescriptions)[Ty] = "label"; + } + } } // Check to see if the Type is already on the stack... @@ -391,10 +395,10 @@ // Primitive 'Type' data //===----------------------------------------------------------------------===// -const Type *Type::VoidTy = new Type("void", Type::VoidTyID); -const Type *Type::FloatTy = new Type("float", Type::FloatTyID); -const Type *Type::DoubleTy = new Type("double", Type::DoubleTyID); -const Type *Type::LabelTy = new Type("label", Type::LabelTyID); +const Type *Type::VoidTy = new Type(Type::VoidTyID); +const Type *Type::FloatTy = new Type(Type::FloatTyID); +const Type *Type::DoubleTy = new Type(Type::DoubleTyID); +const Type *Type::LabelTy = new Type(Type::LabelTyID); namespace { struct BuiltinIntegerType : public IntegerType { From sabre at nondot.org Fri Apr 20 17:40:26 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 20 Apr 2007 17:40:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JIT.cpp JIT.h Message-ID: <200704202240.l3KMeQIu024485@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: JIT.cpp updated: 1.94 -> 1.95 JIT.h updated: 1.31 -> 1.32 --- Log message: rename JIT::state -> JIT::jitstate to avoid shadowing ExecutionEngine::state --- Diffs of the changes: (+8 -8) JIT.cpp | 14 +++++++------- JIT.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) Index: llvm/lib/ExecutionEngine/JIT/JIT.cpp diff -u llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.94 llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.95 --- llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.94 Mon Mar 5 21:11:31 2007 +++ llvm/lib/ExecutionEngine/JIT/JIT.cpp Fri Apr 20 17:40:05 2007 @@ -50,7 +50,7 @@ } JIT::JIT(ModuleProvider *MP, TargetMachine &tm, TargetJITInfo &tji) - : ExecutionEngine(MP), TM(tm), TJI(tji), state(MP) { + : ExecutionEngine(MP), TM(tm), TJI(tji), jitstate(MP) { setTargetData(TM.getTargetData()); // Initialize MCE @@ -58,7 +58,7 @@ // Add target data MutexGuard locked(lock); - FunctionPassManager &PM = state.getPM(locked); + FunctionPassManager &PM = jitstate.getPM(locked); PM.add(new TargetData(*TM.getTargetData())); // Turn the machine code intermediate representation into bytes in memory that @@ -235,15 +235,15 @@ // JIT the function isAlreadyCodeGenerating = true; - state.getPM(locked).run(*F); + jitstate.getPM(locked).run(*F); isAlreadyCodeGenerating = false; // If the function referred to a global variable that had not yet been // emitted, it allocates memory for the global, but doesn't emit it yet. Emit // all of these globals now. - while (!state.getPendingGlobals(locked).empty()) { - const GlobalVariable *GV = state.getPendingGlobals(locked).back(); - state.getPendingGlobals(locked).pop_back(); + while (!jitstate.getPendingGlobals(locked).empty()) { + const GlobalVariable *GV = jitstate.getPendingGlobals(locked).back(); + jitstate.getPendingGlobals(locked).pop_back(); EmitGlobalVariable(GV); } } @@ -335,7 +335,7 @@ unsigned MisAligned = ((intptr_t)Ptr & (A-1)); Ptr = (char*)Ptr + (MisAligned ? (A-MisAligned) : 0); } - state.getPendingGlobals(locked).push_back(GV); + jitstate.getPendingGlobals(locked).push_back(GV); } addGlobalMapping(GV, Ptr); return Ptr; Index: llvm/lib/ExecutionEngine/JIT/JIT.h diff -u llvm/lib/ExecutionEngine/JIT/JIT.h:1.31 llvm/lib/ExecutionEngine/JIT/JIT.h:1.32 --- llvm/lib/ExecutionEngine/JIT/JIT.h:1.31 Sat Mar 3 12:19:18 2007 +++ llvm/lib/ExecutionEngine/JIT/JIT.h Fri Apr 20 17:40:05 2007 @@ -54,7 +54,7 @@ TargetJITInfo &TJI; // The JITInfo for the target we are compiling to MachineCodeEmitter *MCE; // MCE object - JITState state; + JITState jitstate; JIT(ModuleProvider *MP, TargetMachine &tm, TargetJITInfo &tji); public: From jeffc at jolt-lang.org Fri Apr 20 17:40:32 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Fri, 20 Apr 2007 17:40:32 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/LowerInvoke.cpp Message-ID: <200704202240.l3KMeWaC024491@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: LowerInvoke.cpp updated: 1.58 -> 1.59 --- Log message: Comment out usage of write() for now. --- Diffs of the changes: (+6 -0) LowerInvoke.cpp | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/lib/Transforms/Utils/LowerInvoke.cpp diff -u llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.58 llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.59 --- llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.58 Mon Apr 16 13:10:23 2007 +++ llvm/lib/Transforms/Utils/LowerInvoke.cpp Fri Apr 20 17:40:10 2007 @@ -149,8 +149,12 @@ // We need the 'write' and 'abort' functions for both models. AbortFn = M.getOrInsertFunction("abort", Type::VoidTy, (Type *)0); +#if 0 // "write" is Unix-specific.. code is going away soon anyway. WriteFn = M.getOrInsertFunction("write", Type::VoidTy, Type::Int32Ty, VoidPtrTy, Type::Int32Ty, (Type *)0); +#else + WriteFn = 0; +#endif return true; } @@ -185,6 +189,7 @@ void LowerInvoke::writeAbortMessage(Instruction *IB) { +#if 0 if (AbortMessage == 0) createAbortMessage(IB->getParent()->getParent()->getParent()); @@ -194,6 +199,7 @@ Args[1] = AbortMessage; Args[2] = ConstantInt::get(Type::Int32Ty, AbortMessageLength); (new CallInst(WriteFn, Args, 3, "", IB))->setTailCall(); +#endif } bool LowerInvoke::insertCheapEHSupport(Function &F) { From jeffc at jolt-lang.org Fri Apr 20 17:40:34 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Fri, 20 Apr 2007 17:40:34 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp Message-ID: <200704202240.l3KMeYrM024496@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86IntelAsmPrinter.cpp updated: 1.71 -> 1.72 --- Log message: Comment out usage of write() for now. --- Diffs of the changes: (+0 -4) X86IntelAsmPrinter.cpp | 4 ---- 1 files changed, 4 deletions(-) Index: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.71 llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.72 --- llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.71 Thu Apr 19 19:33:54 2007 +++ llvm/lib/Target/X86/X86IntelAsmPrinter.cpp Fri Apr 20 17:40:10 2007 @@ -355,10 +355,6 @@ if (I->hasDLLImportLinkage()) { O << "__imp_"; } - // Microsoft sticks an extra _ in front of "_write" (whether LLVM should - // hard-code usage of a Unix API is another question). - if (Name == "_write") - Name = "__write"; O << Name << ":near\n"; } From sabre at nondot.org Fri Apr 20 17:40:58 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 20 Apr 2007 17:40:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JIT.h Message-ID: <200704202240.l3KMewlA024537@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: JIT.h updated: 1.32 -> 1.33 --- Log message: fit in 80 cols --- Diffs of the changes: (+2 -2) JIT.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/ExecutionEngine/JIT/JIT.h diff -u llvm/lib/ExecutionEngine/JIT/JIT.h:1.32 llvm/lib/ExecutionEngine/JIT/JIT.h:1.33 --- llvm/lib/ExecutionEngine/JIT/JIT.h:1.32 Fri Apr 20 17:40:05 2007 +++ llvm/lib/ExecutionEngine/JIT/JIT.h Fri Apr 20 17:40:40 2007 @@ -39,11 +39,11 @@ public: JITState(ModuleProvider *MP) : PM(MP) {} - FunctionPassManager& getPM(const MutexGuard& locked) { + FunctionPassManager &getPM(const MutexGuard &L) { return PM; } - std::vector& getPendingGlobals(const MutexGuard& locked) { + std::vector &getPendingGlobals(const MutexGuard &L) { return PendingGlobals; } }; From clattner at apple.com Fri Apr 20 17:44:42 2007 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Apr 2007 15:44:42 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp In-Reply-To: <200704202240.l3KMeYrM024496@zion.cs.uiuc.edu> References: <200704202240.l3KMeYrM024496@zion.cs.uiuc.edu> Message-ID: > Comment out usage of write() for now. Thanks Jeff! -Chris > --- > Diffs of the changes: (+0 -4) > > X86IntelAsmPrinter.cpp | 4 ---- > 1 files changed, 4 deletions(-) > > > Index: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp > diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.71 llvm/lib/ > Target/X86/X86IntelAsmPrinter.cpp:1.72 > --- llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.71 Thu Apr 19 > 19:33:54 2007 > +++ llvm/lib/Target/X86/X86IntelAsmPrinter.cpp Fri Apr 20 17:40:10 > 2007 > @@ -355,10 +355,6 @@ > if (I->hasDLLImportLinkage()) { > O << "__imp_"; > } > - // Microsoft sticks an extra _ in front of "_write" (whether > LLVM should > - // hard-code usage of a Unix API is another question). > - if (Name == "_write") > - Name = "__write"; > O << Name << ":near\n"; > } > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Fri Apr 20 17:57:38 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 20 Apr 2007 17:57:38 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp Message-ID: <200704202257.l3KMvcRk024908@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: TargetSelect.cpp updated: 1.14 -> 1.15 --- Log message: avoid mutating a global in an accessor --- Diffs of the changes: (+6 -5) TargetSelect.cpp | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) Index: llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp diff -u llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp:1.14 llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp:1.15 --- llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp:1.14 Sat Mar 3 12:19:18 2007 +++ llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp Fri Apr 20 17:57:20 2007 @@ -39,15 +39,16 @@ /// for the current target. Otherwise, return null. /// ExecutionEngine *JIT::create(ModuleProvider *MP, std::string *ErrorStr) { - if (MArch == 0) { + const TargetMachineRegistry::Entry *TheArch = MArch; + if (TheArch == 0) { std::string Error; - MArch = TargetMachineRegistry::getClosestTargetForJIT(Error); - if (MArch == 0) { + TheArch = TargetMachineRegistry::getClosestTargetForJIT(Error); + if (TheArch == 0) { if (ErrorStr) *ErrorStr = Error; return 0; } - } else if (MArch->JITMatchQualityFn() == 0) { + } else if (TheArch->JITMatchQualityFn() == 0) { cerr << "WARNING: This target JIT is not designed for the host you are" << " running. If bad things happen, please choose a different " << "-march switch.\n"; @@ -64,7 +65,7 @@ } // Allocate a target... - TargetMachine *Target = MArch->CtorFn(*MP->getModule(), FeaturesStr); + TargetMachine *Target = TheArch->CtorFn(*MP->getModule(), FeaturesStr); assert(Target && "Could not allocate target machine!"); // If the target supports JIT code generation, return a new JIT now. From lauro.venancio at gmail.com Fri Apr 20 18:02:57 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Fri, 20 Apr 2007 18:02:57 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200704202302.l3KN2vvv025009@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.487 -> 1.488 --- Log message: Allow the lowering of ISD::GLOBAL_OFFSET_TABLE. --- Diffs of the changes: (+1 -1) LegalizeDAG.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.487 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.488 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.487 Fri Apr 20 16:38:10 2007 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Apr 20 18:02:39 2007 @@ -628,7 +628,6 @@ case ISD::SRCVALUE: case ISD::STRING: case ISD::CONDCODE: - case ISD::GLOBAL_OFFSET_TABLE: // Primitives must all be legal. assert(TLI.isOperationLegal(Node->getValueType(0), Node->getValueType(0)) && "This must be legal!"); @@ -653,6 +652,7 @@ #endif assert(0 && "Do not know how to legalize this operator!"); abort(); + case ISD::GLOBAL_OFFSET_TABLE: case ISD::GlobalAddress: case ISD::GlobalTLSAddress: case ISD::ExternalSymbol: From reid at x10sys.com Fri Apr 20 18:26:31 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 20 Apr 2007 18:26:31 -0500 Subject: [llvm-commits] CVS: llvm-www/SVNMigration.html Message-ID: <200704202326.l3KNQVK2025446@zion.cs.uiuc.edu> Changes in directory llvm-www: SVNMigration.html updated: 1.8 -> 1.9 --- Log message: Define schedule, update status. --- Diffs of the changes: (+23 -5) SVNMigration.html | 28 +++++++++++++++++++++++----- 1 files changed, 23 insertions(+), 5 deletions(-) Index: llvm-www/SVNMigration.html diff -u llvm-www/SVNMigration.html:1.8 llvm-www/SVNMigration.html:1.9 --- llvm-www/SVNMigration.html:1.8 Sat Apr 7 16:19:10 2007 +++ llvm-www/SVNMigration.html Fri Apr 20 18:26:14 2007 @@ -1,9 +1,27 @@ -
    Subversion Migration Notes
    +
    Subversion Migration

    This document contains notes about the planned migration of the CVS code repository to Subversion.

    +
    + +
    Schedule
    +
    +

    When: June 5, 2007

    +

    Outage Duration: Approximately 4 hours. During this perdiod CVS + access will be unavailable as the repository is converted to Subversion + format. When the conversion is completed, Subversion access will be + enabled.

    +

    Fallback Policy: If the conversion cannot be completed successfully + in 4 hours, we will turn CVS access back on and try again at a later date.

    +
    + +
    Notes
    +
    +

    Status as of 2007-04-20
    We have successfully migrated all the + sub-projects targeted for conversion over the UIUC internal network. The + conversion can happen. Conversion notice email should be sent soon.

    Status as of 2007-04-07
    All the technology is in place for the migration to occur. We are now only waiting for TSG to install the authentication tokens so that existing "commit" users will be granted @@ -27,7 +45,7 @@

    - +

    Since everything will be in one SVN repository, we thought we'd take this opportunity to rename some top level directories to reduce redundancy. This @@ -59,7 +77,7 @@

    - +

    The existing branches have been categorized as shown in the table below. If a branch is scheduled to be removed and you need it, please let @@ -114,7 +132,7 @@

    - +

    Below are some tables of tag names to be kept or removed when the migration occurs.

    @@ -166,6 +184,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/07 21:19:10 $ +
    Last modified: $Date: 2007/04/20 23:26:14 $ From reid at x10sys.com Fri Apr 20 18:31:29 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 20 Apr 2007 18:31:29 -0500 Subject: [llvm-commits] CVS: llvm-www/SVNMigration.html Message-ID: <200704202331.l3KNVTES025579@zion.cs.uiuc.edu> Changes in directory llvm-www: SVNMigration.html updated: 1.9 -> 1.10 --- Log message: Add the SVN version. --- Diffs of the changes: (+2 -1) SVNMigration.html | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm-www/SVNMigration.html diff -u llvm-www/SVNMigration.html:1.9 llvm-www/SVNMigration.html:1.10 --- llvm-www/SVNMigration.html:1.9 Fri Apr 20 18:26:14 2007 +++ llvm-www/SVNMigration.html Fri Apr 20 18:31:12 2007 @@ -15,6 +15,7 @@ enabled.

    Fallback Policy: If the conversion cannot be completed successfully in 4 hours, we will turn CVS access back on and try again at a later date.

    +

    Subversion Version: 1.4.3

    Notes
    @@ -184,6 +185,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/20 23:26:14 $ +
    Last modified: $Date: 2007/04/20 23:31:12 $ From sabre at nondot.org Fri Apr 20 18:59:46 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 20 Apr 2007 18:59:46 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Verifier.cpp Message-ID: <200704202359.l3KNxkc2026077@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Verifier.cpp updated: 1.204 -> 1.205 --- Log message: Fix regressions introduced by my previous patch: opt calls verifier in a way that the "Mod" ivar was not getting set. --- Diffs of the changes: (+3 -1) Verifier.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.204 llvm/lib/VMCore/Verifier.cpp:1.205 --- llvm/lib/VMCore/Verifier.cpp:1.204 Fri Apr 20 16:48:08 2007 +++ llvm/lib/VMCore/Verifier.cpp Fri Apr 20 18:59:29 2007 @@ -113,7 +113,9 @@ bool runOnFunction(Function &F) { // Get dominator information if we are being run by PassManager if (RealPass) EF = &getAnalysis(); - + + Mod = F.getParent(); + visit(F); InstsInThisBlock.clear(); From sabre at nondot.org Fri Apr 20 19:12:36 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 20 Apr 2007 19:12:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Pass.cpp Message-ID: <200704210012.l3L0CaDi026333@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Pass.cpp updated: 1.85 -> 1.86 --- Log message: Fix a bug that prevented the JIT from working correctly after llvm_shutdown. Pass info objects are initialized by static ctors, so deleting them at llvm_shutdown time prevents resurrection from working. --- Diffs of the changes: (+16 -6) Pass.cpp | 22 ++++++++++++++++------ 1 files changed, 16 insertions(+), 6 deletions(-) Index: llvm/lib/VMCore/Pass.cpp diff -u llvm/lib/VMCore/Pass.cpp:1.85 llvm/lib/VMCore/Pass.cpp:1.86 --- llvm/lib/VMCore/Pass.cpp:1.85 Sun Mar 4 18:00:42 2007 +++ llvm/lib/VMCore/Pass.cpp Fri Apr 20 19:12:18 2007 @@ -189,9 +189,19 @@ }; } -static ManagedStatic PassRegistrarObj; static std::vector *Listeners = 0; +// FIXME: This should use ManagedStatic to manage the pass registrar. +// Unfortunately, we can't do this, because passes are registered with static +// ctors, and having llvm_shutdown clear this map prevents successful +// ressurection after llvm_shutdown is run. +static PassRegistrar *getPassRegistrar() { + static PassRegistrar *PassRegistrarObj = 0; + if (!PassRegistrarObj) + PassRegistrarObj = new PassRegistrar(); + return PassRegistrarObj; +} + // getPassInfo - Return the PassInfo data structure that corresponds to this // pass... const PassInfo *Pass::getPassInfo() const { @@ -200,11 +210,11 @@ } const PassInfo *Pass::lookupPassInfo(const std::type_info &TI) { - return PassRegistrarObj->GetPassInfo(TI); + return getPassRegistrar()->GetPassInfo(TI); } void RegisterPassBase::registerPass() { - PassRegistrarObj->RegisterPass(PIObj); + getPassRegistrar()->RegisterPass(PIObj); // Notify any listeners. if (Listeners) @@ -214,7 +224,7 @@ } void RegisterPassBase::unregisterPass() { - PassRegistrarObj->UnregisterPass(PIObj); + getPassRegistrar()->UnregisterPass(PIObj); } //===----------------------------------------------------------------------===// @@ -247,7 +257,7 @@ PassInfo *IIPI = const_cast(ImplementationInfo); IIPI->addInterfaceImplemented(InterfaceInfo); - PassRegistrarObj->RegisterAnalysisGroup(InterfaceInfo, IIPI, isDefault); + getPassRegistrar()->RegisterAnalysisGroup(InterfaceInfo, IIPI, isDefault); } } @@ -286,7 +296,7 @@ // passEnumerate callback on each PassInfo object. // void PassRegistrationListener::enumeratePasses() { - PassRegistrarObj->EnumerateWith(this); + getPassRegistrar()->EnumerateWith(this); } //===----------------------------------------------------------------------===// From dpatel at apple.com Fri Apr 20 19:34:54 2007 From: dpatel at apple.com (Devang Patel) Date: Fri, 20 Apr 2007 19:34:54 -0500 Subject: [llvm-commits] CVS: llvm/test/Analysis/Dominators/2007-04-20-PostDom-Reset.ll Message-ID: <200704210034.l3L0YsuY026659@zion.cs.uiuc.edu> Changes in directory llvm/test/Analysis/Dominators: 2007-04-20-PostDom-Reset.ll added (r1.1) --- Log message: New test case. --- Diffs of the changes: (+28 -0) 2007-04-20-PostDom-Reset.ll | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+) Index: llvm/test/Analysis/Dominators/2007-04-20-PostDom-Reset.ll diff -c /dev/null llvm/test/Analysis/Dominators/2007-04-20-PostDom-Reset.ll:1.1 *** /dev/null Fri Apr 20 19:34:47 2007 --- llvm/test/Analysis/Dominators/2007-04-20-PostDom-Reset.ll Fri Apr 20 19:34:37 2007 *************** *** 0 **** --- 1,28 ---- + ; RUN: llvm-upgrade < %s | llvm-as | opt -postdomfrontier -disable-output + + void @args_out_of_range() { + entry: + br label %bb + + bb: ; preds = %bb, %entry + br label %bb + } + + void @args_out_of_range_3() { + entry: + br label %bb + + bb: ; preds = %bb, %entry + br label %bb + } + + void @Feq() { + entry: + br i1 false, label %cond_true, label %cond_next + + cond_true: ; preds = %entry + unreachable + + cond_next: ; preds = %entry + unreachable + } From dpatel at apple.com Fri Apr 20 19:37:03 2007 From: dpatel at apple.com (Devang Patel) Date: Fri, 20 Apr 2007 19:37:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Dominators.cpp Message-ID: <200704210037.l3L0b3VU026725@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Dominators.cpp updated: 1.96 -> 1.97 --- Log message: Reset vertex. Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070416/048092.html --- Diffs of the changes: (+1 -0) Dominators.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/VMCore/Dominators.cpp diff -u llvm/lib/VMCore/Dominators.cpp:1.96 llvm/lib/VMCore/Dominators.cpp:1.97 --- llvm/lib/VMCore/Dominators.cpp:1.96 Sun Apr 15 18:14:18 2007 +++ llvm/lib/VMCore/Dominators.cpp Fri Apr 20 19:36:45 2007 @@ -285,6 +285,7 @@ Nodes.clear(); IDoms.clear(); Roots.clear(); + Vertex.clear(); RootNode = 0; } From clattner at apple.com Fri Apr 20 19:43:53 2007 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Apr 2007 17:43:53 -0700 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h In-Reply-To: <200704202138.l3KLcZP6023226@zion.cs.uiuc.edu> References: <200704202138.l3KLcZP6023226@zion.cs.uiuc.edu> Message-ID: <660D1863-1EC5-4A97-B7ED-E9729026091A@apple.com> > +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Fri Apr 20 > 16:38:10 2007 > @@ -19,6 +19,7 @@ > #ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H > #define LLVM_CODEGEN_SELECTIONDAGNODES_H > > +#include "llvm/GlobalVariable.h" Please don't add this #include, just define the GlobalAddressSDNode ctor method out-of-line as needed. > @@ -1164,7 +1167,12 @@ > friend class SelectionDAG; > GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, > MVT::ValueType VT, > int o = 0) > - : SDNode(isTarget ? ISD::TargetGlobalAddress : > ISD::GlobalAddress, > + : SDNode(dyn_cast(GA) && Please use "isa(GA)" instead of dyncast because this is a predicate. -Chris From clattner at apple.com Fri Apr 20 19:45:57 2007 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Apr 2007 17:45:57 -0700 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp SelectionDAG.cpp In-Reply-To: <200704202138.l3KLchWX023264@zion.cs.uiuc.edu> References: <200704202138.l3KLchWX023264@zion.cs.uiuc.edu> Message-ID: <665619BF-3AC8-44AA-9A22-BD872E6EB162@apple.com> > @@ -14,6 +14,7 @@ > #include "llvm/CodeGen/SelectionDAG.h" > #include "llvm/Constants.h" > #include "llvm/GlobalValue.h" > +#include "llvm/GlobalVariable.h" Please drop the #include of GlobalValue since GlobalVariable.h brings it in. -Chris From clattner at apple.com Fri Apr 20 19:47:11 2007 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Apr 2007 17:47:11 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp X86ISelLowering.cpp X86ISelLowering.h X86InstrInfo.td In-Reply-To: <200704202138.l3KLcfxe023245@zion.cs.uiuc.edu> References: <200704202138.l3KLcfxe023245@zion.cs.uiuc.edu> Message-ID: <1F2CEF21-3628-4E08-94D8-D0CF09A8C615@apple.com> > Changes in directory llvm/lib/Target/X86: > > X86ATTAsmPrinter.cpp updated: 1.100 -> 1.101 > X86AsmPrinter.cpp updated: 1.239 -> 1.240 > X86ISelLowering.cpp updated: 1.393 -> 1.394 > X86ISelLowering.h updated: 1.98 -> 1.99 > X86InstrInfo.td updated: 1.302 -> 1.303 I'll let Evan and/or Anton review this one. Thanks Lauro, very nice! Should the TLS bug be closed now? -Chris From clattner at apple.com Fri Apr 20 19:49:55 2007 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Apr 2007 17:49:55 -0700 Subject: [llvm-commits] Function aliases In-Reply-To: <179C5B28-90DA-4A73-9570-922AE95925CE@mac.com> References: <20070419205157.GQ5062.SS386SS@village.us.cray.com> <1177021495.13159.147.camel@asl.dorms.spbu.ru> <179C5B28-90DA-4A73-9570-922AE95925CE@mac.com> Message-ID: <133F6EF1-E809-46A7-90B4-239C921F3E5D@apple.com> > Why not simply reinsert the aliased GV into the symbol table under > the alias name? In this manner, alias objects would not need to > derive from GlobalValue at all. Aliases could be stored in a list > on the side as you describe, solving the memory usage problem. The > majority of code could remain ignorant of them, resolving the code > duplication Anton was worried about. Unfortunately, this won't work. Values can have at most one name in LLVM, -Chris From evan.cheng at apple.com Fri Apr 20 19:54:23 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 20 Apr 2007 19:54:23 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h Message-ID: <200704210054.l3L0sN8R027076@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: MRegisterInfo.h updated: 1.105 -> 1.106 --- Log message: Add super-register set. --- Diffs of the changes: (+13 -1) MRegisterInfo.h | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Target/MRegisterInfo.h diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.105 llvm/include/llvm/Target/MRegisterInfo.h:1.106 --- llvm/include/llvm/Target/MRegisterInfo.h:1.105 Fri Apr 20 16:28:05 2007 +++ llvm/include/llvm/Target/MRegisterInfo.h Fri Apr 20 19:54:06 2007 @@ -40,11 +40,15 @@ /// Registers that this does not apply to simply should set this to null. /// The SubRegs field is a zero terminated array of registers that are /// sub-registers of the specific register, e.g. AL, AH are sub-registers of AX. +/// The SuperRegs field is a zero terminated array of registers that are +/// super-registers of the specific register, e.g. RAX, EAX, are sub-registers +/// of AX. /// struct TargetRegisterDesc { const char *Name; // Assembly language name for the register const unsigned *AliasSet; // Register Alias Set, described above const unsigned *SubRegs; // Sub-register set, described above + const unsigned *SuperRegs; // Super-register set, described above }; class TargetRegisterClass { @@ -271,13 +275,21 @@ } /// getSubRegisters - Return the set of registers that are sub-registers of - // the specified register, or a null list of there are none. The list + /// the specified register, or a null list of there are none. The list /// returned is zero terminated. /// const unsigned *getSubRegisters(unsigned RegNo) const { return get(RegNo).SubRegs; } + /// getSuperRegisters - Return the set of registers that are super-registers + /// of the specified register, or a null list of there are none. The list + /// returned is zero terminated. + /// + const unsigned *getSuperRegisters(unsigned RegNo) const { + return get(RegNo).SuperRegs; + } + /// getName - Return the symbolic target specific name for the specified /// physical register. const char *getName(unsigned RegNo) const { From jeffc at jolt-lang.org Fri Apr 20 19:54:55 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Fri, 20 Apr 2007 17:54:55 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp X86ISelLowering.cpp X86ISelLowering.h X86InstrInfo.td In-Reply-To: <1F2CEF21-3628-4E08-94D8-D0CF09A8C615@apple.com> References: <200704202138.l3KLcfxe023245@zion.cs.uiuc.edu> <1F2CEF21-3628-4E08-94D8-D0CF09A8C615@apple.com> Message-ID: <462960DF.9060802@jolt-lang.org> What about the Intel printer? Chris Lattner wrote: >> Changes in directory llvm/lib/Target/X86: >> >> X86ATTAsmPrinter.cpp updated: 1.100 -> 1.101 >> X86AsmPrinter.cpp updated: 1.239 -> 1.240 >> X86ISelLowering.cpp updated: 1.393 -> 1.394 >> X86ISelLowering.h updated: 1.98 -> 1.99 >> X86InstrInfo.td updated: 1.302 -> 1.303 >> > > I'll let Evan and/or Anton review this one. > > Thanks Lauro, very nice! Should the TLS bug be closed now? > > -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 Fri Apr 20 19:55:47 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 20 Apr 2007 19:55:47 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/RegisterInfoEmitter.cpp Message-ID: <200704210055.l3L0tlBe027110@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: RegisterInfoEmitter.cpp updated: 1.51 -> 1.52 --- Log message: Bug fix; add super-registers sets. --- Diffs of the changes: (+58 -11) RegisterInfoEmitter.cpp | 69 ++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 58 insertions(+), 11 deletions(-) Index: llvm/utils/TableGen/RegisterInfoEmitter.cpp diff -u llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.51 llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.52 --- llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.51 Fri Apr 20 16:12:49 2007 +++ llvm/utils/TableGen/RegisterInfoEmitter.cpp Fri Apr 20 19:55:29 2007 @@ -107,10 +107,33 @@ return true; } -static void addSubReg(Record *R, Record *S, - std::map > &SubRegs, - std::map > &Aliases, - RegisterInfoEmitter &RIE) { +static void addSuperReg(Record *R, Record *S, + std::map > &SubRegs, + std::map > &SuperRegs, + std::map > &Aliases, + RegisterInfoEmitter &RIE) { + if (R == S) { + cerr << "Error: recursive sub-register relationship between" + << " register " << RIE.getQualifiedName(R) + << " and its sub-registers?\n"; + abort(); + } + if (!SuperRegs[R].insert(S).second) + return; + SubRegs[S].insert(R); + Aliases[R].insert(S); + Aliases[S].insert(R); + if (SuperRegs.count(S)) + for (std::set::iterator I = SuperRegs[S].begin(), + E = SuperRegs[S].end(); I != E; ++I) + addSuperReg(R, *I, SubRegs, SuperRegs, Aliases, RIE); +} + +static void addSubSuperReg(Record *R, Record *S, + std::map > &SubRegs, + std::map > &SuperRegs, + std::map > &Aliases, + RegisterInfoEmitter &RIE) { if (R == S) { cerr << "Error: recursive sub-register relationship between" << " register " << RIE.getQualifiedName(R) @@ -120,12 +143,13 @@ if (!SubRegs[R].insert(S).second) return; + addSuperReg(S, R, SubRegs, SuperRegs, Aliases, RIE); Aliases[R].insert(S); Aliases[S].insert(R); if (SubRegs.count(S)) for (std::set::iterator I = SubRegs[S].begin(), E = SubRegs[S].end(); I != E; ++I) - addSubReg(R, *I, SubRegs, Aliases, RIE); + addSubSuperReg(R, *I, SubRegs, SuperRegs, Aliases, RIE); } // RegisterInfoEmitter::run - Main register file description emitter. @@ -294,8 +318,9 @@ << "RegClass,\n"; OS << " };\n"; - // Emit register sub-registers / aliases... + // Emit register sub-registers / super-registers, aliases... std::map > RegisterSubRegs; + std::map > RegisterSuperRegs; std::map > RegisterAliases; const std::vector &Regs = Target.getRegisters(); @@ -320,6 +345,7 @@ } } + // Process sub-register sets. for (unsigned i = 0, e = Regs.size(); i != e; ++i) { Record *R = Regs[i].TheDef; std::vector LI = Regs[i].TheDef->getValueAsListOfDefs("SubRegs"); @@ -330,7 +356,8 @@ cerr << "Warning: register " << getQualifiedName(SubReg) << " specified as a sub-register of " << getQualifiedName(R) << " multiple times!\n"; - addSubReg(R, SubReg, RegisterSubRegs, RegisterAliases, *this); + addSubSuperReg(R, SubReg, RegisterSubRegs, RegisterSuperRegs, + RegisterAliases, *this); } } @@ -365,9 +392,25 @@ OS << getQualifiedName(*ASI) << ", "; OS << "0 };\n"; } - OS<<"\n const TargetRegisterDesc RegisterDescriptors[] = { // Descriptors\n"; - OS << " { \"NOREG\",\t0,\t0 },\n"; + if (!RegisterSuperRegs.empty()) + OS << "\n\n // Register Super-registers Sets...\n"; + + // Emit the empty super-registers list + OS << " const unsigned Empty_SuperRegsSet[] = { 0 };\n"; + // Loop over all of the registers which have super-registers, emitting the + // super-registers list to memory. + for (std::map >::iterator + I = RegisterSuperRegs.begin(), E = RegisterSuperRegs.end(); I != E; ++I) { + OS << " const unsigned " << I->first->getName() << "_SuperRegsSet[] = { "; + for (std::set::iterator ASI = I->second.begin(), + E = I->second.end(); ASI != E; ++ASI) + OS << getQualifiedName(*ASI) << ", "; + OS << "0 };\n"; + } + + OS<<"\n const TargetRegisterDesc RegisterDescriptors[] = { // Descriptors\n"; + OS << " { \"NOREG\",\t0,\t0,\t0 },\n"; // Now that register alias and sub-registers sets have been emitted, emit the // register descriptors now. @@ -385,9 +428,13 @@ else OS << "Empty_AliasSet,\t"; if (RegisterSubRegs.count(Reg.TheDef)) - OS << Reg.getName() << "_SubRegsSet },\n"; + OS << Reg.getName() << "_SubRegsSet,\t"; + else + OS << "Empty_SubRegsSet,\t"; + if (RegisterSuperRegs.count(Reg.TheDef)) + OS << Reg.getName() << "_SuperRegsSet },\n"; else - OS << "Empty_SubRegsSet },\n"; + OS << "Empty_SuperRegsSet },\n"; } OS << " };\n"; // End of register descriptors... OS << "}\n\n"; // End of anonymous namespace... From clattner at apple.com Fri Apr 20 19:59:19 2007 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Apr 2007 17:59:19 -0700 Subject: [llvm-commits] Function aliases In-Reply-To: <1177049862.13159.162.camel@asl.dorms.spbu.ru> References: <20070419205157.GQ5062.SS386SS@village.us.cray.com> <1177021495.13159.147.camel@asl.dorms.spbu.ru> <1177049862.13159.162.camel@asl.dorms.spbu.ru> Message-ID: <54A7260C-1FDE-4B3D-91CA-6B40D261E49A@apple.com> >> I don't think that really makes sense. Aliases aren't really global >> variables or functions themselves, they are a third kind of object. > Why the third? They definitely *are* either external functions or GVs. > For example, function aliases can be called, we can take address of > them, etc. The only difference is absence of body (because they are > "external") and two symbols they're emitting. I disagree. They *act like* functions or GV's, but they really aren't them. For example, (from m understanding), it is not legal to give an alias a function body or a global variable initializer. They clearly need to be usable as a global object (f.e. in a call instruction or a load instruction), so they should derive from GlobalValue, but they are not themselves functions or global variables. >> What do you think about making a new GlobalAlias class, which derives >> from GlobalValue. > And after subdivide into FunctionAlias & GlobalVariableAlias? This > will > lead to code duplication, since almost all methods of Functions should > go to FunctionAlias, the same for GVs. No, you wouldn't need both classes, just a single one. > This will also require to > carefully check all other places, where GVs and Functions are used and > change corresponding logic. Considre for example CallInst. For it we > should at least resolve issue with getCalledFunction(), which nowadays > return Function* and we should probably add new method called > getCalledFunctionAlias() or resolved the two possible return type > issues > otherwise. I don't think it's worth to do so invasive changes > everywhere > for such small feature. Two things: getCalledFunction already returns null if the callee is not a function, e.g. an indirect call. All of the users of this method will already do the right thing and treat aliases as unknown calls. This will be correct. However, I think that linker should try to resolve aliases when possible. For example, consider something like this: void foo() {} void bar() alias foo void baz() { bar(); } I'd expect the linker (or something else) to want to resolve through aliases if the alias, if the actual destination function is around. If this happens, in practice, there will be very few (if any) direct users of the alias object. -Chris From clattner at apple.com Fri Apr 20 20:00:39 2007 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Apr 2007 18:00:39 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp X86ISelLowering.cpp X86ISelLowering.h X86InstrInfo.td In-Reply-To: <462960DF.9060802@jolt-lang.org> References: <200704202138.l3KLcfxe023245@zion.cs.uiuc.edu> <1F2CEF21-3628-4E08-94D8-D0CF09A8C615@apple.com> <462960DF.9060802@jolt-lang.org> Message-ID: On Apr 20, 2007, at 5:54 PM, Jeff Cohen wrote: > What about the Intel printer? Presumably the win32 ABI uses completely different mechanisms for TLS. Unless Lauro is signing up for it, it sounds like an entry for the top of the X86/README.txt file. -Chris From reid at x10sys.com Fri Apr 20 22:32:13 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 20 Apr 2007 22:32:13 -0500 Subject: [llvm-commits] CVS: llvm-www/SVNMigration.html Message-ID: <200704210332.l3L3WDgR029468@zion.cs.uiuc.edu> Changes in directory llvm-www: SVNMigration.html updated: 1.10 -> 1.11 --- Log message: Add a new section. --- Diffs of the changes: (+34 -2) SVNMigration.html | 36 ++++++++++++++++++++++++++++++++++-- 1 files changed, 34 insertions(+), 2 deletions(-) Index: llvm-www/SVNMigration.html diff -u llvm-www/SVNMigration.html:1.10 llvm-www/SVNMigration.html:1.11 --- llvm-www/SVNMigration.html:1.10 Fri Apr 20 18:31:12 2007 +++ llvm-www/SVNMigration.html Fri Apr 20 22:31:55 2007 @@ -9,7 +9,7 @@
    Schedule

    When: June 5, 2007

    -

    Outage Duration: Approximately 4 hours. During this perdiod CVS +

    Outage Duration: Approximately 4 hours. During this period CVS access will be unavailable as the repository is converted to Subversion format. When the conversion is completed, Subversion access will be enabled.

    @@ -18,6 +18,38 @@

    Subversion Version: 1.4.3

    +
    User Impact
    +
    +

    Here are some things you need to know about how to use Subversion once the + migration is done and how to prepare for the change.

    +
      +
    • Subversion Version: 1.4.3. You can use older clients, but we + recommend that you upgrade to 1.4.3 to gain most benefit.
    • +
    • URLS: Subversion uses URLs to specify the repository. Our + configuration uses HTTP URLs. The host name portion of the URL for all + LLVM related repositories is svn.llvm.org (which redirects to + subversion.cs.uiuc.edu). We encourage you to use the svn.llvm.org host name + because that one will be correct in perpetuity as the redirect might not be. +
    • Repository Access: There are two ways to access the + repository: public (anonymous, read-only access) and private (named, + read-write access).
    • +
    • Public Access
    • : The URL for the public access repository is + http://svn.llvm.org/pub/svn/llvm + Use this URL with the svn checkout command to obtain a read-only + copy of LLVM without a username or password. +
    • Private Access
    • : The URL for the private access repository is + http://vn.llvm.org/svn/llvm. + Use this URL with the svn checkout command to obtain read-write + access to the LLVM repository. The svn command will prompt you for + your user name and password. +
    • Browsable URLs: Both the public and private access URLs are + browsable with any web browser.
    • +
    • Available Now:: You can try these out now. Only a few users have + commit access (those who are testing it). Any changes made will be discarded + before the June 5th conversion.
    • +
    +
    +
    Notes

    Status as of 2007-04-20
    We have successfully migrated all the @@ -185,6 +217,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/20 23:31:12 $ +
    Last modified: $Date: 2007/04/21 03:31:55 $ From sabre at nondot.org Fri Apr 20 22:35:45 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 20 Apr 2007 22:35:45 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2007-04-11-InlineAsmUnion.c Message-ID: <200704210335.l3L3ZjS0029548@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2007-04-11-InlineAsmUnion.c updated: 1.3 -> 1.4 --- Log message: make this portable to 64-bit hosts --- Diffs of the changes: (+1 -1) 2007-04-11-InlineAsmUnion.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CFrontend/2007-04-11-InlineAsmUnion.c diff -u llvm/test/CFrontend/2007-04-11-InlineAsmUnion.c:1.3 llvm/test/CFrontend/2007-04-11-InlineAsmUnion.c:1.4 --- llvm/test/CFrontend/2007-04-11-InlineAsmUnion.c:1.3 Sun Apr 15 15:08:37 2007 +++ llvm/test/CFrontend/2007-04-11-InlineAsmUnion.c Fri Apr 20 22:35:28 2007 @@ -1,6 +1,6 @@ // RUN: %llvmgcc %s -S -emit-llvm -o - | grep {call i32 asm} -union U { int x; char* p; }; +union U { int x; float p; }; void foo() { union U bar; __asm__ volatile("foo %0\n" : "=r"(bar)); From reid at x10sys.com Fri Apr 20 22:40:56 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 20 Apr 2007 22:40:56 -0500 Subject: [llvm-commits] CVS: llvm-www/SVNMigration.html Message-ID: <200704210340.l3L3euXR029684@zion.cs.uiuc.edu> Changes in directory llvm-www: SVNMigration.html updated: 1.11 -> 1.12 --- Log message: Clean up a bit. --- Diffs of the changes: (+12 -10) SVNMigration.html | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) Index: llvm-www/SVNMigration.html diff -u llvm-www/SVNMigration.html:1.11 llvm-www/SVNMigration.html:1.12 --- llvm-www/SVNMigration.html:1.11 Fri Apr 20 22:31:55 2007 +++ llvm-www/SVNMigration.html Fri Apr 20 22:40:38 2007 @@ -8,14 +8,16 @@

    Schedule
    -

    When: June 5, 2007

    -

    Outage Duration: Approximately 4 hours. During this period CVS - access will be unavailable as the repository is converted to Subversion - format. When the conversion is completed, Subversion access will be - enabled.

    -

    Fallback Policy: If the conversion cannot be completed successfully - in 4 hours, we will turn CVS access back on and try again at a later date.

    -

    Subversion Version: 1.4.3

    +

    When: June 5, 2007, approx. 1pm CDT (Central Time USA) or 18:00 GMT).

    +

    Duration: 4 hours

    +

    Notices:: Notices will be sent out 1 week before, 1 day before, and + 1 hour before the conversion actually takes place.

    +

    Impact: Both CVS and Subversion will be unavailable for approximately + 4 hours while the migration takes place. Once completed, CVS will be restored + in read-only mode and Subversion will permit read-write access.

    +

    Fallback Plan: If the conversion cannot be completed successfully + in 4 hours, we will turn CVS commit access back on and try the migration + again at a later date.

    User Impact
    @@ -54,7 +56,7 @@

    Status as of 2007-04-20
    We have successfully migrated all the sub-projects targeted for conversion over the UIUC internal network. The - conversion can happen. Conversion notice email should be sent soon.

    + Subversion snapshot is available for access (for testing only).

    Status as of 2007-04-07
    All the technology is in place for the migration to occur. We are now only waiting for TSG to install the authentication tokens so that existing "commit" users will be granted @@ -217,6 +219,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/21 03:31:55 $ +
    Last modified: $Date: 2007/04/21 03:40:38 $ From reid at x10sys.com Fri Apr 20 22:42:02 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 20 Apr 2007 22:42:02 -0500 Subject: [llvm-commits] CVS: llvm-www/SVNMigration.html Message-ID: <200704210342.l3L3g27H029760@zion.cs.uiuc.edu> Changes in directory llvm-www: SVNMigration.html updated: 1.12 -> 1.13 --- Log message: Formatting/Validation issue. --- Diffs of the changes: (+3 -3) SVNMigration.html | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-www/SVNMigration.html diff -u llvm-www/SVNMigration.html:1.12 llvm-www/SVNMigration.html:1.13 --- llvm-www/SVNMigration.html:1.12 Fri Apr 20 22:40:38 2007 +++ llvm-www/SVNMigration.html Fri Apr 20 22:41:44 2007 @@ -35,11 +35,11 @@

  • Repository Access: There are two ways to access the repository: public (anonymous, read-only access) and private (named, read-write access).
  • -
  • Public Access
  • : The URL for the public access repository is +
  • Public Access: The URL for the public access repository is http://svn.llvm.org/pub/svn/llvm Use this URL with the svn checkout command to obtain a read-only copy of LLVM without a username or password.
  • -
  • Private Access
  • : The URL for the private access repository is +
  • Private Access: The URL for the private access repository is http://vn.llvm.org/svn/llvm. Use this URL with the svn checkout command to obtain read-write
  • access to the LLVM repository. The svn command will prompt you for @@ -219,6 +219,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/21 03:40:38 $ +
    Last modified: $Date: 2007/04/21 03:41:44 $ From cscollab-rspencer at uiuc.edu Fri Apr 20 22:40:04 2007 From: cscollab-rspencer at uiuc.edu (cscollab-rspencer at uiuc.edu) Date: Sat, 21 Apr 2007 03:40:04 -0000 Subject: [llvm-commits] [llvm] r36266 - /llvm/trunk/CREDITS.TXT Message-ID: <200704210340.l3L3e4mZ001848@dcs-lbuild.cs.uiuc.edu> Author: cscollab-rspencer Date: Fri Apr 20 22:40:04 2007 New Revision: 36266 URL: http://subversion.cs.uiuc.edu/viewvc/llvm?rev=36266&view=rev Log: Add a credit. Modified: llvm/trunk/CREDITS.TXT Modified: llvm/trunk/CREDITS.TXT URL: http://subversion.cs.uiuc.edu/viewvc/llvm/llvm/trunk/CREDITS.TXT?rev=36266&r1=36265&r2=36266&view=diff ============================================================================== --- llvm/trunk/CREDITS.TXT (original) +++ llvm/trunk/CREDITS.TXT Fri Apr 20 22:40:04 2007 @@ -191,7 +191,7 @@ D: Stacker, llvmc, llvm-ld, llvm-ar, llvm2cpp, lib/Archive, lib/Linker, D: lib/System, bytecode enhancements, symtab hacking, unoverloading of D: intrinsics, makefile and configuration system, documentation, various bug -D: fixing. +D: fixing, Subversion migration. N: Adam Treat E: manyoso at yahoo.com From reid at x10sys.com Fri Apr 20 22:43:19 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 20 Apr 2007 22:43:19 -0500 Subject: [llvm-commits] CVS: llvm-www/SVNMigration.html Message-ID: <200704210343.l3L3hJvD029843@zion.cs.uiuc.edu> Changes in directory llvm-www: SVNMigration.html updated: 1.13 -> 1.14 --- Log message: Validation error. --- Diffs of the changes: (+2 -2) SVNMigration.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/SVNMigration.html diff -u llvm-www/SVNMigration.html:1.13 llvm-www/SVNMigration.html:1.14 --- llvm-www/SVNMigration.html:1.13 Fri Apr 20 22:41:44 2007 +++ llvm-www/SVNMigration.html Fri Apr 20 22:43:01 2007 @@ -41,7 +41,7 @@ copy of LLVM without a username or password.
  • Private Access: The URL for the private access repository is http://vn.llvm.org/svn/llvm. - Use this URL with the svn checkout command to obtain read-write
  • + Use this URL with the svn checkout command to obtain read-write access to the LLVM repository. The svn command will prompt you for your user name and password.
  • Browsable URLs: Both the public and private access URLs are @@ -219,6 +219,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/21 03:41:44 $ +
    Last modified: $Date: 2007/04/21 03:43:01 $ From rspencer at reidspencer.com Fri Apr 20 22:56:30 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Fri, 20 Apr 2007 20:56:30 -0700 Subject: [llvm-commits] [llvm] r36266 - /llvm/trunk/CREDITS.TXT In-Reply-To: <200704210340.l3L3e4mZ001848@dcs-lbuild.cs.uiuc.edu> References: <200704210340.l3L3e4mZ001848@dcs-lbuild.cs.uiuc.edu> Message-ID: <1177127790.20748.57.camel@bashful.x10sys.com> Anton, This is my first test commit on the test subversion repository. The email generated looks okay, but I think we need to have the email notification script enhanced slightly. I'm wondering if you could look into these things ... The subject line looks great! :) but .. On Sat, 2007-04-21 at 03:40 +0000, cscollab-rspencer at uiuc.edu wrote: I thought we were going to turn these into the actual user's name. Has that mapping gone away? I think the old CVS one make the reply-to field be the user's actual email address rather than "name at zion.cs.uiuc.edu". I think we need to do the same here. Otherwise the process of commit review gets harder. Is this just failing because you were expecting "reid" instead of cscollab-rspencer. I have an email in to David asking if we can get rid of the prefix. He forwarded it on to the people that do the user authentication stuff. Reid > Author: cscollab-rspencer Real name would be nice here too. > Date: Fri Apr 20 22:40:04 2007 > New Revision: 36266 > > URL: http://subversion.cs.uiuc.edu/viewvc/llvm?rev=36266&view=rev > Log: > Add a credit. If its a one line log comment, can we get it on the "Log" line, otherwise can we indent the lines a few of spaces, as in Modified: field below? > > Modified: > llvm/trunk/CREDITS.TXT > I thought we were going to run the diff output through diffstat and insert the histogram here like we did for CVS? > Modified: llvm/trunk/CREDITS.TXT The usual diff line here is "Index: ...". Is this the way svn diff generates it or can we fix it? Thanks, Reid. > URL: http://subversion.cs.uiuc.edu/viewvc/llvm/llvm/trunk/CREDITS.TXT?rev=36266&r1=36265&r2=36266&view=diff > ============================================================================== > --- llvm/trunk/CREDITS.TXT (original) > +++ llvm/trunk/CREDITS.TXT Fri Apr 20 22:40:04 2007 > @@ -191,7 +191,7 @@ > D: Stacker, llvmc, llvm-ld, llvm-ar, llvm2cpp, lib/Archive, lib/Linker, > D: lib/System, bytecode enhancements, symtab hacking, unoverloading of > D: intrinsics, makefile and configuration system, documentation, various bug > -D: fixing. > +D: fixing, Subversion migration. > > N: Adam Treat > E: manyoso at yahoo.com > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From reid at x10sys.com Fri Apr 20 23:00:26 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 20 Apr 2007 23:00:26 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704210400.l3L40QJu030458@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html updated: 1.16 -> 1.17 --- Log message: Add Pertti's entry. --- Diffs of the changes: (+2 -1) Name.html | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.16 llvm-www/Name.html:1.17 --- llvm-www/Name.html:1.16 Mon Apr 16 20:56:54 2007 +++ llvm-www/Name.html Fri Apr 20 23:00:09 2007 @@ -282,6 +282,7 @@ (on WP page, the three points about Pidgin creation are quite relevant for LLVM :-) ). Spelling it ("Ssabir") not only makes the name unique, but recalls LLVM is all about SSA. + Pertti Kellom??kiNopsaFinnish for rapid.
  • @@ -292,6 +293,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/17 01:56:54 $ +
    Last modified: $Date: 2007/04/21 04:00:09 $ From clattner at apple.com Fri Apr 20 23:05:12 2007 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Apr 2007 21:05:12 -0700 Subject: [llvm-commits] [llvm] r36266 - /llvm/trunk/CREDITS.TXT In-Reply-To: <200704210340.l3L3e4mZ001848@dcs-lbuild.cs.uiuc.edu> References: <200704210340.l3L3e4mZ001848@dcs-lbuild.cs.uiuc.edu> Message-ID: <73EA5DE9-8796-48AE-B1F3-6B3DCA0E3A00@apple.com> > URL: http://subversion.cs.uiuc.edu/viewvc/llvm/llvm/trunk/ > CREDITS.TXT?rev=36266&r1=36265&r2=36266&view=diff > ====================================================================== > ======== Also, can we get a blank line after the URL? My mail client turns the URL and the ==== into one url... Thanks! -Chris > --- llvm/trunk/CREDITS.TXT (original) > +++ llvm/trunk/CREDITS.TXT Fri Apr 20 22:40:04 2007 > @@ -191,7 +191,7 @@ > D: Stacker, llvmc, llvm-ld, llvm-ar, llvm2cpp, lib/Archive, lib/ > Linker, > D: lib/System, bytecode enhancements, symtab hacking, > unoverloading of > D: intrinsics, makefile and configuration system, documentation, > various bug > -D: fixing. > +D: fixing, Subversion migration. > > N: Adam Treat > E: manyoso at yahoo.com > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From resistor at mac.com Sat Apr 21 02:05:03 2007 From: resistor at mac.com (Owen Anderson) Date: Sat, 21 Apr 2007 02:05:03 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h Message-ID: <200704210705.l3L753n5001563@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: Dominators.h updated: 1.75 -> 1.76 --- Log message: Fix some null checks to actually test the part that needs checking. --- Diffs of the changes: (+2 -3) Dominators.h | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Analysis/Dominators.h diff -u llvm/include/llvm/Analysis/Dominators.h:1.75 llvm/include/llvm/Analysis/Dominators.h:1.76 --- llvm/include/llvm/Analysis/Dominators.h:1.75 Fri Apr 20 00:44:16 2007 +++ llvm/include/llvm/Analysis/Dominators.h Sat Apr 21 02:04:45 2007 @@ -323,16 +323,15 @@ /// Return the immediate dominator of A. BasicBlock *getIDom(BasicBlock *A) const { - if (!A) return 0; - ETNode *NodeA = getNode(A); + if (!NodeA) return 0; const ETNode *idom = NodeA->getFather(); return idom ? idom->getData() : 0; } void getChildren(BasicBlock *A, std::vector& children) const { - if (!A) return; ETNode *NodeA = getNode(A); + if (!NodeA) return; const ETNode* son = NodeA->getSon(); if (!son) return; From resistor at mac.com Sat Apr 21 02:12:06 2007 From: resistor at mac.com (Owen Anderson) Date: Sat, 21 Apr 2007 02:12:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LICM.cpp Message-ID: <200704210712.l3L7C6qG004553@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LICM.cpp updated: 1.93 -> 1.94 --- Log message: Fix a comment. --- Diffs of the changes: (+1 -1) LICM.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.93 llvm/lib/Transforms/Scalar/LICM.cpp:1.94 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.93 Fri Apr 20 01:27:13 2007 +++ llvm/lib/Transforms/Scalar/LICM.cpp Sat Apr 21 02:11:47 2007 @@ -307,7 +307,7 @@ /// HoistRegion - Walk the specified region of the CFG (defined by all blocks /// dominated by the specified block, and that are in the current loop) in depth -/// first order w.r.t the DominatorTree. This allows us to visit definitions +/// first order w.r.t the ETForest. This allows us to visit definitions /// before uses, allowing us to hoist a loop body in one pass without iteration. /// void LICM::HoistRegion(BasicBlock *BB) { From resistor at mac.com Sat Apr 21 02:13:04 2007 From: resistor at mac.com (Owen Anderson) Date: Sat, 21 Apr 2007 02:13:04 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200704210713.l3L7D4YD004911@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.97 -> 1.98 --- Log message: Fix a comment. --- Diffs of the changes: (+1 -1) PromoteMemoryToRegister.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.97 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.98 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.97 Fri Apr 20 01:27:13 2007 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sat Apr 21 02:12:44 2007 @@ -142,7 +142,7 @@ return ET.properlyDominates(I1->getParent(), I2->getParent()); } - /// dominates - Return true if BB1 dominates BB2 using the DominatorTree. + /// dominates - Return true if BB1 dominates BB2 using the ETForest. /// bool dominates(BasicBlock *BB1, BasicBlock *BB2) const { return ET.dominates(BB1, BB2); From clattner at apple.com Sat Apr 21 02:13:50 2007 From: clattner at apple.com (Chris Lattner) Date: Sat, 21 Apr 2007 00:13:50 -0700 Subject: [llvm-commits] [llvm] r36266 - /llvm/trunk/CREDITS.TXT In-Reply-To: <1177128372.20748.63.camel@bashful.x10sys.com> References: <200704210340.l3L3e4mZ001848@dcs-lbuild.cs.uiuc.edu> <1177128372.20748.63.camel@bashful.x10sys.com> Message-ID: <50FFB128-D823-43A6-995D-A911BFB77B25@apple.com> On Apr 20, 2007, at 9:06 PM, Reid Spencer wrote: > On Fri, 2007-04-20 at 20:46 -0700, Chris Lattner wrote: >> Urg, this is going to come from cscollab-rspencer at ... ? > > I've asked David to fix this. He said he would forward my request > on to > the authentication people at UIUC. He said they aren't likely to > give us > prefix-less user names. > > The more issues we run into with UIUC the more I'm not liking how this > is turning out. Can we just have the post-commit script fakemail that it is reid at hisfavoritedomain.com sending it? -Chris > Reid. > >> >> Yuck. Can we get a mapping table like we have for cvs committers? >> >> -Chris >> >> Begin forwarded message: >> >>> From: cscollab-rspencer at uiuc.edu >>> Date: April 20, 2007 8:40:04 PM PDT >>> To: llvm-commits at cs.uiuc.edu >>> Subject: [llvm-commits] [llvm] r36266 - /llvm/trunk/CREDITS.TXT >>> Reply-To: CVS Commit Messages for LLVM repository >> commits at cs.uiuc.edu> >>> >>> Author: cscollab-rspencer >>> Date: Fri Apr 20 22:40:04 2007 >>> New Revision: 36266 >>> >>> URL: http://subversion.cs.uiuc.edu/viewvc/llvm?rev=36266&view=rev >>> Log: >>> Add a credit. >>> >>> Modified: >>> llvm/trunk/CREDITS.TXT >>> >>> Modified: llvm/trunk/CREDITS.TXT >>> URL: http://subversion.cs.uiuc.edu/viewvc/llvm/llvm/trunk/ >>> CREDITS.TXT?rev=36266&r1=36265&r2=36266&view=diff >>> ==================================================================== >>> == >>> ======== >>> --- llvm/trunk/CREDITS.TXT (original) >>> +++ llvm/trunk/CREDITS.TXT Fri Apr 20 22:40:04 2007 >>> @@ -191,7 +191,7 @@ >>> D: Stacker, llvmc, llvm-ld, llvm-ar, llvm2cpp, lib/Archive, lib/ >>> Linker, >>> D: lib/System, bytecode enhancements, symtab hacking, >>> unoverloading of >>> D: intrinsics, makefile and configuration system, documentation, >>> various bug >>> -D: fixing. >>> +D: fixing, Subversion migration. >>> >>> N: Adam Treat >>> E: manyoso at yahoo.com >>> >>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> > From resistor at mac.com Sat Apr 21 02:38:40 2007 From: resistor at mac.com (Owen Anderson) Date: Sat, 21 Apr 2007 02:38:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp Message-ID: <200704210738.l3L7ceWK011162@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: PredicateSimplifier.cpp updated: 1.68 -> 1.69 --- Log message: Make PredicateSimplifier not use DominatorTree. --- Diffs of the changes: (+32 -31) PredicateSimplifier.cpp | 63 ++++++++++++++++++++++++------------------------ 1 files changed, 32 insertions(+), 31 deletions(-) Index: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp diff -u llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.68 llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.69 --- llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.68 Thu Apr 19 00:35:00 2007 +++ llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp Sat Apr 21 02:38:12 2007 @@ -1980,21 +1980,19 @@ /// can't be equal and will solve setcc instructions when possible. /// @brief Root of the predicate simplifier optimization. class VISIBILITY_HIDDEN PredicateSimplifier : public FunctionPass { - DominatorTree *DT; ETForest *Forest; bool modified; InequalityGraph *IG; UnreachableBlocks UB; ValueRanges *VR; - std::vector WorkList; + std::vector WorkList; public: bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredID(BreakCriticalEdgesID); - AU.addRequired(); AU.addRequired(); AU.addRequired(); AU.addPreserved(); @@ -2010,15 +2008,15 @@ class VISIBILITY_HIDDEN Forwards : public InstVisitor { friend class InstVisitor; PredicateSimplifier *PS; - DominatorTree::Node *DTNode; + BasicBlock *Node; public: InequalityGraph &IG; UnreachableBlocks &UB; ValueRanges &VR; - Forwards(PredicateSimplifier *PS, DominatorTree::Node *DTNode) - : PS(PS), DTNode(DTNode), IG(*PS->IG), UB(PS->UB), VR(*PS->VR) {} + Forwards(PredicateSimplifier *PS, BasicBlock* node) + : PS(PS), Node(node), IG(*PS->IG), UB(PS->UB), VR(*PS->VR) {} void visitTerminatorInst(TerminatorInst &TI); void visitBranchInst(BranchInst &BI); @@ -2038,31 +2036,32 @@ // Used by terminator instructions to proceed from the current basic // block to the next. Verifies that "current" dominates "next", // then calls visitBasicBlock. - void proceedToSuccessors(DominatorTree::Node *Current) { - for (DominatorTree::Node::iterator I = Current->begin(), - E = Current->end(); I != E; ++I) { + void proceedToSuccessors(BasicBlock *Current) { + std::vector Children; + Forest->getChildren(Current, Children); + for (std::vector::iterator I = Children.begin(), + E = Children.end(); I != E; ++I) { WorkList.push_back(*I); } } - void proceedToSuccessor(DominatorTree::Node *Next) { + void proceedToSuccessor(BasicBlock *Next) { WorkList.push_back(Next); } // Visits each instruction in the basic block. - void visitBasicBlock(DominatorTree::Node *Node) { - BasicBlock *BB = Node->getBlock(); + void visitBasicBlock(BasicBlock *BB) { ETNode *ET = Forest->getNodeForBlock(BB); DOUT << "Entering Basic Block: " << BB->getName() << " (" << ET->getDFSNumIn() << ")\n"; for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E;) { - visitInstruction(I++, Node, ET); + visitInstruction(I++, BB, ET); } } // Tries to simplify each Instruction and add new properties to // the PropertySet. - void visitInstruction(Instruction *I, DominatorTree::Node *DT, ETNode *ET) { + void visitInstruction(Instruction *I, BasicBlock *node, ETNode *ET) { DOUT << "Considering instruction " << *I << "\n"; DEBUG(IG->dump()); @@ -2106,14 +2105,13 @@ std::string name = I->getParent()->getName(); DOUT << "push (%" << name << ")\n"; - Forwards visit(this, DT); + Forwards visit(this, node); visit.visit(*I); DOUT << "pop (%" << name << ")\n"; } }; bool PredicateSimplifier::runOnFunction(Function &F) { - DT = &getAnalysis(); Forest = &getAnalysis(); TargetData *TD = &getAnalysis(); @@ -2127,12 +2125,12 @@ BasicBlock *RootBlock = &F.getEntryBlock(); IG = new InequalityGraph(Forest->getNodeForBlock(RootBlock)); VR = new ValueRanges(TD); - WorkList.push_back(DT->getRootNode()); + WorkList.push_back(Forest->getRoot()); do { - DominatorTree::Node *DTNode = WorkList.back(); + BasicBlock *node = WorkList.back(); WorkList.pop_back(); - if (!UB.isDead(DTNode->getBlock())) visitBasicBlock(DTNode); + if (!UB.isDead(node)) visitBasicBlock(node); } while (!WorkList.empty()); delete VR; @@ -2144,12 +2142,12 @@ } void PredicateSimplifier::Forwards::visitTerminatorInst(TerminatorInst &TI) { - PS->proceedToSuccessors(DTNode); + PS->proceedToSuccessors(Node); } void PredicateSimplifier::Forwards::visitBranchInst(BranchInst &BI) { if (BI.isUnconditional()) { - PS->proceedToSuccessors(DTNode); + PS->proceedToSuccessors(Node); return; } @@ -2158,24 +2156,26 @@ BasicBlock *FalseDest = BI.getSuccessor(1); if (isa(Condition) || TrueDest == FalseDest) { - PS->proceedToSuccessors(DTNode); + PS->proceedToSuccessors(Node); return; } - for (DominatorTree::Node::iterator I = DTNode->begin(), E = DTNode->end(); - I != E; ++I) { - BasicBlock *Dest = (*I)->getBlock(); + std::vector Children; + PS->Forest->getChildren(Node, Children); + for (std::vector::iterator I = Children.begin(), + E = Children.end(); I != E; ++I) { + BasicBlock *Dest = *I; DOUT << "Branch thinking about %" << Dest->getName() << "(" << PS->Forest->getNodeForBlock(Dest)->getDFSNumIn() << ")\n"; if (Dest == TrueDest) { - DOUT << "(" << DTNode->getBlock()->getName() << ") true set:\n"; + DOUT << "(" << Node->getName() << ") true set:\n"; VRPSolver VRP(IG, UB, VR, PS->Forest, PS->modified, Dest); VRP.add(ConstantInt::getTrue(), Condition, ICmpInst::ICMP_EQ); VRP.solve(); DEBUG(IG.dump()); } else if (Dest == FalseDest) { - DOUT << "(" << DTNode->getBlock()->getName() << ") false set:\n"; + DOUT << "(" << Node->getName() << ") false set:\n"; VRPSolver VRP(IG, UB, VR, PS->Forest, PS->modified, Dest); VRP.add(ConstantInt::getFalse(), Condition, ICmpInst::ICMP_EQ); VRP.solve(); @@ -2191,10 +2191,11 @@ // Set the EQProperty in each of the cases BBs, and the NEProperties // in the default BB. - - for (DominatorTree::Node::iterator I = DTNode->begin(), E = DTNode->end(); - I != E; ++I) { - BasicBlock *BB = (*I)->getBlock(); + std::vector Children; + PS->Forest->getChildren(Node, Children); + for (std::vector::iterator I = Children.begin(), + E = Children.end(); I != E; ++I) { + BasicBlock *BB = *I; DOUT << "Switch thinking about BB %" << BB->getName() << "(" << PS->Forest->getNodeForBlock(BB)->getDFSNumIn() << ")\n"; From christopher.lamb at gmail.com Sat Apr 21 02:53:49 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Sat, 21 Apr 2007 02:53:49 -0500 Subject: [llvm-commits] Target itineraries tablegen fix Message-ID: <2EA08CCB-2CB5-4C04-B413-9C4F7BF15B8B@gmail.com> I ran into a problem generating certain itineraries, and I think this fixes it... -- Christopher Lamb ? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070421/406f6b78/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: itineraries_fix.diff Type: application/octet-stream Size: 1017 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070421/406f6b78/attachment.obj -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070421/406f6b78/attachment-0001.html From christopher.lamb at gmail.com Sat Apr 21 03:16:55 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Sat, 21 Apr 2007 03:16:55 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h Message-ID: <200704210816.l3L8Gtbu011852@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.147 -> 1.148 SelectionDAGNodes.h updated: 1.185 -> 1.186 --- Log message: add support for alignment attributes on load/store instructions --- Diffs of the changes: (+10 -5) SelectionDAG.h | 11 +++++++---- SelectionDAGNodes.h | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.147 llvm/include/llvm/CodeGen/SelectionDAG.h:1.148 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.147 Fri Apr 20 16:38:10 2007 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Sat Apr 21 03:16:25 2007 @@ -311,10 +311,12 @@ /// determined by their operands, and they produce a value AND a token chain. /// SDOperand getLoad(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, - const Value *SV, int SVOffset, bool isVolatile=false); + const Value *SV, int SVOffset, bool isVolatile=false, + unsigned Alignment=0); SDOperand getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, const Value *SV, - int SVOffset, MVT::ValueType EVT, bool isVolatile=false); + int SVOffset, MVT::ValueType EVT, bool isVolatile=false, + unsigned Alignment=0); SDOperand getIndexedLoad(SDOperand OrigLoad, SDOperand Base, SDOperand Offset, ISD::MemIndexedMode AM); SDOperand getVecLoad(unsigned Count, MVT::ValueType VT, SDOperand Chain, @@ -323,10 +325,11 @@ /// getStore - Helper function to build ISD::STORE nodes. /// SDOperand getStore(SDOperand Chain, SDOperand Val, SDOperand Ptr, - const Value *SV, int SVOffset, bool isVolatile=false); + const Value *SV, int SVOffset, bool isVolatile=false, + unsigned Alignment=0); SDOperand getTruncStore(SDOperand Chain, SDOperand Val, SDOperand Ptr, const Value *SV, int SVOffset, MVT::ValueType TVT, - bool isVolatile=false); + bool isVolatile=false, unsigned Alignment=0); SDOperand getIndexedStore(SDOperand OrigStoe, SDOperand Base, SDOperand Offset, ISD::MemIndexedMode AM); Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.185 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.186 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.185 Fri Apr 20 16:38:10 2007 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Sat Apr 21 03:16:25 2007 @@ -1448,7 +1448,7 @@ friend class SelectionDAG; LoadSDNode(SDOperand *ChainPtrOff, SDVTList VTs, ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT, - const Value *SV, int O=0, unsigned Align=1, bool Vol=false) + const Value *SV, int O=0, unsigned Align=0, bool Vol=false) : SDNode(ISD::LOAD, VTs), AddrMode(AM), ExtType(ETy), LoadedVT(LVT), SrcValue(SV), SVOffset(O), Alignment(Align), IsVolatile(Vol) { @@ -1456,6 +1456,7 @@ Ops[1] = ChainPtrOff[1]; // Ptr Ops[2] = ChainPtrOff[2]; // Off InitOperands(Ops, 3); + assert(Align != 0 && "Loads should have non-zero aligment"); assert((getOffset().getOpcode() == ISD::UNDEF || AddrMode != ISD::UNINDEXED) && "Only indexed load has a non-undef offset operand"); @@ -1518,6 +1519,7 @@ Ops[2] = ChainValuePtrOff[2]; // Ptr Ops[3] = ChainValuePtrOff[3]; // Off InitOperands(Ops, 4); + assert(Align != 0 && "Stores should have non-zero aligment"); assert((getOffset().getOpcode() == ISD::UNDEF || AddrMode != ISD::UNINDEXED) && "Only indexed store has a non-undef offset operand"); From christopher.lamb at gmail.com Sat Apr 21 03:17:08 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Sat, 21 Apr 2007 03:17:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Message-ID: <200704210817.l3L8H8Jo011871@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.248 -> 1.249 --- Log message: add support for alignment attributes on load/store instructions --- Diffs of the changes: (+21 -3) Reader.cpp | 24 +++++++++++++++++++++--- 1 files changed, 21 insertions(+), 3 deletions(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.248 llvm/lib/Bytecode/Reader/Reader.cpp:1.249 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.248 Thu Apr 12 13:32:50 2007 +++ llvm/lib/Bytecode/Reader/Reader.cpp Sat Apr 21 03:16:25 2007 @@ -831,13 +831,31 @@ &Idx[0], Idx.size()); break; } - case 62: // volatile load + case 62: { // attributed load + if (Oprnds.size() != 2 || !isa(InstTy)) + error("Invalid attributed load instruction!"); + signed Log2AlignVal = ((Oprnds[1]>>1)-1); + Result = new LoadInst(getValue(iType, Oprnds[0]), "", (Oprnds[1] & 1), + ((Log2AlignVal < 0) ? 0 : 1<(InstTy)) error("Invalid load instruction!"); - Result = new LoadInst(getValue(iType, Oprnds[0]), "", Opcode == 62); + Result = new LoadInst(getValue(iType, Oprnds[0]), ""); break; - case 63: // volatile store + case 63: { // attributed store + if (!isa(InstTy) || Oprnds.size() != 3) + error("Invalid store instruction!"); + + Value *Ptr = getValue(iType, Oprnds[1]); + const Type *ValTy = cast(Ptr->getType())->getElementType(); + signed Log2AlignVal = ((Oprnds[2]>>1)-1); + Result = new StoreInst(getValue(getTypeSlot(ValTy), Oprnds[0]), Ptr, + (Oprnds[2] & 1), + ((Log2AlignVal < 0) ? 0 : 1<(InstTy) || Oprnds.size() != 2) error("Invalid store instruction!"); From christopher.lamb at gmail.com Sat Apr 21 03:17:09 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Sat, 21 Apr 2007 03:17:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200704210817.l3L8H9Fc011876@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.173 -> 1.174 --- Log message: add support for alignment attributes on load/store instructions --- Diffs of the changes: (+27 -5) Writer.cpp | 32 +++++++++++++++++++++++++++----- 1 files changed, 27 insertions(+), 5 deletions(-) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.173 llvm/lib/Bytecode/Writer/Writer.cpp:1.174 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.173 Mon Apr 16 18:32:28 2007 +++ llvm/lib/Bytecode/Writer/Writer.cpp Sat Apr 21 03:16:25 2007 @@ -616,7 +616,7 @@ unsigned Opcode = I.getOpcode(); unsigned NumOperands = I.getNumOperands(); - // Encode 'tail call' as 61, 'volatile load' as 62, and 'volatile store' as + // Encode 'tail call' as 61 // 63. if (const CallInst *CI = dyn_cast(&I)) { if (CI->getCallingConv() == CallingConv::C) { @@ -632,10 +632,6 @@ } else { Opcode = 58; // Call escape sequence. } - } else if (isa(I) && cast(I).isVolatile()) { - Opcode = 62; - } else if (isa(I) && cast(I).isVolatile()) { - Opcode = 63; } // Figure out which type to encode with the instruction. Typically we want @@ -744,6 +740,32 @@ } else if (isa(I)) { // Invoke escape seq has at least 4 operands to encode. ++NumOperands; + } else if (const LoadInst *LI = dyn_cast(&I)) { + // Encode attributed load as opcode 62 + // We need to encode the attributes of the load instruction as the second + // operand. Its not really a slot, but we don't want to break the + // instruction format for these instructions. + if (LI->getAlignment() || LI->isVolatile()) { + NumOperands = 2; + Slots[1] = ((Log2_32(LI->getAlignment())+1)<<1) + + (LI->isVolatile() ? 1 : 0); + if (Slots[1] > MaxOpSlot) + MaxOpSlot = Slots[1]; + Opcode = 62; + } + } else if (const StoreInst *SI = dyn_cast(&I)) { + // Encode attributed store as opcode 63 + // We need to encode the attributes of the store instruction as the third + // operand. Its not really a slot, but we don't want to break the + // instruction format for these instructions. + if (SI->getAlignment() || SI->isVolatile()) { + NumOperands = 3; + Slots[2] = ((Log2_32(SI->getAlignment())+1)<<1) + + (SI->isVolatile() ? 1 : 0); + if (Slots[2] > MaxOpSlot) + MaxOpSlot = Slots[2]; + Opcode = 63; + } } // Decide which instruction encoding to use. This is determined primarily From christopher.lamb at gmail.com Sat Apr 21 03:17:10 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Sat, 21 Apr 2007 03:17:10 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp SelectionDAG.cpp SelectionDAGISel.cpp Message-ID: <200704210817.l3L8HAJW011885@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.293 -> 1.294 SelectionDAG.cpp updated: 1.398 -> 1.399 SelectionDAGISel.cpp updated: 1.421 -> 1.422 --- Log message: add support for alignment attributes on load/store instructions --- Diffs of the changes: (+79 -36) DAGCombiner.cpp | 70 +++++++++++++++++++++++++++++++++++++-------------- SelectionDAG.cpp | 33 +++++++++++++++--------- SelectionDAGISel.cpp | 12 +++++--- 3 files changed, 79 insertions(+), 36 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.293 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.294 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.293 Tue Apr 17 22:06:49 2007 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sat Apr 21 03:16:25 2007 @@ -1263,7 +1263,9 @@ (!AfterLegalize || TLI.isLoadXLegal(ISD::ZEXTLOAD, EVT))) { SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), - LN0->getSrcValueOffset(), EVT); + LN0->getSrcValueOffset(), EVT, + LN0->isVolatile(), + LN0->getAlignment()); AddToWorkList(N); CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1)); return SDOperand(N, 0); // Return N so it doesn't get rechecked! @@ -1280,7 +1282,9 @@ (!AfterLegalize || TLI.isLoadXLegal(ISD::ZEXTLOAD, EVT))) { SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), - LN0->getSrcValueOffset(), EVT); + LN0->getSrcValueOffset(), EVT, + LN0->isVolatile(), + LN0->getAlignment()); AddToWorkList(N); CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1)); return SDOperand(N, 0); // Return N so it doesn't get rechecked! @@ -1320,7 +1324,8 @@ AddToWorkList(NewPtr.Val); SDOperand Load = DAG.getExtLoad(ISD::ZEXTLOAD, VT, LN0->getChain(), NewPtr, - LN0->getSrcValue(), LN0->getSrcValueOffset(), EVT); + LN0->getSrcValue(), LN0->getSrcValueOffset(), EVT, + LN0->isVolatile(), LN0->getAlignment()); AddToWorkList(N); CombineTo(N0.Val, Load, Load.getValue(1)); return SDOperand(N, 0); // Return N so it doesn't get rechecked! @@ -2120,7 +2125,8 @@ SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), - N0.getValueType()); + N0.getValueType(), + LN0->isVolatile()); CombineTo(N, ExtLoad); CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), ExtLoad.getValue(1)); @@ -2136,7 +2142,9 @@ if (!AfterLegalize || TLI.isLoadXLegal(ISD::SEXTLOAD, EVT)) { SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), - LN0->getSrcValueOffset(), EVT); + LN0->getSrcValueOffset(), EVT, + LN0->isVolatile(), + LN0->getAlignment()); CombineTo(N, ExtLoad); CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), ExtLoad.getValue(1)); @@ -2212,7 +2220,9 @@ SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), - N0.getValueType()); + N0.getValueType(), + LN0->isVolatile(), + LN0->getAlignment()); CombineTo(N, ExtLoad); CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), ExtLoad.getValue(1)); @@ -2227,7 +2237,9 @@ MVT::ValueType EVT = LN0->getLoadedVT(); SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), - LN0->getSrcValueOffset(), EVT); + LN0->getSrcValueOffset(), EVT, + LN0->isVolatile(), + LN0->getAlignment()); CombineTo(N, ExtLoad); CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), ExtLoad.getValue(1)); @@ -2303,7 +2315,9 @@ SDOperand ExtLoad = DAG.getExtLoad(ISD::EXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), - N0.getValueType()); + N0.getValueType(), + LN0->isVolatile(), + LN0->getAlignment()); CombineTo(N, ExtLoad); CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), ExtLoad.getValue(1)); @@ -2321,7 +2335,9 @@ SDOperand ExtLoad = DAG.getExtLoad(LN0->getExtensionType(), VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), - LN0->getSrcValueOffset(), EVT); + LN0->getSrcValueOffset(), EVT, + LN0->isVolatile(), + LN0->getAlignment()); CombineTo(N, ExtLoad); CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), ExtLoad.getValue(1)); @@ -2398,9 +2414,11 @@ AddToWorkList(NewPtr.Val); SDOperand Load = (ExtType == ISD::NON_EXTLOAD) ? DAG.getLoad(VT, LN0->getChain(), NewPtr, - LN0->getSrcValue(), LN0->getSrcValueOffset()) + LN0->getSrcValue(), LN0->getSrcValueOffset(), + LN0->isVolatile(), LN0->getAlignment()) : DAG.getExtLoad(ExtType, VT, LN0->getChain(), NewPtr, - LN0->getSrcValue(), LN0->getSrcValueOffset(), EVT); + LN0->getSrcValue(), LN0->getSrcValueOffset(), EVT, + LN0->isVolatile(), LN0->getAlignment()); AddToWorkList(N); if (CombineSRL) { std::vector NowDead; @@ -2479,7 +2497,9 @@ LoadSDNode *LN0 = cast(N0); SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), - LN0->getSrcValueOffset(), EVT); + LN0->getSrcValueOffset(), EVT, + LN0->isVolatile(), + LN0->getAlignment()); CombineTo(N, ExtLoad); CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1)); return SDOperand(N, 0); // Return N so it doesn't get rechecked! @@ -2492,7 +2512,9 @@ LoadSDNode *LN0 = cast(N0); SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), - LN0->getSrcValueOffset(), EVT); + LN0->getSrcValueOffset(), EVT, + LN0->isVolatile(), + LN0->getAlignment()); CombineTo(N, ExtLoad); CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1)); return SDOperand(N, 0); // Return N so it doesn't get rechecked! @@ -2552,7 +2574,8 @@ if (0 && ISD::isNON_EXTLoad(N0.Val) && N0.hasOneUse()) { LoadSDNode *LN0 = cast(N0); SDOperand Load = DAG.getLoad(VT, LN0->getChain(), LN0->getBasePtr(), - LN0->getSrcValue(), LN0->getSrcValueOffset()); + LN0->getSrcValue(), LN0->getSrcValueOffset(), + LN0->isVolatile(), LN0->getAlignment()); AddToWorkList(N); CombineTo(N0.Val, DAG.getNode(ISD::BIT_CONVERT, N0.getValueType(), Load), Load.getValue(1)); @@ -2942,7 +2965,9 @@ SDOperand ExtLoad = DAG.getExtLoad(ISD::EXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), - N0.getValueType()); + N0.getValueType(), + LN0->isVolatile(), + LN0->getAlignment()); CombineTo(N, ExtLoad); CombineTo(N0.Val, DAG.getNode(ISD::FP_ROUND, N0.getValueType(), ExtLoad), ExtLoad.getValue(1)); @@ -3331,13 +3356,16 @@ // Replace the chain to void dependency. if (LD->getExtensionType() == ISD::NON_EXTLOAD) { ReplLoad = DAG.getLoad(N->getValueType(0), BetterChain, Ptr, - LD->getSrcValue(), LD->getSrcValueOffset()); + LD->getSrcValue(), LD->getSrcValueOffset(), + LD->isVolatile(), LD->getAlignment()); } else { ReplLoad = DAG.getExtLoad(LD->getExtensionType(), LD->getValueType(0), BetterChain, Ptr, LD->getSrcValue(), LD->getSrcValueOffset(), - LD->getLoadedVT()); + LD->getLoadedVT(), + LD->isVolatile(), + LD->getAlignment()); } // Create token factor to keep old chain connected. @@ -4040,13 +4068,17 @@ if (LLD->getExtensionType() == ISD::NON_EXTLOAD) Load = DAG.getLoad(TheSelect->getValueType(0), LLD->getChain(), Addr,LLD->getSrcValue(), - LLD->getSrcValueOffset()); + LLD->getSrcValueOffset(), + LLD->isVolatile(), + LLD->getAlignment()); else { Load = DAG.getExtLoad(LLD->getExtensionType(), TheSelect->getValueType(0), LLD->getChain(), Addr, LLD->getSrcValue(), LLD->getSrcValueOffset(), - LLD->getLoadedVT()); + LLD->getLoadedVT(), + LLD->isVolatile(), + LLD->getAlignment()); } // Users of the select now use the result of the load. CombineTo(TheSelect, Load); Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.398 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.399 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.398 Fri Apr 20 16:38:10 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Sat Apr 21 03:16:25 2007 @@ -20,6 +20,7 @@ #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Target/TargetData.h" #include "llvm/Target/MRegisterInfo.h" #include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetInstrInfo.h" @@ -1539,9 +1540,7 @@ SDOperand SelectionDAG::getLoad(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, const Value *SV, int SVOffset, - bool isVolatile) { - // FIXME: Alignment == 1 for now. - unsigned Alignment = 1; + bool isVolatile, unsigned Alignment) { SDVTList VTs = getVTList(VT, MVT::Other); SDOperand Undef = getNode(ISD::UNDEF, Ptr.getValueType()); SDOperand Ops[] = { Chain, Ptr, Undef }; @@ -1557,6 +1556,10 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); + if (Alignment == 0) { // Ensure that codegen never sees alignment 0 + const Type *Ty = MVT::getTypeForValueType(VT); + Alignment = TLI.getTargetData()->getABITypeAlignment(Ty); + } SDNode *N = new LoadSDNode(Ops, VTs, ISD::UNINDEXED, ISD::NON_EXTLOAD, VT, SV, SVOffset, Alignment, isVolatile); @@ -1569,7 +1572,7 @@ SDOperand Chain, SDOperand Ptr, const Value *SV, int SVOffset, MVT::ValueType EVT, - bool isVolatile) { + bool isVolatile, unsigned Alignment) { // If they are asking for an extending load from/to the same thing, return a // normal load. if (VT == EVT) @@ -1584,8 +1587,6 @@ assert(MVT::isInteger(VT) == MVT::isInteger(EVT) && "Cannot convert from FP to Int or Int -> FP!"); - // FIXME: Alignment == 1 for now. - unsigned Alignment = 1; SDVTList VTs = getVTList(VT, MVT::Other); SDOperand Undef = getNode(ISD::UNDEF, Ptr.getValueType()); SDOperand Ops[] = { Chain, Ptr, Undef }; @@ -1601,6 +1602,10 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); + if (Alignment == 0) { // Ensure that codegen never sees alignment 0 + const Type *Ty = MVT::getTypeForValueType(VT); + Alignment = TLI.getTargetData()->getABITypeAlignment(Ty); + } SDNode *N = new LoadSDNode(Ops, VTs, ISD::UNINDEXED, ExtType, EVT, SV, SVOffset, Alignment, isVolatile); CSEMap.InsertNode(N, IP); @@ -1648,11 +1653,9 @@ SDOperand SelectionDAG::getStore(SDOperand Chain, SDOperand Val, SDOperand Ptr, const Value *SV, int SVOffset, - bool isVolatile) { + bool isVolatile, unsigned Alignment) { MVT::ValueType VT = Val.getValueType(); - // FIXME: Alignment == 1 for now. - unsigned Alignment = 1; SDVTList VTs = getVTList(MVT::Other); SDOperand Undef = getNode(ISD::UNDEF, Ptr.getValueType()); SDOperand Ops[] = { Chain, Val, Ptr, Undef }; @@ -1668,6 +1671,10 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); + if (Alignment == 0) { // Ensure that codegen never sees alignment 0 + const Type *Ty = MVT::getTypeForValueType(VT); + Alignment = TLI.getTargetData()->getABITypeAlignment(Ty); + } SDNode *N = new StoreSDNode(Ops, VTs, ISD::UNINDEXED, false, VT, SV, SVOffset, Alignment, isVolatile); CSEMap.InsertNode(N, IP); @@ -1678,7 +1685,7 @@ SDOperand SelectionDAG::getTruncStore(SDOperand Chain, SDOperand Val, SDOperand Ptr, const Value *SV, int SVOffset, MVT::ValueType SVT, - bool isVolatile) { + bool isVolatile, unsigned Alignment) { MVT::ValueType VT = Val.getValueType(); bool isTrunc = VT != SVT; @@ -1686,8 +1693,6 @@ assert(MVT::isInteger(VT) == MVT::isInteger(SVT) && "Can't do FP-INT conversion!"); - // FIXME: Alignment == 1 for now. - unsigned Alignment = 1; SDVTList VTs = getVTList(MVT::Other); SDOperand Undef = getNode(ISD::UNDEF, Ptr.getValueType()); SDOperand Ops[] = { Chain, Val, Ptr, Undef }; @@ -1703,6 +1708,10 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); + if (Alignment == 0) { // Ensure that codegen never sees alignment 0 + const Type *Ty = MVT::getTypeForValueType(VT); + Alignment = TLI.getTargetData()->getABITypeAlignment(Ty); + } SDNode *N = new StoreSDNode(Ops, VTs, ISD::UNINDEXED, isTrunc, SVT, SV, SVOffset, Alignment, isVolatile); CSEMap.InsertNode(N, IP); Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.421 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.422 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.421 Sat Apr 14 14:39:41 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sat Apr 21 03:16:25 2007 @@ -498,7 +498,7 @@ SDOperand getLoadFrom(const Type *Ty, SDOperand Ptr, const Value *SV, SDOperand Root, - bool isVolatile); + bool isVolatile, unsigned Alignment); SDOperand getIntPtrConstant(uint64_t Val) { return DAG.getConstant(Val, TLI.getPointerTy()); @@ -2313,19 +2313,21 @@ } setValue(&I, getLoadFrom(I.getType(), Ptr, I.getOperand(0), - Root, I.isVolatile())); + Root, I.isVolatile(), I.getAlignment())); } SDOperand SelectionDAGLowering::getLoadFrom(const Type *Ty, SDOperand Ptr, const Value *SV, SDOperand Root, - bool isVolatile) { + bool isVolatile, + unsigned Alignment) { SDOperand L; if (const VectorType *PTy = dyn_cast(Ty)) { MVT::ValueType PVT = TLI.getValueType(PTy->getElementType()); L = DAG.getVecLoad(PTy->getNumElements(), PVT, Root, Ptr, DAG.getSrcValue(SV)); } else { - L = DAG.getLoad(TLI.getValueType(Ty), Root, Ptr, SV, 0, isVolatile); + L = DAG.getLoad(TLI.getValueType(Ty), Root, Ptr, SV, 0, + isVolatile, Alignment); } if (isVolatile) @@ -2342,7 +2344,7 @@ SDOperand Src = getValue(SrcV); SDOperand Ptr = getValue(I.getOperand(1)); DAG.setRoot(DAG.getStore(getRoot(), Src, Ptr, I.getOperand(1), 0, - I.isVolatile())); + I.isVolatile(), I.getAlignment())); } /// IntrinsicCannotAccessMemory - Return true if the specified intrinsic cannot From christopher.lamb at gmail.com Sat Apr 21 03:17:11 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Sat, 21 Apr 2007 03:17:11 -0500 Subject: [llvm-commits] CVS: llvm/docs/BytecodeFormat.html LangRef.html Message-ID: <200704210817.l3L8HBA1011897@zion.cs.uiuc.edu> Changes in directory llvm/docs: BytecodeFormat.html updated: 1.68 -> 1.69 LangRef.html updated: 1.234 -> 1.235 --- Log message: add support for alignment attributes on load/store instructions --- Diffs of the changes: (+8 -8) BytecodeFormat.html | 8 ++++---- LangRef.html | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) Index: llvm/docs/BytecodeFormat.html diff -u llvm/docs/BytecodeFormat.html:1.68 llvm/docs/BytecodeFormat.html:1.69 --- llvm/docs/BytecodeFormat.html:1.68 Thu Apr 12 14:52:46 2007 +++ llvm/docs/BytecodeFormat.html Sat Apr 21 03:16:24 2007 @@ -1587,15 +1587,15 @@ Call+FastCC+TailCall5951.5 Call+FastCC6051.5 Call+CCC+TailCall6151.5 - Load+Volatile6231.3 - Store+Volatile6331.3 + Load+Attributes6272.0 + Store+Attributes6372.0

    * Note: These aren't really opcodes from an LLVM language perspective. They encode information into other opcodes without reserving space for that information. -For example, opcode=63 is a Volatile Store. The opcode for this +For example, opcode=63 is an Attributed Store. The opcode for this instruction is 25 (Store) but we encode it as 63 to indicate that is a Volatile Store. The same is done for the calling conventions and tail calls. In each of these entries in range 56-63, the opcode is documented as the base @@ -2097,7 +2097,7 @@ Reid Spencer and Chris Lattner
    The LLVM Compiler Infrastructure
    -Last modified: $Date: 2007/04/12 19:52:46 $ +Last modified: $Date: 2007/04/21 08:16:24 $ Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.234 llvm/docs/LangRef.html:1.235 --- llvm/docs/LangRef.html:1.234 Thu Apr 12 15:34:36 2007 +++ llvm/docs/LangRef.html Sat Apr 21 03:16:25 2007 @@ -2609,7 +2609,7 @@ Instruction

    Syntax:
    -
      <result> = load <ty>* <pointer>
    <result> = volatile load <ty>* <pointer>
    +
      <result> = load <ty>* <pointer>[, align <alignment>]
    <result> = volatile load <ty>* <pointer>[, align <alignment>]
    Overview:

    The 'load' instruction is used to read from memory.

    Arguments:
    @@ -2634,8 +2634,8 @@ Instruction
    Syntax:
    -
      store <ty> <value>, <ty>* <pointer>                   ; yields {void}
    -  volatile store <ty> <value>, <ty>* <pointer>                   ; yields {void}
    +
      store <ty> <value>, <ty>* <pointer>[, align <alignment>]                   ; yields {void}
    +  volatile store <ty> <value>, <ty>* <pointer>[, align <alignment>]          ; yields {void}
     
    Overview:

    The 'store' instruction is used to write to memory.

    @@ -4732,7 +4732,7 @@ Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/04/12 20:34:36 $ + Last modified: $Date: 2007/04/21 08:16:25 $ From christopher.lamb at gmail.com Sat Apr 21 03:17:08 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Sat, 21 Apr 2007 03:17:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y llvmAsmParser.y.cvs Message-ID: <200704210817.l3L8H8GA011866@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp.cvs updated: 1.88 -> 1.89 llvmAsmParser.h.cvs updated: 1.66 -> 1.67 llvmAsmParser.y updated: 1.343 -> 1.344 llvmAsmParser.y.cvs updated: 1.89 -> 1.90 --- Log message: add support for alignment attributes on load/store instructions --- Diffs of the changes: (+3264 -4326) llvmAsmParser.cpp.cvs | 7126 +++++++++++++++++++++----------------------------- llvmAsmParser.h.cvs | 448 --- llvmAsmParser.y | 8 llvmAsmParser.y.cvs | 8 4 files changed, 3264 insertions(+), 4326 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.88 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.89 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.88 Mon Apr 16 17:02:22 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Sat Apr 21 03:16:25 2007 @@ -1,342 +1,150 @@ -/* A Bison parser, made by GNU Bison 2.1. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +/* A Bison parser, made from /Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y + by GNU Bison version 1.28 */ - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 +#define YYBISON 1 /* Identify Bison output. */ -/* Substitute the variable and function names. */ #define yyparse llvmAsmparse -#define yylex llvmAsmlex +#define yylex llvmAsmlex #define yyerror llvmAsmerror -#define yylval llvmAsmlval -#define yychar llvmAsmchar +#define yylval llvmAsmlval +#define yychar llvmAsmchar #define yydebug llvmAsmdebug #define yynerrs llvmAsmnerrs +#define ESINT64VAL 257 +#define EUINT64VAL 258 +#define ESAPINTVAL 259 +#define EUAPINTVAL 260 +#define LOCALVAL_ID 261 +#define GLOBALVAL_ID 262 +#define FPVAL 263 +#define VOID 264 +#define INTTYPE 265 +#define FLOAT 266 +#define DOUBLE 267 +#define LABEL 268 +#define TYPE 269 +#define LOCALVAR 270 +#define GLOBALVAR 271 +#define LABELSTR 272 +#define STRINGCONSTANT 273 +#define ATSTRINGCONSTANT 274 +#define ZEROINITIALIZER 275 +#define TRUETOK 276 +#define FALSETOK 277 +#define BEGINTOK 278 +#define ENDTOK 279 +#define DECLARE 280 +#define DEFINE 281 +#define GLOBAL 282 +#define CONSTANT 283 +#define SECTION 284 +#define VOLATILE 285 +#define THREAD_LOCAL 286 +#define TO 287 +#define DOTDOTDOT 288 +#define NULL_TOK 289 +#define UNDEF 290 +#define INTERNAL 291 +#define LINKONCE 292 +#define WEAK 293 +#define APPENDING 294 +#define DLLIMPORT 295 +#define DLLEXPORT 296 +#define EXTERN_WEAK 297 +#define OPAQUE 298 +#define EXTERNAL 299 +#define TARGET 300 +#define TRIPLE 301 +#define ALIGN 302 +#define DEPLIBS 303 +#define CALL 304 +#define TAIL 305 +#define ASM_TOK 306 +#define MODULE 307 +#define SIDEEFFECT 308 +#define CC_TOK 309 +#define CCC_TOK 310 +#define FASTCC_TOK 311 +#define COLDCC_TOK 312 +#define X86_STDCALLCC_TOK 313 +#define X86_FASTCALLCC_TOK 314 +#define DATALAYOUT 315 +#define RET 316 +#define BR 317 +#define SWITCH 318 +#define INVOKE 319 +#define UNWIND 320 +#define UNREACHABLE 321 +#define ADD 322 +#define SUB 323 +#define MUL 324 +#define UDIV 325 +#define SDIV 326 +#define FDIV 327 +#define UREM 328 +#define SREM 329 +#define FREM 330 +#define AND 331 +#define OR 332 +#define XOR 333 +#define SHL 334 +#define LSHR 335 +#define ASHR 336 +#define ICMP 337 +#define FCMP 338 +#define EQ 339 +#define NE 340 +#define SLT 341 +#define SGT 342 +#define SLE 343 +#define SGE 344 +#define ULT 345 +#define UGT 346 +#define ULE 347 +#define UGE 348 +#define OEQ 349 +#define ONE 350 +#define OLT 351 +#define OGT 352 +#define OLE 353 +#define OGE 354 +#define ORD 355 +#define UNO 356 +#define UEQ 357 +#define UNE 358 +#define MALLOC 359 +#define ALLOCA 360 +#define FREE 361 +#define LOAD 362 +#define STORE 363 +#define GETELEMENTPTR 364 +#define TRUNC 365 +#define ZEXT 366 +#define SEXT 367 +#define FPTRUNC 368 +#define FPEXT 369 +#define BITCAST 370 +#define UITOFP 371 +#define SITOFP 372 +#define FPTOUI 373 +#define FPTOSI 374 +#define INTTOPTR 375 +#define PTRTOINT 376 +#define PHI_TOK 377 +#define SELECT 378 +#define VAARG 379 +#define EXTRACTELEMENT 380 +#define INSERTELEMENT 381 +#define SHUFFLEVECTOR 382 +#define NORETURN 383 +#define INREG 384 +#define SRET 385 +#define NOUNWIND 386 +#define DEFAULT 387 +#define HIDDEN 388 - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ESINT64VAL = 258, - EUINT64VAL = 259, - ESAPINTVAL = 260, - EUAPINTVAL = 261, - LOCALVAL_ID = 262, - GLOBALVAL_ID = 263, - FPVAL = 264, - VOID = 265, - INTTYPE = 266, - FLOAT = 267, - DOUBLE = 268, - LABEL = 269, - TYPE = 270, - LOCALVAR = 271, - GLOBALVAR = 272, - LABELSTR = 273, - STRINGCONSTANT = 274, - ATSTRINGCONSTANT = 275, - ZEROINITIALIZER = 276, - TRUETOK = 277, - FALSETOK = 278, - BEGINTOK = 279, - ENDTOK = 280, - DECLARE = 281, - DEFINE = 282, - GLOBAL = 283, - CONSTANT = 284, - SECTION = 285, - VOLATILE = 286, - THREAD_LOCAL = 287, - TO = 288, - DOTDOTDOT = 289, - NULL_TOK = 290, - UNDEF = 291, - INTERNAL = 292, - LINKONCE = 293, - WEAK = 294, - APPENDING = 295, - DLLIMPORT = 296, - DLLEXPORT = 297, - EXTERN_WEAK = 298, - OPAQUE = 299, - EXTERNAL = 300, - TARGET = 301, - TRIPLE = 302, - ALIGN = 303, - DEPLIBS = 304, - CALL = 305, - TAIL = 306, - ASM_TOK = 307, - MODULE = 308, - SIDEEFFECT = 309, - CC_TOK = 310, - CCC_TOK = 311, - FASTCC_TOK = 312, - COLDCC_TOK = 313, - X86_STDCALLCC_TOK = 314, - X86_FASTCALLCC_TOK = 315, - DATALAYOUT = 316, - RET = 317, - BR = 318, - SWITCH = 319, - INVOKE = 320, - UNWIND = 321, - UNREACHABLE = 322, - ADD = 323, - SUB = 324, - MUL = 325, - UDIV = 326, - SDIV = 327, - FDIV = 328, - UREM = 329, - SREM = 330, - FREM = 331, - AND = 332, - OR = 333, - XOR = 334, - SHL = 335, - LSHR = 336, - ASHR = 337, - ICMP = 338, - FCMP = 339, - EQ = 340, - NE = 341, - SLT = 342, - SGT = 343, - SLE = 344, - SGE = 345, - ULT = 346, - UGT = 347, - ULE = 348, - UGE = 349, - OEQ = 350, - ONE = 351, - OLT = 352, - OGT = 353, - OLE = 354, - OGE = 355, - ORD = 356, - UNO = 357, - UEQ = 358, - UNE = 359, - MALLOC = 360, - ALLOCA = 361, - FREE = 362, - LOAD = 363, - STORE = 364, - GETELEMENTPTR = 365, - TRUNC = 366, - ZEXT = 367, - SEXT = 368, - FPTRUNC = 369, - FPEXT = 370, - BITCAST = 371, - UITOFP = 372, - SITOFP = 373, - FPTOUI = 374, - FPTOSI = 375, - INTTOPTR = 376, - PTRTOINT = 377, - PHI_TOK = 378, - SELECT = 379, - VAARG = 380, - EXTRACTELEMENT = 381, - INSERTELEMENT = 382, - SHUFFLEVECTOR = 383, - NORETURN = 384, - INREG = 385, - SRET = 386, - NOUNWIND = 387, - DEFAULT = 388, - HIDDEN = 389 - }; -#endif -/* Tokens. */ -#define ESINT64VAL 258 -#define EUINT64VAL 259 -#define ESAPINTVAL 260 -#define EUAPINTVAL 261 -#define LOCALVAL_ID 262 -#define GLOBALVAL_ID 263 -#define FPVAL 264 -#define VOID 265 -#define INTTYPE 266 -#define FLOAT 267 -#define DOUBLE 268 -#define LABEL 269 -#define TYPE 270 -#define LOCALVAR 271 -#define GLOBALVAR 272 -#define LABELSTR 273 -#define STRINGCONSTANT 274 -#define ATSTRINGCONSTANT 275 -#define ZEROINITIALIZER 276 -#define TRUETOK 277 -#define FALSETOK 278 -#define BEGINTOK 279 -#define ENDTOK 280 -#define DECLARE 281 -#define DEFINE 282 -#define GLOBAL 283 -#define CONSTANT 284 -#define SECTION 285 -#define VOLATILE 286 -#define THREAD_LOCAL 287 -#define TO 288 -#define DOTDOTDOT 289 -#define NULL_TOK 290 -#define UNDEF 291 -#define INTERNAL 292 -#define LINKONCE 293 -#define WEAK 294 -#define APPENDING 295 -#define DLLIMPORT 296 -#define DLLEXPORT 297 -#define EXTERN_WEAK 298 -#define OPAQUE 299 -#define EXTERNAL 300 -#define TARGET 301 -#define TRIPLE 302 -#define ALIGN 303 -#define DEPLIBS 304 -#define CALL 305 -#define TAIL 306 -#define ASM_TOK 307 -#define MODULE 308 -#define SIDEEFFECT 309 -#define CC_TOK 310 -#define CCC_TOK 311 -#define FASTCC_TOK 312 -#define COLDCC_TOK 313 -#define X86_STDCALLCC_TOK 314 -#define X86_FASTCALLCC_TOK 315 -#define DATALAYOUT 316 -#define RET 317 -#define BR 318 -#define SWITCH 319 -#define INVOKE 320 -#define UNWIND 321 -#define UNREACHABLE 322 -#define ADD 323 -#define SUB 324 -#define MUL 325 -#define UDIV 326 -#define SDIV 327 -#define FDIV 328 -#define UREM 329 -#define SREM 330 -#define FREM 331 -#define AND 332 -#define OR 333 -#define XOR 334 -#define SHL 335 -#define LSHR 336 -#define ASHR 337 -#define ICMP 338 -#define FCMP 339 -#define EQ 340 -#define NE 341 -#define SLT 342 -#define SGT 343 -#define SLE 344 -#define SGE 345 -#define ULT 346 -#define UGT 347 -#define ULE 348 -#define UGE 349 -#define OEQ 350 -#define ONE 351 -#define OLT 352 -#define OGT 353 -#define OLE 354 -#define OGE 355 -#define ORD 356 -#define UNO 357 -#define UEQ 358 -#define UNE 359 -#define MALLOC 360 -#define ALLOCA 361 -#define FREE 362 -#define LOAD 363 -#define STORE 364 -#define GETELEMENTPTR 365 -#define TRUNC 366 -#define ZEXT 367 -#define SEXT 368 -#define FPTRUNC 369 -#define FPEXT 370 -#define BITCAST 371 -#define UITOFP 372 -#define SITOFP 373 -#define FPTOUI 374 -#define FPTOSI 375 -#define INTTOPTR 376 -#define PTRTOINT 377 -#define PHI_TOK 378 -#define SELECT 379 -#define VAARG 380 -#define EXTRACTELEMENT 381 -#define INSERTELEMENT 382 -#define SHUFFLEVECTOR 383 -#define NORETURN 384 -#define INREG 385 -#define SRET 386 -#define NOUNWIND 387 -#define DEFAULT 388 -#define HIDDEN 389 - - - - -/* Copy the first part of user declarations. */ -#line 14 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +#line 14 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1260,28 +1068,8 @@ } - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 938 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" -typedef union YYSTYPE { +#line 938 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +typedef union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -1327,1499 +1115,1068 @@ llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; } YYSTYPE; -/* Line 196 of yacc.c. */ -#line 1332 "llvmAsmParser.tab.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 219 of yacc.c. */ -#line 1344 "llvmAsmParser.tab.c" - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYINCLUDED_STDLIB_H -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) -# endif -# ifdef __cplusplus -extern "C" { -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifdef __cplusplus -} -# endif -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ +#include +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - }; -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) +#define YYFINAL 565 +#define YYFLAG -32768 +#define YYNTBASE 149 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 388 ? yytranslate[x] : 227) + +static const short yytranslate[] = { 0, + 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, 2, 2, 2, 2, 2, 139, + 140, 137, 2, 136, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 144, + 135, 145, 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, + 141, 138, 143, 2, 2, 2, 2, 2, 148, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 142, + 2, 2, 146, 2, 147, 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, 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, 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, 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, 1, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 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, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134 +}; -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, + 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, + 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, + 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, + 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, + 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, + 119, 122, 123, 125, 127, 130, 131, 133, 135, 137, + 139, 141, 143, 145, 147, 148, 150, 151, 153, 155, + 156, 158, 160, 162, 164, 165, 167, 169, 171, 173, + 175, 178, 180, 182, 184, 186, 187, 190, 192, 194, + 196, 197, 200, 201, 204, 205, 209, 212, 213, 215, + 216, 220, 222, 225, 227, 229, 231, 233, 235, 237, + 240, 242, 245, 251, 257, 263, 269, 273, 276, 282, + 287, 290, 292, 294, 296, 300, 302, 306, 308, 309, + 311, 315, 320, 324, 328, 333, 338, 342, 349, 355, + 358, 361, 364, 367, 370, 373, 376, 379, 382, 385, + 388, 391, 398, 404, 413, 420, 427, 435, 443, 450, + 459, 468, 472, 474, 476, 478, 480, 481, 483, 484, + 486, 489, 490, 494, 495, 499, 503, 507, 511, 512, + 520, 521, 530, 531, 540, 543, 547, 549, 553, 557, + 561, 565, 567, 568, 574, 578, 580, 584, 586, 587, + 597, 599, 601, 606, 608, 610, 613, 617, 618, 620, + 622, 624, 626, 628, 630, 632, 634, 636, 640, 642, + 648, 650, 652, 654, 656, 658, 660, 663, 666, 669, + 673, 676, 677, 679, 682, 685, 689, 699, 709, 718, + 733, 735, 737, 744, 750, 753, 760, 768, 772, 778, + 779, 780, 784, 787, 789, 795, 801, 808, 815, 820, + 827, 832, 837, 844, 851, 854, 863, 865, 867, 868, + 872, 879, 883, 890, 893, 899, 907 +}; -#endif +static const short yyrhs[] = { 68, + 0, 69, 0, 70, 0, 71, 0, 72, 0, 73, + 0, 74, 0, 75, 0, 76, 0, 80, 0, 81, + 0, 82, 0, 77, 0, 78, 0, 79, 0, 111, + 0, 112, 0, 113, 0, 114, 0, 115, 0, 116, + 0, 117, 0, 118, 0, 119, 0, 120, 0, 121, + 0, 122, 0, 85, 0, 86, 0, 87, 0, 88, + 0, 89, 0, 90, 0, 91, 0, 92, 0, 93, + 0, 94, 0, 95, 0, 96, 0, 97, 0, 98, + 0, 99, 0, 100, 0, 101, 0, 102, 0, 103, + 0, 104, 0, 91, 0, 92, 0, 93, 0, 94, + 0, 22, 0, 23, 0, 11, 0, 12, 0, 13, + 0, 16, 0, 19, 0, 156, 0, 0, 156, 135, + 0, 0, 17, 0, 20, 0, 159, 135, 0, 0, + 37, 0, 39, 0, 38, 0, 40, 0, 42, 0, + 41, 0, 43, 0, 45, 0, 0, 134, 0, 0, + 41, 0, 43, 0, 0, 37, 0, 38, 0, 39, + 0, 42, 0, 0, 56, 0, 57, 0, 58, 0, + 59, 0, 60, 0, 55, 4, 0, 112, 0, 113, + 0, 130, 0, 131, 0, 0, 168, 167, 0, 129, + 0, 132, 0, 167, 0, 0, 170, 169, 0, 0, + 48, 4, 0, 0, 136, 48, 4, 0, 30, 19, + 0, 0, 173, 0, 0, 136, 176, 175, 0, 173, + 0, 48, 4, 0, 11, 0, 12, 0, 13, 0, + 14, 0, 44, 0, 177, 0, 178, 137, 0, 211, + 0, 138, 4, 0, 178, 139, 182, 140, 170, 0, + 10, 139, 182, 140, 170, 0, 141, 4, 142, 178, + 143, 0, 144, 4, 142, 178, 145, 0, 146, 183, + 147, 0, 146, 147, 0, 144, 146, 183, 147, 145, + 0, 144, 146, 147, 145, 0, 178, 168, 0, 178, + 0, 10, 0, 179, 0, 181, 136, 179, 0, 181, + 0, 181, 136, 34, 0, 34, 0, 0, 178, 0, + 183, 136, 178, 0, 178, 141, 186, 143, 0, 178, + 141, 143, 0, 178, 148, 19, 0, 178, 144, 186, + 145, 0, 178, 146, 186, 147, 0, 178, 146, 147, + 0, 178, 144, 146, 186, 147, 145, 0, 178, 144, + 146, 147, 145, 0, 178, 35, 0, 178, 36, 0, + 178, 211, 0, 178, 185, 0, 178, 21, 0, 154, + 3, 0, 154, 5, 0, 154, 4, 0, 154, 6, + 0, 11, 22, 0, 11, 23, 0, 155, 9, 0, + 151, 139, 184, 33, 178, 140, 0, 110, 139, 184, + 222, 140, 0, 124, 139, 184, 136, 184, 136, 184, + 140, 0, 149, 139, 184, 136, 184, 140, 0, 150, + 139, 184, 136, 184, 140, 0, 83, 152, 139, 184, + 136, 184, 140, 0, 84, 153, 139, 184, 136, 184, + 140, 0, 126, 139, 184, 136, 184, 140, 0, 127, + 139, 184, 136, 184, 136, 184, 140, 0, 128, 139, + 184, 136, 184, 136, 184, 140, 0, 186, 136, 184, + 0, 184, 0, 28, 0, 29, 0, 32, 0, 0, + 190, 0, 0, 191, 0, 190, 191, 0, 0, 27, + 192, 207, 0, 0, 26, 193, 208, 0, 53, 52, + 197, 0, 158, 15, 178, 0, 158, 15, 10, 0, + 0, 160, 163, 188, 187, 184, 194, 175, 0, 0, + 160, 161, 163, 188, 187, 184, 195, 175, 0, 0, + 160, 162, 163, 188, 187, 178, 196, 175, 0, 46, + 198, 0, 49, 135, 199, 0, 19, 0, 47, 135, + 19, 0, 61, 135, 19, 0, 141, 200, 143, 0, + 200, 136, 19, 0, 19, 0, 0, 201, 136, 178, + 168, 157, 0, 178, 168, 157, 0, 201, 0, 201, + 136, 34, 0, 34, 0, 0, 166, 180, 159, 139, + 202, 140, 170, 174, 171, 0, 24, 0, 146, 0, + 165, 163, 203, 204, 0, 25, 0, 147, 0, 214, + 206, 0, 164, 163, 203, 0, 0, 54, 0, 3, + 0, 4, 0, 9, 0, 22, 0, 23, 0, 35, + 0, 36, 0, 21, 0, 144, 186, 145, 0, 185, + 0, 52, 209, 19, 136, 19, 0, 7, 0, 8, + 0, 156, 0, 159, 0, 211, 0, 210, 0, 178, + 212, 0, 214, 215, 0, 205, 215, 0, 216, 158, + 217, 0, 216, 219, 0, 0, 18, 0, 62, 213, + 0, 62, 10, 0, 63, 14, 212, 0, 63, 11, + 212, 136, 14, 212, 136, 14, 212, 0, 64, 154, + 212, 136, 14, 212, 141, 218, 143, 0, 64, 154, + 212, 136, 14, 212, 141, 143, 0, 65, 166, 180, + 212, 139, 221, 140, 170, 33, 14, 212, 66, 14, + 212, 0, 66, 0, 67, 0, 218, 154, 210, 136, + 14, 212, 0, 154, 210, 136, 14, 212, 0, 158, + 224, 0, 178, 141, 212, 136, 212, 143, 0, 220, + 136, 141, 212, 136, 212, 143, 0, 178, 212, 168, + 0, 221, 136, 178, 212, 168, 0, 0, 0, 222, + 136, 213, 0, 51, 50, 0, 50, 0, 149, 178, + 212, 136, 212, 0, 150, 178, 212, 136, 212, 0, + 83, 152, 178, 212, 136, 212, 0, 84, 153, 178, + 212, 136, 212, 0, 151, 213, 33, 178, 0, 124, + 213, 136, 213, 136, 213, 0, 125, 213, 136, 178, + 0, 126, 213, 136, 213, 0, 127, 213, 136, 213, + 136, 213, 0, 128, 213, 136, 213, 136, 213, 0, + 123, 220, 0, 223, 166, 180, 212, 139, 221, 140, + 170, 0, 226, 0, 31, 0, 0, 105, 178, 172, + 0, 105, 178, 136, 11, 212, 172, 0, 106, 178, + 172, 0, 106, 178, 136, 11, 212, 172, 0, 107, + 213, 0, 225, 108, 178, 212, 172, 0, 225, 109, + 213, 136, 178, 212, 172, 0, 110, 178, 212, 222, + 0 +}; -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; #endif -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 39 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1317 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 149 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 79 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 288 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 563 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 389 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 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, 2, 2, 2, 2, 2, - 139, 140, 137, 2, 136, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 144, 135, 145, 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, 141, 138, 143, 2, 2, 2, 2, 2, 148, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 142, 2, 2, 146, 2, 147, 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, - 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, 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, 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, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 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, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134 +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1094, + 1094, 1094, 1094, 1094, 1094, 1095, 1095, 1095, 1095, 1095, + 1095, 1095, 1096, 1096, 1096, 1096, 1096, 1099, 1099, 1100, + 1100, 1101, 1101, 1102, 1102, 1103, 1103, 1107, 1107, 1108, + 1108, 1109, 1109, 1110, 1110, 1111, 1111, 1112, 1112, 1113, + 1113, 1114, 1115, 1120, 1121, 1121, 1123, 1123, 1124, 1124, + 1128, 1132, 1137, 1137, 1139, 1143, 1149, 1150, 1151, 1152, + 1153, 1157, 1158, 1159, 1163, 1164, 1168, 1169, 1170, 1174, + 1175, 1176, 1177, 1178, 1181, 1181, 1182, 1183, 1184, 1185, + 1186, 1194, 1195, 1196, 1197, 1200, 1201, 1206, 1207, 1208, + 1211, 1212, 1219, 1219, 1226, 1226, 1235, 1243, 1243, 1249, + 1249, 1251, 1256, 1269, 1269, 1269, 1269, 1272, 1276, 1280, + 1287, 1292, 1300, 1326, 1353, 1358, 1370, 1380, 1384, 1394, + 1401, 1408, 1415, 1420, 1425, 1432, 1433, 1440, 1447, 1455, + 1461, 1473, 1501, 1517, 1546, 1574, 1599, 1618, 1644, 1664, + 1676, 1683, 1749, 1759, 1769, 1775, 1785, 1791, 1801, 1806, + 1811, 1819, 1831, 1853, 1861, 1867, 1878, 1883, 1888, 1894, + 1900, 1909, 1913, 1921, 1921, 1924, 1924, 1935, 1940, 1948, + 1949, 1953, 1953, 1957, 1957, 1960, 1963, 1987, 1998, 2005, + 2008, 2013, 2016, 2022, 2026, 2029, 2035, 2048, 2052, 2057, + 2059, 2064, 2069, 2078, 2088, 2099, 2103, 2112, 2121, 2126, + 2245, 2245, 2247, 2256, 2256, 2258, 2263, 2275, 2279, 2284, + 2288, 2292, 2296, 2300, 2304, 2308, 2312, 2316, 2341, 2345, + 2359, 2363, 2367, 2371, 2377, 2377, 2383, 2392, 2396, 2405, + 2414, 2423, 2427, 2432, 2436, 2440, 2445, 2455, 2474, 2483, + 2559, 2563, 2570, 2581, 2594, 2604, 2615, 2625, 2634, 2643, + 2646, 2647, 2654, 2658, 2663, 2684, 2701, 2715, 2729, 2741, + 2749, 2756, 2762, 2768, 2774, 2789, 2870, 2875, 2879, 2886, + 2893, 2901, 2908, 2916, 2924, 2938, 2955 }; +#endif -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned short int yyprhs[] = -{ - 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, - 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, - 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, - 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, - 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, - 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, - 119, 121, 122, 125, 126, 128, 130, 133, 134, 136, - 138, 140, 142, 144, 146, 148, 150, 151, 153, 154, - 156, 158, 159, 161, 163, 165, 167, 168, 170, 172, - 174, 176, 178, 181, 183, 185, 187, 189, 190, 193, - 195, 197, 199, 200, 203, 204, 207, 208, 212, 215, - 216, 218, 219, 223, 225, 228, 230, 232, 234, 236, - 238, 240, 243, 245, 248, 254, 260, 266, 272, 276, - 279, 285, 290, 293, 295, 297, 299, 303, 305, 309, - 311, 312, 314, 318, 323, 327, 331, 336, 341, 345, - 352, 358, 361, 364, 367, 370, 373, 376, 379, 382, - 385, 388, 391, 394, 401, 407, 416, 423, 430, 438, - 446, 453, 462, 471, 475, 477, 479, 481, 483, 484, - 486, 487, 489, 492, 493, 497, 498, 502, 506, 510, - 514, 515, 523, 524, 533, 534, 543, 546, 550, 552, - 556, 560, 564, 568, 570, 571, 577, 581, 583, 587, - 589, 590, 600, 602, 604, 609, 611, 613, 616, 620, - 621, 623, 625, 627, 629, 631, 633, 635, 637, 639, - 643, 645, 651, 653, 655, 657, 659, 661, 663, 666, - 669, 672, 676, 679, 680, 682, 685, 688, 692, 702, - 712, 721, 736, 738, 740, 747, 753, 756, 763, 771, - 775, 781, 782, 783, 787, 790, 792, 798, 804, 811, - 818, 823, 830, 835, 840, 847, 854, 857, 866, 868, - 870, 871, 875, 882, 886, 893, 896, 901, 908 -}; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short int yyrhs[] = -{ - 190, 0, -1, 68, -1, 69, -1, 70, -1, 71, - -1, 72, -1, 73, -1, 74, -1, 75, -1, 76, - -1, 80, -1, 81, -1, 82, -1, 77, -1, 78, - -1, 79, -1, 111, -1, 112, -1, 113, -1, 114, - -1, 115, -1, 116, -1, 117, -1, 118, -1, 119, - -1, 120, -1, 121, -1, 122, -1, 85, -1, 86, - -1, 87, -1, 88, -1, 89, -1, 90, -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, 91, -1, 92, - -1, 93, -1, 94, -1, 22, -1, 23, -1, 11, - -1, 12, -1, 13, -1, 16, -1, 19, -1, 157, - -1, -1, 157, 135, -1, -1, 17, -1, 20, -1, - 160, 135, -1, -1, 37, -1, 39, -1, 38, -1, - 40, -1, 42, -1, 41, -1, 43, -1, 45, -1, - -1, 134, -1, -1, 41, -1, 43, -1, -1, 37, - -1, 38, -1, 39, -1, 42, -1, -1, 56, -1, - 57, -1, 58, -1, 59, -1, 60, -1, 55, 4, - -1, 112, -1, 113, -1, 130, -1, 131, -1, -1, - 169, 168, -1, 129, -1, 132, -1, 168, -1, -1, - 171, 170, -1, -1, 48, 4, -1, -1, 136, 48, - 4, -1, 30, 19, -1, -1, 174, -1, -1, 136, - 177, 176, -1, 174, -1, 48, 4, -1, 11, -1, - 12, -1, 13, -1, 14, -1, 44, -1, 178, -1, - 179, 137, -1, 212, -1, 138, 4, -1, 179, 139, - 183, 140, 171, -1, 10, 139, 183, 140, 171, -1, - 141, 4, 142, 179, 143, -1, 144, 4, 142, 179, - 145, -1, 146, 184, 147, -1, 146, 147, -1, 144, - 146, 184, 147, 145, -1, 144, 146, 147, 145, -1, - 179, 169, -1, 179, -1, 10, -1, 180, -1, 182, - 136, 180, -1, 182, -1, 182, 136, 34, -1, 34, - -1, -1, 179, -1, 184, 136, 179, -1, 179, 141, - 187, 143, -1, 179, 141, 143, -1, 179, 148, 19, - -1, 179, 144, 187, 145, -1, 179, 146, 187, 147, - -1, 179, 146, 147, -1, 179, 144, 146, 187, 147, - 145, -1, 179, 144, 146, 147, 145, -1, 179, 35, - -1, 179, 36, -1, 179, 212, -1, 179, 186, -1, - 179, 21, -1, 155, 3, -1, 155, 5, -1, 155, - 4, -1, 155, 6, -1, 11, 22, -1, 11, 23, - -1, 156, 9, -1, 152, 139, 185, 33, 179, 140, - -1, 110, 139, 185, 223, 140, -1, 124, 139, 185, - 136, 185, 136, 185, 140, -1, 150, 139, 185, 136, - 185, 140, -1, 151, 139, 185, 136, 185, 140, -1, - 83, 153, 139, 185, 136, 185, 140, -1, 84, 154, - 139, 185, 136, 185, 140, -1, 126, 139, 185, 136, - 185, 140, -1, 127, 139, 185, 136, 185, 136, 185, - 140, -1, 128, 139, 185, 136, 185, 136, 185, 140, - -1, 187, 136, 185, -1, 185, -1, 28, -1, 29, - -1, 32, -1, -1, 191, -1, -1, 192, -1, 191, - 192, -1, -1, 27, 193, 208, -1, -1, 26, 194, - 209, -1, 53, 52, 198, -1, 159, 15, 179, -1, - 159, 15, 10, -1, -1, 161, 164, 189, 188, 185, - 195, 176, -1, -1, 161, 162, 164, 189, 188, 185, - 196, 176, -1, -1, 161, 163, 164, 189, 188, 179, - 197, 176, -1, 46, 199, -1, 49, 135, 200, -1, - 19, -1, 47, 135, 19, -1, 61, 135, 19, -1, - 141, 201, 143, -1, 201, 136, 19, -1, 19, -1, - -1, 202, 136, 179, 169, 158, -1, 179, 169, 158, - -1, 202, -1, 202, 136, 34, -1, 34, -1, -1, - 167, 181, 160, 139, 203, 140, 171, 175, 172, -1, - 24, -1, 146, -1, 166, 164, 204, 205, -1, 25, - -1, 147, -1, 215, 207, -1, 165, 164, 204, -1, - -1, 54, -1, 3, -1, 4, -1, 9, -1, 22, - -1, 23, -1, 35, -1, 36, -1, 21, -1, 144, - 187, 145, -1, 186, -1, 52, 210, 19, 136, 19, - -1, 7, -1, 8, -1, 157, -1, 160, -1, 212, - -1, 211, -1, 179, 213, -1, 215, 216, -1, 206, - 216, -1, 217, 159, 218, -1, 217, 220, -1, -1, - 18, -1, 62, 214, -1, 62, 10, -1, 63, 14, - 213, -1, 63, 11, 213, 136, 14, 213, 136, 14, - 213, -1, 64, 155, 213, 136, 14, 213, 141, 219, - 143, -1, 64, 155, 213, 136, 14, 213, 141, 143, - -1, 65, 167, 181, 213, 139, 222, 140, 171, 33, - 14, 213, 66, 14, 213, -1, 66, -1, 67, -1, - 219, 155, 211, 136, 14, 213, -1, 155, 211, 136, - 14, 213, -1, 159, 225, -1, 179, 141, 213, 136, - 213, 143, -1, 221, 136, 141, 213, 136, 213, 143, - -1, 179, 213, 169, -1, 222, 136, 179, 213, 169, - -1, -1, -1, 223, 136, 214, -1, 51, 50, -1, - 50, -1, 150, 179, 213, 136, 213, -1, 151, 179, - 213, 136, 213, -1, 83, 153, 179, 213, 136, 213, - -1, 84, 154, 179, 213, 136, 213, -1, 152, 214, - 33, 179, -1, 124, 214, 136, 214, 136, 214, -1, - 125, 214, 136, 179, -1, 126, 214, 136, 214, -1, - 127, 214, 136, 214, 136, 214, -1, 128, 214, 136, - 214, 136, 214, -1, 123, 221, -1, 224, 167, 181, - 213, 139, 222, 140, 171, -1, 227, -1, 31, -1, - -1, 105, 179, 173, -1, 105, 179, 136, 11, 213, - 173, -1, 106, 179, 173, -1, 106, 179, 136, 11, - 213, 173, -1, 107, 214, -1, 226, 108, 179, 213, - -1, 226, 109, 214, 136, 179, 213, -1, 110, 179, - 213, 223, -1 -}; +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = -{ - 0, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, - 1093, 1094, 1094, 1094, 1094, 1094, 1094, 1095, 1095, 1095, - 1095, 1095, 1095, 1096, 1096, 1096, 1096, 1096, 1096, 1099, - 1099, 1100, 1100, 1101, 1101, 1102, 1102, 1103, 1103, 1107, - 1107, 1108, 1108, 1109, 1109, 1110, 1110, 1111, 1111, 1112, - 1112, 1113, 1113, 1114, 1115, 1120, 1121, 1121, 1123, 1123, - 1124, 1124, 1128, 1132, 1137, 1137, 1139, 1143, 1149, 1150, - 1151, 1152, 1153, 1157, 1158, 1159, 1163, 1164, 1168, 1169, - 1170, 1174, 1175, 1176, 1177, 1178, 1181, 1182, 1183, 1184, - 1185, 1186, 1187, 1194, 1195, 1196, 1197, 1200, 1201, 1206, - 1207, 1208, 1211, 1212, 1219, 1220, 1226, 1227, 1235, 1243, - 1244, 1249, 1250, 1251, 1256, 1269, 1269, 1269, 1269, 1272, - 1276, 1280, 1287, 1292, 1300, 1326, 1353, 1358, 1370, 1380, - 1384, 1394, 1401, 1408, 1415, 1420, 1425, 1432, 1433, 1440, - 1447, 1455, 1461, 1473, 1501, 1517, 1546, 1574, 1599, 1618, - 1644, 1664, 1676, 1683, 1749, 1759, 1769, 1775, 1785, 1791, - 1801, 1806, 1811, 1819, 1831, 1853, 1861, 1867, 1878, 1883, - 1888, 1894, 1900, 1909, 1913, 1921, 1921, 1924, 1924, 1935, - 1940, 1948, 1949, 1953, 1953, 1957, 1957, 1960, 1963, 1987, - 1998, 1998, 2008, 2008, 2016, 2016, 2026, 2029, 2035, 2048, - 2052, 2057, 2059, 2064, 2069, 2078, 2088, 2099, 2103, 2112, - 2121, 2126, 2245, 2245, 2247, 2256, 2256, 2258, 2263, 2275, - 2279, 2284, 2288, 2292, 2296, 2300, 2304, 2308, 2312, 2316, - 2341, 2345, 2359, 2363, 2367, 2371, 2377, 2377, 2383, 2392, - 2396, 2405, 2414, 2423, 2427, 2432, 2436, 2440, 2445, 2455, - 2474, 2483, 2559, 2563, 2570, 2581, 2594, 2604, 2615, 2625, - 2634, 2643, 2646, 2647, 2654, 2658, 2663, 2684, 2701, 2715, - 2729, 2741, 2749, 2756, 2762, 2768, 2774, 2789, 2870, 2875, - 2879, 2886, 2893, 2901, 2908, 2916, 2924, 2938, 2955 +static const char * const yytname[] = { "$","error","$undefined.","ESINT64VAL", +"EUINT64VAL","ESAPINTVAL","EUAPINTVAL","LOCALVAL_ID","GLOBALVAL_ID","FPVAL", +"VOID","INTTYPE","FLOAT","DOUBLE","LABEL","TYPE","LOCALVAR","GLOBALVAR","LABELSTR", +"STRINGCONSTANT","ATSTRINGCONSTANT","ZEROINITIALIZER","TRUETOK","FALSETOK","BEGINTOK", +"ENDTOK","DECLARE","DEFINE","GLOBAL","CONSTANT","SECTION","VOLATILE","THREAD_LOCAL", +"TO","DOTDOTDOT","NULL_TOK","UNDEF","INTERNAL","LINKONCE","WEAK","APPENDING", +"DLLIMPORT","DLLEXPORT","EXTERN_WEAK","OPAQUE","EXTERNAL","TARGET","TRIPLE", +"ALIGN","DEPLIBS","CALL","TAIL","ASM_TOK","MODULE","SIDEEFFECT","CC_TOK","CCC_TOK", +"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","NORETURN","INREG","SRET","NOUNWIND", +"DEFAULT","HIDDEN","'='","','","'*'","'\\\\'","'('","')'","'['","'x'","']'", +"'<'","'>'","'{'","'}'","'c'","ArithmeticOps","LogicalOps","CastOps","IPredicates", +"FPredicates","IntType","FPType","LocalName","OptLocalName","OptLocalAssign", +"GlobalName","OptGlobalAssign","GVInternalLinkage","GVExternalLinkage","GVVisibilityStyle", +"FunctionDeclareLinkage","FunctionDefineLinkage","OptCallingConv","ParamAttr", +"OptParamAttrs","FuncAttr","OptFuncAttrs","OptAlign","OptCAlign","SectionString", +"OptSection","GlobalVarAttributes","GlobalVarAttribute","PrimType","Types","ArgType", +"ResultTypes","ArgTypeList","ArgTypeListI","TypeListI","ConstVal","ConstExpr", +"ConstVector","GlobalType","ThreadLocal","Module","DefinitionList","Definition", +"@1","@2","@3","@4","@5","AsmBlock","TargetDefinition","LibrariesDefinition", +"LibList","ArgListH","ArgList","FunctionHeaderH","BEGIN","FunctionHeader","END", +"Function","FunctionProto","OptSideEffect","ConstValueRef","SymbolicValueRef", +"ValueRef","ResolvedVal","BasicBlockList","BasicBlock","InstructionList","BBTerminatorInst", +"JumpTable","Inst","PHIList","ValueRefList","IndexList","OptTailCall","InstVal", +"OptVolatile","MemoryInst", NULL }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL", - "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE", - "FLOAT", "DOUBLE", "LABEL", "TYPE", "LOCALVAR", "GLOBALVAR", "LABELSTR", - "STRINGCONSTANT", "ATSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK", - "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL", - "CONSTANT", "SECTION", "VOLATILE", "THREAD_LOCAL", "TO", "DOTDOTDOT", - "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK", "APPENDING", - "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", "EXTERNAL", "TARGET", - "TRIPLE", "ALIGN", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE", - "SIDEEFFECT", "CC_TOK", "CCC_TOK", "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", "NORETURN", "INREG", "SRET", "NOUNWIND", "DEFAULT", - "HIDDEN", "'='", "','", "'*'", "'\\\\'", "'('", "')'", "'['", "'x'", - "']'", "'<'", "'>'", "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", - "LogicalOps", "CastOps", "IPredicates", "FPredicates", "IntType", - "FPType", "LocalName", "OptLocalName", "OptLocalAssign", "GlobalName", - "OptGlobalAssign", "GVInternalLinkage", "GVExternalLinkage", - "GVVisibilityStyle", "FunctionDeclareLinkage", "FunctionDefineLinkage", - "OptCallingConv", "ParamAttr", "OptParamAttrs", "FuncAttr", - "OptFuncAttrs", "OptAlign", "OptCAlign", "SectionString", "OptSection", - "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", "Types", - "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", "TypeListI", - "ConstVal", "ConstExpr", "ConstVector", "GlobalType", "ThreadLocal", - "Module", "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", - "AsmBlock", "TargetDefinition", "LibrariesDefinition", "LibList", - "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", - "END", "Function", "FunctionProto", "OptSideEffect", "ConstValueRef", - "SymbolicValueRef", "ValueRef", "ResolvedVal", "BasicBlockList", - "BasicBlock", "InstructionList", "BBTerminatorInst", "JumpTable", "Inst", - "PHIList", "ValueRefList", "IndexList", "OptTailCall", "InstVal", - "OptVolatile", "MemoryInst", 0 +static const short yyr1[] = { 0, + 149, 149, 149, 149, 149, 149, 149, 149, 149, 150, + 150, 150, 150, 150, 150, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 152, 152, 152, + 152, 152, 152, 152, 152, 152, 152, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 154, 155, 155, 156, 156, 157, 157, + 158, 158, 159, 159, 160, 160, 161, 161, 161, 161, + 161, 162, 162, 162, 163, 163, 164, 164, 164, 165, + 165, 165, 165, 165, 166, 166, 166, 166, 166, 166, + 166, 167, 167, 167, 167, 168, 168, 169, 169, 169, + 170, 170, 171, 171, 172, 172, 173, 174, 174, 175, + 175, 176, 176, 177, 177, 177, 177, 178, 178, 178, + 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, + 179, 180, 180, 181, 181, 182, 182, 182, 182, 183, + 183, 184, 184, 184, 184, 184, 184, 184, 184, 184, + 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, + 184, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, + 190, 192, 191, 193, 191, 191, 191, 191, 194, 191, + 195, 191, 196, 191, 191, 191, 197, 198, 198, 199, + 200, 200, 200, 201, 201, 202, 202, 202, 202, 203, + 204, 204, 205, 206, 206, 207, 208, 209, 209, 210, + 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, + 211, 211, 211, 211, 212, 212, 213, 214, 214, 215, + 216, 216, 216, 217, 217, 217, 217, 217, 217, 217, + 217, 217, 218, 218, 219, 220, 220, 221, 221, 221, + 222, 222, 223, 223, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 225, 225, 226, + 226, 226, 226, 226, 226, 226, 226 }; -#endif -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 61, 44, 42, 92, 40, - 41, 91, 120, 93, 60, 62, 123, 125, 99 +static const short yyr2[] = { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 2, 0, 1, 1, 2, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, + 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 2, 1, 1, 1, 1, 0, 2, 1, 1, 1, + 0, 2, 0, 2, 0, 3, 2, 0, 1, 0, + 3, 1, 2, 1, 1, 1, 1, 1, 1, 2, + 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, 6, 8, + 8, 3, 1, 1, 1, 1, 0, 1, 0, 1, + 2, 0, 3, 0, 3, 3, 3, 3, 0, 7, + 0, 8, 0, 8, 2, 3, 1, 3, 3, 3, + 3, 1, 0, 5, 3, 1, 3, 1, 0, 9, + 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, 2, 2, 3, + 2, 0, 1, 2, 2, 3, 9, 9, 8, 14, + 1, 1, 6, 5, 2, 6, 7, 3, 5, 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, 4 }; -# endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 149, 150, 150, 150, 150, 150, 150, 150, 150, - 150, 151, 151, 151, 151, 151, 151, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 153, - 153, 153, 153, 153, 153, 153, 153, 153, 153, 154, - 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, - 154, 154, 154, 154, 154, 155, 156, 156, 157, 157, - 158, 158, 159, 159, 160, 160, 161, 161, 162, 162, - 162, 162, 162, 163, 163, 163, 164, 164, 165, 165, - 165, 166, 166, 166, 166, 166, 167, 167, 167, 167, - 167, 167, 167, 168, 168, 168, 168, 169, 169, 170, - 170, 170, 171, 171, 172, 172, 173, 173, 174, 175, - 175, 176, 176, 177, 177, 178, 178, 178, 178, 179, - 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, - 179, 179, 180, 181, 181, 182, 182, 183, 183, 183, - 183, 184, 184, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 187, 187, 188, 188, 189, 189, 190, - 190, 191, 191, 193, 192, 194, 192, 192, 192, 192, - 195, 192, 196, 192, 197, 192, 192, 192, 198, 199, - 199, 200, 201, 201, 201, 202, 202, 203, 203, 203, - 203, 204, 205, 205, 206, 207, 207, 208, 209, 210, - 210, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 212, 212, 212, 212, 213, 213, 214, 215, - 215, 216, 217, 217, 217, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 219, 219, 220, 221, 221, 222, - 222, 222, 223, 223, 224, 224, 225, 225, 225, 225, - 225, 225, 225, 225, 225, 225, 225, 225, 225, 226, - 226, 227, 227, 227, 227, 227, 227, 227, 227 +static const short yydefact[] = { 66, + 57, 63, 58, 64, 184, 182, 0, 0, 0, 0, + 0, 0, 75, 66, 180, 77, 80, 0, 0, 195, + 0, 0, 61, 0, 65, 67, 69, 68, 70, 72, + 71, 73, 74, 76, 75, 75, 177, 181, 78, 79, + 75, 185, 81, 82, 83, 84, 75, 242, 183, 242, + 0, 0, 203, 196, 197, 186, 231, 232, 188, 114, + 115, 116, 117, 118, 0, 0, 0, 0, 233, 234, + 119, 187, 121, 177, 177, 176, 0, 85, 85, 243, + 239, 62, 214, 215, 216, 238, 198, 199, 202, 0, + 139, 122, 0, 0, 0, 0, 128, 140, 0, 120, + 139, 0, 0, 174, 175, 0, 0, 86, 87, 88, + 89, 90, 0, 217, 0, 279, 241, 0, 200, 138, + 96, 134, 136, 0, 0, 0, 0, 0, 0, 127, + 0, 0, 0, 114, 115, 116, 0, 0, 0, 189, + 91, 133, 132, 0, 211, 212, 213, 278, 264, 0, + 0, 0, 0, 85, 251, 252, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 13, 14, 15, 10, 11, + 12, 0, 0, 0, 0, 0, 0, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 240, 85, + 255, 0, 277, 201, 131, 0, 101, 0, 0, 130, + 0, 141, 101, 191, 193, 159, 160, 155, 157, 156, + 158, 161, 154, 150, 151, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 153, + 152, 110, 0, 263, 245, 0, 244, 0, 0, 54, + 0, 0, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 0, 52, 53, 48, 49, 50, 51, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 0, + 105, 105, 284, 0, 0, 275, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 92, 93, 94, + 95, 97, 137, 135, 124, 125, 126, 129, 123, 110, + 110, 0, 0, 0, 0, 0, 0, 0, 143, 173, + 0, 0, 0, 147, 0, 144, 0, 0, 0, 0, + 190, 209, 220, 221, 222, 227, 223, 224, 225, 226, + 218, 0, 229, 236, 235, 237, 0, 246, 0, 0, + 0, 0, 0, 280, 0, 282, 261, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 98, 99, 100, 102, 192, 194, 0, 0, 261, 0, + 0, 0, 0, 0, 142, 128, 140, 0, 145, 146, + 0, 0, 0, 0, 0, 112, 110, 208, 96, 206, + 0, 219, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 287, 0, 0, 0, 271, 272, 0, 0, + 0, 0, 269, 0, 105, 0, 0, 0, 0, 0, + 0, 0, 0, 172, 149, 0, 0, 0, 0, 107, + 113, 111, 60, 0, 101, 0, 228, 0, 0, 260, + 0, 0, 105, 106, 105, 0, 0, 0, 0, 0, + 0, 265, 266, 260, 0, 285, 0, 0, 0, 163, + 0, 0, 0, 0, 148, 0, 0, 0, 59, 205, + 207, 96, 108, 0, 0, 0, 0, 0, 267, 268, + 281, 283, 262, 0, 0, 270, 273, 274, 0, 105, + 0, 0, 0, 169, 0, 0, 165, 166, 162, 60, + 109, 103, 230, 0, 0, 96, 0, 101, 256, 0, + 101, 286, 167, 168, 0, 0, 0, 204, 0, 210, + 0, 249, 0, 0, 258, 0, 0, 257, 276, 164, + 170, 171, 104, 247, 0, 248, 0, 96, 0, 0, + 0, 259, 0, 0, 0, 0, 254, 0, 0, 253, + 0, 250, 0, 0, 0 }; -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 0, 2, 0, 1, 1, 2, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, - 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, - 1, 1, 2, 1, 1, 1, 1, 0, 2, 1, - 1, 1, 0, 2, 0, 2, 0, 3, 2, 0, - 1, 0, 3, 1, 2, 1, 1, 1, 1, 1, - 1, 2, 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, - 6, 8, 8, 3, 1, 1, 1, 1, 0, 1, - 0, 1, 2, 0, 3, 0, 3, 3, 3, 3, - 0, 7, 0, 8, 0, 8, 2, 3, 1, 3, - 3, 3, 3, 1, 0, 5, 3, 1, 3, 1, - 0, 9, 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, 2, - 2, 3, 2, 0, 1, 2, 2, 3, 9, 9, - 8, 14, 1, 1, 6, 5, 2, 6, 7, 3, - 5, 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, 4, 6, 4 +static const short yydefgoto[] = { 237, + 238, 239, 263, 280, 137, 138, 69, 480, 11, 70, + 13, 35, 36, 37, 41, 47, 113, 302, 205, 374, + 305, 530, 354, 396, 512, 331, 397, 71, 139, 122, + 144, 123, 124, 99, 320, 343, 321, 106, 77, 563, + 14, 15, 17, 16, 242, 310, 311, 56, 20, 54, + 90, 400, 401, 114, 147, 48, 85, 49, 42, 403, + 344, 73, 346, 247, 50, 81, 82, 199, 534, 117, + 286, 488, 413, 200, 201, 202, 203 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned short int yydefact[] = -{ - 67, 58, 64, 59, 65, 185, 183, 0, 0, 0, - 0, 0, 0, 76, 0, 67, 181, 78, 81, 0, - 0, 196, 0, 0, 62, 0, 66, 68, 70, 69, - 71, 73, 72, 74, 75, 77, 76, 76, 178, 1, - 182, 79, 80, 76, 186, 82, 83, 84, 85, 76, - 243, 184, 243, 0, 0, 204, 197, 198, 187, 232, - 233, 189, 115, 116, 117, 118, 119, 0, 0, 0, - 0, 234, 235, 120, 188, 122, 178, 178, 177, 0, - 86, 86, 244, 240, 63, 215, 216, 217, 239, 199, - 200, 203, 0, 140, 123, 0, 0, 0, 0, 129, - 141, 0, 121, 140, 0, 0, 175, 176, 0, 0, - 87, 88, 89, 90, 91, 0, 218, 0, 280, 242, - 0, 201, 139, 97, 135, 137, 0, 0, 0, 0, - 0, 0, 128, 0, 0, 0, 115, 116, 117, 0, - 0, 0, 190, 92, 134, 133, 0, 212, 213, 214, - 279, 265, 0, 0, 0, 0, 86, 252, 253, 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, 241, 86, 256, 0, 278, 202, 132, 0, 102, - 0, 0, 131, 0, 142, 102, 192, 194, 160, 161, - 156, 158, 157, 159, 162, 155, 151, 152, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 154, 153, 111, 0, 264, 246, 0, 245, - 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, 106, 106, 285, 0, 0, 276, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 93, 94, 95, 96, 98, 138, 136, 125, 126, 127, - 130, 124, 111, 111, 0, 0, 0, 0, 0, 0, - 0, 144, 174, 0, 0, 0, 148, 0, 145, 0, - 0, 0, 0, 191, 210, 221, 222, 223, 228, 224, - 225, 226, 227, 219, 0, 230, 237, 236, 238, 0, - 247, 0, 0, 0, 0, 0, 281, 0, 283, 262, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 99, 100, 101, 103, 193, 195, 0, - 0, 262, 0, 0, 0, 0, 0, 143, 129, 141, - 0, 146, 147, 0, 0, 0, 0, 0, 113, 111, - 209, 97, 207, 0, 220, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 288, 0, 0, 0, 272, - 273, 0, 0, 0, 0, 270, 0, 286, 0, 0, - 0, 0, 0, 0, 0, 0, 173, 150, 0, 0, - 0, 0, 108, 114, 112, 61, 0, 102, 0, 229, - 0, 0, 261, 0, 0, 106, 107, 106, 0, 0, - 0, 0, 0, 0, 266, 267, 261, 0, 0, 0, - 164, 0, 0, 0, 0, 149, 0, 0, 0, 60, - 206, 208, 97, 109, 0, 0, 0, 0, 0, 268, - 269, 0, 282, 284, 263, 0, 0, 271, 274, 275, - 0, 287, 0, 0, 0, 170, 0, 0, 166, 167, - 163, 61, 110, 104, 231, 0, 0, 97, 0, 102, - 257, 0, 102, 168, 169, 0, 0, 0, 205, 0, - 211, 0, 250, 0, 0, 259, 0, 0, 258, 277, - 165, 171, 172, 105, 248, 0, 249, 0, 97, 0, - 0, 0, 260, 0, 0, 0, 0, 255, 0, 0, - 254, 0, 251 +static const short yypact[] = { 593, +-32768,-32768,-32768,-32768,-32768,-32768, -1, -87, 11, -41, + 89, -13, 46, 1408,-32768, 185, 82, 13, 55,-32768, + 81, 211,-32768, 1122,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768, 98, 98, 206,-32768,-32768,-32768, + 98,-32768,-32768,-32768,-32768,-32768, 98, 235,-32768, 8, + 242, 251, 252,-32768,-32768,-32768,-32768,-32768, 128,-32768, +-32768,-32768,-32768,-32768, 272, 274, 4, 122,-32768,-32768, +-32768, 61,-32768, 206, 206,-32768, 183, 290, 290,-32768, +-32768, 121,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -92, + 979,-32768, 137, 139, 284, 128,-32768, 61, -70,-32768, + 979, 183, 183,-32768,-32768, 1136, 278,-32768,-32768,-32768, +-32768,-32768, 1178,-32768, -15, 1277,-32768, 264,-32768,-32768, + 61,-32768, 148, 153, 1192, 1192, 160, -66, 1192,-32768, + 162, 1136, 1192, 32, 297, 298, 215, 301, 761,-32768, +-32768, 128, 61, 145,-32768,-32768,-32768,-32768,-32768, 262, + 1234, 248, 304, 290,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, 157, 422, 1192, 1192, 1192, 1192,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1192, + 1192, 1192, 1192, 1192, 1192, 1192, 1192, 1192,-32768, 290, +-32768, -34,-32768,-32768, -33, 1019,-32768, 71, -22,-32768, + 173, 61,-32768,-32768, 61,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768, 157, 422, 180, 181, 182, + 184, 186, 1038, 1276, 448, 305, 187, 188, 191,-32768, +-32768, 193, 192,-32768, 128, 614,-32768, 740, 740,-32768, + 740, 1178,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768, 1192,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1192, + 88, 119,-32768, 614, 62, 197, 198, 199, 200, 207, + 217, 614, 614, 309, 1178, 1192, 1192,-32768,-32768,-32768, +-32768,-32768,-32768,-32768, -73,-32768,-32768,-32768, -73, 193, + 193, 212, 216, 1136, 1136, 1136, 1136, 1136,-32768,-32768, + -44, 933, -69,-32768, -40,-32768, 1136, 1136, 1136, -5, +-32768, 1077,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, + 300, 1136,-32768,-32768,-32768,-32768, 220,-32768, 221, 740, + 614, 614, 17,-32768, 23,-32768,-32768, 740, 218, 1192, + 1192, 1192, 1192, 1192, 222, 225, 1192, 740, 614, 226, +-32768,-32768,-32768,-32768,-32768,-32768, 1136, 1136,-32768, 227, + 229, 230, 231, 1136,-32768, 228, 761, -35,-32768,-32768, + 234, 236, 341, 356, 372,-32768, 193,-32768, 61, 241, + 238,-32768, 360, -36, 366, 367, 243, 253, 254, 740, + 387, 740, 256, 257, 740, 258, 61,-32768, 259, 266, + 740, 740, 61, 261, 269, 1192, 270, 271, -67, 1136, + 1136, 1136, 1136,-32768,-32768, 263, 1136, 1136, 1192,-32768, +-32768,-32768, 33, 1093,-32768, 273,-32768, 740, 740, 1192, + 740, 740, 269,-32768, 269, 1192, 740, 275, 1192, 1192, + 1192,-32768,-32768, 1192, 362,-32768, 614, 1136, 1136,-32768, + 279, 277, 288, 293,-32768, 280, 292, 42,-32768,-32768, +-32768, 61, 65, 395, 299, 308, 614, 7,-32768,-32768, +-32768,-32768,-32768, 291, 740,-32768,-32768,-32768, 73, 269, + 302, 306, 1136,-32768, 1136, 1136,-32768,-32768,-32768, 33, +-32768, 391,-32768, 426, 1,-32768, 1192,-32768,-32768, 307, +-32768,-32768,-32768,-32768, 311, 312, 313,-32768, 453,-32768, + 740,-32768, 890, 18, -33, 614, 75,-32768, -73,-32768, +-32768,-32768,-32768,-32768, 327,-32768, 890,-32768, 452, 455, + 337, -33, 740, 740, 460, 409,-32768, 740, 462,-32768, + 740,-32768, 477, 479,-32768 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const short int yydefgoto[] = -{ - -1, 239, 240, 241, 265, 282, 139, 140, 71, 480, - 11, 72, 13, 36, 37, 38, 43, 49, 115, 304, - 207, 376, 307, 530, 356, 398, 513, 333, 399, 73, - 141, 124, 146, 125, 126, 101, 322, 345, 323, 108, - 79, 14, 15, 16, 18, 17, 244, 312, 313, 58, - 21, 56, 92, 402, 403, 116, 149, 50, 87, 51, - 44, 405, 346, 75, 348, 249, 52, 83, 84, 201, - 534, 119, 288, 488, 415, 202, 203, 204, 205 +static const short yypgoto[] = { 364, + 365, 368, 260, 255, -151,-32768, 0, -27, 403, 16, +-32768,-32768,-32768, 6,-32768,-32768, -139, -298, -389,-32768, + -210,-32768, -269, 10,-32768, -279,-32768,-32768, -23, 281, + -233,-32768, 389, 396, 70, -133, -217, 134, 190,-32768, +-32768, 481,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768, 417,-32768,-32768,-32768,-32768,-32768,-32768, + -483, -135, 120, -171,-32768, 447,-32768,-32768,-32768,-32768, +-32768, 34, 125,-32768,-32768,-32768,-32768 }; -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -476 -static const short int yypact[] = -{ - 28, -476, -476, -476, -476, -476, -476, -10, -55, 8, - -33, 97, 3, 55, 167, 394, -476, 172, 210, 86, - 98, -476, 102, 219, -476, 1017, -476, -476, -476, -476, - -476, -476, -476, -476, -476, -476, 123, 123, 218, -476, - -476, -476, -476, 123, -476, -476, -476, -476, -476, 123, - 241, -476, 2, 242, 251, 253, -476, -476, -476, -476, - -476, 137, -476, -476, -476, -476, -476, 274, 283, 1, - 456, -476, -476, -476, 83, -476, 218, 218, -476, 103, - 291, 291, -476, -476, 121, -476, -476, -476, -476, -476, - -476, -476, -26, 874, -476, 148, 149, 470, 137, -476, - 83, -97, -476, 874, 103, 103, -476, -476, 1031, 288, - -476, -476, -476, -476, -476, 1073, -476, -7, 1172, -476, - 282, -476, -476, 83, -476, 157, 162, 1087, 1087, 158, - -61, 1087, -476, 165, 1031, 1087, 60, 297, 298, 201, - 299, 656, -476, -476, 137, 83, 217, -476, -476, -476, - -476, -476, 262, 1129, 257, 302, 291, -476, -476, -476, - -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, - -476, -476, -476, -476, 461, 273, 1087, 1087, 1087, 1087, - -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, - -476, -476, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, - 1087, -476, 291, -476, 74, -476, -476, -25, 914, -476, - 19, 41, -476, 175, 83, -476, -476, 83, -476, -476, - -476, -476, -476, -476, -476, -476, -476, -476, 461, 273, - 178, 182, 183, 184, 186, 933, 1171, 552, 309, 190, - 191, 194, -476, -476, 199, 197, -476, 137, 509, -476, - 635, 635, -476, 635, 1073, -476, -476, -476, -476, -476, - -476, -476, -476, -476, -476, 1087, -476, -476, -476, -476, - -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, - -476, -476, 1087, -17, 92, -476, 509, 75, 207, 208, - 220, 221, 222, 223, 509, 509, 304, 1073, 1087, 1087, - -476, -476, -476, -476, -476, -476, -476, 154, -476, -476, - -476, 154, 199, 199, 214, 215, 1031, 1031, 1031, 1031, - 1031, -476, -476, -22, 828, -75, -476, -58, -476, 1031, - 1031, 1031, 5, -476, 972, -476, -476, -476, -476, -476, - -476, -476, -476, 301, 1031, -476, -476, -476, -476, 224, - -476, 226, 635, 509, 509, 14, -476, 23, -476, -476, - 635, 237, 1087, 1087, 1087, 1087, 1087, 243, 244, 1087, - 635, 509, 246, -476, -476, -476, -476, -476, -476, 1031, - 1031, -476, 247, 248, 254, 255, 1031, -476, 250, 656, - -46, -476, -476, 256, 261, 360, 383, 399, -476, 199, - -476, 83, 269, 266, -476, 388, -60, 398, 401, 277, - 272, 289, 635, 420, 635, 293, 294, 635, 295, 83, - -476, 296, 300, 635, 635, 83, 305, -476, 1087, 310, - 314, -98, 1031, 1031, 1031, 1031, -476, -476, 290, 1031, - 1031, 1087, -476, -476, -476, 33, 988, -476, 315, -476, - 635, 635, 1087, 635, 635, 316, -476, 316, 1087, 635, - 317, 1087, 1087, 1087, -476, -476, 1087, 509, 1031, 1031, - -476, 318, 287, 320, 321, -476, 319, 322, 116, -476, - -476, -476, 83, 79, 414, 324, 330, 509, 21, -476, - -476, 393, -476, -476, -476, 331, 635, -476, -476, -476, - 59, -476, 325, 339, 1031, -476, 1031, 1031, -476, -476, - -476, 33, -476, 410, -476, 447, -2, -476, 1087, -476, - -476, 342, -476, -476, -476, 348, 351, 352, -476, 489, - -476, 635, -476, 785, -1, -25, 509, 133, -476, 154, - -476, -476, -476, -476, -476, 359, -476, 785, -476, 482, - 483, 362, -25, 635, 635, 485, 439, -476, 635, 492, - -476, 635, -476 -}; -/* YYPGOTO[NTERM-NUM]. */ -static const short int yypgoto[] = -{ - -476, 389, 392, 397, 292, 306, -153, -476, 0, 10, - 435, 4, -476, -476, -476, 87, -476, -476, -145, -295, - -383, -476, -208, -476, -276, 39, -476, -291, -476, -476, - -24, 326, -241, -476, 421, 426, 69, -138, -196, 89, - 204, -476, -476, 512, -476, -476, -476, -476, -476, -476, - -476, -476, -476, -476, -476, 452, -476, -476, -476, -476, - -476, -476, -475, -135, -227, -164, -476, 484, -476, -476, - -476, -476, -476, 73, 159, -476, -476, -476, -476 -}; +#define YYLAST 1461 -/* 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 -181 -static const short int yytable[] = -{ - 10, 74, 253, 242, 12, 96, 243, 311, 358, 252, - 252, 254, 375, 352, 285, 10, 375, 147, 445, 12, - 82, 377, 378, 349, 350, 412, 351, 85, -180, 289, - 290, 291, 292, 293, 414, 396, 296, 19, 458, 131, - 325, 327, 470, -63, 1, 2, 100, 3, 4, 1, - 132, 20, 3, 397, 5, 6, 370, 297, 545, 359, - 23, 386, 413, -55, -55, -55, -55, 367, 368, 123, - 391, 413, 551, 100, 7, 131, 386, 8, 386, 123, - 22, 9, 218, 219, 10, 449, 213, 300, 301, 392, - 386, 145, 27, 28, 29, 30, 31, 32, 33, 511, - 34, 438, 24, 210, 211, 302, 303, 214, 444, 396, - 120, 217, 25, 347, 386, 347, 347, 121, 347, 355, - 102, 387, 103, 76, 77, 409, 410, 411, 390, 248, - 80, 106, 107, 416, 535, 372, 81, 1, 26, 148, - 3, 532, 546, 426, 427, 300, 301, 97, 406, 86, - 245, 347, 283, 284, 248, 286, 102, 518, 103, 347, - 347, 519, 308, 302, 303, 552, 549, 39, 287, 248, - 248, 248, 248, 248, 294, 295, 248, 142, 102, 492, - 103, 493, 298, 299, 123, 455, 309, 457, 375, 35, - 460, 300, 301, 134, 135, 518, 464, 465, 418, 522, - 420, 421, 422, 216, 220, 221, 222, 223, 373, 302, - 303, 374, 102, 41, 103, 42, 360, 347, 347, 347, - 102, 53, 103, 485, 486, 347, 489, 490, 357, 102, - 145, 103, 495, 54, 2, 347, 347, 4, 57, 483, - 501, 353, 375, 55, 375, 300, 301, 45, 46, 47, - 78, 242, 48, 102, 243, 103, 510, 35, 354, 82, - 517, 89, 373, 302, 303, 374, 300, 301, 250, 521, - 90, 251, 91, 145, 371, 248, 93, 347, 94, 347, - 104, 105, 347, 373, 302, 303, 374, 95, 347, 347, - 127, 128, 143, 208, 494, 266, 267, 497, 498, 499, - 389, 206, 209, 212, 544, 215, -56, -57, 224, 548, - 401, 537, 246, 252, 539, 347, 347, 316, 347, 347, - 310, 317, 318, 319, 347, 320, 556, 557, 328, 329, - 330, 560, 347, 331, 562, 332, 334, 369, 248, 419, - 248, 248, 248, 361, 362, 425, 109, 110, 111, 112, - 113, 114, 347, 379, 380, 404, 363, 364, 365, 366, - 407, 347, 408, 533, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 417, 423, - 424, 547, 428, 432, 433, 381, 382, 383, 384, 385, - 434, 435, 439, 441, -179, 437, 347, 440, 393, 394, - 395, 347, 442, 443, 467, 446, 447, 448, 453, -63, - 1, 2, 450, 3, 4, 451, 452, 478, 347, 347, - 5, 6, 482, 347, 456, 454, 347, 505, 487, 458, - 459, 461, 462, 514, 248, 475, 463, 248, 248, 248, - 7, 413, 487, 8, 466, 479, 468, 9, 429, 430, - 469, 484, 491, 496, 504, 436, 506, 507, 529, 508, - 515, 531, 509, 59, 60, 523, 98, 62, 63, 64, - 65, 516, 1, 2, 520, 3, 4, 59, 60, 524, - 98, 62, 63, 64, 65, 538, 1, 2, 540, 3, - 4, 541, 542, 543, 536, 550, 553, 554, 555, 558, - 66, 471, 472, 473, 474, 559, 561, 198, 476, 477, - 199, 479, 335, 336, 66, 200, 59, 60, 337, 118, - 314, 528, 512, 130, 133, 1, 2, 40, 3, 4, - 338, 339, 340, 117, 306, 315, 88, 502, 503, 500, - 431, 0, 0, 0, 341, 342, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 0, 0, 0, 59, - 60, 343, 98, 136, 137, 138, 65, 0, 1, 2, - 0, 3, 4, 525, 0, 526, 527, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 228, 229, 67, 0, 66, 68, 0, 0, - 69, 0, 70, 99, 0, 0, 0, 0, 67, 0, - 0, 68, 0, 0, 69, 0, 70, 129, 0, 230, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 0, 231, 0, 232, 233, 234, 335, 336, - 0, 0, 59, 60, 337, 0, 102, 0, 103, 0, - 0, 1, 2, 344, 3, 4, 338, 339, 340, 0, - 0, 0, 0, 59, 60, 0, 0, 0, 0, 0, - 341, 342, 1, 2, 0, 3, 4, 225, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 343, 0, 0, - 67, 226, 227, 68, 0, 0, 69, 0, 70, 326, - 0, 0, 0, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 228, 229, - 0, 0, 0, 0, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 228, - 229, 0, 0, 0, 0, 230, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 0, 231, - 0, 232, 233, 234, 0, 0, 230, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 344, - 231, 0, 232, 233, 234, 0, 0, 0, 335, 336, - 0, 0, 0, 102, 337, 103, 0, 235, 0, 0, - 236, 0, 237, 0, 238, 0, 338, 339, 340, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 341, 342, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 59, 60, 343, 98, 136, - 137, 138, 65, 0, 1, 2, 0, 3, 4, 0, - 0, 0, 0, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 228, 229, - 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, - 0, 59, 60, 0, 98, 62, 63, 64, 65, 0, - 1, 2, 0, 3, 4, 230, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 122, 231, - 0, 232, 233, 234, 0, 0, 0, 0, 66, 0, - 0, 59, 60, 0, 98, 62, 63, 64, 65, 344, - 1, 2, 0, 3, 4, 0, 0, 0, 0, 0, - 59, 60, 0, 98, 136, 137, 138, 65, 305, 1, - 2, 0, 3, 4, 0, 0, 0, 0, 66, 0, - 0, 0, 0, 0, 0, 0, 67, 0, 0, 68, - 0, 0, 69, 0, 70, 388, 0, 66, 0, 59, - 60, 0, 98, 62, 63, 64, 65, 0, 1, 2, - 0, 3, 4, 0, 0, 59, 60, 0, 98, 62, - 63, 64, 65, 0, 1, 2, 400, 3, 4, 0, - 0, 0, 67, 0, 0, 68, 66, 0, 69, 0, - 70, 0, 481, 0, 59, 60, 0, 61, 62, 63, - 64, 65, 66, 1, 2, 0, 3, 4, 59, 60, - 0, 98, 136, 137, 138, 65, 0, 1, 2, 0, - 3, 4, 67, 0, 0, 68, 0, 0, 69, 0, - 70, 66, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 67, 0, 0, 68, 66, 321, 69, 0, 70, - 59, 60, 0, 144, 62, 63, 64, 65, 0, 1, - 2, 0, 3, 4, 59, 60, 0, 98, 62, 63, - 64, 65, 0, 1, 2, 0, 3, 4, 0, 0, - 67, 0, 0, 68, 0, 0, 69, 66, 70, 0, - 0, 0, 0, 0, 0, 0, 67, 0, 0, 68, - 0, 66, 69, 0, 70, 0, 59, 60, 0, 247, - 62, 63, 64, 65, 0, 1, 2, 0, 3, 4, - 0, 0, 0, 0, 0, 67, 0, 0, 68, 0, - 0, 69, 0, 70, 0, 0, 0, 0, 0, 67, - 0, 0, 68, 66, 0, 69, 0, 70, 59, 60, - 0, 98, 136, 137, 138, 65, 0, 1, 2, 0, - 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 150, 0, 0, 0, 0, 0, 0, - 0, 67, 0, 0, 68, 66, 0, 69, 0, 70, - 0, 0, 151, 152, 0, 67, 0, 0, 68, 0, - 0, 69, 0, 70, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, - 68, 0, 0, 69, 0, 70, 0, 176, 177, 178, - 0, 0, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 0, 0, 0, 0, 0, 0, 0, 0, 67, - 0, 0, 68, 0, 0, 69, 0, 324 -}; -static const short int yycheck[] = -{ - 0, 25, 155, 141, 0, 4, 141, 215, 284, 11, - 11, 156, 307, 254, 178, 15, 311, 24, 401, 15, - 18, 312, 313, 250, 251, 11, 253, 25, 0, 193, - 194, 195, 196, 197, 11, 30, 200, 47, 136, 136, - 236, 237, 140, 15, 16, 17, 70, 19, 20, 16, - 147, 61, 19, 48, 26, 27, 297, 202, 533, 286, - 52, 136, 48, 3, 4, 5, 6, 294, 295, 93, - 145, 48, 547, 97, 46, 136, 136, 49, 136, 103, - 135, 53, 22, 23, 84, 145, 147, 112, 113, 147, - 136, 115, 37, 38, 39, 40, 41, 42, 43, 482, - 45, 147, 135, 127, 128, 130, 131, 131, 399, 30, - 136, 135, 15, 248, 136, 250, 251, 143, 253, 136, - 137, 143, 139, 36, 37, 352, 353, 354, 324, 153, - 43, 28, 29, 360, 517, 299, 49, 16, 135, 146, - 19, 143, 143, 370, 371, 112, 113, 146, 344, 147, - 146, 286, 176, 177, 178, 179, 137, 136, 139, 294, - 295, 140, 143, 130, 131, 548, 33, 0, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 108, 137, 455, - 139, 457, 108, 109, 208, 412, 145, 414, 483, 134, - 417, 112, 113, 104, 105, 136, 423, 424, 362, 140, - 364, 365, 366, 134, 3, 4, 5, 6, 129, 130, - 131, 132, 137, 41, 139, 43, 141, 352, 353, 354, - 137, 135, 139, 450, 451, 360, 453, 454, 136, 137, - 254, 139, 459, 135, 17, 370, 371, 20, 19, 447, - 467, 265, 537, 141, 539, 112, 113, 37, 38, 39, - 32, 389, 42, 137, 389, 139, 140, 134, 282, 18, - 487, 19, 129, 130, 131, 132, 112, 113, 11, 496, - 19, 14, 19, 297, 298, 299, 139, 412, 4, 414, - 76, 77, 417, 129, 130, 131, 132, 4, 423, 424, - 142, 142, 4, 136, 458, 22, 23, 461, 462, 463, - 324, 19, 140, 145, 531, 140, 9, 9, 9, 536, - 334, 519, 50, 11, 522, 450, 451, 139, 453, 454, - 145, 139, 139, 139, 459, 139, 553, 554, 19, 139, - 139, 558, 467, 139, 561, 136, 139, 33, 362, 363, - 364, 365, 366, 136, 136, 369, 55, 56, 57, 58, - 59, 60, 487, 139, 139, 54, 136, 136, 136, 136, - 136, 496, 136, 516, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 141, 136, - 136, 534, 136, 136, 136, 316, 317, 318, 319, 320, - 136, 136, 136, 33, 0, 145, 531, 136, 329, 330, - 331, 536, 19, 4, 428, 136, 140, 19, 136, 15, - 16, 17, 14, 19, 20, 14, 139, 441, 553, 554, - 26, 27, 446, 558, 4, 136, 561, 140, 452, 136, - 136, 136, 136, 19, 458, 145, 136, 461, 462, 463, - 46, 48, 466, 49, 139, 445, 136, 53, 379, 380, - 136, 136, 136, 136, 136, 386, 136, 136, 48, 140, - 136, 14, 140, 7, 8, 140, 10, 11, 12, 13, - 14, 141, 16, 17, 143, 19, 20, 7, 8, 140, - 10, 11, 12, 13, 14, 143, 16, 17, 140, 19, - 20, 140, 140, 4, 518, 136, 14, 14, 136, 14, - 44, 432, 433, 434, 435, 66, 14, 118, 439, 440, - 118, 511, 3, 4, 44, 118, 7, 8, 9, 84, - 228, 511, 483, 97, 103, 16, 17, 15, 19, 20, - 21, 22, 23, 81, 208, 229, 52, 468, 469, 466, - 381, -1, -1, -1, 35, 36, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, -1, -1, -1, 7, - 8, 52, 10, 11, 12, 13, 14, -1, 16, 17, - -1, 19, 20, 504, -1, 506, 507, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 138, -1, 44, 141, -1, -1, - 144, -1, 146, 147, -1, -1, -1, -1, 138, -1, - -1, 141, -1, -1, 144, -1, 146, 147, -1, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, -1, 124, -1, 126, 127, 128, 3, 4, - -1, -1, 7, 8, 9, -1, 137, -1, 139, -1, - -1, 16, 17, 144, 19, 20, 21, 22, 23, -1, - -1, -1, -1, 7, 8, -1, -1, -1, -1, -1, - 35, 36, 16, 17, -1, 19, 20, 21, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 52, -1, -1, - 138, 35, 36, 141, -1, -1, 144, -1, 146, 147, - -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, -1, -1, -1, -1, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, -1, 124, - -1, 126, 127, 128, -1, -1, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 144, - 124, -1, 126, 127, 128, -1, -1, -1, 3, 4, - -1, -1, -1, 137, 9, 139, -1, 141, -1, -1, - 144, -1, 146, -1, 148, -1, 21, 22, 23, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 35, 36, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 7, 8, 52, 10, 11, - 12, 13, 14, -1, 16, 17, -1, 19, 20, -1, - -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, - -1, 7, 8, -1, 10, 11, 12, 13, 14, -1, - 16, 17, -1, 19, 20, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 34, 124, - -1, 126, 127, 128, -1, -1, -1, -1, 44, -1, - -1, 7, 8, -1, 10, 11, 12, 13, 14, 144, - 16, 17, -1, 19, 20, -1, -1, -1, -1, -1, - 7, 8, -1, 10, 11, 12, 13, 14, 34, 16, - 17, -1, 19, 20, -1, -1, -1, -1, 44, -1, - -1, -1, -1, -1, -1, -1, 138, -1, -1, 141, - -1, -1, 144, -1, 146, 147, -1, 44, -1, 7, - 8, -1, 10, 11, 12, 13, 14, -1, 16, 17, - -1, 19, 20, -1, -1, 7, 8, -1, 10, 11, - 12, 13, 14, -1, 16, 17, 34, 19, 20, -1, - -1, -1, 138, -1, -1, 141, 44, -1, 144, -1, - 146, -1, 34, -1, 7, 8, -1, 10, 11, 12, - 13, 14, 44, 16, 17, -1, 19, 20, 7, 8, - -1, 10, 11, 12, 13, 14, -1, 16, 17, -1, - 19, 20, 138, -1, -1, 141, -1, -1, 144, -1, - 146, 44, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 138, -1, -1, 141, 44, 143, 144, -1, 146, - 7, 8, -1, 10, 11, 12, 13, 14, -1, 16, - 17, -1, 19, 20, 7, 8, -1, 10, 11, 12, - 13, 14, -1, 16, 17, -1, 19, 20, -1, -1, - 138, -1, -1, 141, -1, -1, 144, 44, 146, -1, - -1, -1, -1, -1, -1, -1, 138, -1, -1, 141, - -1, 44, 144, -1, 146, -1, 7, 8, -1, 10, - 11, 12, 13, 14, -1, 16, 17, -1, 19, 20, - -1, -1, -1, -1, -1, 138, -1, -1, 141, -1, - -1, 144, -1, 146, -1, -1, -1, -1, -1, 138, - -1, -1, 141, 44, -1, 144, -1, 146, 7, 8, - -1, 10, 11, 12, 13, 14, -1, 16, 17, -1, - 19, 20, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 31, -1, -1, -1, -1, -1, -1, - -1, 138, -1, -1, 141, 44, -1, 144, -1, 146, - -1, -1, 50, 51, -1, 138, -1, -1, 141, -1, - -1, 144, -1, 146, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 138, -1, -1, - 141, -1, -1, 144, -1, 146, -1, 105, 106, 107, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, -1, -1, -1, -1, -1, -1, -1, -1, 138, - -1, -1, 141, -1, -1, 144, -1, 146 +static const short yytable[] = { 10, + 72, 251, 309, 241, 283, 240, 373, 94, 145, 443, + 373, 250, 356, 10, 252, 12, 323, 325, 350, 287, + 288, 289, 290, 291, 394, 80, 294, 410, 250, 12, + 375, 376, 83, 412, -54, -54, -54, -54, 298, 299, + 74, 75, 395, 118, 98, 18, 78, 21, 1, 545, + 119, 3, 79, 216, 217, 371, 300, 301, 372, 19, + 295, 368, 22, 551, 411, 129, 384, 121, 456, 129, + 411, 98, 470, 296, 297, 389, 130, 121, 298, 299, + 211, 10, 26, 27, 28, 29, 30, 31, 32, 143, + 33, 384, 510, 23, 394, 384, 300, 301, 385, 384, + 384, 208, 209, 24, 388, 212, 390, 549, 447, 215, + 345, 436, 345, 345, 100, 345, 101, 442, 43, 44, + 45, 25, 307, 46, 404, 370, 535, 246, 57, 58, + 146, 96, 60, 61, 62, 63, 1, 1, 2, 3, + 3, 4, 517, 532, 298, 299, 518, 51, 345, 95, + 281, 282, 246, 284, 84, 466, 345, 345, 552, 243, + 546, 2, 300, 301, 4, 64, 285, 246, 246, 246, + 246, 246, 292, 293, 246, 140, 298, 299, 100, 34, + 101, 509, 121, 491, 373, 492, 298, 299, 416, 52, + 418, 419, 420, 371, 300, 301, 372, 100, 100, 101, + 101, 214, 358, 371, 300, 301, 372, 100, 517, 101, + 104, 105, 521, 306, 345, 345, 345, 218, 219, 220, + 221, 53, 345, 353, 100, 39, 101, 40, 143, 55, + 522, 34, 345, 345, 483, 132, 133, 76, 373, 351, + 373, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 241, 80, 240, 355, 100, 352, 101, 248, 65, + 87, 249, 66, 102, 103, 67, 91, 68, 97, 88, + 89, 143, 369, 246, 345, 92, 345, 93, 125, 345, + 126, 141, 204, 206, 493, 345, 345, 496, 497, 498, + 57, 58, 207, 96, 60, 61, 62, 63, 387, 1, + 2, 213, 3, 4, 210, -55, -56, 537, 399, 222, + 539, 244, 345, 345, 250, 345, 345, 308, 314, 315, + 316, 345, 317, 326, 318, 327, 328, 64, 330, 329, + 332, 345, 359, 360, 361, 362, 246, 417, 246, 246, + 246, 367, 363, 423, 107, 108, 109, 110, 111, 112, + 377, 345, 364, 402, 378, 405, 406, 421, 415, 345, + 422, 426, 430, 533, 431, 432, 433, 347, 348, 437, + 349, 438, 435, 439, 440, 441, 444, 445, 446, 448, + 449, 450, 547, 379, 380, 381, 382, 383, 451, 452, + 454, 456, 457, 459, 460, 345, 391, 392, 393, 464, + 345, 461, 467, 357, 465, 468, 469, 475, 484, 411, + 495, 365, 366, 513, 503, 478, 504, 345, 345, 507, + 482, 65, 345, 505, 66, 345, 487, 67, 506, 68, + 127, 508, 246, 519, 514, 246, 246, 246, 529, 531, + 487, 523, 479, 264, 265, 524, 427, 428, 515, 538, + 540, 541, 542, 434, 57, 58, 543, 96, 134, 135, + 136, 63, 550, 1, 2, 553, 3, 4, 554, 407, + 408, 409, 555, 558, 559, 561, 564, 414, 565, 196, + 197, 313, 528, 198, 116, 312, 304, 424, 425, 131, + 128, 64, 511, 536, 38, 115, 86, 499, 0, 471, + 472, 473, 474, 429, 0, 0, 476, 477, 0, 479, + 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 0, 0, 0, 453, + 0, 455, 0, 0, 458, 0, 0, 501, 502, 0, + 462, 463, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 485, 486, 0, + 489, 490, 525, 0, 526, 527, 494, 0, 0, 0, + 0, 0, 0, 0, 0, 65, 500, 0, 66, 0, + 0, 67, -179, 68, 324, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 516, -62, 1, 2, + 0, 3, 4, 0, 520, 0, 333, 334, 5, 6, + 57, 58, 335, 0, 0, 0, 0, 0, 0, 1, + 2, 0, 3, 4, 336, 337, 338, 0, 7, 0, + 0, 8, 0, 0, 0, 9, 0, 0, 339, 340, + 544, 0, 0, 0, 0, 548, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 341, 0, 0, 0, 0, + 0, 0, 556, 557, 0, 0, 0, 560, 0, 0, + 562, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 226, 227, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 228, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 0, 229, 0, 230, + 231, 232, 333, 334, 0, 0, 57, 58, 335, 0, + 100, 0, 101, 0, 0, 1, 2, 342, 3, 4, + 336, 337, 338, 0, 0, 0, 0, 57, 58, 0, + 0, 0, 0, 0, 339, 340, 1, 2, 0, 3, + 4, 223, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 341, 0, 0, 0, 224, 225, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 226, 227, 0, 0, 0, 0, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 226, 227, 0, 0, 0, 0, 228, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 0, 229, 0, 230, 231, 232, 0, 0, + 228, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 342, 229, 0, 230, 231, 232, 0, + 0, 0, 333, 334, 0, 0, 0, 100, 335, 101, + 0, 233, 0, 0, 234, 0, 235, 0, 236, 0, + 336, 337, 338, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 339, 340, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, + 58, 341, 96, 134, 135, 136, 63, 0, 1, 2, + 0, 3, 4, 0, 0, 0, 0, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 226, 227, 0, 0, 64, 0, 0, 0, + 0, 0, 0, 0, 0, 57, 58, 0, 96, 60, + 61, 62, 63, 0, 1, 2, 0, 3, 4, 228, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 120, 229, 0, 230, 231, 232, 0, 0, + 0, 0, 64, 0, 0, 57, 58, 0, 96, 60, + 61, 62, 63, 342, 1, 2, 0, 3, 4, 0, + 0, 0, 0, 0, 57, 58, 0, 96, 134, 135, + 136, 63, 303, 1, 2, 0, 3, 4, 0, 0, + 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 66, 0, 0, 67, 0, 68, 386, + 0, 64, 0, 57, 58, 0, 96, 60, 61, 62, + 63, 0, 1, 2, 0, 3, 4, 0, 0, 57, + 58, 0, 96, 60, 61, 62, 63, 0, 1, 2, + 398, 3, 4, 0, 0, 0, 65, 0, 0, 66, + 64, 0, 67, 0, 68, 0, 481, 0, 57, 58, + 0, 59, 60, 61, 62, 63, 64, 1, 2, 0, + 3, 4, 57, 58, 0, 96, 134, 135, 136, 63, + 0, 1, 2, 0, 3, 4, 65, 0, 0, 66, + 0, 0, 67, 0, 68, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 65, 0, 0, 66, 64, + 319, 67, 0, 68, 57, 58, 0, 142, 60, 61, + 62, 63, 0, 1, 2, 0, 3, 4, 57, 58, + 0, 96, 60, 61, 62, 63, 0, 1, 2, 0, + 3, 4, 0, 0, 65, 0, 0, 66, 0, 0, + 67, 64, 68, 0, 0, 0, 0, 0, 0, 0, + 65, 0, 0, 66, 0, 64, 67, 0, 68, 0, + 57, 58, 0, 245, 60, 61, 62, 63, 0, 1, + 2, 0, 3, 4, 0, 0, 0, 0, 0, 65, + 0, 0, 66, 0, 0, 67, 0, 68, 0, 0, + 0, 0, 0, 65, 0, 0, 66, 64, 0, 67, + 0, 68, 57, 58, 0, 96, 134, 135, 136, 63, + 0, 1, 2, 0, 3, 4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 148, 0, 0, + 0, 0, 0, 0, 0, 65, 0, 0, 66, 64, + 0, 67, 0, 68, 0, 0, 149, 150, 0, 65, + 0, 0, 66, 0, 0, 67, 0, 68, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 65, 0, 0, 66, 0, 0, 67, 0, 68, + 0, 174, 175, 176, 0, 0, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 0, 0, -178, 0, 0, + 0, 0, 0, 65, 0, 0, 66, 0, 0, 67, + 0, 322, -62, 1, 2, 0, 3, 4, 0, 0, + 0, 0, 0, 5, 6, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 0, 0, 8, 0, 0, 0, + 9 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 16, 17, 19, 20, 26, 27, 46, 49, 53, - 157, 159, 160, 161, 190, 191, 192, 194, 193, 47, - 61, 199, 135, 52, 135, 15, 135, 37, 38, 39, - 40, 41, 42, 43, 45, 134, 162, 163, 164, 0, - 192, 41, 43, 165, 209, 37, 38, 39, 42, 166, - 206, 208, 215, 135, 135, 141, 200, 19, 198, 7, - 8, 10, 11, 12, 13, 14, 44, 138, 141, 144, - 146, 157, 160, 178, 179, 212, 164, 164, 32, 189, - 164, 164, 18, 216, 217, 25, 147, 207, 216, 19, - 19, 19, 201, 139, 4, 4, 4, 146, 10, 147, - 179, 184, 137, 139, 189, 189, 28, 29, 188, 55, - 56, 57, 58, 59, 60, 167, 204, 204, 159, 220, - 136, 143, 34, 179, 180, 182, 183, 142, 142, 147, - 184, 136, 147, 183, 188, 188, 11, 12, 13, 155, - 156, 179, 185, 4, 10, 179, 181, 24, 146, 205, - 31, 50, 51, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 105, 106, 107, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 150, 151, - 152, 218, 224, 225, 226, 227, 19, 169, 136, 140, - 179, 179, 145, 147, 179, 140, 185, 179, 22, 23, - 3, 4, 5, 6, 9, 21, 35, 36, 83, 84, - 110, 124, 126, 127, 128, 141, 144, 146, 148, 150, - 151, 152, 186, 212, 195, 160, 50, 10, 179, 214, - 11, 14, 11, 155, 167, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 153, 22, 23, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 154, 179, 179, 214, 179, 179, 221, 214, - 214, 214, 214, 214, 179, 179, 214, 167, 108, 109, - 112, 113, 130, 131, 168, 34, 180, 171, 143, 145, - 145, 171, 196, 197, 153, 154, 139, 139, 139, 139, - 139, 143, 185, 187, 146, 187, 147, 187, 19, 139, - 139, 139, 136, 176, 139, 3, 4, 9, 21, 22, - 23, 35, 36, 52, 144, 186, 211, 212, 213, 213, - 213, 213, 181, 179, 179, 136, 173, 136, 173, 213, - 141, 136, 136, 136, 136, 136, 136, 213, 213, 33, - 181, 179, 214, 129, 132, 168, 170, 176, 176, 139, - 139, 185, 185, 185, 185, 185, 136, 143, 147, 179, - 187, 145, 147, 185, 185, 185, 30, 48, 174, 177, - 34, 179, 202, 203, 54, 210, 187, 136, 136, 213, - 213, 213, 11, 48, 11, 223, 213, 141, 214, 179, - 214, 214, 214, 136, 136, 179, 213, 213, 136, 185, - 185, 223, 136, 136, 136, 136, 185, 145, 147, 136, - 136, 33, 19, 4, 176, 169, 136, 140, 19, 145, - 14, 14, 139, 136, 136, 213, 4, 213, 136, 136, - 213, 136, 136, 136, 213, 213, 139, 179, 136, 136, - 140, 185, 185, 185, 185, 145, 185, 185, 179, 157, - 158, 34, 179, 171, 136, 213, 213, 179, 222, 213, - 213, 136, 173, 173, 214, 213, 136, 214, 214, 214, - 222, 213, 185, 185, 136, 140, 136, 136, 140, 140, - 140, 169, 174, 175, 19, 136, 141, 213, 136, 140, - 143, 213, 140, 140, 140, 185, 185, 185, 158, 48, - 172, 14, 143, 155, 219, 169, 179, 171, 143, 171, - 140, 140, 140, 4, 213, 211, 143, 155, 213, 33, - 136, 211, 169, 14, 14, 136, 213, 213, 14, 66, - 213, 14, 213 +static const short yycheck[] = { 0, + 24, 153, 213, 139, 176, 139, 305, 4, 24, 399, + 309, 11, 282, 14, 154, 0, 234, 235, 252, 191, + 192, 193, 194, 195, 30, 18, 198, 11, 11, 14, + 310, 311, 25, 11, 3, 4, 5, 6, 112, 113, + 35, 36, 48, 136, 68, 47, 41, 135, 16, 533, + 143, 19, 47, 22, 23, 129, 130, 131, 132, 61, + 200, 295, 52, 547, 48, 136, 136, 91, 136, 136, + 48, 95, 140, 108, 109, 145, 147, 101, 112, 113, + 147, 82, 37, 38, 39, 40, 41, 42, 43, 113, + 45, 136, 482, 135, 30, 136, 130, 131, 143, 136, + 136, 125, 126, 15, 322, 129, 147, 33, 145, 133, + 246, 147, 248, 249, 137, 251, 139, 397, 37, 38, + 39, 135, 145, 42, 342, 297, 516, 151, 7, 8, + 146, 10, 11, 12, 13, 14, 16, 16, 17, 19, + 19, 20, 136, 143, 112, 113, 140, 135, 284, 146, + 174, 175, 176, 177, 147, 425, 292, 293, 548, 144, + 143, 17, 130, 131, 20, 44, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 106, 112, 113, 137, 134, + 139, 140, 206, 453, 483, 455, 112, 113, 360, 135, + 362, 363, 364, 129, 130, 131, 132, 137, 137, 139, + 139, 132, 141, 129, 130, 131, 132, 137, 136, 139, + 28, 29, 140, 143, 350, 351, 352, 3, 4, 5, + 6, 141, 358, 136, 137, 41, 139, 43, 252, 19, + 500, 134, 368, 369, 445, 102, 103, 32, 537, 263, + 539, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 387, 18, 387, 136, 137, 280, 139, 11, 138, + 19, 14, 141, 74, 75, 144, 139, 146, 147, 19, + 19, 295, 296, 297, 410, 4, 412, 4, 142, 415, + 142, 4, 19, 136, 456, 421, 422, 459, 460, 461, + 7, 8, 140, 10, 11, 12, 13, 14, 322, 16, + 17, 140, 19, 20, 145, 9, 9, 518, 332, 9, + 521, 50, 448, 449, 11, 451, 452, 145, 139, 139, + 139, 457, 139, 19, 139, 139, 139, 44, 136, 139, + 139, 467, 136, 136, 136, 136, 360, 361, 362, 363, + 364, 33, 136, 367, 55, 56, 57, 58, 59, 60, + 139, 487, 136, 54, 139, 136, 136, 136, 141, 495, + 136, 136, 136, 515, 136, 136, 136, 248, 249, 136, + 251, 136, 145, 33, 19, 4, 136, 140, 19, 14, + 14, 139, 534, 314, 315, 316, 317, 318, 136, 136, + 4, 136, 136, 136, 136, 531, 327, 328, 329, 139, + 536, 136, 426, 284, 136, 136, 136, 145, 136, 48, + 136, 292, 293, 19, 136, 439, 140, 553, 554, 140, + 444, 138, 558, 136, 141, 561, 450, 144, 136, 146, + 147, 140, 456, 143, 136, 459, 460, 461, 48, 14, + 464, 140, 443, 22, 23, 140, 377, 378, 141, 143, + 140, 140, 140, 384, 7, 8, 4, 10, 11, 12, + 13, 14, 136, 16, 17, 14, 19, 20, 14, 350, + 351, 352, 136, 14, 66, 14, 0, 358, 0, 116, + 116, 227, 510, 116, 82, 226, 206, 368, 369, 101, + 95, 44, 483, 517, 14, 79, 50, 464, -1, 430, + 431, 432, 433, 379, -1, -1, 437, 438, -1, 510, + -1, -1, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, -1, -1, -1, 410, + -1, 412, -1, -1, 415, -1, -1, 468, 469, -1, + 421, 422, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 448, 449, -1, + 451, 452, 503, -1, 505, 506, 457, -1, -1, -1, + -1, -1, -1, -1, -1, 138, 467, -1, 141, -1, + -1, 144, 0, 146, 147, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 487, 15, 16, 17, + -1, 19, 20, -1, 495, -1, 3, 4, 26, 27, + 7, 8, 9, -1, -1, -1, -1, -1, -1, 16, + 17, -1, 19, 20, 21, 22, 23, -1, 46, -1, + -1, 49, -1, -1, -1, 53, -1, -1, 35, 36, + 531, -1, -1, -1, -1, 536, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, + -1, -1, 553, 554, -1, -1, -1, 558, -1, -1, + 561, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, -1, 124, -1, 126, + 127, 128, 3, 4, -1, -1, 7, 8, 9, -1, + 137, -1, 139, -1, -1, 16, 17, 144, 19, 20, + 21, 22, 23, -1, -1, -1, -1, 7, 8, -1, + -1, -1, -1, -1, 35, 36, 16, 17, -1, 19, + 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 52, -1, -1, -1, 35, 36, -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, -1, -1, -1, -1, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, -1, -1, -1, -1, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, -1, 124, -1, 126, 127, 128, -1, -1, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 144, 124, -1, 126, 127, 128, -1, + -1, -1, 3, 4, -1, -1, -1, 137, 9, 139, + -1, 141, -1, -1, 144, -1, 146, -1, 148, -1, + 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 35, 36, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 7, + 8, 52, 10, 11, 12, 13, 14, -1, 16, 17, + -1, 19, 20, -1, -1, -1, -1, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, -1, -1, 44, -1, -1, -1, + -1, -1, -1, -1, -1, 7, 8, -1, 10, 11, + 12, 13, 14, -1, 16, 17, -1, 19, 20, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 34, 124, -1, 126, 127, 128, -1, -1, + -1, -1, 44, -1, -1, 7, 8, -1, 10, 11, + 12, 13, 14, 144, 16, 17, -1, 19, 20, -1, + -1, -1, -1, -1, 7, 8, -1, 10, 11, 12, + 13, 14, 34, 16, 17, -1, 19, 20, -1, -1, + -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, + 138, -1, -1, 141, -1, -1, 144, -1, 146, 147, + -1, 44, -1, 7, 8, -1, 10, 11, 12, 13, + 14, -1, 16, 17, -1, 19, 20, -1, -1, 7, + 8, -1, 10, 11, 12, 13, 14, -1, 16, 17, + 34, 19, 20, -1, -1, -1, 138, -1, -1, 141, + 44, -1, 144, -1, 146, -1, 34, -1, 7, 8, + -1, 10, 11, 12, 13, 14, 44, 16, 17, -1, + 19, 20, 7, 8, -1, 10, 11, 12, 13, 14, + -1, 16, 17, -1, 19, 20, 138, -1, -1, 141, + -1, -1, 144, -1, 146, 44, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 138, -1, -1, 141, 44, + 143, 144, -1, 146, 7, 8, -1, 10, 11, 12, + 13, 14, -1, 16, 17, -1, 19, 20, 7, 8, + -1, 10, 11, 12, 13, 14, -1, 16, 17, -1, + 19, 20, -1, -1, 138, -1, -1, 141, -1, -1, + 144, 44, 146, -1, -1, -1, -1, -1, -1, -1, + 138, -1, -1, 141, -1, 44, 144, -1, 146, -1, + 7, 8, -1, 10, 11, 12, 13, 14, -1, 16, + 17, -1, 19, 20, -1, -1, -1, -1, -1, 138, + -1, -1, 141, -1, -1, 144, -1, 146, -1, -1, + -1, -1, -1, 138, -1, -1, 141, 44, -1, 144, + -1, 146, 7, 8, -1, 10, 11, 12, 13, 14, + -1, 16, 17, -1, 19, 20, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 31, -1, -1, + -1, -1, -1, -1, -1, 138, -1, -1, 141, 44, + -1, 144, -1, 146, -1, -1, 50, 51, -1, 138, + -1, -1, 141, -1, -1, 144, -1, 146, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 138, -1, -1, 141, -1, -1, 144, -1, 146, + -1, 105, 106, 107, -1, -1, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, -1, -1, 0, -1, -1, + -1, -1, -1, 138, -1, -1, 141, -1, -1, 144, + -1, 146, 15, 16, 17, -1, 19, 20, -1, -1, + -1, -1, -1, 26, 27, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 46, -1, -1, 49, -1, -1, -1, + 53 }; +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/share/bison.simple" +/* This file comes from bison-1.28. */ + +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +#ifndef YYSTACK_USE_ALLOCA +#ifdef alloca +#define YYSTACK_USE_ALLOCA +#else /* alloca not defined */ +#ifdef __GNUC__ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) +#define YYSTACK_USE_ALLOCA +#include +#else /* not sparc */ +/* We think this test detects Watcom and Microsoft C. */ +/* This used to test MSDOS, but that is a bad idea + since that symbol is in the user namespace. */ +#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) +#if 0 /* No need for malloc.h, which pollutes the namespace; + instead, just don't use alloca. */ +#include +#endif +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +/* I don't know what this was needed for, but it pollutes the namespace. + So I turned it off. rms, 2 May 1997. */ +/* #include */ + #pragma alloca +#define YYSTACK_USE_ALLOCA +#else /* not MSDOS, or __TURBOC__, or _AIX */ +#if 0 +#ifdef __hpux /* haible at ilog.fr says this works for HPUX 9.05 and up, + and on HPUX 10. Eventually we can turn this on. */ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#endif /* __hpux */ +#endif +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc */ +#endif /* not GNU C */ +#endif /* alloca not defined */ +#endif /* YYSTACK_USE_ALLOCA not defined */ + +#ifdef YYSTACK_USE_ALLOCA +#define YYSTACK_ALLOC alloca +#else +#define YYSTACK_ALLOC malloc +#endif + +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) +#define YYEMPTY -2 #define YYEOF 0 - #define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ - #define YYFAIL goto yyerrlab - #define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ +#define YYBACKUP(token, value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ + { yyerror ("syntax error: cannot back up"); YYERROR; } \ while (0) - #define YYTERROR 1 #define YYERRCODE 256 - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) +#ifndef YYPURE +#define YYLEX yylex() #endif - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif +#ifdef YYPURE +#ifdef YYLSP_NEEDED +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval, &yylloc) #endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - +#else /* not YYLSP_NEEDED */ #ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) +#define YYLEX yylex(&yylval, YYLEX_PARAM) #else -# define YYLEX yylex () +#define YYLEX yylex(&yylval) +#endif +#endif /* not YYLSP_NEEDED */ #endif -/* Enable debugging if requested. */ -#if YYDEBUG +/* If nonreentrant, generate the variables here */ -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) +#ifndef YYPURE -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ #endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ #endif -{ - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); -} -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ +/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -/* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -# define YYINITDEPTH 200 +#define YYINITDEPTH 200 #endif -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif #ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 +#define YYMAXDEPTH 10000 #endif - +/* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (to, from, count) + char *to; + char *from; + unsigned int count; { - if (*yystr == '"') - { - size_t yyn = 0; - char const *yyp = yystr; + register char *f = from; + register char *t = to; + register int i = count; - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; + while (i-- > 0) + *t++ = *f++; } -# endif - -#endif /* YYERROR_VERBOSE */ - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +#else /* __cplusplus */ -#if defined (__STDC__) || defined (__cplusplus) +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif +__yy_memcpy (char *to, char *from, unsigned int count) { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - + register char *t = to; + register char *f = from; + register int i = count; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); + while (i-- > 0) + *t++ = *f++; } -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; #endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} +#endif +#line 217 "/usr/share/bison.simple" -/* Prevent warnings from -Wmissing-prototypes. */ +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG +#define YYPARSE_PARAM_DECL +#endif /* not YYPARSE_PARAM */ +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) +int yyparse (void *); #else -int -yyparse () - +int yyparse (void); #endif #endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - +int +yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else #define YYPOPSTACK (yyvsp--, yyssp--) +#endif - YYSIZE_T yystacksize = YYINITDEPTH; + int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; +#endif +#endif + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ int yylen; - YYDPRINTF ((stderr, "Starting parse\n")); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif yystate = 0; yyerrstatus = 0; @@ -2831,682 +2188,650 @@ so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; + yyssp = yyss - 1; yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: + + *++yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif - if (yyss + yystacksize - 1 <= yyssp) - { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + int size = yyssp - yyss + 1; #ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif - yyss = yyss1; - yyvs = yyvs1; - } + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif #else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 2; + } yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) + if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; - - { - short int *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif +#ifndef YYSTACK_USE_ALLOCA + yyfree_stacks = 1; +#endif + yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, + size * (unsigned int) sizeof (*yyssp)); + yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, + size * (unsigned int) sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, + size * (unsigned int) sizeof (*yylsp)); +#endif #endif /* no yyoverflow */ - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif - if (yyss + yystacksize - 1 <= yyssp) + if (yyssp >= yyss + yystacksize - 1) YYABORT; } - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: + yybackup: /* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ +/* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ - /* First try to decide what to do without reference to look-ahead token. */ + /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yyn == YYFLAG) goto yydefault; - /* Not known => get a look-ahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif yychar = YYLEX; } - if (yychar <= YYEOF) + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif } else { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + yychar1 = YYTRANSLATE(yychar); + +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif } - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; + yyn = yytable[yyn]; - if (yyn <= 0) + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) + if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } + else if (yyn == 0) + goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + /* Shift the lookahead token. */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ +/* Do the default action for the current state. */ yydefault: + yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; - goto yyreduce; - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ +/* Do a reduction. yyn is the number of a rule to reduce with. */ yyreduce: - /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) +#if YYDEBUG != 0 + if (yydebug) { - case 29: -#line 1099 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} - break; - - case 30: -#line 1099 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} - break; + int i; - case 31: -#line 1100 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} - break; - - case 32: -#line 1100 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} - break; - - case 33: -#line 1101 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} - break; - - case 34: -#line 1101 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} - break; - - case 35: -#line 1102 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} - break; - - case 36: -#line 1102 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} - break; + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); - case 37: -#line 1103 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} - break; + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif - case 38: -#line 1103 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} - break; - case 39: -#line 1107 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} - break; + switch (yyn) { - case 40: -#line 1107 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} - break; - - case 41: -#line 1108 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} - break; - - case 42: -#line 1108 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} - break; - - case 43: -#line 1109 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} - break; - - case 44: -#line 1109 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} - break; - - case 45: -#line 1110 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} - break; - - case 46: -#line 1110 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} - break; - - case 47: -#line 1111 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} - break; - - case 48: -#line 1111 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} - break; - - case 49: -#line 1112 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} - break; - - case 50: -#line 1112 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} - break; - - case 51: -#line 1113 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} - break; - - case 52: -#line 1113 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} - break; - - case 53: -#line 1114 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} - break; - - case 54: -#line 1115 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} - break; - - case 61: -#line 1124 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = 0; ;} - break; - - case 62: -#line 1128 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = (yyvsp[-1].StrVal); +case 28: +#line 1099 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_EQ; ; + break;} +case 29: +#line 1099 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_NE; ; + break;} +case 30: +#line 1100 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SLT; ; + break;} +case 31: +#line 1100 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SGT; ; + break;} +case 32: +#line 1101 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SLE; ; + break;} +case 33: +#line 1101 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SGE; ; + break;} +case 34: +#line 1102 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_ULT; ; + break;} +case 35: +#line 1102 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_UGT; ; + break;} +case 36: +#line 1103 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_ULE; ; + break;} +case 37: +#line 1103 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_UGE; ; + break;} +case 38: +#line 1107 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OEQ; ; + break;} +case 39: +#line 1107 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ONE; ; + break;} +case 40: +#line 1108 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OLT; ; + break;} +case 41: +#line 1108 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OGT; ; + break;} +case 42: +#line 1109 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OLE; ; + break;} +case 43: +#line 1109 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OGE; ; + break;} +case 44: +#line 1110 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ORD; ; + break;} +case 45: +#line 1110 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UNO; ; + break;} +case 46: +#line 1111 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UEQ; ; + break;} +case 47: +#line 1111 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UNE; ; + break;} +case 48: +#line 1112 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ULT; ; + break;} +case 49: +#line 1112 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UGT; ; + break;} +case 50: +#line 1113 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ULE; ; + break;} +case 51: +#line 1113 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UGE; ; + break;} +case 52: +#line 1114 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_TRUE; ; + break;} +case 53: +#line 1115 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_FALSE; ; + break;} +case 60: +#line 1124 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = 0; ; + break;} +case 61: +#line 1128 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = yyvsp[-1].StrVal; CHECK_FOR_ERROR - ;} - break; - - case 63: -#line 1132 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = 0; + ; + break;} +case 62: +#line 1132 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = 0; CHECK_FOR_ERROR - ;} - break; - - case 66: -#line 1139 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = (yyvsp[-1].StrVal); + ; + break;} +case 65: +#line 1139 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = yyvsp[-1].StrVal; CHECK_FOR_ERROR - ;} - break; - - case 67: -#line 1143 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = 0; + ; + break;} +case 66: +#line 1143 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = 0; CHECK_FOR_ERROR - ;} - break; - - case 68: -#line 1149 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} - break; - - case 69: -#line 1150 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} - break; - - case 70: -#line 1151 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} - break; - - case 71: -#line 1152 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} - break; - - case 72: -#line 1153 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} - break; - - case 73: -#line 1157 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} - break; - - case 74: -#line 1158 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} - break; - - case 75: -#line 1159 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 76: -#line 1163 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} - break; - - case 77: -#line 1164 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} - break; - - case 78: -#line 1168 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 79: -#line 1169 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} - break; - - case 80: -#line 1170 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} - break; - - case 81: -#line 1174 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 82: -#line 1175 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} - break; - - case 83: -#line 1176 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} - break; - - case 84: -#line 1177 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} - break; - - case 85: -#line 1178 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} - break; - - case 86: -#line 1181 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::C; ;} - break; - - case 87: -#line 1182 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::C; ;} - break; - - case 88: -#line 1183 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::Fast; ;} - break; - - case 89: -#line 1184 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::Cold; ;} - break; - - case 90: -#line 1185 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} - break; - - case 91: -#line 1186 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} - break; - - case 92: -#line 1187 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) + ; + break;} +case 67: +#line 1149 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::InternalLinkage; ; + break;} +case 68: +#line 1150 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::WeakLinkage; ; + break;} +case 69: +#line 1151 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; + break;} +case 70: +#line 1152 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::AppendingLinkage; ; + break;} +case 71: +#line 1153 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; + break;} +case 72: +#line 1157 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; + break;} +case 73: +#line 1158 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; + break;} +case 74: +#line 1159 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 75: +#line 1163 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Visibility = GlobalValue::DefaultVisibility; ; + break;} +case 76: +#line 1164 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Visibility = GlobalValue::HiddenVisibility; ; + break;} +case 77: +#line 1168 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 78: +#line 1169 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; + break;} +case 79: +#line 1170 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; + break;} +case 80: +#line 1174 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 81: +#line 1175 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::InternalLinkage; ; + break;} +case 82: +#line 1176 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; + break;} +case 83: +#line 1177 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::WeakLinkage; ; + break;} +case 84: +#line 1178 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; + break;} +case 85: +#line 1181 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::C; ; + break;} +case 86: +#line 1182 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::C; ; + break;} +case 87: +#line 1183 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::Fast; ; + break;} +case 88: +#line 1184 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::Cold; ; + break;} +case 89: +#line 1185 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::X86_StdCall; ; + break;} +case 90: +#line 1186 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::X86_FastCall; ; + break;} +case 91: +#line 1187 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val) GEN_ERROR("Calling conv too large"); - (yyval.UIntVal) = (yyvsp[0].UInt64Val); + yyval.UIntVal = yyvsp[0].UInt64Val; CHECK_FOR_ERROR - ;} - break; - - case 93: -#line 1194 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} - break; - - case 94: -#line 1195 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::SExt; ;} - break; - - case 95: -#line 1196 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::InReg; ;} - break; - - case 96: -#line 1197 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} - break; - - case 97: -#line 1200 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::None; ;} - break; - - case 98: -#line 1201 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ParamAttrs) = (yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs); - ;} - break; - - case 99: -#line 1206 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} - break; - - case 100: -#line 1207 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} - break; - - case 102: -#line 1211 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::None; ;} - break; - - case 103: -#line 1212 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ParamAttrs) = (yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs); - ;} - break; - - case 104: -#line 1219 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = 0; ;} - break; - - case 105: -#line 1220 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.UIntVal) = (yyvsp[0].UInt64Val); - if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) + ; + break;} +case 92: +#line 1194 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::ZExt; ; + break;} +case 93: +#line 1195 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::SExt; ; + break;} +case 94: +#line 1196 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::InReg; ; + break;} +case 95: +#line 1197 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::StructRet; ; + break;} +case 96: +#line 1200 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::None; ; + break;} +case 97: +#line 1201 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ParamAttrs = yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs; + ; + break;} +case 98: +#line 1206 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::NoReturn; ; + break;} +case 99: +#line 1207 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::NoUnwind; ; + break;} +case 101: +#line 1211 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::None; ; + break;} +case 102: +#line 1212 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ParamAttrs = yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs; + ; + break;} +case 103: +#line 1219 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = 0; ; + break;} +case 104: +#line 1220 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.UIntVal = yyvsp[0].UInt64Val; + if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) GEN_ERROR("Alignment must be a power of two"); CHECK_FOR_ERROR -;} - break; - - case 106: -#line 1226 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = 0; ;} - break; - - case 107: -#line 1227 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.UIntVal) = (yyvsp[0].UInt64Val); - if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) +; + break;} +case 105: +#line 1226 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = 0; ; + break;} +case 106: +#line 1227 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.UIntVal = yyvsp[0].UInt64Val; + if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) GEN_ERROR("Alignment must be a power of two"); CHECK_FOR_ERROR -;} - break; - - case 108: -#line 1235 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i) - if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\') +; + break;} +case 107: +#line 1235 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + for (unsigned i = 0, e = strlen(yyvsp[0].StrVal); i != e; ++i) + if (yyvsp[0].StrVal[i] == '"' || yyvsp[0].StrVal[i] == '\\') GEN_ERROR("Invalid character in section name"); - (yyval.StrVal) = (yyvsp[0].StrVal); + yyval.StrVal = yyvsp[0].StrVal; CHECK_FOR_ERROR -;} - break; - - case 109: -#line 1243 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = 0; ;} - break; - - case 110: -#line 1244 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = (yyvsp[0].StrVal); ;} - break; - - case 111: -#line 1249 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - {;} - break; - - case 112: -#line 1250 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - {;} - break; - - case 113: -#line 1251 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - CurGV->setSection((yyvsp[0].StrVal)); - free((yyvsp[0].StrVal)); +; + break;} +case 108: +#line 1243 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = 0; ; + break;} +case 109: +#line 1244 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = yyvsp[0].StrVal; ; + break;} +case 110: +#line 1249 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{; + break;} +case 111: +#line 1250 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{; + break;} +case 112: +#line 1251 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurGV->setSection(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); CHECK_FOR_ERROR - ;} - break; - - case 114: -#line 1256 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val))) + ; + break;} +case 113: +#line 1256 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[0].UInt64Val != 0 && !isPowerOf2_32(yyvsp[0].UInt64Val)) GEN_ERROR("Alignment must be a power of two"); - CurGV->setAlignment((yyvsp[0].UInt64Val)); + CurGV->setAlignment(yyvsp[0].UInt64Val); CHECK_FOR_ERROR - ;} - break; - - case 119: -#line 1272 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); + ; + break;} +case 118: +#line 1272 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR - ;} - break; - - case 120: -#line 1276 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); + ; + break;} +case 119: +#line 1276 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); CHECK_FOR_ERROR - ;} - break; - - case 121: -#line 1280 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Pointer type? - if (*(yyvsp[-1].TypeVal) == Type::LabelTy) + ; + break;} +case 120: +#line 1280 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Pointer type? + if (*yyvsp[-1].TypeVal == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[-1].TypeVal)))); - delete (yyvsp[-1].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 122: -#line 1287 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Named types are also simple types... - const Type* tmp = getTypeVal((yyvsp[0].ValIDVal)); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-1].TypeVal))); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - (yyval.TypeVal) = new PATypeHolder(tmp); - ;} - break; - - case 123: -#line 1292 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Type UpReference - if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); + ; + break;} +case 121: +#line 1287 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Named types are also simple types... + const Type* tmp = getTypeVal(yyvsp[0].ValIDVal); + CHECK_FOR_ERROR + yyval.TypeVal = new PATypeHolder(tmp); + ; + break;} +case 122: +#line 1292 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Type UpReference + if (yyvsp[0].UInt64Val > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder - UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[0].UInt64Val), OT)); // Add to vector... - (yyval.TypeVal) = new PATypeHolder(OT); + UpRefs.push_back(UpRefRecord((unsigned)yyvsp[0].UInt64Val, OT)); // Add to vector... + yyval.TypeVal = new PATypeHolder(OT); UR_OUT("New Upreference!\n"); CHECK_FOR_ERROR - ;} - break; - - case 124: -#line 1300 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 123: +#line 1300 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ std::vector Params; ParamAttrsList Attrs; - if ((yyvsp[0].ParamAttrs) != ParamAttr::None) - Attrs.addAttributes(0, (yyvsp[0].ParamAttrs)); + if (yyvsp[0].ParamAttrs != ParamAttr::None) + Attrs.addAttributes(0, yyvsp[0].ParamAttrs); unsigned index = 1; - TypeWithAttrsList::iterator I = (yyvsp[-2].TypeWithAttrsList)->begin(), E = (yyvsp[-2].TypeWithAttrsList)->end(); + TypeWithAttrsList::iterator I = yyvsp[-2].TypeWithAttrsList->begin(), E = yyvsp[-2].TypeWithAttrsList->end(); for (; I != E; ++I, ++index) { const Type *Ty = I->Ty->get(); Params.push_back(Ty); @@ -3520,22 +2845,21 @@ ParamAttrsList *ActualAttrs = 0; if (!Attrs.empty()) ActualAttrs = new ParamAttrsList(Attrs); - FunctionType *FT = FunctionType::get(*(yyvsp[-4].TypeVal), Params, isVarArg, ActualAttrs); - delete (yyvsp[-2].TypeWithAttrsList); // Delete the argument list - delete (yyvsp[-4].TypeVal); // Delete the return type handle - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); - CHECK_FOR_ERROR - ;} - break; - - case 125: -#line 1326 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + FunctionType *FT = FunctionType::get(*yyvsp[-4].TypeVal, Params, isVarArg, ActualAttrs); + delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list + delete yyvsp[-4].TypeVal; // Delete the return type handle + yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT)); + CHECK_FOR_ERROR + ; + break;} +case 124: +#line 1326 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ std::vector Params; ParamAttrsList Attrs; - if ((yyvsp[0].ParamAttrs) != ParamAttr::None) - Attrs.addAttributes(0, (yyvsp[0].ParamAttrs)); - TypeWithAttrsList::iterator I = (yyvsp[-2].TypeWithAttrsList)->begin(), E = (yyvsp[-2].TypeWithAttrsList)->end(); + if (yyvsp[0].ParamAttrs != ParamAttr::None) + Attrs.addAttributes(0, yyvsp[0].ParamAttrs); + TypeWithAttrsList::iterator I = yyvsp[-2].TypeWithAttrsList->begin(), E = yyvsp[-2].TypeWithAttrsList->end(); unsigned index = 1; for ( ; I != E; ++I, ++index) { const Type* Ty = I->Ty->get(); @@ -3551,305 +2875,284 @@ if (!Attrs.empty()) ActualAttrs = new ParamAttrsList(Attrs); - FunctionType *FT = FunctionType::get((yyvsp[-4].PrimType), Params, isVarArg, ActualAttrs); - delete (yyvsp[-2].TypeWithAttrsList); // Delete the argument list - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); - CHECK_FOR_ERROR - ;} - break; - - case 126: -#line 1353 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Sized array type? - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val)))); - delete (yyvsp[-1].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 127: -#line 1358 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Vector type? - const llvm::Type* ElemTy = (yyvsp[-1].TypeVal)->get(); - if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) + FunctionType *FT = FunctionType::get(yyvsp[-4].PrimType, Params, isVarArg, ActualAttrs); + delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list + yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT)); + CHECK_FOR_ERROR + ; + break;} +case 125: +#line 1353 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Sized array type? + yyval.TypeVal = new PATypeHolder(HandleUpRefs(ArrayType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 126: +#line 1358 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Vector type? + const llvm::Type* ElemTy = yyvsp[-1].TypeVal->get(); + if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val) GEN_ERROR("Unsigned result not equal to signed result"); if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger()) GEN_ERROR("Element type of a VectorType must be primitive"); - if (!isPowerOf2_32((yyvsp[-3].UInt64Val))) + if (!isPowerOf2_32(yyvsp[-3].UInt64Val)) GEN_ERROR("Vector length should be a power of 2"); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val)))); - delete (yyvsp[-1].TypeVal); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(VectorType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 128: -#line 1370 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Structure type? + ; + break;} +case 127: +#line 1370 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Structure type? std::vector Elements; - for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(), - E = (yyvsp[-1].TypeList)->end(); I != E; ++I) + for (std::list::iterator I = yyvsp[-1].TypeList->begin(), + E = yyvsp[-1].TypeList->end(); I != E; ++I) Elements.push_back(*I); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); - delete (yyvsp[-1].TypeList); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); + delete yyvsp[-1].TypeList; CHECK_FOR_ERROR - ;} - break; - - case 129: -#line 1380 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Empty structure type? - (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); - CHECK_FOR_ERROR - ;} - break; - - case 130: -#line 1384 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 128: +#line 1380 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Empty structure type? + yyval.TypeVal = new PATypeHolder(StructType::get(std::vector())); + CHECK_FOR_ERROR + ; + break;} +case 129: +#line 1384 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ std::vector Elements; - for (std::list::iterator I = (yyvsp[-2].TypeList)->begin(), - E = (yyvsp[-2].TypeList)->end(); I != E; ++I) + for (std::list::iterator I = yyvsp[-2].TypeList->begin(), + E = yyvsp[-2].TypeList->end(); I != E; ++I) Elements.push_back(*I); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); - delete (yyvsp[-2].TypeList); - CHECK_FOR_ERROR - ;} - break; - - case 131: -#line 1394 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Empty structure type? - (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); + delete yyvsp[-2].TypeList; CHECK_FOR_ERROR - ;} - break; - - case 132: -#line 1401 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrs).Ty = (yyvsp[-1].TypeVal); - (yyval.TypeWithAttrs).Attrs = (yyvsp[0].ParamAttrs); - ;} - break; - - case 133: -#line 1408 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 130: +#line 1394 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Empty structure type? + yyval.TypeVal = new PATypeHolder(StructType::get(std::vector(), true)); + CHECK_FOR_ERROR + ; + break;} +case 131: +#line 1401 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrs.Ty = yyvsp[-1].TypeVal; + yyval.TypeWithAttrs.Attrs = yyvsp[0].ParamAttrs; + ; + break;} +case 132: +#line 1408 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); - if (!(*(yyvsp[0].TypeVal))->isFirstClassType()) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + if (!(*yyvsp[0].TypeVal)->isFirstClassType()) GEN_ERROR("LLVM functions cannot return aggregate types"); - (yyval.TypeVal) = (yyvsp[0].TypeVal); - ;} - break; - - case 134: -#line 1415 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); - ;} - break; - - case 135: -#line 1420 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); - (yyval.TypeWithAttrsList)->push_back((yyvsp[0].TypeWithAttrs)); + yyval.TypeVal = yyvsp[0].TypeVal; + ; + break;} +case 133: +#line 1415 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(Type::VoidTy); + ; + break;} +case 134: +#line 1420 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList = new TypeWithAttrsList(); + yyval.TypeWithAttrsList->push_back(yyvsp[0].TypeWithAttrs); CHECK_FOR_ERROR - ;} - break; - - case 136: -#line 1425 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList))->push_back((yyvsp[0].TypeWithAttrs)); + ; + break;} +case 135: +#line 1425 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList)->push_back(yyvsp[0].TypeWithAttrs); CHECK_FOR_ERROR - ;} - break; - - case 138: -#line 1433 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList); + ; + break;} +case 137: +#line 1433 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); - (yyval.TypeWithAttrsList)->push_back(TWA); + yyval.TypeWithAttrsList->push_back(TWA); CHECK_FOR_ERROR - ;} - break; - - case 139: -#line 1440 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList) = new TypeWithAttrsList; + ; + break;} +case 138: +#line 1440 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); - (yyval.TypeWithAttrsList)->push_back(TWA); + yyval.TypeWithAttrsList->push_back(TWA); CHECK_FOR_ERROR - ;} - break; - - case 140: -#line 1447 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); - CHECK_FOR_ERROR - ;} - break; - - case 141: -#line 1455 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeList) = new std::list(); - (yyval.TypeList)->push_back(*(yyvsp[0].TypeVal)); - delete (yyvsp[0].TypeVal); + ; + break;} +case 139: +#line 1447 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList = new TypeWithAttrsList(); CHECK_FOR_ERROR - ;} - break; - - case 142: -#line 1461 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(*(yyvsp[0].TypeVal)); - delete (yyvsp[0].TypeVal); + ; + break;} +case 140: +#line 1455 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeList = new std::list(); + yyval.TypeList->push_back(*yyvsp[0].TypeVal); + delete yyvsp[0].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 141: +#line 1461 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal); + delete yyvsp[0].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 143: -#line 1473 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized arr + ; + break;} +case 142: +#line 1473 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[-3].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + const ArrayType *ATy = dyn_cast(yyvsp[-3].TypeVal->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[-3].TypeVal))->getDescription() + "'"); + (*yyvsp[-3].TypeVal)->getDescription() + "'"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)(yyvsp[-1].ConstVector)->size()) + if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) GEN_ERROR("Type mismatch: constant sized array initialized with " + - utostr((yyvsp[-1].ConstVector)->size()) + " arguments, but has size of " + + utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) + for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { + if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); + (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); } - (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[-1].ConstVector)); - delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); + yyval.ConstVal = ConstantArray::get(ATy, *yyvsp[-1].ConstVector); + delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 144: -#line 1501 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 143: +#line 1501 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[-2].TypeVal))->getDescription() + "'"); + (*yyvsp[-2].TypeVal)->getDescription() + "'"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) GEN_ERROR("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +""); - (yyval.ConstVal) = ConstantArray::get(ATy, std::vector()); - delete (yyvsp[-2].TypeVal); + yyval.ConstVal = ConstantArray::get(ATy, std::vector()); + delete yyvsp[-2].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 145: -#line 1517 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 144: +#line 1517 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[-2].TypeVal))->getDescription() + "'"); + (*yyvsp[-2].TypeVal)->getDescription() + "'"); int NumElements = ATy->getNumElements(); const Type *ETy = ATy->getElementType(); - char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); - if (NumElements != -1 && NumElements != (EndStr-(yyvsp[0].StrVal))) + char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); + if (NumElements != -1 && NumElements != (EndStr-yyvsp[0].StrVal)) GEN_ERROR("Can't build string constant of size " + - itostr((int)(EndStr-(yyvsp[0].StrVal))) + + itostr((int)(EndStr-yyvsp[0].StrVal)) + " when array has size " + itostr(NumElements) + ""); std::vector Vals; if (ETy == Type::Int8Ty) { - for (unsigned char *C = (unsigned char *)(yyvsp[0].StrVal); + for (unsigned char *C = (unsigned char *)yyvsp[0].StrVal; C != (unsigned char*)EndStr; ++C) Vals.push_back(ConstantInt::get(ETy, *C)); } else { - free((yyvsp[0].StrVal)); + free(yyvsp[0].StrVal); GEN_ERROR("Cannot build string arrays of non byte sized elements"); } - free((yyvsp[0].StrVal)); - (yyval.ConstVal) = ConstantArray::get(ATy, Vals); - delete (yyvsp[-2].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 146: -#line 1546 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized arr + free(yyvsp[0].StrVal); + yyval.ConstVal = ConstantArray::get(ATy, Vals); + delete yyvsp[-2].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 145: +#line 1546 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); - const VectorType *PTy = dyn_cast((yyvsp[-3].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + const VectorType *PTy = dyn_cast(yyvsp[-3].TypeVal->get()); if (PTy == 0) GEN_ERROR("Cannot make packed constant with type: '" + - (*(yyvsp[-3].TypeVal))->getDescription() + "'"); + (*yyvsp[-3].TypeVal)->getDescription() + "'"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)(yyvsp[-1].ConstVector)->size()) + if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) GEN_ERROR("Type mismatch: constant sized packed initialized with " + - utostr((yyvsp[-1].ConstVector)->size()) + " arguments, but has size of " + + utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) + for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { + if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); + (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); } - (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[-1].ConstVector)); - delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); + yyval.ConstVal = ConstantVector::get(PTy, *yyvsp[-1].ConstVector); + delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 147: -#line 1574 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - const StructType *STy = dyn_cast((yyvsp[-3].TypeVal)->get()); + ; + break;} +case 146: +#line 1574 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + const StructType *STy = dyn_cast(yyvsp[-3].TypeVal->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[-3].TypeVal))->getDescription() + "'"); + (*yyvsp[-3].TypeVal)->getDescription() + "'"); - if ((yyvsp[-1].ConstVector)->size() != STy->getNumContainedTypes()) + if (yyvsp[-1].ConstVector->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = (yyvsp[-1].ConstVector)->size(); i != e; ++i) - if ((*(yyvsp[-1].ConstVector))[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = yyvsp[-1].ConstVector->size(); i != e; ++i) + if ((*yyvsp[-1].ConstVector)[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -3859,21 +3162,20 @@ if (STy->isPacked()) GEN_ERROR("Unpacked Initializer to vector type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[-1].ConstVector)); - delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); + yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-1].ConstVector); + delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 148: -#line 1599 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 147: +#line 1599 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); - const StructType *STy = dyn_cast((yyvsp[-2].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + const StructType *STy = dyn_cast(yyvsp[-2].TypeVal->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[-2].TypeVal))->getDescription() + "'"); + (*yyvsp[-2].TypeVal)->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type"); @@ -3882,26 +3184,25 @@ if (STy->isPacked()) GEN_ERROR("Unpacked Initializer to vector type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); - delete (yyvsp[-2].TypeVal); + yyval.ConstVal = ConstantStruct::get(STy, std::vector()); + delete yyvsp[-2].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 149: -#line 1618 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - const StructType *STy = dyn_cast((yyvsp[-5].TypeVal)->get()); + ; + break;} +case 148: +#line 1618 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + const StructType *STy = dyn_cast(yyvsp[-5].TypeVal->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[-5].TypeVal))->getDescription() + "'"); + (*yyvsp[-5].TypeVal)->getDescription() + "'"); - if ((yyvsp[-2].ConstVector)->size() != STy->getNumContainedTypes()) + if (yyvsp[-2].ConstVector->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = (yyvsp[-2].ConstVector)->size(); i != e; ++i) - if ((*(yyvsp[-2].ConstVector))[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = yyvsp[-2].ConstVector->size(); i != e; ++i) + if ((*yyvsp[-2].ConstVector)[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -3912,21 +3213,20 @@ GEN_ERROR("Vector initializer to non-vector type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[-2].ConstVector)); - delete (yyvsp[-5].TypeVal); delete (yyvsp[-2].ConstVector); + yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-2].ConstVector); + delete yyvsp[-5].TypeVal; delete yyvsp[-2].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 150: -#line 1644 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 149: +#line 1644 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); - const StructType *STy = dyn_cast((yyvsp[-4].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); + const StructType *STy = dyn_cast(yyvsp[-4].TypeVal->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[-4].TypeVal))->getDescription() + "'"); + (*yyvsp[-4].TypeVal)->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type"); @@ -3936,45 +3236,42 @@ GEN_ERROR("Vector initializer to non-vector type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); - delete (yyvsp[-4].TypeVal); + yyval.ConstVal = ConstantStruct::get(STy, std::vector()); + delete yyvsp[-4].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 151: -#line 1664 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 150: +#line 1664 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + const PointerType *PTy = dyn_cast(yyvsp[-1].TypeVal->get()); if (PTy == 0) GEN_ERROR("Cannot make null pointer constant with type: '" + - (*(yyvsp[-1].TypeVal))->getDescription() + "'"); + (*yyvsp[-1].TypeVal)->getDescription() + "'"); - (yyval.ConstVal) = ConstantPointerNull::get(PTy); - delete (yyvsp[-1].TypeVal); + yyval.ConstVal = ConstantPointerNull::get(PTy); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 152: -#line 1676 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 151: +#line 1676 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - (yyval.ConstVal) = UndefValue::get((yyvsp[-1].TypeVal)->get()); - delete (yyvsp[-1].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 153: -#line 1683 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + yyval.ConstVal = UndefValue::get(yyvsp[-1].TypeVal->get()); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 152: +#line 1683 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - const PointerType *Ty = dyn_cast((yyvsp[-1].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + const PointerType *Ty = dyn_cast(yyvsp[-1].TypeVal->get()); if (Ty == 0) GEN_ERROR("Global const reference must be a pointer type"); @@ -3988,7 +3285,7 @@ Function *SavedCurFn = CurFun.CurrentFunction; CurFun.CurrentFunction = 0; - Value *V = getExistingVal(Ty, (yyvsp[0].ValIDVal)); + Value *V = getExistingVal(Ty, yyvsp[0].ValIDVal); CHECK_FOR_ERROR CurFun.CurrentFunction = SavedCurFn; @@ -4003,16 +3300,16 @@ // First check to see if the forward references value is already created! PerModuleInfo::GlobalRefsType::iterator I = - CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[0].ValIDVal))); + CurModule.GlobalRefs.find(std::make_pair(PT, yyvsp[0].ValIDVal)); if (I != CurModule.GlobalRefs.end()) { V = I->second; // Placeholder already exists, use it... - (yyvsp[0].ValIDVal).destroy(); + yyvsp[0].ValIDVal.destroy(); } else { std::string Name; - if ((yyvsp[0].ValIDVal).Type == ValID::GlobalName) - Name = (yyvsp[0].ValIDVal).Name; - else if ((yyvsp[0].ValIDVal).Type != ValID::GlobalID) + if (yyvsp[0].ValIDVal.Type == ValID::GlobalName) + Name = yyvsp[0].ValIDVal.Name; + else if (yyvsp[0].ValIDVal.Type != ValID::GlobalID) GEN_ERROR("Invalid reference to global"); // Create the forward referenced global. @@ -4028,340 +3325,307 @@ } // Keep track of the fact that we have a forward ref to recycle it - CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[0].ValIDVal)), GV)); + CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, yyvsp[0].ValIDVal), GV)); V = GV; } } - (yyval.ConstVal) = cast(V); - delete (yyvsp[-1].TypeVal); // Free the type handle + yyval.ConstVal = cast(V); + delete yyvsp[-1].TypeVal; // Free the type handle CHECK_FOR_ERROR - ;} - break; - - case 154: -#line 1749 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 153: +#line 1749 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - if ((yyvsp[-1].TypeVal)->get() != (yyvsp[0].ConstVal)->getType()) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + if (yyvsp[-1].TypeVal->get() != yyvsp[0].ConstVal->getType()) GEN_ERROR("Mismatched types for constant expression: " + - (*(yyvsp[-1].TypeVal))->getDescription() + " and " + (yyvsp[0].ConstVal)->getType()->getDescription()); - (yyval.ConstVal) = (yyvsp[0].ConstVal); - delete (yyvsp[-1].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 155: -#line 1759 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + (*yyvsp[-1].TypeVal)->getDescription() + " and " + yyvsp[0].ConstVal->getType()->getDescription()); + yyval.ConstVal = yyvsp[0].ConstVal; + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 154: +#line 1759 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - const Type *Ty = (yyvsp[-1].TypeVal)->get(); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + const Type *Ty = yyvsp[-1].TypeVal->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) GEN_ERROR("Cannot create a null initialized value of this type"); - (yyval.ConstVal) = Constant::getNullValue(Ty); - delete (yyvsp[-1].TypeVal); + yyval.ConstVal = Constant::getNullValue(Ty); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 156: -#line 1769 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val))) + ; + break;} +case 155: +#line 1769 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // integral constants + if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].SInt64Val)) GEN_ERROR("Constant value doesn't fit in type"); - (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val), true); + yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].SInt64Val, true); CHECK_FOR_ERROR - ;} - break; - - case 157: -#line 1775 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // arbitrary precision integer constants - uint32_t BitWidth = cast((yyvsp[-1].PrimType))->getBitWidth(); - if ((yyvsp[0].APIntVal)->getBitWidth() > BitWidth) { + ; + break;} +case 156: +#line 1775 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // arbitrary precision integer constants + uint32_t BitWidth = cast(yyvsp[-1].PrimType)->getBitWidth(); + if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) { GEN_ERROR("Constant value does not fit in type"); } - (yyvsp[0].APIntVal)->sextOrTrunc(BitWidth); - (yyval.ConstVal) = ConstantInt::get(*(yyvsp[0].APIntVal)); - delete (yyvsp[0].APIntVal); - CHECK_FOR_ERROR - ;} - break; - - case 158: -#line 1785 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val))) + yyvsp[0].APIntVal->sextOrTrunc(BitWidth); + yyval.ConstVal = ConstantInt::get(*yyvsp[0].APIntVal); + delete yyvsp[0].APIntVal; + CHECK_FOR_ERROR + ; + break;} +case 157: +#line 1785 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // integral constants + if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].UInt64Val)) GEN_ERROR("Constant value doesn't fit in type"); - (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val), false); + yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].UInt64Val, false); CHECK_FOR_ERROR - ;} - break; - - case 159: -#line 1791 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // arbitrary precision integer constants - uint32_t BitWidth = cast((yyvsp[-1].PrimType))->getBitWidth(); - if ((yyvsp[0].APIntVal)->getBitWidth() > BitWidth) { + ; + break;} +case 158: +#line 1791 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // arbitrary precision integer constants + uint32_t BitWidth = cast(yyvsp[-1].PrimType)->getBitWidth(); + if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) { GEN_ERROR("Constant value does not fit in type"); } - (yyvsp[0].APIntVal)->zextOrTrunc(BitWidth); - (yyval.ConstVal) = ConstantInt::get(*(yyvsp[0].APIntVal)); - delete (yyvsp[0].APIntVal); - CHECK_FOR_ERROR - ;} - break; - - case 160: -#line 1801 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Boolean constants - assert(cast((yyvsp[-1].PrimType))->getBitWidth() == 1 && "Not Bool?"); - (yyval.ConstVal) = ConstantInt::getTrue(); - CHECK_FOR_ERROR - ;} - break; - - case 161: -#line 1806 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Boolean constants - assert(cast((yyvsp[-1].PrimType))->getBitWidth() == 1 && "Not Bool?"); - (yyval.ConstVal) = ConstantInt::getFalse(); - CHECK_FOR_ERROR - ;} - break; - - case 162: -#line 1811 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Float & Double constants - if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].FPVal))) + yyvsp[0].APIntVal->zextOrTrunc(BitWidth); + yyval.ConstVal = ConstantInt::get(*yyvsp[0].APIntVal); + delete yyvsp[0].APIntVal; + CHECK_FOR_ERROR + ; + break;} +case 159: +#line 1801 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Boolean constants + assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?"); + yyval.ConstVal = ConstantInt::getTrue(); + CHECK_FOR_ERROR + ; + break;} +case 160: +#line 1806 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Boolean constants + assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?"); + yyval.ConstVal = ConstantInt::getFalse(); + CHECK_FOR_ERROR + ; + break;} +case 161: +#line 1811 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Float & Double constants + if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].FPVal)) GEN_ERROR("Floating point constant invalid for type"); - (yyval.ConstVal) = ConstantFP::get((yyvsp[-1].PrimType), (yyvsp[0].FPVal)); + yyval.ConstVal = ConstantFP::get(yyvsp[-1].PrimType, yyvsp[0].FPVal); CHECK_FOR_ERROR - ;} - break; - - case 163: -#line 1819 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 162: +#line 1819 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - Constant *Val = (yyvsp[-3].ConstVal); - const Type *DestTy = (yyvsp[-1].TypeVal)->get(); - if (!CastInst::castIsValid((yyvsp[-5].CastOpVal), (yyvsp[-3].ConstVal), DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + Constant *Val = yyvsp[-3].ConstVal; + const Type *DestTy = yyvsp[-1].TypeVal->get(); + if (!CastInst::castIsValid(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'"); - (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[-5].CastOpVal), (yyvsp[-3].ConstVal), DestTy); - delete (yyvsp[-1].TypeVal); - ;} - break; - - case 164: -#line 1831 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if (!isa((yyvsp[-2].ConstVal)->getType())) + yyval.ConstVal = ConstantExpr::getCast(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy); + delete yyvsp[-1].TypeVal; + ; + break;} +case 163: +#line 1831 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!isa(yyvsp[-2].ConstVal->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); const Type *IdxTy = - GetElementPtrInst::getIndexedType((yyvsp[-2].ConstVal)->getType(), &(*(yyvsp[-1].ValueList))[0], (yyvsp[-1].ValueList)->size(), + GetElementPtrInst::getIndexedType(yyvsp[-2].ConstVal->getType(), &(*yyvsp[-1].ValueList)[0], yyvsp[-1].ValueList->size(), true); if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr"); SmallVector IdxVec; - for (unsigned i = 0, e = (yyvsp[-1].ValueList)->size(); i != e; ++i) - if (Constant *C = dyn_cast((*(yyvsp[-1].ValueList))[i])) + for (unsigned i = 0, e = yyvsp[-1].ValueList->size(); i != e; ++i) + if (Constant *C = dyn_cast((*yyvsp[-1].ValueList)[i])) IdxVec.push_back(C); else GEN_ERROR("Indices to constant getelementptr must be constants"); - delete (yyvsp[-1].ValueList); + delete yyvsp[-1].ValueList; - (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[-2].ConstVal), &IdxVec[0], IdxVec.size()); + yyval.ConstVal = ConstantExpr::getGetElementPtr(yyvsp[-2].ConstVal, &IdxVec[0], IdxVec.size()); CHECK_FOR_ERROR - ;} - break; - - case 165: -#line 1853 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[-5].ConstVal)->getType() != Type::Int1Ty) + ; + break;} +case 164: +#line 1853 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-5].ConstVal->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("Select operand types must match"); - (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + yyval.ConstVal = ConstantExpr::getSelect(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 166: -#line 1861 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + ; + break;} +case 165: +#line 1861 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("Binary operator types must match"); CHECK_FOR_ERROR; - (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); - ;} - break; - - case 167: -#line 1867 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + ; + break;} +case 166: +#line 1867 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("Logical operator types must match"); - if (!(yyvsp[-3].ConstVal)->getType()->isInteger()) { - if (Instruction::isShift((yyvsp[-5].BinaryOpVal)) || !isa((yyvsp[-3].ConstVal)->getType()) || - !cast((yyvsp[-3].ConstVal)->getType())->getElementType()->isInteger()) + if (!yyvsp[-3].ConstVal->getType()->isInteger()) { + if (Instruction::isShift(yyvsp[-5].BinaryOpVal) || !isa(yyvsp[-3].ConstVal->getType()) || + !cast(yyvsp[-3].ConstVal->getType())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } - (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 168: -#line 1878 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + ; + break;} +case 167: +#line 1878 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("icmp operand types must match"); - (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[-5].IPredicate), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); - ;} - break; - - case 169: -#line 1883 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + yyval.ConstVal = ConstantExpr::getICmp(yyvsp[-5].IPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + ; + break;} +case 168: +#line 1883 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("fcmp operand types must match"); - (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[-5].FPredicate), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); - ;} - break; - - case 170: -#line 1888 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) + yyval.ConstVal = ConstantExpr::getFCmp(yyvsp[-5].FPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + ; + break;} +case 169: +#line 1888 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!ExtractElementInst::isValidOperands(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) GEN_ERROR("Invalid extractelement operands"); - (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + yyval.ConstVal = ConstantExpr::getExtractElement(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 171: -#line 1894 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) + ; + break;} +case 170: +#line 1894 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!InsertElementInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) GEN_ERROR("Invalid insertelement operands"); - (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + yyval.ConstVal = ConstantExpr::getInsertElement(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 172: -#line 1900 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) + ; + break;} +case 171: +#line 1900 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!ShuffleVectorInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) GEN_ERROR("Invalid shufflevector operands"); - (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + yyval.ConstVal = ConstantExpr::getShuffleVector(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 173: -#line 1909 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); + ; + break;} +case 172: +#line 1909 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 174: -#line 1913 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ConstVector) = new std::vector(); - (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); + ; + break;} +case 173: +#line 1913 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ConstVector = new std::vector(); + yyval.ConstVector->push_back(yyvsp[0].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 175: -#line 1921 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.BoolVal) = false; ;} - break; - - case 176: -#line 1921 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.BoolVal) = true; ;} - break; - - case 177: -#line 1924 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.BoolVal) = true; ;} - break; - - case 178: -#line 1924 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.BoolVal) = false; ;} - break; - - case 179: -#line 1935 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; + ; + break;} +case 174: +#line 1921 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = false; ; + break;} +case 175: +#line 1921 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = true; ; + break;} +case 176: +#line 1924 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = true; ; + break;} +case 177: +#line 1924 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = false; ; + break;} +case 178: +#line 1935 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ModuleVal = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ;} - break; - - case 180: -#line 1940 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; + ; + break;} +case 179: +#line 1940 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ModuleVal = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ;} - break; - - case 183: -#line 1953 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { CurFun.isDeclare = false; ;} - break; - - case 184: -#line 1953 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 182: +#line 1953 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurFun.isDeclare = false; ; + break;} +case 183: +#line 1953 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurFun.FunctionDone(); CHECK_FOR_ERROR - ;} - break; - - case 185: -#line 1957 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { CurFun.isDeclare = true; ;} - break; - - case 186: -#line 1957 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 184: +#line 1957 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurFun.isDeclare = true; ; + break;} +case 185: +#line 1957 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 187: -#line 1960 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 186: +#line 1960 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 188: -#line 1963 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 187: +#line 1963 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: // @@ -4371,250 +3635,228 @@ // If types are not resolved eagerly, then the two types will not be // determined to be the same type! // - ResolveTypeTo((yyvsp[-2].StrVal), *(yyvsp[0].TypeVal)); + ResolveTypeTo(yyvsp[-2].StrVal, *yyvsp[0].TypeVal); - if (!setTypeName(*(yyvsp[0].TypeVal), (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) { + if (!setTypeName(*yyvsp[0].TypeVal, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back(*(yyvsp[0].TypeVal)); + CurModule.Types.push_back(*yyvsp[0].TypeVal); } - delete (yyvsp[0].TypeVal); + delete yyvsp[0].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 189: -#line 1987 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - ResolveTypeTo((yyvsp[-2].StrVal), (yyvsp[0].PrimType)); + ; + break;} +case 188: +#line 1987 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + ResolveTypeTo(yyvsp[-2].StrVal, yyvsp[0].PrimType); - if (!setTypeName((yyvsp[0].PrimType), (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) { + if (!setTypeName(yyvsp[0].PrimType, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back((yyvsp[0].PrimType)); + CurModule.Types.push_back(yyvsp[0].PrimType); } CHECK_FOR_ERROR - ;} - break; - - case 190: -#line 1998 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 189: +#line 1998 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ /* "Externally Visible" Linkage */ - if ((yyvsp[0].ConstVal) == 0) + if (yyvsp[0].ConstVal == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable((yyvsp[-4].StrVal), GlobalValue::ExternalLinkage, - (yyvsp[-3].Visibility), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal), (yyvsp[-2].BoolVal)); + CurGV = ParseGlobalVariable(yyvsp[-4].StrVal, GlobalValue::ExternalLinkage, + yyvsp[-3].Visibility, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal, yyvsp[-2].BoolVal); CHECK_FOR_ERROR - ;} - break; - - case 191: -#line 2005 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 190: +#line 2005 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurGV = 0; - ;} - break; - - case 192: -#line 2008 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[0].ConstVal) == 0) + ; + break;} +case 191: +#line 2008 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[0].ConstVal == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable((yyvsp[-5].StrVal), (yyvsp[-4].Linkage), (yyvsp[-3].Visibility), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal), (yyvsp[-2].BoolVal)); + CurGV = ParseGlobalVariable(yyvsp[-5].StrVal, yyvsp[-4].Linkage, yyvsp[-3].Visibility, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal, yyvsp[-2].BoolVal); CHECK_FOR_ERROR - ;} - break; - - case 193: -#line 2013 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 192: +#line 2013 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurGV = 0; - ;} - break; - - case 194: -#line 2016 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 193: +#line 2016 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); - CurGV = ParseGlobalVariable((yyvsp[-5].StrVal), (yyvsp[-4].Linkage), (yyvsp[-3].Visibility), (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0, (yyvsp[-2].BoolVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + CurGV = ParseGlobalVariable(yyvsp[-5].StrVal, yyvsp[-4].Linkage, yyvsp[-3].Visibility, yyvsp[-1].BoolVal, *yyvsp[0].TypeVal, 0, yyvsp[-2].BoolVal); CHECK_FOR_ERROR - delete (yyvsp[0].TypeVal); - ;} - break; - - case 195: -#line 2022 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[0].TypeVal; + ; + break;} +case 194: +#line 2022 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurGV = 0; CHECK_FOR_ERROR - ;} - break; - - case 196: -#line 2026 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - CHECK_FOR_ERROR - ;} - break; - - case 197: -#line 2029 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 195: +#line 2026 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CHECK_FOR_ERROR + ; + break;} +case 196: +#line 2029 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 198: -#line 2035 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 197: +#line 2035 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); - char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); - std::string NewAsm((yyvsp[0].StrVal), EndStr); - free((yyvsp[0].StrVal)); + char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); + std::string NewAsm(yyvsp[0].StrVal, EndStr); + free(yyvsp[0].StrVal); if (AsmSoFar.empty()) CurModule.CurrentModule->setModuleInlineAsm(NewAsm); else CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+NewAsm); CHECK_FOR_ERROR -;} - break; - - case 199: -#line 2048 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal)); - free((yyvsp[0].StrVal)); - ;} - break; - - case 200: -#line 2052 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal)); - free((yyvsp[0].StrVal)); - ;} - break; - - case 202: -#line 2059 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); - free((yyvsp[0].StrVal)); +; + break;} +case 198: +#line 2048 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->setTargetTriple(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); + ; + break;} +case 199: +#line 2052 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->setDataLayout(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); + ; + break;} +case 201: +#line 2059 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); CHECK_FOR_ERROR - ;} - break; - - case 203: -#line 2064 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); - free((yyvsp[0].StrVal)); + ; + break;} +case 202: +#line 2064 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); CHECK_FOR_ERROR - ;} - break; - - case 204: -#line 2069 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 203: +#line 2069 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 205: -#line 2078 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 204: +#line 2078 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); - if (*(yyvsp[-2].TypeVal) == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + if (*yyvsp[-2].TypeVal == Type::VoidTy) GEN_ERROR("void typed arguments are invalid"); - ArgListEntry E; E.Attrs = (yyvsp[-1].ParamAttrs); E.Ty = (yyvsp[-2].TypeVal); E.Name = (yyvsp[0].StrVal); - (yyval.ArgList) = (yyvsp[-4].ArgList); - (yyvsp[-4].ArgList)->push_back(E); - CHECK_FOR_ERROR - ;} - break; - - case 206: -#line 2088 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal; + yyval.ArgList = yyvsp[-4].ArgList; + yyvsp[-4].ArgList->push_back(E); + CHECK_FOR_ERROR + ; + break;} +case 205: +#line 2088 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); - if (*(yyvsp[-2].TypeVal) == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + if (*yyvsp[-2].TypeVal == Type::VoidTy) GEN_ERROR("void typed arguments are invalid"); - ArgListEntry E; E.Attrs = (yyvsp[-1].ParamAttrs); E.Ty = (yyvsp[-2].TypeVal); E.Name = (yyvsp[0].StrVal); - (yyval.ArgList) = new ArgListType; - (yyval.ArgList)->push_back(E); - CHECK_FOR_ERROR - ;} - break; - - case 207: -#line 2099 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = (yyvsp[0].ArgList); + ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal; + yyval.ArgList = new ArgListType; + yyval.ArgList->push_back(E); + CHECK_FOR_ERROR + ; + break;} +case 206: +#line 2099 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = yyvsp[0].ArgList; CHECK_FOR_ERROR - ;} - break; - - case 208: -#line 2103 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = (yyvsp[-2].ArgList); + ; + break;} +case 207: +#line 2103 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = yyvsp[-2].ArgList; struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = ParamAttr::None; - (yyval.ArgList)->push_back(E); + yyval.ArgList->push_back(E); CHECK_FOR_ERROR - ;} - break; - - case 209: -#line 2112 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = new ArgListType; + ; + break;} +case 208: +#line 2112 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = new ArgListType; struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = ParamAttr::None; - (yyval.ArgList)->push_back(E); + yyval.ArgList->push_back(E); CHECK_FOR_ERROR - ;} - break; - - case 210: -#line 2121 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = 0; + ; + break;} +case 209: +#line 2121 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = 0; CHECK_FOR_ERROR - ;} - break; - - case 211: -#line 2127 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - UnEscapeLexed((yyvsp[-6].StrVal)); - std::string FunctionName((yyvsp[-6].StrVal)); - free((yyvsp[-6].StrVal)); // Free strdup'd memory! + ; + break;} +case 210: +#line 2127 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + UnEscapeLexed(yyvsp[-6].StrVal); + std::string FunctionName(yyvsp[-6].StrVal); + free(yyvsp[-6].StrVal); // Free strdup'd memory! // Check the function result for abstractness if this is a define. We should // have no abstract types at this point - if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[-7].TypeVal))) - GEN_ERROR("Reference to abstract result: "+ (yyvsp[-7].TypeVal)->get()->getDescription()); + if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(yyvsp[-7].TypeVal)) + GEN_ERROR("Reference to abstract result: "+ yyvsp[-7].TypeVal->get()->getDescription()); std::vector ParamTypeList; ParamAttrsList ParamAttrs; - if ((yyvsp[-2].ParamAttrs) != ParamAttr::None) - ParamAttrs.addAttributes(0, (yyvsp[-2].ParamAttrs)); - if ((yyvsp[-4].ArgList)) { // If there are arguments... + if (yyvsp[-2].ParamAttrs != ParamAttr::None) + ParamAttrs.addAttributes(0, yyvsp[-2].ParamAttrs); + if (yyvsp[-4].ArgList) { // If there are arguments... unsigned index = 1; - for (ArgListType::iterator I = (yyvsp[-4].ArgList)->begin(); I != (yyvsp[-4].ArgList)->end(); ++I, ++index) { + for (ArgListType::iterator I = yyvsp[-4].ArgList->begin(); I != yyvsp[-4].ArgList->end(); ++I, ++index) { const Type* Ty = I->Ty->get(); if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty)) GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); @@ -4632,10 +3874,10 @@ if (!ParamAttrs.empty()) ActualAttrs = new ParamAttrsList(ParamAttrs); - FunctionType *FT = FunctionType::get(*(yyvsp[-7].TypeVal), ParamTypeList, isVarArg, + FunctionType *FT = FunctionType::get(*yyvsp[-7].TypeVal, ParamTypeList, isVarArg, ActualAttrs); const PointerType *PFT = PointerType::get(FT); - delete (yyvsp[-7].TypeVal); + delete yyvsp[-7].TypeVal; ValID ID; if (!FunctionName.empty()) { @@ -4684,26 +3926,26 @@ Fn->setLinkage(CurFun.Linkage); Fn->setVisibility(CurFun.Visibility); } - Fn->setCallingConv((yyvsp[-8].UIntVal)); - Fn->setAlignment((yyvsp[0].UIntVal)); - if ((yyvsp[-1].StrVal)) { - Fn->setSection((yyvsp[-1].StrVal)); - free((yyvsp[-1].StrVal)); + Fn->setCallingConv(yyvsp[-8].UIntVal); + Fn->setAlignment(yyvsp[0].UIntVal); + if (yyvsp[-1].StrVal) { + Fn->setSection(yyvsp[-1].StrVal); + free(yyvsp[-1].StrVal); } // Add all of the arguments we parsed to the function... - if ((yyvsp[-4].ArgList)) { // Is null if empty... + if (yyvsp[-4].ArgList) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert((yyvsp[-4].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[-4].ArgList)->back().Name == 0 && + assert(yyvsp[-4].ArgList->back().Ty->get() == Type::VoidTy && yyvsp[-4].ArgList->back().Name == 0 && "Not a varargs marker!"); - delete (yyvsp[-4].ArgList)->back().Ty; - (yyvsp[-4].ArgList)->pop_back(); // Delete the last entry + delete yyvsp[-4].ArgList->back().Ty; + yyvsp[-4].ArgList->pop_back(); // Delete the last entry } Function::arg_iterator ArgIt = Fn->arg_begin(); Function::arg_iterator ArgEnd = Fn->arg_end(); unsigned Idx = 1; - for (ArgListType::iterator I = (yyvsp[-4].ArgList)->begin(); - I != (yyvsp[-4].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { + for (ArgListType::iterator I = yyvsp[-4].ArgList->begin(); + I != yyvsp[-4].ArgList->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { delete I->Ty; // Delete the typeholder... setValueName(ArgIt, I->Name); // Insert arg into symtab... CHECK_FOR_ERROR @@ -4711,364 +3953,330 @@ Idx++; } - delete (yyvsp[-4].ArgList); // We're now done with the argument list + delete yyvsp[-4].ArgList; // We're now done with the argument list } CHECK_FOR_ERROR -;} - break; - - case 214: -#line 2247 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.FunctionVal) = CurFun.CurrentFunction; +; + break;} +case 213: +#line 2247 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.FunctionVal = CurFun.CurrentFunction; // Make sure that we keep track of the linkage type even if there was a // previous "declare". - (yyval.FunctionVal)->setLinkage((yyvsp[-3].Linkage)); - (yyval.FunctionVal)->setVisibility((yyvsp[-2].Visibility)); -;} - break; - - case 217: -#line 2258 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); + yyval.FunctionVal->setLinkage(yyvsp[-3].Linkage); + yyval.FunctionVal->setVisibility(yyvsp[-2].Visibility); +; + break;} +case 216: +#line 2258 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.FunctionVal = yyvsp[-1].FunctionVal; CHECK_FOR_ERROR -;} - break; - - case 218: -#line 2263 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - CurFun.CurrentFunction->setLinkage((yyvsp[-2].Linkage)); - CurFun.CurrentFunction->setVisibility((yyvsp[-1].Visibility)); - (yyval.FunctionVal) = CurFun.CurrentFunction; +; + break;} +case 217: +#line 2263 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurFun.CurrentFunction->setLinkage(yyvsp[-2].Linkage); + CurFun.CurrentFunction->setVisibility(yyvsp[-1].Visibility); + yyval.FunctionVal = CurFun.CurrentFunction; CurFun.FunctionDone(); CHECK_FOR_ERROR - ;} - break; - - case 219: -#line 2275 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = false; - CHECK_FOR_ERROR - ;} - break; - - case 220: -#line 2279 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = true; - CHECK_FOR_ERROR - ;} - break; - - case 221: -#line 2284 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // A reference to a direct constant - (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); - CHECK_FOR_ERROR - ;} - break; - - case 222: -#line 2288 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); - CHECK_FOR_ERROR - ;} - break; - - case 223: -#line 2292 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Perhaps it's an FP constant? - (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); - CHECK_FOR_ERROR - ;} - break; - - case 224: -#line 2296 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); - CHECK_FOR_ERROR - ;} - break; - - case 225: -#line 2300 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); - CHECK_FOR_ERROR - ;} - break; - - case 226: -#line 2304 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::createNull(); - CHECK_FOR_ERROR - ;} - break; - - case 227: -#line 2308 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::createUndef(); - CHECK_FOR_ERROR - ;} - break; - - case 228: -#line 2312 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // A vector zero constant. - (yyval.ValIDVal) = ValID::createZeroInit(); - CHECK_FOR_ERROR - ;} - break; - - case 229: -#line 2316 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized packed vector - const Type *ETy = (*(yyvsp[-1].ConstVector))[0]->getType(); - int NumElements = (yyvsp[-1].ConstVector)->size(); - - VectorType* pt = VectorType::get(ETy, NumElements); - PATypeHolder* PTy = new PATypeHolder( - HandleUpRefs( - VectorType::get( - ETy, - NumElements) - ) - ); - - // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) - GEN_ERROR("Element #" + utostr(i) + " is not of type '" + - ETy->getDescription() +"' as required!\nIt is of type '" + - (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); - } - - (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[-1].ConstVector))); - delete PTy; delete (yyvsp[-1].ConstVector); - CHECK_FOR_ERROR - ;} - break; - - case 230: -#line 2341 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal)); - CHECK_FOR_ERROR - ;} - break; - - case 231: -#line 2345 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - char *End = UnEscapeLexed((yyvsp[-2].StrVal), true); - std::string AsmStr = std::string((yyvsp[-2].StrVal), End); - End = UnEscapeLexed((yyvsp[0].StrVal), true); - std::string Constraints = std::string((yyvsp[0].StrVal), End); - (yyval.ValIDVal) = ValID::createInlineAsm(AsmStr, Constraints, (yyvsp[-3].BoolVal)); - free((yyvsp[-2].StrVal)); - free((yyvsp[0].StrVal)); - CHECK_FOR_ERROR - ;} - break; - - case 232: -#line 2359 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Is it an integer reference...? - (yyval.ValIDVal) = ValID::createLocalID((yyvsp[0].UIntVal)); - CHECK_FOR_ERROR - ;} - break; - - case 233: -#line 2363 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[0].UIntVal)); - CHECK_FOR_ERROR - ;} - break; - - case 234: -#line 2367 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Is it a named reference...? - (yyval.ValIDVal) = ValID::createLocalName((yyvsp[0].StrVal)); - CHECK_FOR_ERROR - ;} - break; - - case 235: -#line 2371 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Is it a named reference...? - (yyval.ValIDVal) = ValID::createGlobalName((yyvsp[0].StrVal)); - CHECK_FOR_ERROR - ;} - break; - - case 238: -#line 2383 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - (yyval.ValueVal) = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); - delete (yyvsp[-1].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 239: -#line 2392 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); - CHECK_FOR_ERROR - ;} - break; - - case 240: -#line 2396 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Do not allow functions with 0 basic blocks - (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); - CHECK_FOR_ERROR - ;} - break; - - case 241: -#line 2405 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - setValueName((yyvsp[0].TermInstVal), (yyvsp[-1].StrVal)); + ; + break;} +case 218: +#line 2275 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = false; CHECK_FOR_ERROR - InsertValue((yyvsp[0].TermInstVal)); - (yyvsp[-2].BasicBlockVal)->getInstList().push_back((yyvsp[0].TermInstVal)); - (yyval.BasicBlockVal) = (yyvsp[-2].BasicBlockVal); + ; + break;} +case 219: +#line 2279 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = true; CHECK_FOR_ERROR - ;} - break; - - case 242: -#line 2414 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if (CastInst *CI1 = dyn_cast((yyvsp[0].InstVal))) - if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) - if (CI2->getParent() == 0) - (yyvsp[-1].BasicBlockVal)->getInstList().push_back(CI2); - (yyvsp[-1].BasicBlockVal)->getInstList().push_back((yyvsp[0].InstVal)); - (yyval.BasicBlockVal) = (yyvsp[-1].BasicBlockVal); + ; + break;} +case 220: +#line 2284 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // A reference to a direct constant + yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val); + CHECK_FOR_ERROR + ; + break;} +case 221: +#line 2288 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val); CHECK_FOR_ERROR - ;} - break; - - case 243: -#line 2423 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Empty space between instruction lists - (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); + ; + break;} +case 222: +#line 2292 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Perhaps it's an FP constant? + yyval.ValIDVal = ValID::create(yyvsp[0].FPVal); + CHECK_FOR_ERROR + ; + break;} +case 223: +#line 2296 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR - ;} - break; - - case 244: -#line 2427 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Labelled (named) basic block - (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName((yyvsp[0].StrVal))); + ; + break;} +case 224: +#line 2300 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR - ;} - break; - - case 245: -#line 2432 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Return with a result... - (yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal)); + ; + break;} +case 225: +#line 2304 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::createNull(); CHECK_FOR_ERROR - ;} - break; - - case 246: -#line 2436 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Return with no result... - (yyval.TermInstVal) = new ReturnInst(); + ; + break;} +case 226: +#line 2308 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::createUndef(); CHECK_FOR_ERROR - ;} - break; + ; + break;} +case 227: +#line 2312 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // A vector zero constant. + yyval.ValIDVal = ValID::createZeroInit(); + CHECK_FOR_ERROR + ; + break;} +case 228: +#line 2316 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized packed vector + const Type *ETy = (*yyvsp[-1].ConstVector)[0]->getType(); + int NumElements = yyvsp[-1].ConstVector->size(); + + VectorType* pt = VectorType::get(ETy, NumElements); + PATypeHolder* PTy = new PATypeHolder( + HandleUpRefs( + VectorType::get( + ETy, + NumElements) + ) + ); + + // Verify all elements are correct type! + for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { + if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) + GEN_ERROR("Element #" + utostr(i) + " is not of type '" + + ETy->getDescription() +"' as required!\nIt is of type '" + + (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); + } - case 247: -#line 2440 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Unconditional Branch... - BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); + yyval.ValIDVal = ValID::create(ConstantVector::get(pt, *yyvsp[-1].ConstVector)); + delete PTy; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - (yyval.TermInstVal) = new BranchInst(tmpBB); - ;} - break; - - case 248: -#line 2445 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - assert(cast((yyvsp[-7].PrimType))->getBitWidth() == 1 && "Not Bool?"); - BasicBlock* tmpBBA = getBBVal((yyvsp[-3].ValIDVal)); + ; + break;} +case 229: +#line 2341 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal); + CHECK_FOR_ERROR + ; + break;} +case 230: +#line 2345 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + char *End = UnEscapeLexed(yyvsp[-2].StrVal, true); + std::string AsmStr = std::string(yyvsp[-2].StrVal, End); + End = UnEscapeLexed(yyvsp[0].StrVal, true); + std::string Constraints = std::string(yyvsp[0].StrVal, End); + yyval.ValIDVal = ValID::createInlineAsm(AsmStr, Constraints, yyvsp[-3].BoolVal); + free(yyvsp[-2].StrVal); + free(yyvsp[0].StrVal); + CHECK_FOR_ERROR + ; + break;} +case 231: +#line 2359 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is it an integer reference...? + yyval.ValIDVal = ValID::createLocalID(yyvsp[0].UIntVal); + CHECK_FOR_ERROR + ; + break;} +case 232: +#line 2363 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::createGlobalID(yyvsp[0].UIntVal); CHECK_FOR_ERROR - BasicBlock* tmpBBB = getBBVal((yyvsp[0].ValIDVal)); + ; + break;} +case 233: +#line 2367 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is it a named reference...? + yyval.ValIDVal = ValID::createLocalName(yyvsp[0].StrVal); + CHECK_FOR_ERROR + ; + break;} +case 234: +#line 2371 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is it a named reference...? + yyval.ValIDVal = ValID::createGlobalName(yyvsp[0].StrVal); + CHECK_FOR_ERROR + ; + break;} +case 237: +#line 2383 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!UpRefs.empty()) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + yyval.ValueVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 238: +#line 2392 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.FunctionVal = yyvsp[-1].FunctionVal; CHECK_FOR_ERROR - Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[-6].ValIDVal)); + ; + break;} +case 239: +#line 2396 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Do not allow functions with 0 basic blocks + yyval.FunctionVal = yyvsp[-1].FunctionVal; + CHECK_FOR_ERROR + ; + break;} +case 240: +#line 2405 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal); CHECK_FOR_ERROR - (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal); - ;} - break; - - case 249: -#line 2455 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - Value* tmpVal = getVal((yyvsp[-7].PrimType), (yyvsp[-6].ValIDVal)); + InsertValue(yyvsp[0].TermInstVal); + yyvsp[-2].BasicBlockVal->getInstList().push_back(yyvsp[0].TermInstVal); + yyval.BasicBlockVal = yyvsp[-2].BasicBlockVal; + CHECK_FOR_ERROR + ; + break;} +case 241: +#line 2414 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (CastInst *CI1 = dyn_cast(yyvsp[0].InstVal)) + if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) + if (CI2->getParent() == 0) + yyvsp[-1].BasicBlockVal->getInstList().push_back(CI2); + yyvsp[-1].BasicBlockVal->getInstList().push_back(yyvsp[0].InstVal); + yyval.BasicBlockVal = yyvsp[-1].BasicBlockVal; + CHECK_FOR_ERROR + ; + break;} +case 242: +#line 2423 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Empty space between instruction lists + yyval.BasicBlockVal = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); + CHECK_FOR_ERROR + ; + break;} +case 243: +#line 2427 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Labelled (named) basic block + yyval.BasicBlockVal = defineBBVal(ValID::createLocalName(yyvsp[0].StrVal)); + CHECK_FOR_ERROR + ; + break;} +case 244: +#line 2432 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Return with a result... + yyval.TermInstVal = new ReturnInst(yyvsp[0].ValueVal); + CHECK_FOR_ERROR + ; + break;} +case 245: +#line 2436 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Return with no result... + yyval.TermInstVal = new ReturnInst(); + CHECK_FOR_ERROR + ; + break;} +case 246: +#line 2440 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Unconditional Branch... + BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); + CHECK_FOR_ERROR + yyval.TermInstVal = new BranchInst(tmpBB); + ; + break;} +case 247: +#line 2445 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + assert(cast(yyvsp[-7].PrimType)->getBitWidth() == 1 && "Not Bool?"); + BasicBlock* tmpBBA = getBBVal(yyvsp[-3].ValIDVal); + CHECK_FOR_ERROR + BasicBlock* tmpBBB = getBBVal(yyvsp[0].ValIDVal); + CHECK_FOR_ERROR + Value* tmpVal = getVal(Type::Int1Ty, yyvsp[-6].ValIDVal); + CHECK_FOR_ERROR + yyval.TermInstVal = new BranchInst(tmpBBA, tmpBBB, tmpVal); + ; + break;} +case 248: +#line 2455 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + Value* tmpVal = getVal(yyvsp[-7].PrimType, yyvsp[-6].ValIDVal); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[-3].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[-3].ValIDVal); CHECK_FOR_ERROR - SwitchInst *S = new SwitchInst(tmpVal, tmpBB, (yyvsp[-1].JumpTable)->size()); - (yyval.TermInstVal) = S; + SwitchInst *S = new SwitchInst(tmpVal, tmpBB, yyvsp[-1].JumpTable->size()); + yyval.TermInstVal = S; - std::vector >::iterator I = (yyvsp[-1].JumpTable)->begin(), - E = (yyvsp[-1].JumpTable)->end(); + std::vector >::iterator I = yyvsp[-1].JumpTable->begin(), + E = yyvsp[-1].JumpTable->end(); for (; I != E; ++I) { if (ConstantInt *CI = dyn_cast(I->first)) S->addCase(CI, I->second); else GEN_ERROR("Switch case is constant, but not a simple integer"); } - delete (yyvsp[-1].JumpTable); + delete yyvsp[-1].JumpTable; CHECK_FOR_ERROR - ;} - break; - - case 250: -#line 2474 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - Value* tmpVal = getVal((yyvsp[-6].PrimType), (yyvsp[-5].ValIDVal)); + ; + break;} +case 249: +#line 2474 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + Value* tmpVal = getVal(yyvsp[-6].PrimType, yyvsp[-5].ValIDVal); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[-2].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[-2].ValIDVal); CHECK_FOR_ERROR SwitchInst *S = new SwitchInst(tmpVal, tmpBB, 0); - (yyval.TermInstVal) = S; + yyval.TermInstVal = S; CHECK_FOR_ERROR - ;} - break; - - case 251: -#line 2484 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 250: +#line 2484 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Handle the short syntax const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast((yyvsp[-11].TypeVal)->get())) || + if (!(PFTy = dyn_cast(yyvsp[-11].TypeVal->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; ParamAttrsList ParamAttrs; - if ((yyvsp[-6].ParamAttrs) != ParamAttr::None) - ParamAttrs.addAttributes(0, (yyvsp[-6].ParamAttrs)); - ValueRefList::iterator I = (yyvsp[-8].ValueRefList)->begin(), E = (yyvsp[-8].ValueRefList)->end(); + if (yyvsp[-6].ParamAttrs != ParamAttr::None) + ParamAttrs.addAttributes(0, yyvsp[-6].ParamAttrs); + ValueRefList::iterator I = yyvsp[-8].ValueRefList->begin(), E = yyvsp[-8].ValueRefList->end(); unsigned index = 1; for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); @@ -5082,22 +4290,22 @@ ParamAttrsList *Attrs = 0; if (!ParamAttrs.empty()) Attrs = new ParamAttrsList(ParamAttrs); - Ty = FunctionType::get((yyvsp[-11].TypeVal)->get(), ParamTypes, false, Attrs); + Ty = FunctionType::get(yyvsp[-11].TypeVal->get(), ParamTypes, false, Attrs); PFTy = PointerType::get(Ty); } - delete (yyvsp[-11].TypeVal); + delete yyvsp[-11].TypeVal; - Value *V = getVal(PFTy, (yyvsp[-10].ValIDVal)); // Get the function we're calling... + Value *V = getVal(PFTy, yyvsp[-10].ValIDVal); // Get the function we're calling... CHECK_FOR_ERROR - BasicBlock *Normal = getBBVal((yyvsp[-3].ValIDVal)); + BasicBlock *Normal = getBBVal(yyvsp[-3].ValIDVal); CHECK_FOR_ERROR - BasicBlock *Except = getBBVal((yyvsp[0].ValIDVal)); + BasicBlock *Except = getBBVal(yyvsp[0].ValIDVal); CHECK_FOR_ERROR // Check the arguments ValueList Args; - if ((yyvsp[-8].ValueRefList)->empty()) { // Has no arguments? + if (yyvsp[-8].ValueRefList->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -5107,7 +4315,7 @@ // correctly! FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = (yyvsp[-8].ValueRefList)->begin(), ArgE = (yyvsp[-8].ValueRefList)->end(); + ValueRefList::iterator ArgI = yyvsp[-8].ValueRefList->begin(), ArgE = yyvsp[-8].ValueRefList->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -5126,346 +4334,320 @@ // Create the InvokeInst InvokeInst *II = new InvokeInst(V, Normal, Except, &Args[0], Args.size()); - II->setCallingConv((yyvsp[-12].UIntVal)); - (yyval.TermInstVal) = II; - delete (yyvsp[-8].ValueRefList); - CHECK_FOR_ERROR - ;} - break; - - case 252: -#line 2559 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TermInstVal) = new UnwindInst(); + II->setCallingConv(yyvsp[-12].UIntVal); + yyval.TermInstVal = II; + delete yyvsp[-8].ValueRefList; + CHECK_FOR_ERROR + ; + break;} +case 251: +#line 2559 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TermInstVal = new UnwindInst(); CHECK_FOR_ERROR - ;} - break; - - case 253: -#line 2563 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TermInstVal) = new UnreachableInst(); + ; + break;} +case 252: +#line 2563 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TermInstVal = new UnreachableInst(); CHECK_FOR_ERROR - ;} - break; - - case 254: -#line 2570 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.JumpTable) = (yyvsp[-5].JumpTable); - Constant *V = cast(getExistingVal((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); + ; + break;} +case 253: +#line 2570 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.JumpTable = yyvsp[-5].JumpTable; + Constant *V = cast(getExistingVal(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value"); - BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); - ;} - break; - - case 255: -#line 2581 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.JumpTable) = new std::vector >(); - Constant *V = cast(getExistingVal((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); + yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); + ; + break;} +case 254: +#line 2581 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.JumpTable = new std::vector >(); + Constant *V = cast(getExistingVal(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value"); - BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); - ;} - break; - - case 256: -#line 2594 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); + ; + break;} +case 255: +#line 2594 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is this definition named?? if so, assign the name... - setValueName((yyvsp[0].InstVal), (yyvsp[-1].StrVal)); + setValueName(yyvsp[0].InstVal, yyvsp[-1].StrVal); CHECK_FOR_ERROR - InsertValue((yyvsp[0].InstVal)); - (yyval.InstVal) = (yyvsp[0].InstVal); + InsertValue(yyvsp[0].InstVal); + yyval.InstVal = yyvsp[0].InstVal; CHECK_FOR_ERROR - ;} - break; - - case 257: -#line 2604 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { // Used for PHI nodes + ; + break;} +case 256: +#line 2604 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Used for PHI nodes if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-5].TypeVal))->getDescription()); - (yyval.PHIList) = new std::list >(); - Value* tmpVal = getVal(*(yyvsp[-5].TypeVal), (yyvsp[-3].ValIDVal)); - CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[-1].ValIDVal)); - CHECK_FOR_ERROR - (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); - delete (yyvsp[-5].TypeVal); - ;} - break; - - case 258: -#line 2615 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.PHIList) = (yyvsp[-6].PHIList); - Value* tmpVal = getVal((yyvsp[-6].PHIList)->front().first->getType(), (yyvsp[-3].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-5].TypeVal)->getDescription()); + yyval.PHIList = new std::list >(); + Value* tmpVal = getVal(*yyvsp[-5].TypeVal, yyvsp[-3].ValIDVal); + CHECK_FOR_ERROR + BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal); + CHECK_FOR_ERROR + yyval.PHIList->push_back(std::make_pair(tmpVal, tmpBB)); + delete yyvsp[-5].TypeVal; + ; + break;} +case 257: +#line 2615 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.PHIList = yyvsp[-6].PHIList; + Value* tmpVal = getVal(yyvsp[-6].PHIList->front().first->getType(), yyvsp[-3].ValIDVal); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[-1].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyvsp[-6].PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); - ;} - break; - - case 259: -#line 2625 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + yyvsp[-6].PHIList->push_back(std::make_pair(tmpVal, tmpBB)); + ; + break;} +case 258: +#line 2625 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); // Used for call and invoke instructions - (yyval.ValueRefList) = new ValueRefList(); - ValueRefListEntry E; E.Attrs = (yyvsp[0].ParamAttrs); E.Val = getVal((yyvsp[-2].TypeVal)->get(), (yyvsp[-1].ValIDVal)); - (yyval.ValueRefList)->push_back(E); - delete (yyvsp[-2].TypeVal); - ;} - break; - - case 260: -#line 2634 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + yyval.ValueRefList = new ValueRefList(); + ValueRefListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-2].TypeVal->get(), yyvsp[-1].ValIDVal); + yyval.ValueRefList->push_back(E); + delete yyvsp[-2].TypeVal; + ; + break;} +case 259: +#line 2634 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); - (yyval.ValueRefList) = (yyvsp[-4].ValueRefList); - ValueRefListEntry E; E.Attrs = (yyvsp[0].ParamAttrs); E.Val = getVal((yyvsp[-2].TypeVal)->get(), (yyvsp[-1].ValIDVal)); - (yyval.ValueRefList)->push_back(E); - delete (yyvsp[-2].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 261: -#line 2643 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.ValueRefList) = new ValueRefList(); ;} - break; - - case 262: -#line 2646 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { (yyval.ValueList) = new std::vector(); ;} - break; - - case 263: -#line 2647 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValueList) = (yyvsp[-2].ValueList); - (yyval.ValueList)->push_back((yyvsp[0].ValueVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + yyval.ValueRefList = yyvsp[-4].ValueRefList; + ValueRefListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-2].TypeVal->get(), yyvsp[-1].ValIDVal); + yyval.ValueRefList->push_back(E); + delete yyvsp[-2].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 260: +#line 2643 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValueRefList = new ValueRefList(); ; + break;} +case 261: +#line 2646 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValueList = new std::vector(); ; + break;} +case 262: +#line 2647 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValueList = yyvsp[-2].ValueList; + yyval.ValueList->push_back(yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 264: -#line 2654 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = true; + ; + break;} +case 263: +#line 2654 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = true; CHECK_FOR_ERROR - ;} - break; - - case 265: -#line 2658 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = false; + ; + break;} +case 264: +#line 2658 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = false; CHECK_FOR_ERROR - ;} - break; - - case 266: -#line 2663 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 265: +#line 2663 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); - if (!(*(yyvsp[-3].TypeVal))->isInteger() && !(*(yyvsp[-3].TypeVal))->isFloatingPoint() && - !isa((*(yyvsp[-3].TypeVal)).get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + if (!(*yyvsp[-3].TypeVal)->isInteger() && !(*yyvsp[-3].TypeVal)->isFloatingPoint() && + !isa((*yyvsp[-3].TypeVal).get())) GEN_ERROR( "Arithmetic operator requires integer, FP, or packed operands"); - if (isa((*(yyvsp[-3].TypeVal)).get()) && - ((yyvsp[-4].BinaryOpVal) == Instruction::URem || - (yyvsp[-4].BinaryOpVal) == Instruction::SRem || - (yyvsp[-4].BinaryOpVal) == Instruction::FRem)) + if (isa((*yyvsp[-3].TypeVal).get()) && + (yyvsp[-4].BinaryOpVal == Instruction::URem || + yyvsp[-4].BinaryOpVal == Instruction::SRem || + yyvsp[-4].BinaryOpVal == Instruction::FRem)) GEN_ERROR("Remainder not supported on vector types"); - Value* val1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); + Value* val1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); CHECK_FOR_ERROR - Value* val2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); + Value* val2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = BinaryOperator::create((yyvsp[-4].BinaryOpVal), val1, val2); - if ((yyval.InstVal) == 0) + yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, val1, val2); + if (yyval.InstVal == 0) GEN_ERROR("binary operator returned null"); - delete (yyvsp[-3].TypeVal); - ;} - break; - - case 267: -#line 2684 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-3].TypeVal; + ; + break;} +case 266: +#line 2684 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); - if (!(*(yyvsp[-3].TypeVal))->isInteger()) { - if (Instruction::isShift((yyvsp[-4].BinaryOpVal)) || !isa((yyvsp[-3].TypeVal)->get()) || - !cast((yyvsp[-3].TypeVal)->get())->getElementType()->isInteger()) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + if (!(*yyvsp[-3].TypeVal)->isInteger()) { + if (Instruction::isShift(yyvsp[-4].BinaryOpVal) || !isa(yyvsp[-3].TypeVal->get()) || + !cast(yyvsp[-3].TypeVal->get())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } - Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); + Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); + Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = BinaryOperator::create((yyvsp[-4].BinaryOpVal), tmpVal1, tmpVal2); - if ((yyval.InstVal) == 0) + yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, tmpVal1, tmpVal2); + if (yyval.InstVal == 0) GEN_ERROR("binary operator returned null"); - delete (yyvsp[-3].TypeVal); - ;} - break; - - case 268: -#line 2701 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-3].TypeVal; + ; + break;} +case 267: +#line 2701 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); - if (isa((*(yyvsp[-3].TypeVal)).get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + if (isa((*yyvsp[-3].TypeVal).get())) GEN_ERROR("Vector types not supported by icmp instruction"); - Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); + Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); + Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = CmpInst::create((yyvsp[-5].OtherOpVal), (yyvsp[-4].IPredicate), tmpVal1, tmpVal2); - if ((yyval.InstVal) == 0) + yyval.InstVal = CmpInst::create(yyvsp[-5].OtherOpVal, yyvsp[-4].IPredicate, tmpVal1, tmpVal2); + if (yyval.InstVal == 0) GEN_ERROR("icmp operator returned null"); - delete (yyvsp[-3].TypeVal); - ;} - break; - - case 269: -#line 2715 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-3].TypeVal; + ; + break;} +case 268: +#line 2715 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); - if (isa((*(yyvsp[-3].TypeVal)).get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + if (isa((*yyvsp[-3].TypeVal).get())) GEN_ERROR("Vector types not supported by fcmp instruction"); - Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); + Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); + Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = CmpInst::create((yyvsp[-5].OtherOpVal), (yyvsp[-4].FPredicate), tmpVal1, tmpVal2); - if ((yyval.InstVal) == 0) + yyval.InstVal = CmpInst::create(yyvsp[-5].OtherOpVal, yyvsp[-4].FPredicate, tmpVal1, tmpVal2); + if (yyval.InstVal == 0) GEN_ERROR("fcmp operator returned null"); - delete (yyvsp[-3].TypeVal); - ;} - break; - - case 270: -#line 2729 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-3].TypeVal; + ; + break;} +case 269: +#line 2729 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); - Value* Val = (yyvsp[-2].ValueVal); - const Type* DestTy = (yyvsp[0].TypeVal)->get(); - if (!CastInst::castIsValid((yyvsp[-3].CastOpVal), Val, DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + Value* Val = yyvsp[-2].ValueVal; + const Type* DestTy = yyvsp[0].TypeVal->get(); + if (!CastInst::castIsValid(yyvsp[-3].CastOpVal, Val, DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'"); - (yyval.InstVal) = CastInst::create((yyvsp[-3].CastOpVal), Val, DestTy); - delete (yyvsp[0].TypeVal); - ;} - break; - - case 271: -#line 2741 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[-4].ValueVal)->getType() != Type::Int1Ty) + yyval.InstVal = CastInst::create(yyvsp[-3].CastOpVal, Val, DestTy); + delete yyvsp[0].TypeVal; + ; + break;} +case 270: +#line 2741 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-4].ValueVal->getType() != Type::Int1Ty) GEN_ERROR("select condition must be boolean"); - if ((yyvsp[-2].ValueVal)->getType() != (yyvsp[0].ValueVal)->getType()) + if (yyvsp[-2].ValueVal->getType() != yyvsp[0].ValueVal->getType()) GEN_ERROR("select value types should match"); - (yyval.InstVal) = new SelectInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + yyval.InstVal = new SelectInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 272: -#line 2749 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 271: +#line 2749 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); - (yyval.InstVal) = new VAArgInst((yyvsp[-2].ValueVal), *(yyvsp[0].TypeVal)); - delete (yyvsp[0].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 273: -#line 2756 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + yyval.InstVal = new VAArgInst(yyvsp[-2].ValueVal, *yyvsp[0].TypeVal); + delete yyvsp[0].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 272: +#line 2756 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!ExtractElementInst::isValidOperands(yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) GEN_ERROR("Invalid extractelement operands"); - (yyval.InstVal) = new ExtractElementInst((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + yyval.InstVal = new ExtractElementInst(yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 274: -#line 2762 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) + ; + break;} +case 273: +#line 2762 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!InsertElementInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) GEN_ERROR("Invalid insertelement operands"); - (yyval.InstVal) = new InsertElementInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + yyval.InstVal = new InsertElementInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 275: -#line 2768 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) + ; + break;} +case 274: +#line 2768 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!ShuffleVectorInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) GEN_ERROR("Invalid shufflevector operands"); - (yyval.InstVal) = new ShuffleVectorInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + yyval.InstVal = new ShuffleVectorInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 276: -#line 2774 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - const Type *Ty = (yyvsp[0].PHIList)->front().first->getType(); + ; + break;} +case 275: +#line 2774 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + const Type *Ty = yyvsp[0].PHIList->front().first->getType(); if (!Ty->isFirstClassType()) GEN_ERROR("PHI node operands must be of first class type"); - (yyval.InstVal) = new PHINode(Ty); - ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[0].PHIList)->size()); - while ((yyvsp[0].PHIList)->begin() != (yyvsp[0].PHIList)->end()) { - if ((yyvsp[0].PHIList)->front().first->getType() != Ty) + yyval.InstVal = new PHINode(Ty); + ((PHINode*)yyval.InstVal)->reserveOperandSpace(yyvsp[0].PHIList->size()); + while (yyvsp[0].PHIList->begin() != yyvsp[0].PHIList->end()) { + if (yyvsp[0].PHIList->front().first->getType() != Ty) GEN_ERROR("All elements of a PHI node must be of the same type"); - cast((yyval.InstVal))->addIncoming((yyvsp[0].PHIList)->front().first, (yyvsp[0].PHIList)->front().second); - (yyvsp[0].PHIList)->pop_front(); + cast(yyval.InstVal)->addIncoming(yyvsp[0].PHIList->front().first, yyvsp[0].PHIList->front().second); + yyvsp[0].PHIList->pop_front(); } - delete (yyvsp[0].PHIList); // Free the list... + delete yyvsp[0].PHIList; // Free the list... CHECK_FOR_ERROR - ;} - break; - - case 277: -#line 2790 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 276: +#line 2790 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Handle the short syntax const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast((yyvsp[-5].TypeVal)->get())) || + if (!(PFTy = dyn_cast(yyvsp[-5].TypeVal->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; ParamAttrsList ParamAttrs; - if ((yyvsp[0].ParamAttrs) != ParamAttr::None) - ParamAttrs.addAttributes(0, (yyvsp[0].ParamAttrs)); + if (yyvsp[0].ParamAttrs != ParamAttr::None) + ParamAttrs.addAttributes(0, yyvsp[0].ParamAttrs); unsigned index = 1; - ValueRefList::iterator I = (yyvsp[-2].ValueRefList)->begin(), E = (yyvsp[-2].ValueRefList)->end(); + ValueRefList::iterator I = yyvsp[-2].ValueRefList->begin(), E = yyvsp[-2].ValueRefList->end(); for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) @@ -5479,11 +4661,11 @@ if (!ParamAttrs.empty()) Attrs = new ParamAttrsList(ParamAttrs); - Ty = FunctionType::get((yyvsp[-5].TypeVal)->get(), ParamTypes, false, Attrs); + Ty = FunctionType::get(yyvsp[-5].TypeVal->get(), ParamTypes, false, Attrs); PFTy = PointerType::get(Ty); } - Value *V = getVal(PFTy, (yyvsp[-4].ValIDVal)); // Get the function we're calling... + Value *V = getVal(PFTy, yyvsp[-4].ValIDVal); // Get the function we're calling... CHECK_FOR_ERROR // Check for call to invalid intrinsic to avoid crashing later. @@ -5497,7 +4679,7 @@ // Check the arguments ValueList Args; - if ((yyvsp[-2].ValueRefList)->empty()) { // Has no arguments? + if (yyvsp[-2].ValueRefList->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -5508,7 +4690,7 @@ // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = (yyvsp[-2].ValueRefList)->begin(), ArgE = (yyvsp[-2].ValueRefList)->end(); + ValueRefList::iterator ArgI = yyvsp[-2].ValueRefList->begin(), ArgE = yyvsp[-2].ValueRefList->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -5525,428 +4707,365 @@ } // Create the call node CallInst *CI = new CallInst(V, &Args[0], Args.size()); - CI->setTailCall((yyvsp[-7].BoolVal)); - CI->setCallingConv((yyvsp[-6].UIntVal)); - (yyval.InstVal) = CI; - delete (yyvsp[-2].ValueRefList); - delete (yyvsp[-5].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 278: -#line 2870 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.InstVal) = (yyvsp[0].InstVal); + CI->setTailCall(yyvsp[-7].BoolVal); + CI->setCallingConv(yyvsp[-6].UIntVal); + yyval.InstVal = CI; + delete yyvsp[-2].ValueRefList; + delete yyvsp[-5].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 277: +#line 2870 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.InstVal = yyvsp[0].InstVal; CHECK_FOR_ERROR - ;} - break; - - case 279: -#line 2875 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = true; + ; + break;} +case 278: +#line 2875 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = true; CHECK_FOR_ERROR - ;} - break; - - case 280: -#line 2879 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = false; + ; + break;} +case 279: +#line 2879 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = false; CHECK_FOR_ERROR - ;} - break; - - case 281: -#line 2886 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 280: +#line 2886 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - (yyval.InstVal) = new MallocInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal)); - delete (yyvsp[-1].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 282: -#line 2893 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + yyval.InstVal = new MallocInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 281: +#line 2893 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); - Value* tmpVal = getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); + Value* tmpVal = getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new MallocInst(*(yyvsp[-4].TypeVal), tmpVal, (yyvsp[0].UIntVal)); - delete (yyvsp[-4].TypeVal); - ;} - break; - - case 283: -#line 2901 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + yyval.InstVal = new MallocInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal); + delete yyvsp[-4].TypeVal; + ; + break;} +case 282: +#line 2901 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - (yyval.InstVal) = new AllocaInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal)); - delete (yyvsp[-1].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 284: -#line 2908 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + yyval.InstVal = new AllocaInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 283: +#line 2908 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); - Value* tmpVal = getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); + Value* tmpVal = getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new AllocaInst(*(yyvsp[-4].TypeVal), tmpVal, (yyvsp[0].UIntVal)); - delete (yyvsp[-4].TypeVal); - ;} - break; - - case 285: -#line 2916 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { - if (!isa((yyvsp[0].ValueVal)->getType())) + yyval.InstVal = new AllocaInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal); + delete yyvsp[-4].TypeVal; + ; + break;} +case 284: +#line 2916 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!isa(yyvsp[0].ValueVal->getType())) GEN_ERROR("Trying to free nonpointer type " + - (yyvsp[0].ValueVal)->getType()->getDescription() + ""); - (yyval.InstVal) = new FreeInst((yyvsp[0].ValueVal)); + yyvsp[0].ValueVal->getType()->getDescription() + ""); + yyval.InstVal = new FreeInst(yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 286: -#line 2924 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 285: +#line 2924 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - if (!isa((yyvsp[-1].TypeVal)->get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + if (!isa(yyvsp[-2].TypeVal->get())) GEN_ERROR("Can't load from nonpointer type: " + - (*(yyvsp[-1].TypeVal))->getDescription()); - if (!cast((yyvsp[-1].TypeVal)->get())->getElementType()->isFirstClassType()) + (*yyvsp[-2].TypeVal)->getDescription()); + if (!cast(yyvsp[-2].TypeVal->get())->getElementType()->isFirstClassType()) GEN_ERROR("Can't load from pointer of non-first-class type: " + - (*(yyvsp[-1].TypeVal))->getDescription()); - Value* tmpVal = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); + (*yyvsp[-2].TypeVal)->getDescription()); + Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[-3].BoolVal)); - delete (yyvsp[-1].TypeVal); - ;} - break; - - case 287: -#line 2938 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + yyval.InstVal = new LoadInst(tmpVal, "", yyvsp[-4].BoolVal, yyvsp[0].UIntVal); + delete yyvsp[-2].TypeVal; + ; + break;} +case 286: +#line 2938 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - const PointerType *PT = dyn_cast((yyvsp[-1].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + const PointerType *PT = dyn_cast(yyvsp[-2].TypeVal->get()); if (!PT) GEN_ERROR("Can't store to a nonpointer type: " + - (*(yyvsp[-1].TypeVal))->getDescription()); + (*yyvsp[-2].TypeVal)->getDescription()); const Type *ElTy = PT->getElementType(); - if (ElTy != (yyvsp[-3].ValueVal)->getType()) - GEN_ERROR("Can't store '" + (yyvsp[-3].ValueVal)->getType()->getDescription() + + if (ElTy != yyvsp[-4].ValueVal->getType()) + GEN_ERROR("Can't store '" + yyvsp[-4].ValueVal->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'"); - Value* tmpVal = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); + Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new StoreInst((yyvsp[-3].ValueVal), tmpVal, (yyvsp[-5].BoolVal)); - delete (yyvsp[-1].TypeVal); - ;} - break; - - case 288: -#line 2955 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" - { + yyval.InstVal = new StoreInst(yyvsp[-4].ValueVal, tmpVal, yyvsp[-6].BoolVal, yyvsp[0].UIntVal); + delete yyvsp[-2].TypeVal; + ; + break;} +case 287: +#line 2955 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); - if (!isa((yyvsp[-2].TypeVal)->get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + if (!isa(yyvsp[-2].TypeVal->get())) GEN_ERROR("getelementptr insn requires pointer operand"); - if (!GetElementPtrInst::getIndexedType(*(yyvsp[-2].TypeVal), &(*(yyvsp[0].ValueList))[0], (yyvsp[0].ValueList)->size(), true)) + if (!GetElementPtrInst::getIndexedType(*yyvsp[-2].TypeVal, &(*yyvsp[0].ValueList)[0], yyvsp[0].ValueList->size(), true)) GEN_ERROR("Invalid getelementptr indices for type '" + - (*(yyvsp[-2].TypeVal))->getDescription()+ "'"); - Value* tmpVal = getVal(*(yyvsp[-2].TypeVal), (yyvsp[-1].ValIDVal)); + (*yyvsp[-2].TypeVal)->getDescription()+ "'"); + Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new GetElementPtrInst(tmpVal, &(*(yyvsp[0].ValueList))[0], (yyvsp[0].ValueList)->size()); - delete (yyvsp[-2].TypeVal); - delete (yyvsp[0].ValueList); - ;} - break; - - - default: break; - } - -/* Line 1126 of yacc.c. */ -#line 5682 "llvmAsmParser.tab.c" + yyval.InstVal = new GetElementPtrInst(tmpVal, &(*yyvsp[0].ValueList)[0], yyvsp[0].ValueList->size()); + delete yyvsp[-2].TypeVal; + delete yyvsp[0].ValueList; + ; + break;} +} + /* the action file gets copied in in place of this dollarsign */ +#line 543 "/usr/share/bison.simple" yyvsp -= yylen; yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif - - YY_STACK_PRINT (yyss, yyssp); +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif *++yyvsp = yyval; +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ yyn = yyr1[yyn]; - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else - yystate = yydefgoto[yyn - YYNTOKENS]; + yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; +yyerrlab: /* here on detecting error */ -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ { ++yynerrs; -#if YYERROR_VERBOSE + +#ifdef YYERROR_VERBOSE yyn = yypact[yystate]; - if (YYPACT_NINF < yyn && yyn < YYLAST) + if (yyn > YYFLAG && yyn < YYLAST) { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - char *yymsg = 0; -# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -#if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -#endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - - if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg) + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yymsg; - int yyi = 0; - while ((*yyp = *yyf)) + strcpy(msg, "parse error"); + + if (count < 5) { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } } - yyerror (yymsg); - YYSTACK_FREE (yymsg); + yyerror(msg); + free(msg); } else - { - yyerror (YY_("syntax error")); - goto yyexhaustedlab; - } + yyerror ("parse error; also virtual memory exceeded"); } else #endif /* YYERROR_VERBOSE */ - yyerror (YY_("syntax error")); + yyerror("parse error"); } - + goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ if (yyerrstatus == 3) { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ + /* if just tried and failed to reuse lookahead token after an error, discard it. */ - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; } - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; + /* Else will try to reuse lookahead token + after shifting the error token. */ + yyerrstatus = 3; /* Each real token shifted decrements this */ -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (0) - goto yyerrorlab; + goto yyerrhandle; -yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; +yyerrdefault: /* current state does not do anything special for the error token. */ + +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif +yyerrpop: /* pop the current state because it cannot handle the error token */ -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif - for (;;) +#if YYDEBUG != 0 + if (yydebug) { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; } + else if (yyn == 0) + goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; - *++yyvsp = yylval; - +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif yystate = yyn; goto yynewstate; + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 0; -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK; - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); #endif - return yyresult; + } + return 1; } - - -#line 2972 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +#line 2972 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions @@ -6027,4 +5146,3 @@ GenerateError(errMsg); return 0; } - Index: llvm/lib/AsmParser/llvmAsmParser.h.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.66 llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.67 --- llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.66 Mon Apr 16 01:56:07 2007 +++ llvm/lib/AsmParser/llvmAsmParser.h.cvs Sat Apr 21 03:16:25 2007 @@ -1,308 +1,4 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ESINT64VAL = 258, - EUINT64VAL = 259, - ESAPINTVAL = 260, - EUAPINTVAL = 261, - LOCALVAL_ID = 262, - GLOBALVAL_ID = 263, - FPVAL = 264, - VOID = 265, - INTTYPE = 266, - FLOAT = 267, - DOUBLE = 268, - LABEL = 269, - TYPE = 270, - LOCALVAR = 271, - GLOBALVAR = 272, - LABELSTR = 273, - STRINGCONSTANT = 274, - ATSTRINGCONSTANT = 275, - ZEROINITIALIZER = 276, - TRUETOK = 277, - FALSETOK = 278, - BEGINTOK = 279, - ENDTOK = 280, - DECLARE = 281, - DEFINE = 282, - GLOBAL = 283, - CONSTANT = 284, - SECTION = 285, - VOLATILE = 286, - THREAD_LOCAL = 287, - TO = 288, - DOTDOTDOT = 289, - NULL_TOK = 290, - UNDEF = 291, - INTERNAL = 292, - LINKONCE = 293, - WEAK = 294, - APPENDING = 295, - DLLIMPORT = 296, - DLLEXPORT = 297, - EXTERN_WEAK = 298, - OPAQUE = 299, - EXTERNAL = 300, - TARGET = 301, - TRIPLE = 302, - ALIGN = 303, - DEPLIBS = 304, - CALL = 305, - TAIL = 306, - ASM_TOK = 307, - MODULE = 308, - SIDEEFFECT = 309, - CC_TOK = 310, - CCC_TOK = 311, - FASTCC_TOK = 312, - COLDCC_TOK = 313, - X86_STDCALLCC_TOK = 314, - X86_FASTCALLCC_TOK = 315, - DATALAYOUT = 316, - RET = 317, - BR = 318, - SWITCH = 319, - INVOKE = 320, - UNWIND = 321, - UNREACHABLE = 322, - ADD = 323, - SUB = 324, - MUL = 325, - UDIV = 326, - SDIV = 327, - FDIV = 328, - UREM = 329, - SREM = 330, - FREM = 331, - AND = 332, - OR = 333, - XOR = 334, - SHL = 335, - LSHR = 336, - ASHR = 337, - ICMP = 338, - FCMP = 339, - EQ = 340, - NE = 341, - SLT = 342, - SGT = 343, - SLE = 344, - SGE = 345, - ULT = 346, - UGT = 347, - ULE = 348, - UGE = 349, - OEQ = 350, - ONE = 351, - OLT = 352, - OGT = 353, - OLE = 354, - OGE = 355, - ORD = 356, - UNO = 357, - UEQ = 358, - UNE = 359, - MALLOC = 360, - ALLOCA = 361, - FREE = 362, - LOAD = 363, - STORE = 364, - GETELEMENTPTR = 365, - TRUNC = 366, - ZEXT = 367, - SEXT = 368, - FPTRUNC = 369, - FPEXT = 370, - BITCAST = 371, - UITOFP = 372, - SITOFP = 373, - FPTOUI = 374, - FPTOSI = 375, - INTTOPTR = 376, - PTRTOINT = 377, - PHI_TOK = 378, - SELECT = 379, - VAARG = 380, - EXTRACTELEMENT = 381, - INSERTELEMENT = 382, - SHUFFLEVECTOR = 383, - NORETURN = 384, - INREG = 385, - SRET = 386, - NOUNWIND = 387, - DEFAULT = 388, - HIDDEN = 389 - }; -#endif -/* Tokens. */ -#define ESINT64VAL 258 -#define EUINT64VAL 259 -#define ESAPINTVAL 260 -#define EUAPINTVAL 261 -#define LOCALVAL_ID 262 -#define GLOBALVAL_ID 263 -#define FPVAL 264 -#define VOID 265 -#define INTTYPE 266 -#define FLOAT 267 -#define DOUBLE 268 -#define LABEL 269 -#define TYPE 270 -#define LOCALVAR 271 -#define GLOBALVAR 272 -#define LABELSTR 273 -#define STRINGCONSTANT 274 -#define ATSTRINGCONSTANT 275 -#define ZEROINITIALIZER 276 -#define TRUETOK 277 -#define FALSETOK 278 -#define BEGINTOK 279 -#define ENDTOK 280 -#define DECLARE 281 -#define DEFINE 282 -#define GLOBAL 283 -#define CONSTANT 284 -#define SECTION 285 -#define VOLATILE 286 -#define THREAD_LOCAL 287 -#define TO 288 -#define DOTDOTDOT 289 -#define NULL_TOK 290 -#define UNDEF 291 -#define INTERNAL 292 -#define LINKONCE 293 -#define WEAK 294 -#define APPENDING 295 -#define DLLIMPORT 296 -#define DLLEXPORT 297 -#define EXTERN_WEAK 298 -#define OPAQUE 299 -#define EXTERNAL 300 -#define TARGET 301 -#define TRIPLE 302 -#define ALIGN 303 -#define DEPLIBS 304 -#define CALL 305 -#define TAIL 306 -#define ASM_TOK 307 -#define MODULE 308 -#define SIDEEFFECT 309 -#define CC_TOK 310 -#define CCC_TOK 311 -#define FASTCC_TOK 312 -#define COLDCC_TOK 313 -#define X86_STDCALLCC_TOK 314 -#define X86_FASTCALLCC_TOK 315 -#define DATALAYOUT 316 -#define RET 317 -#define BR 318 -#define SWITCH 319 -#define INVOKE 320 -#define UNWIND 321 -#define UNREACHABLE 322 -#define ADD 323 -#define SUB 324 -#define MUL 325 -#define UDIV 326 -#define SDIV 327 -#define FDIV 328 -#define UREM 329 -#define SREM 330 -#define FREM 331 -#define AND 332 -#define OR 333 -#define XOR 334 -#define SHL 335 -#define LSHR 336 -#define ASHR 337 -#define ICMP 338 -#define FCMP 339 -#define EQ 340 -#define NE 341 -#define SLT 342 -#define SGT 343 -#define SLE 344 -#define SGE 345 -#define ULT 346 -#define UGT 347 -#define ULE 348 -#define UGE 349 -#define OEQ 350 -#define ONE 351 -#define OLT 352 -#define OGT 353 -#define OLE 354 -#define OGE 355 -#define ORD 356 -#define UNO 357 -#define UEQ 358 -#define UNE 359 -#define MALLOC 360 -#define ALLOCA 361 -#define FREE 362 -#define LOAD 363 -#define STORE 364 -#define GETELEMENTPTR 365 -#define TRUNC 366 -#define ZEXT 367 -#define SEXT 368 -#define FPTRUNC 369 -#define FPEXT 370 -#define BITCAST 371 -#define UITOFP 372 -#define SITOFP 373 -#define FPTOUI 374 -#define FPTOSI 375 -#define INTTOPTR 376 -#define PTRTOINT 377 -#define PHI_TOK 378 -#define SELECT 379 -#define VAARG 380 -#define EXTRACTELEMENT 381 -#define INSERTELEMENT 382 -#define SHUFFLEVECTOR 383 -#define NORETURN 384 -#define INREG 385 -#define SRET 386 -#define NOUNWIND 387 -#define DEFAULT 388 -#define HIDDEN 389 - - - - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 938 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" -typedef union YYSTYPE { +typedef union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -348,14 +44,138 @@ llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; } YYSTYPE; -/* Line 1447 of yacc.c. */ -#line 353 "llvmAsmParser.tab.h" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE llvmAsmlval; - +#define ESINT64VAL 257 +#define EUINT64VAL 258 +#define ESAPINTVAL 259 +#define EUAPINTVAL 260 +#define LOCALVAL_ID 261 +#define GLOBALVAL_ID 262 +#define FPVAL 263 +#define VOID 264 +#define INTTYPE 265 +#define FLOAT 266 +#define DOUBLE 267 +#define LABEL 268 +#define TYPE 269 +#define LOCALVAR 270 +#define GLOBALVAR 271 +#define LABELSTR 272 +#define STRINGCONSTANT 273 +#define ATSTRINGCONSTANT 274 +#define ZEROINITIALIZER 275 +#define TRUETOK 276 +#define FALSETOK 277 +#define BEGINTOK 278 +#define ENDTOK 279 +#define DECLARE 280 +#define DEFINE 281 +#define GLOBAL 282 +#define CONSTANT 283 +#define SECTION 284 +#define VOLATILE 285 +#define THREAD_LOCAL 286 +#define TO 287 +#define DOTDOTDOT 288 +#define NULL_TOK 289 +#define UNDEF 290 +#define INTERNAL 291 +#define LINKONCE 292 +#define WEAK 293 +#define APPENDING 294 +#define DLLIMPORT 295 +#define DLLEXPORT 296 +#define EXTERN_WEAK 297 +#define OPAQUE 298 +#define EXTERNAL 299 +#define TARGET 300 +#define TRIPLE 301 +#define ALIGN 302 +#define DEPLIBS 303 +#define CALL 304 +#define TAIL 305 +#define ASM_TOK 306 +#define MODULE 307 +#define SIDEEFFECT 308 +#define CC_TOK 309 +#define CCC_TOK 310 +#define FASTCC_TOK 311 +#define COLDCC_TOK 312 +#define X86_STDCALLCC_TOK 313 +#define X86_FASTCALLCC_TOK 314 +#define DATALAYOUT 315 +#define RET 316 +#define BR 317 +#define SWITCH 318 +#define INVOKE 319 +#define UNWIND 320 +#define UNREACHABLE 321 +#define ADD 322 +#define SUB 323 +#define MUL 324 +#define UDIV 325 +#define SDIV 326 +#define FDIV 327 +#define UREM 328 +#define SREM 329 +#define FREM 330 +#define AND 331 +#define OR 332 +#define XOR 333 +#define SHL 334 +#define LSHR 335 +#define ASHR 336 +#define ICMP 337 +#define FCMP 338 +#define EQ 339 +#define NE 340 +#define SLT 341 +#define SGT 342 +#define SLE 343 +#define SGE 344 +#define ULT 345 +#define UGT 346 +#define ULE 347 +#define UGE 348 +#define OEQ 349 +#define ONE 350 +#define OLT 351 +#define OGT 352 +#define OLE 353 +#define OGE 354 +#define ORD 355 +#define UNO 356 +#define UEQ 357 +#define UNE 358 +#define MALLOC 359 +#define ALLOCA 360 +#define FREE 361 +#define LOAD 362 +#define STORE 363 +#define GETELEMENTPTR 364 +#define TRUNC 365 +#define ZEXT 366 +#define SEXT 367 +#define FPTRUNC 368 +#define FPEXT 369 +#define BITCAST 370 +#define UITOFP 371 +#define SITOFP 372 +#define FPTOUI 373 +#define FPTOSI 374 +#define INTTOPTR 375 +#define PTRTOINT 376 +#define PHI_TOK 377 +#define SELECT 378 +#define VAARG 379 +#define EXTRACTELEMENT 380 +#define INSERTELEMENT 381 +#define SHUFFLEVECTOR 382 +#define NORETURN 383 +#define INREG 384 +#define SRET 385 +#define NOUNWIND 386 +#define DEFAULT 387 +#define HIDDEN 388 +extern YYSTYPE llvmAsmlval; Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.343 llvm/lib/AsmParser/llvmAsmParser.y:1.344 --- llvm/lib/AsmParser/llvmAsmParser.y:1.343 Mon Apr 16 17:01:57 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y Sat Apr 21 03:16:25 2007 @@ -2921,7 +2921,7 @@ CHECK_FOR_ERROR } - | OptVolatile LOAD Types ValueRef { + | OptVolatile LOAD Types ValueRef OptCAlign { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription()); if (!isa($3->get())) @@ -2932,10 +2932,10 @@ (*$3)->getDescription()); Value* tmpVal = getVal(*$3, $4); CHECK_FOR_ERROR - $$ = new LoadInst(tmpVal, "", $1); + $$ = new LoadInst(tmpVal, "", $1, $5); delete $3; } - | OptVolatile STORE ResolvedVal ',' Types ValueRef { + | OptVolatile STORE ResolvedVal ',' Types ValueRef OptCAlign { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$5)->getDescription()); const PointerType *PT = dyn_cast($5->get()); @@ -2949,7 +2949,7 @@ Value* tmpVal = getVal(*$5, $6); CHECK_FOR_ERROR - $$ = new StoreInst($3, tmpVal, $1); + $$ = new StoreInst($3, tmpVal, $1, $7); delete $5; } | GETELEMENTPTR Types ValueRef IndexList { Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.89 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.90 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.89 Mon Apr 16 17:02:23 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Sat Apr 21 03:16:25 2007 @@ -2921,7 +2921,7 @@ CHECK_FOR_ERROR } - | OptVolatile LOAD Types ValueRef { + | OptVolatile LOAD Types ValueRef OptCAlign { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription()); if (!isa($3->get())) @@ -2932,10 +2932,10 @@ (*$3)->getDescription()); Value* tmpVal = getVal(*$3, $4); CHECK_FOR_ERROR - $$ = new LoadInst(tmpVal, "", $1); + $$ = new LoadInst(tmpVal, "", $1, $5); delete $3; } - | OptVolatile STORE ResolvedVal ',' Types ValueRef { + | OptVolatile STORE ResolvedVal ',' Types ValueRef OptCAlign { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$5)->getDescription()); const PointerType *PT = dyn_cast($5->get()); @@ -2949,7 +2949,7 @@ Value* tmpVal = getVal(*$5, $6); CHECK_FOR_ERROR - $$ = new StoreInst($3, tmpVal, $1); + $$ = new StoreInst($3, tmpVal, $1, $7); delete $5; } | GETELEMENTPTR Types ValueRef IndexList { From christopher.lamb at gmail.com Sat Apr 21 03:17:11 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Sat, 21 Apr 2007 03:17:11 -0500 Subject: [llvm-commits] CVS: llvm/CREDITS.TXT Message-ID: <200704210817.l3L8HBBR011902@zion.cs.uiuc.edu> Changes in directory llvm: CREDITS.TXT updated: 1.72 -> 1.73 --- Log message: add support for alignment attributes on load/store instructions --- Diffs of the changes: (+4 -0) CREDITS.TXT | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/CREDITS.TXT diff -u llvm/CREDITS.TXT:1.72 llvm/CREDITS.TXT:1.73 --- llvm/CREDITS.TXT:1.72 Wed Mar 21 16:45:25 2007 +++ llvm/CREDITS.TXT Sat Apr 21 03:16:24 2007 @@ -118,6 +118,10 @@ E: kowshik at uiuc.edu D: Author of the original C backend +N: Christopher Lamb +E: christopher.lamb at gmail.com +D: aligned load/store support + N: Jim Laskey E: jlaskey at apple.com D: Improvements to the PPC backend, instruction scheduling From christopher.lamb at gmail.com Sat Apr 21 03:17:12 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Sat, 21 Apr 2007 03:17:12 -0500 Subject: [llvm-commits] CVS: llvm/test/Assembler/2007-04-20-AlignedLoad.ll 2007-04-20-AlignedStore.ll Message-ID: <200704210817.l3L8HCGu011909@zion.cs.uiuc.edu> Changes in directory llvm/test/Assembler: 2007-04-20-AlignedLoad.ll added (r1.1) 2007-04-20-AlignedStore.ll added (r1.1) --- Log message: add support for alignment attributes on load/store instructions --- Diffs of the changes: (+14 -0) 2007-04-20-AlignedLoad.ll | 7 +++++++ 2007-04-20-AlignedStore.ll | 7 +++++++ 2 files changed, 14 insertions(+) Index: llvm/test/Assembler/2007-04-20-AlignedLoad.ll diff -c /dev/null llvm/test/Assembler/2007-04-20-AlignedLoad.ll:1.1 *** /dev/null Sat Apr 21 03:16:35 2007 --- llvm/test/Assembler/2007-04-20-AlignedLoad.ll Sat Apr 21 03:16:25 2007 *************** *** 0 **** --- 1,7 ---- + ; RUN: llvm-as < %s |& llvm-dis |& grep 'align 1024' + + define i32 @test(i32* %arg) { + entry: + %tmp2 = load i32* %arg, align 1024 ; [#uses=1] + ret i32 %tmp2 + } Index: llvm/test/Assembler/2007-04-20-AlignedStore.ll diff -c /dev/null llvm/test/Assembler/2007-04-20-AlignedStore.ll:1.1 *** /dev/null Sat Apr 21 03:17:12 2007 --- llvm/test/Assembler/2007-04-20-AlignedStore.ll Sat Apr 21 03:16:25 2007 *************** *** 0 **** --- 1,7 ---- + ; RUN: llvm-as < %s |& llvm-dis | grep 'align 1024' + + define void @test(i32* %arg) { + entry: + store i32 0, i32* %arg, align 1024 + ret void + } From christopher.lamb at gmail.com Sat Apr 21 03:17:12 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Sat, 21 Apr 2007 03:17:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Instructions.cpp Message-ID: <200704210817.l3L8HC5r011916@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.270 -> 1.271 Instructions.cpp updated: 1.85 -> 1.86 --- Log message: add support for alignment attributes on load/store instructions --- Diffs of the changes: (+49 -0) AsmWriter.cpp | 7 +++++++ Instructions.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.270 llvm/lib/VMCore/AsmWriter.cpp:1.271 --- llvm/lib/VMCore/AsmWriter.cpp:1.270 Tue Apr 17 19:57:22 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Sat Apr 21 03:16:25 2007 @@ -1307,6 +1307,13 @@ writeOperand(I.getOperand(i), PrintAllTypes); } } + + // Print post operand alignment for load/store + if (isa(I) && cast(I).getAlignment()) { + Out << ", align " << cast(I).getAlignment(); + } else if (isa(I) && cast(I).getAlignment()) { + Out << ", align " << cast(I).getAlignment(); + } printInfoComment(I); Out << "\n"; Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.85 llvm/lib/VMCore/Instructions.cpp:1.86 --- llvm/lib/VMCore/Instructions.cpp:1.85 Fri Apr 13 19:12:57 2007 +++ llvm/lib/VMCore/Instructions.cpp Sat Apr 21 03:16:25 2007 @@ -20,6 +20,7 @@ #include "llvm/ParameterAttributes.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/ConstantRange.h" +#include "llvm/Support/MathExtras.h" using namespace llvm; unsigned CallSite::getCallingConv() const { @@ -685,6 +686,7 @@ : UnaryInstruction(cast(Ptr->getType())->getElementType(), Load, Ptr, InsertBef) { setVolatile(false); + setAlignment(0); AssertOK(); setName(Name); } @@ -693,6 +695,7 @@ : UnaryInstruction(cast(Ptr->getType())->getElementType(), Load, Ptr, InsertAE) { setVolatile(false); + setAlignment(0); AssertOK(); setName(Name); } @@ -702,6 +705,17 @@ : UnaryInstruction(cast(Ptr->getType())->getElementType(), Load, Ptr, InsertBef) { setVolatile(isVolatile); + setAlignment(0); + AssertOK(); + setName(Name); +} + +LoadInst::LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, + unsigned Align, Instruction *InsertBef) + : UnaryInstruction(cast(Ptr->getType())->getElementType(), + Load, Ptr, InsertBef) { + setVolatile(isVolatile); + setAlignment(Align); AssertOK(); setName(Name); } @@ -711,6 +725,7 @@ : UnaryInstruction(cast(Ptr->getType())->getElementType(), Load, Ptr, InsertAE) { setVolatile(isVolatile); + setAlignment(0); AssertOK(); setName(Name); } @@ -721,6 +736,7 @@ : UnaryInstruction(cast(Ptr->getType())->getElementType(), Load, Ptr, InsertBef) { setVolatile(false); + setAlignment(0); AssertOK(); if (Name && Name[0]) setName(Name); } @@ -729,6 +745,7 @@ : UnaryInstruction(cast(Ptr->getType())->getElementType(), Load, Ptr, InsertAE) { setVolatile(false); + setAlignment(0); AssertOK(); if (Name && Name[0]) setName(Name); } @@ -738,6 +755,7 @@ : UnaryInstruction(cast(Ptr->getType())->getElementType(), Load, Ptr, InsertBef) { setVolatile(isVolatile); + setAlignment(0); AssertOK(); if (Name && Name[0]) setName(Name); } @@ -747,10 +765,15 @@ : UnaryInstruction(cast(Ptr->getType())->getElementType(), Load, Ptr, InsertAE) { setVolatile(isVolatile); + setAlignment(0); AssertOK(); if (Name && Name[0]) setName(Name); } +void LoadInst::setAlignment(unsigned Align) { + assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!"); + SubclassData = (SubclassData & 1) | ((Log2_32(Align)+1)<<1); +} //===----------------------------------------------------------------------===// // StoreInst Implementation @@ -770,6 +793,7 @@ Ops[0].init(val, this); Ops[1].init(addr, this); setVolatile(false); + setAlignment(0); AssertOK(); } @@ -778,6 +802,7 @@ Ops[0].init(val, this); Ops[1].init(addr, this); setVolatile(false); + setAlignment(0); AssertOK(); } @@ -787,6 +812,17 @@ Ops[0].init(val, this); Ops[1].init(addr, this); setVolatile(isVolatile); + setAlignment(0); + AssertOK(); +} + +StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, + unsigned Align, Instruction *InsertBefore) + : Instruction(Type::VoidTy, Store, Ops, 2, InsertBefore) { + Ops[0].init(val, this); + Ops[1].init(addr, this); + setVolatile(isVolatile); + setAlignment(Align); AssertOK(); } @@ -796,9 +832,15 @@ Ops[0].init(val, this); Ops[1].init(addr, this); setVolatile(isVolatile); + setAlignment(0); AssertOK(); } +void StoreInst::setAlignment(unsigned Align) { + assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!"); + SubclassData = (SubclassData & 1) | ((Log2_32(Align)+1)<<1); +} + //===----------------------------------------------------------------------===// // GetElementPtrInst Implementation //===----------------------------------------------------------------------===// From christopher.lamb at gmail.com Sat Apr 21 03:17:10 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Sat, 21 Apr 2007 03:17:10 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Instructions.h Message-ID: <200704210817.l3L8HArx011888@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Instructions.h updated: 1.66 -> 1.67 --- Log message: add support for alignment attributes on load/store instructions --- Diffs of the changes: (+33 -7) Instructions.h | 40 +++++++++++++++++++++++++++++++++------- 1 files changed, 33 insertions(+), 7 deletions(-) Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.66 llvm/include/llvm/Instructions.h:1.67 --- llvm/include/llvm/Instructions.h:1.66 Fri Apr 13 19:12:57 2007 +++ llvm/include/llvm/Instructions.h Sat Apr 21 03:16:25 2007 @@ -211,9 +211,11 @@ /// SubclassData field in Value to store whether or not the load is volatile. /// class LoadInst : public UnaryInstruction { + LoadInst(const LoadInst &LI) : UnaryInstruction(LI.getType(), Load, LI.getOperand(0)) { setVolatile(LI.isVolatile()); + setAlignment(LI.getAlignment()); #ifndef NDEBUG AssertOK(); @@ -223,14 +225,16 @@ public: LoadInst(Value *Ptr, const std::string &Name, Instruction *InsertBefore); LoadInst(Value *Ptr, const std::string &Name, BasicBlock *InsertAtEnd); - LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false, + LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false, + Instruction *InsertBefore = 0); + LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, unsigned Align, Instruction *InsertBefore = 0); LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, BasicBlock *InsertAtEnd); LoadInst(Value *Ptr, const char *Name, Instruction *InsertBefore); LoadInst(Value *Ptr, const char *Name, BasicBlock *InsertAtEnd); - explicit LoadInst(Value *Ptr, const char *Name = 0, bool isVolatile = false, + explicit LoadInst(Value *Ptr, const char *Name = 0, bool isVolatile = false, Instruction *InsertBefore = 0); LoadInst(Value *Ptr, const char *Name, bool isVolatile, BasicBlock *InsertAtEnd); @@ -238,14 +242,23 @@ /// isVolatile - Return true if this is a load from a volatile memory /// location. /// - bool isVolatile() const { return SubclassData; } + bool isVolatile() const { return SubclassData & 1; } /// setVolatile - Specify whether this is a volatile load or not. /// - void setVolatile(bool V) { SubclassData = V; } + void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | (V) ? 1 : 0; } virtual LoadInst *clone() const; + /// getAlignment - Return the alignment of the access that is being performed + /// + unsigned getAlignment() const { + signed Log2AlignVal = ((SubclassData>>1)-1); + return ((Log2AlignVal < 0) ? 0 : 1<>1)-1); + return ((Log2AlignVal < 0) ? 0 : 1< References: <200704210340.l3L3e4mZ001848@dcs-lbuild.cs.uiuc.edu> <1177127790.20748.57.camel.SS2517SS@bashful.x10sys.com> Message-ID: <1177145253.13159.216.camel@asl.dorms.spbu.ru> Reid, > I thought we were going to turn these into the actual user's name. Has > that mapping gone away? I think the old CVS one make the reply-to field > be the user's actual email address rather than "name at zion.cs.uiuc.edu". > I think we need to do the same here. Otherwise the process of commit > review gets harder. Such mapping was done, but for all "CVS-style" accounts. David should just add corresponding mapping username => e-mail to the special section of the configuration file. > Is this just failing because you were expecting "reid" instead of > cscollab-rspencer. Definitely. Script was pre-populated with all current CVS accounts' > > Author: cscollab-rspencer > > Real name would be nice here too. Hmm. Ok, I'll see, what can be done here. > If its a one line log comment, can we get it on the "Log" line, > otherwise can we indent the lines a few of spaces, as in Modified: field > below? I'll check this. > > > > > Modified: > > llvm/trunk/CREDITS.TXT > > > > I thought we were going to run the diff output through diffstat and > insert the histogram here like we did for CVS? Unfortunately, No. This isn't possible here, since diffs are generated per each files separately. Including diffstat will need to redesign everything. > > > Modified: llvm/trunk/CREDITS.TXT > > The usual diff line here is "Index: ...". Is this the way svn diff > generates it or can we fix it? "Index" is just CVS'ism. In fact, patch just ignores everything below "---" and "+++" and treat them as comment. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From asl at math.spbu.ru Sat Apr 21 03:47:58 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 21 Apr 2007 12:47:58 +0400 Subject: [llvm-commits] [llvm] r36266 - /llvm/trunk/CREDITS.TXT In-Reply-To: <73EA5DE9-8796-48AE-B1F3-6B3DCA0E3A00.SS1096SS@apple.com> References: <200704210340.l3L3e4mZ001848@dcs-lbuild.cs.uiuc.edu> <73EA5DE9-8796-48AE-B1F3-6B3DCA0E3A00.SS1096SS@apple.com> Message-ID: <1177145278.13159.218.camel@asl.dorms.spbu.ru> > Also, can we get a blank line after the URL? My mail client turns > the URL and the ==== into one url... Will check. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From asl at math.spbu.ru Sat Apr 21 03:49:25 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 21 Apr 2007 12:49:25 +0400 Subject: [llvm-commits] [llvm] r36266 - /llvm/trunk/CREDITS.TXT In-Reply-To: <50FFB128-D823-43A6-995D-A911BFB77B25.SS2258SS@apple.com> References: <200704210340.l3L3e4mZ001848@dcs-lbuild.cs.uiuc.edu> <1177128372.20748.63.camel@bashful.x10sys.com> <50FFB128-D823-43A6-995D-A911BFB77B25.SS2258SS@apple.com> Message-ID: <1177145365.13159.221.camel@asl.dorms.spbu.ru> Hello, Chris. > Can we just have the post-commit script fakemail that it is > reid at hisfavoritedomain.com sending it? Exactly in this way it should work now. username=>e-mail map just don't know what to do with user "cscollab-rspencer", since is assumes, that Reid is using username "reid" :) -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From asl at math.spbu.ru Sat Apr 21 05:16:44 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 21 Apr 2007 14:16:44 +0400 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp X86ISelLowering.cpp X86ISelLowering.h X86InstrInfo.td In-Reply-To: References: <200704202138.l3KLcfxe023245@zion.cs.uiuc.edu> <1F2CEF21-3628-4E08-94D8-D0CF09A8C615@apple.com> <462960DF.9060802@jolt-lang.org> Message-ID: <1177150604.28521.19.camel@asl.dorms.spbu.ru> > Presumably the win32 ABI uses completely different mechanisms for > TLS. Definitely. As it applies to ELF targets only, maybe it's worth to guard stuff with assert(Subtarget->isTargetELF)? -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From asl at math.spbu.ru Sat Apr 21 05:20:59 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 21 Apr 2007 14:20:59 +0400 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp X86ISelLowering.cpp X86ISelLowering.h X86InstrInfo.td In-Reply-To: <200704202138.l3KLcfxe023245.SS11483SS@zion.cs.uiuc.edu> References: <200704202138.l3KLcfxe023245.SS11483SS@zion.cs.uiuc.edu> Message-ID: <1177150859.28521.23.camel@asl.dorms.spbu.ru> > +SDOperand > +X86TargetLowering::LowerGlobalTLSAddress(SDOperand Op, SelectionDAG > &DAG) { > + // TODO: implement the "local dynamic" model > + // TODO: implement the "initial exec"model for pic executables > + assert(!Subtarget->is64Bit() && "TLS not implemented for X86_64"); > + GlobalAddressSDNode *GA = cast(Op); Well, it seems assert should be: assert(!Subtarget->is64Bit() && Subtarget->isTargetELF() && "TLS not implemented for non-ELF and 64-bit targets"); -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From asl at math.spbu.ru Sat Apr 21 05:21:31 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 21 Apr 2007 14:21:31 +0400 Subject: [llvm-commits] Function aliases In-Reply-To: <54A7260C-1FDE-4B3D-91CA-6B40D261E49A.SS2323SS@apple.com> References: <20070419205157.GQ5062.SS386SS@village.us.cray.com> <1177021495.13159.147.camel@asl.dorms.spbu.ru> <1177049862.13159.162.camel@asl.dorms.spbu.ru> <54A7260C-1FDE-4B3D-91CA-6B40D261E49A.SS2323SS@apple.com> Message-ID: <1177150891.28521.25.camel@asl.dorms.spbu.ru> Hello, Chris. > I disagree. They *act like* functions or GV's, but they really > aren't them. For example, (from m understanding), it is not legal to > give an alias a function body or a global variable initializer. After stripping alias target they are nothing more than just external declarations. That's why I'm thinking it's just GV or Function plus small addendum. > No, you wouldn't need both classes, just a single one. But function aliases can, for example, definitely have CC. It acts like normal Function. > Two things: getCalledFunction already returns null if the callee is > not a function, e.g. an indirect call. All of the users of this > method will already do the right thing and treat aliases as unknown > calls. This will be correct. But it's not indirect call. getCalledFunction() should return "function part" of function alias. > I'd expect the linker (or something else) to want to resolve through > aliases if the alias, if the actual destination function is around. This seems to be useful feature. However, usually aliases are introduces when no alias target exists in the current module. I think the best solution is the one submitted by Gordon: 1. Introduce new table (or use some current) in the Module for alias targets. 2. User normal Function's and GV's for aliases. They will be just external function/variable *declarations*. Everything will be ok. 3. Add methods addAlias(), removeAlias() to GV class to add/remove entries to alias target table. +some utility functions to deal with this table during e.g. object destruction/copying. 4. Let Verifier to reject that GV's and Functions, which has initializer/body and entry in the alias target table. 5. AsmParser should reject usage of alias and initializer/body as well. 6. Let Linker to "propagate" alias targets, if possible. 7. During codegen query alias target entry for each MO_ExternalSymbol to check, whether there is any alias. And emit needed code. Sounds better? -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From jeffc at jolt-lang.org Sat Apr 21 09:30:33 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 21 Apr 2007 07:30:33 -0700 Subject: [llvm-commits] Major regressions Message-ID: <462A2009.1050003@jolt-lang.org> Commits in the last 12 hours or so have broken 34 regression tests and caused 21 failure in llvm-test. They appear to be concentrated in the vector area. From jeffc at jolt-lang.org Sat Apr 21 09:33:16 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 21 Apr 2007 09:33:16 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Instructions.h Message-ID: <200704211433.l3LEXGAa018652@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Instructions.h updated: 1.67 -> 1.68 --- Log message: The expression "SubclassData = (SubclassData & ~1) | (V) ? 1 : 0;" does not do what was intended! | has higher precedence than ?. Caught by Visual Studio. --- Diffs of the changes: (+2 -2) Instructions.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.67 llvm/include/llvm/Instructions.h:1.68 --- llvm/include/llvm/Instructions.h:1.67 Sat Apr 21 03:16:25 2007 +++ llvm/include/llvm/Instructions.h Sat Apr 21 09:32:59 2007 @@ -246,7 +246,7 @@ /// setVolatile - Specify whether this is a volatile load or not. /// - void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | (V) ? 1 : 0; } + void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | unsigned(V); } virtual LoadInst *clone() const; @@ -311,7 +311,7 @@ /// setVolatile - Specify whether this is a volatile load or not. /// - void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | (V) ? 1 : 0; } + void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | unsigned(V); } /// Transparently provide more efficient getOperand methods. Value *getOperand(unsigned i) const { From jeffc at jolt-lang.org Sat Apr 21 09:42:30 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 21 Apr 2007 07:42:30 -0700 Subject: [llvm-commits] CVS: llvm/include/llvm/Instructions.h In-Reply-To: <200704211433.l3LEXGAa018652@zion.cs.uiuc.edu> References: <200704211433.l3LEXGAa018652@zion.cs.uiuc.edu> Message-ID: <462A22D6.1070603@jolt-lang.org> Jeff Cohen wrote: > Changes in directory llvm/include/llvm: > > Instructions.h updated: 1.67 -> 1.68 > --- > Log message: > > The expression "SubclassData = (SubclassData & ~1) | (V) ? 1 : 0;" does not do what > was intended! | has higher precedence than ?. Caught by Visual Studio. > Unfortunately, this wasn't the cause of the failures. It didn't fix a single one. They look like this: FAIL: /usr/home/jeffc/llvm/test/CodeGen/X86/vec_zero.ll: exit(1) at line 1 while running: llvm-upgrade < /usr/home/jeffc/llvm/test/CodeGen/X86/vec_zero.ll | llvm-as | llc -march=x86 -mattr=+sse2 | grep xorps | wc -l | grep 2 Assertion failed: (0 && "ValueType does not correspond to LLVM type!"), function getTypeForValueType, file /usr/home/jeffc/llvm/lib/VMCore/ValueTypes.cpp, line 91. From jeffc at jolt-lang.org Sat Apr 21 09:45:18 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 21 Apr 2007 07:45:18 -0700 Subject: [llvm-commits] Nightly tester annoyance Message-ID: <462A237E.6010309@jolt-lang.org> The nightly tester has acquired the bad habit of believing a regression test has changed it's name whenever the test changes from failing to passing or vice versa. For example, Added Tests: test/CFrontend/2007-04-11-InlineAsmUnion.c Removed Tests: test/CFrontend/2007-04-11-InlineAsmUnion.c: exit(1) at line 1 From jeffc at jolt-lang.org Sat Apr 21 10:29:31 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 21 Apr 2007 10:29:31 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/GlobalValue.h Message-ID: <200704211529.l3LFTVKp019556@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: GlobalValue.h updated: 1.36 -> 1.37 --- Log message: Fix breakage of bytecode reader when built with VC++. --- Diffs of the changes: (+4 -2) GlobalValue.h | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/include/llvm/GlobalValue.h diff -u llvm/include/llvm/GlobalValue.h:1.36 llvm/include/llvm/GlobalValue.h:1.37 --- llvm/include/llvm/GlobalValue.h:1.36 Mon Apr 16 23:31:29 2007 +++ llvm/include/llvm/GlobalValue.h Sat Apr 21 10:29:13 2007 @@ -55,8 +55,10 @@ } Module *Parent; - LinkageTypes Linkage : 4; // The linkage of this global - VisibilityTypes Visibility : 1; // The visibility style of this global + // Note: VC++ treats enums as signed, so an extra bit is required to prevent + // Linkage and Visibility from turning into negative values. + LinkageTypes Linkage : 5; // The linkage of this global + VisibilityTypes Visibility : 2; // The visibility style of this global unsigned Alignment : 16; // Alignment of this symbol, must be power of two std::string Section; // Section to emit this into, empty mean default public: From lauro.venancio at gmail.com Sat Apr 21 11:23:26 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Sat, 21 Apr 2007 13:23:26 -0300 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp X86ISelLowering.cpp X86ISelLowering.h X86InstrInfo.td In-Reply-To: <1F2CEF21-3628-4E08-94D8-D0CF09A8C615@apple.com> References: <200704202138.l3KLcfxe023245@zion.cs.uiuc.edu> <1F2CEF21-3628-4E08-94D8-D0CF09A8C615@apple.com> Message-ID: <9c10c9f0704210923g45e1caach99b82e6a4ddefd31@mail.gmail.com> > > Thanks Lauro, very nice! Should the TLS bug be closed now? Now I will implement PIC and TLS for arm-linux, then I will close the PR941 and open a bug report for each target that doesn't implement TLS. Lauro From jeffc at jolt-lang.org Sat Apr 21 11:29:54 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 21 Apr 2007 11:29:54 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineRelocation.h Message-ID: <200704211629.l3LGTstm020456@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineRelocation.h updated: 1.12 -> 1.13 --- Log message: Make enum-valued bitfield large enough to avoid interpretation as negative values in VC++. --- Diffs of the changes: (+1 -1) MachineRelocation.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/MachineRelocation.h diff -u llvm/include/llvm/CodeGen/MachineRelocation.h:1.12 llvm/include/llvm/CodeGen/MachineRelocation.h:1.13 --- llvm/include/llvm/CodeGen/MachineRelocation.h:1.12 Sun Dec 10 20:19:29 2006 +++ llvm/include/llvm/CodeGen/MachineRelocation.h Sat Apr 21 11:29:37 2007 @@ -63,7 +63,7 @@ } Target; unsigned TargetReloType : 6; // The target relocation ID. - AddressType AddrType : 3; // The field of Target to use. + AddressType AddrType : 4; // The field of Target to use. bool DoesntNeedFnStub : 1; // True if we don't need a fn stub. bool GOTRelative : 1; // Should this relocation be relative to the GOT? From rspencer at reidspencer.com Sat Apr 21 11:38:27 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Sat, 21 Apr 2007 09:38:27 -0700 Subject: [llvm-commits] [llvm] r36266 - /llvm/trunk/CREDITS.TXT In-Reply-To: <50FFB128-D823-43A6-995D-A911BFB77B25@apple.com> References: <200704210340.l3L3e4mZ001848@dcs-lbuild.cs.uiuc.edu> <1177128372.20748.63.camel@bashful.x10sys.com> <50FFB128-D823-43A6-995D-A911BFB77B25@apple.com> Message-ID: <1177173507.20748.70.camel@bashful.x10sys.com> On Sat, 2007-04-21 at 00:13 -0700, Chris Lattner wrote: > On Apr 20, 2007, at 9:06 PM, Reid Spencer wrote: > > > On Fri, 2007-04-20 at 20:46 -0700, Chris Lattner wrote: > >> Urg, this is going to come from cscollab-rspencer at ... ? > > > > I've asked David to fix this. He said he would forward my request > > on to > > the authentication people at UIUC. He said they aren't likely to > > give us > > prefix-less user names. > > > > The more issues we run into with UIUC the more I'm not liking how this > > is turning out. > > Can we just have the post-commit script fakemail that it is > reid at hisfavoritedomain.com sending it? We need to do that anyway, but having one set of user names for pre-conversion and one set for post-conversion is going to double and confuse historical queries like "svn blame". It also makes things like gathering statistics on user activity harder because you have to merge pre-conversion and post-conversion results. Reid. > > -Chris > > > Reid. > > > >> > >> Yuck. Can we get a mapping table like we have for cvs committers? > >> > >> -Chris > >> > >> Begin forwarded message: > >> > >>> From: cscollab-rspencer at uiuc.edu > >>> Date: April 20, 2007 8:40:04 PM PDT > >>> To: llvm-commits at cs.uiuc.edu > >>> Subject: [llvm-commits] [llvm] r36266 - /llvm/trunk/CREDITS.TXT > >>> Reply-To: CVS Commit Messages for LLVM repository >>> commits at cs.uiuc.edu> > >>> > >>> Author: cscollab-rspencer > >>> Date: Fri Apr 20 22:40:04 2007 > >>> New Revision: 36266 > >>> > >>> URL: http://subversion.cs.uiuc.edu/viewvc/llvm?rev=36266&view=rev > >>> Log: > >>> Add a credit. > >>> > >>> Modified: > >>> llvm/trunk/CREDITS.TXT > >>> > >>> Modified: llvm/trunk/CREDITS.TXT > >>> URL: http://subversion.cs.uiuc.edu/viewvc/llvm/llvm/trunk/ > >>> CREDITS.TXT?rev=36266&r1=36265&r2=36266&view=diff > >>> ==================================================================== > >>> == > >>> ======== > >>> --- llvm/trunk/CREDITS.TXT (original) > >>> +++ llvm/trunk/CREDITS.TXT Fri Apr 20 22:40:04 2007 > >>> @@ -191,7 +191,7 @@ > >>> D: Stacker, llvmc, llvm-ld, llvm-ar, llvm2cpp, lib/Archive, lib/ > >>> Linker, > >>> D: lib/System, bytecode enhancements, symtab hacking, > >>> unoverloading of > >>> D: intrinsics, makefile and configuration system, documentation, > >>> various bug > >>> -D: fixing. > >>> +D: fixing, Subversion migration. > >>> > >>> N: Adam Treat > >>> E: manyoso at yahoo.com > >>> > >>> > >>> _______________________________________________ > >>> llvm-commits mailing list > >>> llvm-commits at cs.uiuc.edu > >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > >> > > > From rspencer at reidspencer.com Sat Apr 21 11:46:08 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Sat, 21 Apr 2007 09:46:08 -0700 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp In-Reply-To: <200704210817.l3L8H9Fc011876@zion.cs.uiuc.edu> References: <200704210817.l3L8H9Fc011876@zion.cs.uiuc.edu> Message-ID: <1177173968.20748.73.camel@bashful.x10sys.com> Christopher, On Sat, 2007-04-21 at 03:17 -0500, Christopher Lamb wrote: > > Changes in directory llvm/lib/Bytecode/Writer: > > Writer.cpp updated: 1.173 -> 1.174 > --- > Log message: > > > add support for alignment attributes on load/store instructions > > > --- > Diffs of the changes: (+27 -5) > > Writer.cpp | 32 +++++++++++++++++++++++++++----- > 1 files changed, 27 insertions(+), 5 deletions(-) > > > Index: llvm/lib/Bytecode/Writer/Writer.cpp > diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.173 llvm/lib/Bytecode/Writer/Writer.cpp:1.174 > --- llvm/lib/Bytecode/Writer/Writer.cpp:1.173 Mon Apr 16 18:32:28 2007 > +++ llvm/lib/Bytecode/Writer/Writer.cpp Sat Apr 21 03:16:25 2007 > @@ -616,7 +616,7 @@ > unsigned Opcode = I.getOpcode(); > unsigned NumOperands = I.getNumOperands(); > > - // Encode 'tail call' as 61, 'volatile load' as 62, and 'volatile store' as > + // Encode 'tail call' as 61 > // 63. > if (const CallInst *CI = dyn_cast(&I)) { > if (CI->getCallingConv() == CallingConv::C) { > @@ -632,10 +632,6 @@ > } else { > Opcode = 58; // Call escape sequence. > } > - } else if (isa(I) && cast(I).isVolatile()) { > - Opcode = 62; > - } else if (isa(I) && cast(I).isVolatile()) { > - Opcode = 63; > } > > // Figure out which type to encode with the instruction. Typically we want > @@ -744,6 +740,32 @@ > } else if (isa(I)) { > // Invoke escape seq has at least 4 operands to encode. > ++NumOperands; > + } else if (const LoadInst *LI = dyn_cast(&I)) { > + // Encode attributed load as opcode 62 > + // We need to encode the attributes of the load instruction as the second > + // operand. Its not really a slot, but we don't want to break the > + // instruction format for these instructions. > + if (LI->getAlignment() || LI->isVolatile()) { > + NumOperands = 2; > + Slots[1] = ((Log2_32(LI->getAlignment())+1)<<1) + > + (LI->isVolatile() ? 1 : 0); Is this Log2_32 really needed? The alignment should already be a power of two. If the alignment is something like 7 then you'll get rounding to 8 but I contend that an alignment of 7 can't happen. This can be assured in the bcreader and the asmparser. > + if (Slots[1] > MaxOpSlot) > + MaxOpSlot = Slots[1]; > + Opcode = 62; > + } > + } else if (const StoreInst *SI = dyn_cast(&I)) { > + // Encode attributed store as opcode 63 > + // We need to encode the attributes of the store instruction as the third > + // operand. Its not really a slot, but we don't want to break the > + // instruction format for these instructions. > + if (SI->getAlignment() || SI->isVolatile()) { > + NumOperands = 3; > + Slots[2] = ((Log2_32(SI->getAlignment())+1)<<1) + > + (SI->isVolatile() ? 1 : 0); > + if (Slots[2] > MaxOpSlot) > + MaxOpSlot = Slots[2]; > + Opcode = 63; > + } > } > > // Decide which instruction encoding to use. This is determined primarily > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From rspencer at reidspencer.com Sat Apr 21 11:51:57 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Sat, 21 Apr 2007 09:51:57 -0700 Subject: [llvm-commits] Nightly tester annoyance In-Reply-To: <462A237E.6010309@jolt-lang.org> References: <462A237E.6010309@jolt-lang.org> Message-ID: <1177174317.20748.75.camel@bashful.x10sys.com> Jeff, Please file a bug for this. It is a consequence of the new dejagnu tester. Its output is different and the nightly tester's regex for matching the test name needs to be improved. Reid. On Sat, 2007-04-21 at 07:45 -0700, Jeff Cohen wrote: > The nightly tester has acquired the bad habit of believing a regression > test has changed it's name whenever the test changes from failing to > passing or vice versa. > > For example, > > Added Tests: > test/CFrontend/2007-04-11-InlineAsmUnion.c > > > Removed Tests: > test/CFrontend/2007-04-11-InlineAsmUnion.c: exit(1) at line 1 > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From rspencer at reidspencer.com Sat Apr 21 11:53:48 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Sat, 21 Apr 2007 09:53:48 -0700 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineRelocation.h In-Reply-To: <200704211629.l3LGTstm020456@zion.cs.uiuc.edu> References: <200704211629.l3LGTstm020456@zion.cs.uiuc.edu> Message-ID: <1177174428.20748.77.camel@bashful.x10sys.com> Jeff, On Sat, 2007-04-21 at 11:29 -0500, Jeff Cohen wrote: > > Changes in directory llvm/include/llvm/CodeGen: > > MachineRelocation.h updated: 1.12 -> 1.13 > --- > Log message: > > Make enum-valued bitfield large enough to avoid interpretation as negative values in VC++. > > --- > Diffs of the changes: (+1 -1) > > MachineRelocation.h | 2 +- > 1 files changed, 1 insertion(+), 1 deletion(-) > > > Index: llvm/include/llvm/CodeGen/MachineRelocation.h > diff -u llvm/include/llvm/CodeGen/MachineRelocation.h:1.12 llvm/include/llvm/CodeGen/MachineRelocation.h:1.13 > --- llvm/include/llvm/CodeGen/MachineRelocation.h:1.12 Sun Dec 10 20:19:29 2006 > +++ llvm/include/llvm/CodeGen/MachineRelocation.h Sat Apr 21 11:29:37 2007 > @@ -63,7 +63,7 @@ > } Target; > > unsigned TargetReloType : 6; // The target relocation ID. > - AddressType AddrType : 3; // The field of Target to use. > + AddressType AddrType : 4; // The field of Target to use. Can't we just make AddressType "unsigned" ? Surely VC++ won't treat something explicitly declared as unsigned as a signed quantity. Then we shouldn't need the extra bit, right? Reid. > bool DoesntNeedFnStub : 1; // True if we don't need a fn stub. > bool GOTRelative : 1; // Should this relocation be relative to the GOT? > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From rspencer at reidspencer.com Sat Apr 21 11:54:51 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Sat, 21 Apr 2007 09:54:51 -0700 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp In-Reply-To: <1177173968.20748.73.camel@bashful.x10sys.com> References: <200704210817.l3L8H9Fc011876@zion.cs.uiuc.edu> <1177173968.20748.73.camel@bashful.x10sys.com> Message-ID: <1177174491.20748.79.camel@bashful.x10sys.com> Christopher, I'll answer my own question .. You're compressing the alignment to a smaller value by extracting its log. I didn't get that until I read the Reader.cpp code :) Reid. On Sat, 2007-04-21 at 09:46 -0700, Reid Spencer wrote: > Christopher, > > On Sat, 2007-04-21 at 03:17 -0500, Christopher Lamb wrote: > > > > Changes in directory llvm/lib/Bytecode/Writer: > > > > Writer.cpp updated: 1.173 -> 1.174 > > --- > > Log message: > > > > > > add support for alignment attributes on load/store instructions > > > > > > --- > > Diffs of the changes: (+27 -5) > > > > Writer.cpp | 32 +++++++++++++++++++++++++++----- > > 1 files changed, 27 insertions(+), 5 deletions(-) > > > > > > Index: llvm/lib/Bytecode/Writer/Writer.cpp > > diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.173 llvm/lib/Bytecode/Writer/Writer.cpp:1.174 > > --- llvm/lib/Bytecode/Writer/Writer.cpp:1.173 Mon Apr 16 18:32:28 2007 > > +++ llvm/lib/Bytecode/Writer/Writer.cpp Sat Apr 21 03:16:25 2007 > > @@ -616,7 +616,7 @@ > > unsigned Opcode = I.getOpcode(); > > unsigned NumOperands = I.getNumOperands(); > > > > - // Encode 'tail call' as 61, 'volatile load' as 62, and 'volatile store' as > > + // Encode 'tail call' as 61 > > // 63. > > if (const CallInst *CI = dyn_cast(&I)) { > > if (CI->getCallingConv() == CallingConv::C) { > > @@ -632,10 +632,6 @@ > > } else { > > Opcode = 58; // Call escape sequence. > > } > > - } else if (isa(I) && cast(I).isVolatile()) { > > - Opcode = 62; > > - } else if (isa(I) && cast(I).isVolatile()) { > > - Opcode = 63; > > } > > > > // Figure out which type to encode with the instruction. Typically we want > > @@ -744,6 +740,32 @@ > > } else if (isa(I)) { > > // Invoke escape seq has at least 4 operands to encode. > > ++NumOperands; > > + } else if (const LoadInst *LI = dyn_cast(&I)) { > > + // Encode attributed load as opcode 62 > > + // We need to encode the attributes of the load instruction as the second > > + // operand. Its not really a slot, but we don't want to break the > > + // instruction format for these instructions. > > + if (LI->getAlignment() || LI->isVolatile()) { > > + NumOperands = 2; > > + Slots[1] = ((Log2_32(LI->getAlignment())+1)<<1) + > > + (LI->isVolatile() ? 1 : 0); > > Is this Log2_32 really needed? The alignment should already be a power > of two. If the alignment is something like 7 then you'll get rounding > to 8 but I contend that an alignment of 7 can't happen. This can be > assured in the bcreader and the asmparser. > > > + if (Slots[1] > MaxOpSlot) > > + MaxOpSlot = Slots[1]; > > + Opcode = 62; > > + } > > + } else if (const StoreInst *SI = dyn_cast(&I)) { > > + // Encode attributed store as opcode 63 > > + // We need to encode the attributes of the store instruction as the third > > + // operand. Its not really a slot, but we don't want to break the > > + // instruction format for these instructions. > > + if (SI->getAlignment() || SI->isVolatile()) { > > + NumOperands = 3; > > + Slots[2] = ((Log2_32(SI->getAlignment())+1)<<1) + > > + (SI->isVolatile() ? 1 : 0); > > + if (Slots[2] > MaxOpSlot) > > + MaxOpSlot = Slots[2]; > > + Opcode = 63; > > + } > > } > > > > // Decide which instruction encoding to use. This is determined primarily > > > > > > > > _______________________________________________ > > 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 rspencer at reidspencer.com Sat Apr 21 12:00:51 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Sat, 21 Apr 2007 10:00:51 -0700 Subject: [llvm-commits] Function aliases In-Reply-To: <1177150891.28521.25.camel@asl.dorms.spbu.ru> References: <20070419205157.GQ5062.SS386SS@village.us.cray.com> <1177021495.13159.147.camel@asl.dorms.spbu.ru> <1177049862.13159.162.camel@asl.dorms.spbu.ru> <54A7260C-1FDE-4B3D-91CA-6B40D261E49A.SS2323SS@apple.com> <1177150891.28521.25.camel@asl.dorms.spbu.ru> Message-ID: <1177174851.20748.82.camel@bashful.x10sys.com> I've lost track of this dicsussion because it has occurred over so many emails. Could we please put this into a bugzilla so that it is all in one place? There is a bugzilla for this alias feature, right? If not, Anton, please create one and summarize the various arguments that are being made here. We shouldn't be having design meetings in llvm-commits :) Reid. On Sat, 2007-04-21 at 14:21 +0400, Anton Korobeynikov wrote: > Hello, Chris. > > > I disagree. They *act like* functions or GV's, but they really > > aren't them. For example, (from m understanding), it is not legal to > > give an alias a function body or a global variable initializer. > After stripping alias target they are nothing more than just external > declarations. That's why I'm thinking it's just GV or Function plus > small addendum. > > > No, you wouldn't need both classes, just a single one. > But function aliases can, for example, definitely have CC. It acts like > normal Function. > > > Two things: getCalledFunction already returns null if the callee is > > not a function, e.g. an indirect call. All of the users of this > > method will already do the right thing and treat aliases as unknown > > calls. This will be correct. > But it's not indirect call. getCalledFunction() should return "function > part" of function alias. > > > I'd expect the linker (or something else) to want to resolve through > > aliases if the alias, if the actual destination function is around. > This seems to be useful feature. However, usually aliases are introduces > when no alias target exists in the current module. > > I think the best solution is the one submitted by Gordon: > > 1. Introduce new table (or use some current) in the Module for alias > targets. > 2. User normal Function's and GV's for aliases. They will be just > external function/variable *declarations*. Everything will be ok. > 3. Add methods addAlias(), removeAlias() to GV class to add/remove > entries to alias target table. +some utility functions to deal with this > table during e.g. object destruction/copying. > 4. Let Verifier to reject that GV's and Functions, which has > initializer/body and entry in the alias target table. > 5. AsmParser should reject usage of alias and initializer/body as well. > 6. Let Linker to "propagate" alias targets, if possible. > 7. During codegen query alias target entry for each MO_ExternalSymbol to > check, whether there is any alias. And emit needed code. > > Sounds better? > From reid at x10sys.com Sat Apr 21 12:12:03 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 21 Apr 2007 12:12:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp Message-ID: <200704211712.l3LHC3AJ021093@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: ExternalFunctions.cpp updated: 1.97 -> 1.98 --- Log message: We only need one putchar which gives it a shot at getting matched by its users. --- Diffs of the changes: (+4 -17) ExternalFunctions.cpp | 21 ++++----------------- 1 files changed, 4 insertions(+), 17 deletions(-) Index: llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.97 llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.98 --- llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.97 Fri Mar 30 11:41:50 2007 +++ llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp Sat Apr 21 12:11:45 2007 @@ -112,20 +112,8 @@ // extern "C" { // Don't add C++ manglings to llvm mangling :) -// void putchar(sbyte) -GenericValue lle_VB_putchar(FunctionType *FT, const vector &Args){ - cout << ((char)Args[0].IntVal.getZExtValue()); - return GenericValue(); -} - -// int putchar(int) -GenericValue lle_ii_putchar(FunctionType *FT, const vector &Args){ - cout << ((char)Args[0].IntVal.getZExtValue()) << std::flush; - return Args[0]; -} - // void putchar(ubyte) -GenericValue lle_Vb_putchar(FunctionType *FT, const vector &Args){ +GenericValue lle_X_putchar(FunctionType *FT, const vector &Args){ cout << ((char)Args[0].IntVal.getZExtValue()) << std::flush; return Args[0]; } @@ -354,13 +342,14 @@ break; } } + return GV; } // int printf(sbyte *, ...) - a very rough implementation to make output useful. GenericValue lle_X_printf(FunctionType *FT, const vector &Args) { char Buffer[10000]; vector NewArgs; - NewArgs.push_back(PTOGV(Buffer)); + NewArgs.push_back(PTOGV((void*)&Buffer[0])); NewArgs.insert(NewArgs.end(), Args.begin(), Args.end()); GenericValue GV = lle_X_sprintf(FT, NewArgs); cout << Buffer; @@ -704,9 +693,7 @@ void Interpreter::initializeExternalFunctions() { - FuncNames["lle_Vb_putchar"] = lle_Vb_putchar; - FuncNames["lle_ii_putchar"] = lle_ii_putchar; - FuncNames["lle_VB_putchar"] = lle_VB_putchar; + FuncNames["lle_X_putchar"] = lle_X_putchar; FuncNames["lle_X_exit"] = lle_X_exit; FuncNames["lle_X_abort"] = lle_X_abort; FuncNames["lle_X_malloc"] = lle_X_malloc; From rspencer at reidspencer.com Sat Apr 21 12:21:30 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Sat, 21 Apr 2007 10:21:30 -0700 Subject: [llvm-commits] Major regressions In-Reply-To: <462A2009.1050003@jolt-lang.org> References: <462A2009.1050003@jolt-lang.org> Message-ID: <1177176090.20748.87.camel@bashful.x10sys.com> Jeff, I'm seeing these too. They all seem to be related to Christopher Lamb's alignment changes. If he doesn't step up to fix soon, I'll revert the changes. Reid. On Sat, 2007-04-21 at 07:30 -0700, Jeff Cohen wrote: > Commits in the last 12 hours or so have broken 34 regression tests and > caused 21 failure in llvm-test. They appear to be concentrated in the > vector area. > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From jeffc at jolt-lang.org Sat Apr 21 12:29:38 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 21 Apr 2007 10:29:38 -0700 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineRelocation.h In-Reply-To: <1177174428.20748.77.camel@bashful.x10sys.com> References: <200704211629.l3LGTstm020456@zion.cs.uiuc.edu> <1177174428.20748.77.camel@bashful.x10sys.com> Message-ID: <462A4A02.6010205@jolt-lang.org> Reid Spencer wrote: > Jeff, > > > On Sat, 2007-04-21 at 11:29 -0500, Jeff Cohen wrote: > >> Changes in directory llvm/include/llvm/CodeGen: >> >> MachineRelocation.h updated: 1.12 -> 1.13 >> --- >> Log message: >> >> Make enum-valued bitfield large enough to avoid interpretation as negative values in VC++. >> >> --- >> Diffs of the changes: (+1 -1) >> >> MachineRelocation.h | 2 +- >> 1 files changed, 1 insertion(+), 1 deletion(-) >> >> >> Index: llvm/include/llvm/CodeGen/MachineRelocation.h >> diff -u llvm/include/llvm/CodeGen/MachineRelocation.h:1.12 llvm/include/llvm/CodeGen/MachineRelocation.h:1.13 >> --- llvm/include/llvm/CodeGen/MachineRelocation.h:1.12 Sun Dec 10 20:19:29 2006 >> +++ llvm/include/llvm/CodeGen/MachineRelocation.h Sat Apr 21 11:29:37 2007 >> @@ -63,7 +63,7 @@ >> } Target; >> >> unsigned TargetReloType : 6; // The target relocation ID. >> - AddressType AddrType : 3; // The field of Target to use. >> + AddressType AddrType : 4; // The field of Target to use. >> > > Can't we just make AddressType "unsigned" ? Surely VC++ won't treat > something explicitly declared as unsigned as a signed quantity. Then we > shouldn't need the extra bit, right? > > Reid. Not without inserting a whole bunch of casts elsewhere. Unsigneds cannot be assigned to enums. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070421/de7ec57f/attachment.html From jeffc at jolt-lang.org Sat Apr 21 12:31:32 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 21 Apr 2007 10:31:32 -0700 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp In-Reply-To: <1177174491.20748.79.camel@bashful.x10sys.com> References: <200704210817.l3L8H9Fc011876@zion.cs.uiuc.edu> <1177173968.20748.73.camel@bashful.x10sys.com> <1177174491.20748.79.camel@bashful.x10sys.com> Message-ID: <462A4A74.1010701@jolt-lang.org> Reid Spencer wrote: > Christopher, > > I'll answer my own question .. You're compressing the alignment to a > smaller value by extracting its log. I didn't get that until I read the > Reader.cpp code :) > > Reid. It's still very expensive. There are alternative approaches that are much faster and may still be suitable, like finding the position of the first non-zero bit. From jeffc at jolt-lang.org Sat Apr 21 12:34:46 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 21 Apr 2007 10:34:46 -0700 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp In-Reply-To: <462A4A74.1010701@jolt-lang.org> References: <200704210817.l3L8H9Fc011876@zion.cs.uiuc.edu> <1177173968.20748.73.camel@bashful.x10sys.com> <1177174491.20748.79.camel@bashful.x10sys.com> <462A4A74.1010701@jolt-lang.org> Message-ID: <462A4B36.7050707@jolt-lang.org> Jeff Cohen wrote: > Reid Spencer wrote: > >> Christopher, >> >> I'll answer my own question .. You're compressing the alignment to a >> smaller value by extracting its log. I didn't get that until I read the >> Reader.cpp code :) >> >> Reid. >> > > It's still very expensive. There are alternative approaches that are > much faster and may still be suitable, like finding the position of the > first non-zero bit. Never mind... that's what you are doing... From reid at x10sys.com Sat Apr 21 12:45:24 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 21 Apr 2007 12:45:24 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/bits.h Message-ID: <200704211745.l3LHjO96021625@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: bits.h updated: 1.2 -> 1.3 --- Log message: Add some more types. --- Diffs of the changes: (+3 -2) bits.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/bits.h diff -u llvm-test/SingleSource/UnitTests/Integer/bits.h:1.2 llvm-test/SingleSource/UnitTests/Integer/bits.h:1.3 --- llvm-test/SingleSource/UnitTests/Integer/bits.h:1.2 Tue Apr 17 19:53:49 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bits.h Sat Apr 21 12:45:07 2007 @@ -43,8 +43,9 @@ typedef int __attribute__((bitwidth(33))) int33; typedef int __attribute__((bitwidth(169))) int169; -typedef unsigned int __attribute__((bitwidth(250))) Int250; -typedef unsigned int __attribute__((bitwidth(256))) Int256; +typedef unsigned int __attribute__((bitwidth(250))) int250; +typedef unsigned int __attribute__((bitwidth(256))) int256; +typedef unsigned int __attribute__((bitwidth(256))) int500; #define bitwidthof(TORV) (__bitwidthof__(typeof(TORV))) From reid at x10sys.com Sat Apr 21 12:48:17 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 21 Apr 2007 12:48:17 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/test4.c bits.h Message-ID: <200704211748.l3LHmHfY021690@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: test4.c added (r1.1) bits.h updated: 1.3 -> 1.4 --- Log message: Add test case. --- Diffs of the changes: (+31 -0) bits.h | 5 +++++ test4.c | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) Index: llvm-test/SingleSource/UnitTests/Integer/test4.c diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/test4.c:1.1 *** /dev/null Sat Apr 21 12:48:09 2007 --- llvm-test/SingleSource/UnitTests/Integer/test4.c Sat Apr 21 12:47:59 2007 *************** *** 0 **** --- 1,26 ---- + + #include "bits.h" + + + int main(int argc, char ** argv) + { + uint68 n; + uint63 t1; + uint3 t2; + uint128 t3; + unsigned long long t4; + + t4 = bit_concat((uint25) -1, (uint39)-1); + printBits(t4); + printf("\n"); + + + + n = -1; + t3 = bit_concat(n, (uint60)-1); + printBits(t3); + printf("\n"); + + + return 0; + } Index: llvm-test/SingleSource/UnitTests/Integer/bits.h diff -u llvm-test/SingleSource/UnitTests/Integer/bits.h:1.3 llvm-test/SingleSource/UnitTests/Integer/bits.h:1.4 --- llvm-test/SingleSource/UnitTests/Integer/bits.h:1.3 Sat Apr 21 12:45:07 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bits.h Sat Apr 21 12:47:59 2007 @@ -27,12 +27,17 @@ typedef unsigned int __attribute__((bitwidth(17))) uint17; typedef unsigned int __attribute__((bitwidth(19))) uint19; typedef unsigned int __attribute__((bitwidth(21))) uint21; +typedef unsigned int __attribute__((bitwidth(25))) uint25; typedef unsigned int __attribute__((bitwidth(17))) uint32; typedef unsigned int __attribute__((bitwidth(36))) uint36; +typedef unsigned int __attribute__((bitwidth(39))) uint39; typedef unsigned int __attribute__((bitwidth(47))) uint47; typedef unsigned int __attribute__((bitwidth(48))) uint48; +typedef unsigned int __attribute__((bitwidth(60))) uint60; +typedef unsigned int __attribute__((bitwidth(63))) uint63; typedef unsigned int __attribute__((bitwidth(64))) uint64; typedef unsigned int __attribute__((bitwidth(65))) uint65; +typedef unsigned int __attribute__((bitwidth(68))) uint68; typedef unsigned int __attribute__((bitwidth(128))) uint128; typedef int __attribute__ ((bitwidth(9))) int9; From reid at x10sys.com Sat Apr 21 12:52:12 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 21 Apr 2007 12:52:12 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/test4.reference_output test4.c Message-ID: <200704211752.l3LHqCqw021780@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: test4.reference_output added (r1.1) test4.c updated: 1.1 -> 1.2 --- Log message: Add reference output for test case. --- Diffs of the changes: (+3 -3) test4.c | 3 --- test4.reference_output | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/test4.reference_output diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/test4.reference_output:1.1 *** /dev/null Sat Apr 21 12:52:04 2007 --- llvm-test/SingleSource/UnitTests/Integer/test4.reference_output Sat Apr 21 12:51:54 2007 *************** *** 0 **** --- 1,3 ---- + 1111111111111111111111111111111111111111111111111111111111111111 + 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 + exit 0 Index: llvm-test/SingleSource/UnitTests/Integer/test4.c diff -u llvm-test/SingleSource/UnitTests/Integer/test4.c:1.1 llvm-test/SingleSource/UnitTests/Integer/test4.c:1.2 --- llvm-test/SingleSource/UnitTests/Integer/test4.c:1.1 Sat Apr 21 12:47:59 2007 +++ llvm-test/SingleSource/UnitTests/Integer/test4.c Sat Apr 21 12:51:54 2007 @@ -14,13 +14,10 @@ printBits(t4); printf("\n"); - - n = -1; t3 = bit_concat(n, (uint60)-1); printBits(t3); printf("\n"); - return 0; } From clattner at apple.com Sat Apr 21 13:18:03 2007 From: clattner at apple.com (Chris Lattner) Date: Sat, 21 Apr 2007 11:18:03 -0700 Subject: [llvm-commits] Nightly tester annoyance In-Reply-To: <1177174317.20748.75.camel@bashful.x10sys.com> References: <462A237E.6010309@jolt-lang.org> <1177174317.20748.75.camel@bashful.x10sys.com> Message-ID: <9995176B-1524-4E41-8F4E-6E5825101124@apple.com> On Apr 21, 2007, at 9:51 AM, Reid Spencer wrote: > Jeff, > > Please file a bug for this. It is a consequence of the new dejagnu > tester. Its output is different and the nightly tester's regex for > matching the test name needs to be improved. I agree, this is greatly annoying. I think it would be fixed by just adding a PR suffix only and always. -Chris From baldrick at free.fr Sat Apr 21 13:18:53 2007 From: baldrick at free.fr (Duncan Sands) Date: Sat, 21 Apr 2007 20:18:53 +0200 Subject: [llvm-commits] CVS: llvm/test/lib/llvm.exp In-Reply-To: <200704202124.l3KLOJre022850@zion.cs.uiuc.edu> References: <200704202124.l3KLOJre022850@zion.cs.uiuc.edu> Message-ID: <200704212018.53948.baldrick@free.fr> > + catch { set file_h [ open "/tmp/llvm_obj_check.m" w] } > + set R [ catch { exec $llvmgcc -c "/tmp/llvm_obj_check.m" -o /dev/null >& /tmp/llvm_obj_check.out } ] Will using /tmp and /dev/null work properly under Windows? Ciao, Duncan. From clattner at apple.com Sat Apr 21 13:19:41 2007 From: clattner at apple.com (Chris Lattner) Date: Sat, 21 Apr 2007 11:19:41 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp X86ISelLowering.cpp X86ISelLowering.h X86InstrInfo.td In-Reply-To: <9c10c9f0704210923g45e1caach99b82e6a4ddefd31@mail.gmail.com> References: <200704202138.l3KLcfxe023245@zion.cs.uiuc.edu> <1F2CEF21-3628-4E08-94D8-D0CF09A8C615@apple.com> <9c10c9f0704210923g45e1caach99b82e6a4ddefd31@mail.gmail.com> Message-ID: <55CACF66-A18F-4324-B6EF-77D43B46906F@apple.com> On Apr 21, 2007, at 9:23 AM, Lauro Ramos Venancio wrote: >> >> Thanks Lauro, very nice! Should the TLS bug be closed now? > > Now I will implement PIC and TLS for arm-linux, then I will close the > PR941 and open a bug report for each target that doesn't implement > TLS. I'd prefer to just have it be in the README.txt for each target. We don't need NxM PRs for each feature x each target that is missing :) Thanks again Lauro, -Chris From rspencer at reidspencer.com Sat Apr 21 13:29:33 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Sat, 21 Apr 2007 11:29:33 -0700 Subject: [llvm-commits] Nightly tester annoyance In-Reply-To: <9995176B-1524-4E41-8F4E-6E5825101124@apple.com> References: <462A237E.6010309@jolt-lang.org> <1177174317.20748.75.camel@bashful.x10sys.com> <9995176B-1524-4E41-8F4E-6E5825101124@apple.com> Message-ID: <1177180173.20748.104.camel@bashful.x10sys.com> On Sat, 2007-04-21 at 11:18 -0700, Chris Lattner wrote: > On Apr 21, 2007, at 9:51 AM, Reid Spencer wrote: > > > Jeff, > > > > Please file a bug for this. It is a consequence of the new dejagnu > > tester. Its output is different and the nightly tester's regex for > > matching the test name needs to be improved. > > I agree, this is greatly annoying. I think it would be fixed by just > adding a PR suffix only and always. If you know what the issue is, please fix it. I'm not sure it has anything to do with the PR suffix. > > -Chris > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From reid at x10sys.com Sat Apr 21 13:37:00 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 21 Apr 2007 13:37:00 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Instructions.h Message-ID: <200704211837.l3LIb0FB022482@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Instructions.h updated: 1.68 -> 1.69 --- Log message: Revert Christopher Lamb's load/store alignment changes. --- Diffs of the changes: (+7 -33) Instructions.h | 40 +++++++--------------------------------- 1 files changed, 7 insertions(+), 33 deletions(-) Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.68 llvm/include/llvm/Instructions.h:1.69 --- llvm/include/llvm/Instructions.h:1.68 Sat Apr 21 09:32:59 2007 +++ llvm/include/llvm/Instructions.h Sat Apr 21 13:36:27 2007 @@ -211,11 +211,9 @@ /// SubclassData field in Value to store whether or not the load is volatile. /// class LoadInst : public UnaryInstruction { - LoadInst(const LoadInst &LI) : UnaryInstruction(LI.getType(), Load, LI.getOperand(0)) { setVolatile(LI.isVolatile()); - setAlignment(LI.getAlignment()); #ifndef NDEBUG AssertOK(); @@ -225,16 +223,14 @@ public: LoadInst(Value *Ptr, const std::string &Name, Instruction *InsertBefore); LoadInst(Value *Ptr, const std::string &Name, BasicBlock *InsertAtEnd); - LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false, - Instruction *InsertBefore = 0); - LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, unsigned Align, + LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false, Instruction *InsertBefore = 0); LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, BasicBlock *InsertAtEnd); LoadInst(Value *Ptr, const char *Name, Instruction *InsertBefore); LoadInst(Value *Ptr, const char *Name, BasicBlock *InsertAtEnd); - explicit LoadInst(Value *Ptr, const char *Name = 0, bool isVolatile = false, + explicit LoadInst(Value *Ptr, const char *Name = 0, bool isVolatile = false, Instruction *InsertBefore = 0); LoadInst(Value *Ptr, const char *Name, bool isVolatile, BasicBlock *InsertAtEnd); @@ -242,23 +238,14 @@ /// isVolatile - Return true if this is a load from a volatile memory /// location. /// - bool isVolatile() const { return SubclassData & 1; } + bool isVolatile() const { return SubclassData; } /// setVolatile - Specify whether this is a volatile load or not. /// - void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | unsigned(V); } + void setVolatile(bool V) { SubclassData = V; } virtual LoadInst *clone() const; - /// getAlignment - Return the alignment of the access that is being performed - /// - unsigned getAlignment() const { - signed Log2AlignVal = ((SubclassData>>1)-1); - return ((Log2AlignVal < 0) ? 0 : 1<>1)-1); - return ((Log2AlignVal < 0) ? 0 : 1< Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.271 -> 1.272 Instructions.cpp updated: 1.86 -> 1.87 --- Log message: Revert Christopher Lamb's load/store alignment changes. --- Diffs of the changes: (+0 -49) AsmWriter.cpp | 7 ------- Instructions.cpp | 42 ------------------------------------------ 2 files changed, 49 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.271 llvm/lib/VMCore/AsmWriter.cpp:1.272 --- llvm/lib/VMCore/AsmWriter.cpp:1.271 Sat Apr 21 03:16:25 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Sat Apr 21 13:36:27 2007 @@ -1307,13 +1307,6 @@ writeOperand(I.getOperand(i), PrintAllTypes); } } - - // Print post operand alignment for load/store - if (isa(I) && cast(I).getAlignment()) { - Out << ", align " << cast(I).getAlignment(); - } else if (isa(I) && cast(I).getAlignment()) { - Out << ", align " << cast(I).getAlignment(); - } printInfoComment(I); Out << "\n"; Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.86 llvm/lib/VMCore/Instructions.cpp:1.87 --- llvm/lib/VMCore/Instructions.cpp:1.86 Sat Apr 21 03:16:25 2007 +++ llvm/lib/VMCore/Instructions.cpp Sat Apr 21 13:36:27 2007 @@ -20,7 +20,6 @@ #include "llvm/ParameterAttributes.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/ConstantRange.h" -#include "llvm/Support/MathExtras.h" using namespace llvm; unsigned CallSite::getCallingConv() const { @@ -686,7 +685,6 @@ : UnaryInstruction(cast(Ptr->getType())->getElementType(), Load, Ptr, InsertBef) { setVolatile(false); - setAlignment(0); AssertOK(); setName(Name); } @@ -695,7 +693,6 @@ : UnaryInstruction(cast(Ptr->getType())->getElementType(), Load, Ptr, InsertAE) { setVolatile(false); - setAlignment(0); AssertOK(); setName(Name); } @@ -705,17 +702,6 @@ : UnaryInstruction(cast(Ptr->getType())->getElementType(), Load, Ptr, InsertBef) { setVolatile(isVolatile); - setAlignment(0); - AssertOK(); - setName(Name); -} - -LoadInst::LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, - unsigned Align, Instruction *InsertBef) - : UnaryInstruction(cast(Ptr->getType())->getElementType(), - Load, Ptr, InsertBef) { - setVolatile(isVolatile); - setAlignment(Align); AssertOK(); setName(Name); } @@ -725,7 +711,6 @@ : UnaryInstruction(cast(Ptr->getType())->getElementType(), Load, Ptr, InsertAE) { setVolatile(isVolatile); - setAlignment(0); AssertOK(); setName(Name); } @@ -736,7 +721,6 @@ : UnaryInstruction(cast(Ptr->getType())->getElementType(), Load, Ptr, InsertBef) { setVolatile(false); - setAlignment(0); AssertOK(); if (Name && Name[0]) setName(Name); } @@ -745,7 +729,6 @@ : UnaryInstruction(cast(Ptr->getType())->getElementType(), Load, Ptr, InsertAE) { setVolatile(false); - setAlignment(0); AssertOK(); if (Name && Name[0]) setName(Name); } @@ -755,7 +738,6 @@ : UnaryInstruction(cast(Ptr->getType())->getElementType(), Load, Ptr, InsertBef) { setVolatile(isVolatile); - setAlignment(0); AssertOK(); if (Name && Name[0]) setName(Name); } @@ -765,15 +747,10 @@ : UnaryInstruction(cast(Ptr->getType())->getElementType(), Load, Ptr, InsertAE) { setVolatile(isVolatile); - setAlignment(0); AssertOK(); if (Name && Name[0]) setName(Name); } -void LoadInst::setAlignment(unsigned Align) { - assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!"); - SubclassData = (SubclassData & 1) | ((Log2_32(Align)+1)<<1); -} //===----------------------------------------------------------------------===// // StoreInst Implementation @@ -793,7 +770,6 @@ Ops[0].init(val, this); Ops[1].init(addr, this); setVolatile(false); - setAlignment(0); AssertOK(); } @@ -802,7 +778,6 @@ Ops[0].init(val, this); Ops[1].init(addr, this); setVolatile(false); - setAlignment(0); AssertOK(); } @@ -812,17 +787,6 @@ Ops[0].init(val, this); Ops[1].init(addr, this); setVolatile(isVolatile); - setAlignment(0); - AssertOK(); -} - -StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, - unsigned Align, Instruction *InsertBefore) - : Instruction(Type::VoidTy, Store, Ops, 2, InsertBefore) { - Ops[0].init(val, this); - Ops[1].init(addr, this); - setVolatile(isVolatile); - setAlignment(Align); AssertOK(); } @@ -832,15 +796,9 @@ Ops[0].init(val, this); Ops[1].init(addr, this); setVolatile(isVolatile); - setAlignment(0); AssertOK(); } -void StoreInst::setAlignment(unsigned Align) { - assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!"); - SubclassData = (SubclassData & 1) | ((Log2_32(Align)+1)<<1); -} - //===----------------------------------------------------------------------===// // GetElementPtrInst Implementation //===----------------------------------------------------------------------===// From reid at x10sys.com Sat Apr 21 13:37:02 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 21 Apr 2007 13:37:02 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200704211837.l3LIb2kH022505@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.174 -> 1.175 --- Log message: Revert Christopher Lamb's load/store alignment changes. --- Diffs of the changes: (+5 -27) Writer.cpp | 32 +++++--------------------------- 1 files changed, 5 insertions(+), 27 deletions(-) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.174 llvm/lib/Bytecode/Writer/Writer.cpp:1.175 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.174 Sat Apr 21 03:16:25 2007 +++ llvm/lib/Bytecode/Writer/Writer.cpp Sat Apr 21 13:36:27 2007 @@ -616,7 +616,7 @@ unsigned Opcode = I.getOpcode(); unsigned NumOperands = I.getNumOperands(); - // Encode 'tail call' as 61 + // Encode 'tail call' as 61, 'volatile load' as 62, and 'volatile store' as // 63. if (const CallInst *CI = dyn_cast(&I)) { if (CI->getCallingConv() == CallingConv::C) { @@ -632,6 +632,10 @@ } else { Opcode = 58; // Call escape sequence. } + } else if (isa(I) && cast(I).isVolatile()) { + Opcode = 62; + } else if (isa(I) && cast(I).isVolatile()) { + Opcode = 63; } // Figure out which type to encode with the instruction. Typically we want @@ -740,32 +744,6 @@ } else if (isa(I)) { // Invoke escape seq has at least 4 operands to encode. ++NumOperands; - } else if (const LoadInst *LI = dyn_cast(&I)) { - // Encode attributed load as opcode 62 - // We need to encode the attributes of the load instruction as the second - // operand. Its not really a slot, but we don't want to break the - // instruction format for these instructions. - if (LI->getAlignment() || LI->isVolatile()) { - NumOperands = 2; - Slots[1] = ((Log2_32(LI->getAlignment())+1)<<1) + - (LI->isVolatile() ? 1 : 0); - if (Slots[1] > MaxOpSlot) - MaxOpSlot = Slots[1]; - Opcode = 62; - } - } else if (const StoreInst *SI = dyn_cast(&I)) { - // Encode attributed store as opcode 63 - // We need to encode the attributes of the store instruction as the third - // operand. Its not really a slot, but we don't want to break the - // instruction format for these instructions. - if (SI->getAlignment() || SI->isVolatile()) { - NumOperands = 3; - Slots[2] = ((Log2_32(SI->getAlignment())+1)<<1) + - (SI->isVolatile() ? 1 : 0); - if (Slots[2] > MaxOpSlot) - MaxOpSlot = Slots[2]; - Opcode = 63; - } } // Decide which instruction encoding to use. This is determined primarily From reid at x10sys.com Sat Apr 21 13:37:03 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 21 Apr 2007 13:37:03 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h Message-ID: <200704211837.l3LIb3hm022510@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.148 -> 1.149 SelectionDAGNodes.h updated: 1.186 -> 1.187 --- Log message: Revert Christopher Lamb's load/store alignment changes. --- Diffs of the changes: (+5 -10) SelectionDAG.h | 11 ++++------- SelectionDAGNodes.h | 4 +--- 2 files changed, 5 insertions(+), 10 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.148 llvm/include/llvm/CodeGen/SelectionDAG.h:1.149 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.148 Sat Apr 21 03:16:25 2007 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Sat Apr 21 13:36:27 2007 @@ -311,12 +311,10 @@ /// determined by their operands, and they produce a value AND a token chain. /// SDOperand getLoad(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, - const Value *SV, int SVOffset, bool isVolatile=false, - unsigned Alignment=0); + const Value *SV, int SVOffset, bool isVolatile=false); SDOperand getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, const Value *SV, - int SVOffset, MVT::ValueType EVT, bool isVolatile=false, - unsigned Alignment=0); + int SVOffset, MVT::ValueType EVT, bool isVolatile=false); SDOperand getIndexedLoad(SDOperand OrigLoad, SDOperand Base, SDOperand Offset, ISD::MemIndexedMode AM); SDOperand getVecLoad(unsigned Count, MVT::ValueType VT, SDOperand Chain, @@ -325,11 +323,10 @@ /// getStore - Helper function to build ISD::STORE nodes. /// SDOperand getStore(SDOperand Chain, SDOperand Val, SDOperand Ptr, - const Value *SV, int SVOffset, bool isVolatile=false, - unsigned Alignment=0); + const Value *SV, int SVOffset, bool isVolatile=false); SDOperand getTruncStore(SDOperand Chain, SDOperand Val, SDOperand Ptr, const Value *SV, int SVOffset, MVT::ValueType TVT, - bool isVolatile=false, unsigned Alignment=0); + bool isVolatile=false); SDOperand getIndexedStore(SDOperand OrigStoe, SDOperand Base, SDOperand Offset, ISD::MemIndexedMode AM); Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.186 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.187 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.186 Sat Apr 21 03:16:25 2007 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Sat Apr 21 13:36:27 2007 @@ -1448,7 +1448,7 @@ friend class SelectionDAG; LoadSDNode(SDOperand *ChainPtrOff, SDVTList VTs, ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT, - const Value *SV, int O=0, unsigned Align=0, bool Vol=false) + const Value *SV, int O=0, unsigned Align=1, bool Vol=false) : SDNode(ISD::LOAD, VTs), AddrMode(AM), ExtType(ETy), LoadedVT(LVT), SrcValue(SV), SVOffset(O), Alignment(Align), IsVolatile(Vol) { @@ -1456,7 +1456,6 @@ Ops[1] = ChainPtrOff[1]; // Ptr Ops[2] = ChainPtrOff[2]; // Off InitOperands(Ops, 3); - assert(Align != 0 && "Loads should have non-zero aligment"); assert((getOffset().getOpcode() == ISD::UNDEF || AddrMode != ISD::UNINDEXED) && "Only indexed load has a non-undef offset operand"); @@ -1519,7 +1518,6 @@ Ops[2] = ChainValuePtrOff[2]; // Ptr Ops[3] = ChainValuePtrOff[3]; // Off InitOperands(Ops, 4); - assert(Align != 0 && "Stores should have non-zero aligment"); assert((getOffset().getOpcode() == ISD::UNDEF || AddrMode != ISD::UNINDEXED) && "Only indexed store has a non-undef offset operand"); From reid at x10sys.com Sat Apr 21 13:37:03 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 21 Apr 2007 13:37:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Message-ID: <200704211837.l3LIb3bQ022517@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.249 -> 1.250 --- Log message: Revert Christopher Lamb's load/store alignment changes. --- Diffs of the changes: (+3 -21) Reader.cpp | 24 +++--------------------- 1 files changed, 3 insertions(+), 21 deletions(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.249 llvm/lib/Bytecode/Reader/Reader.cpp:1.250 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.249 Sat Apr 21 03:16:25 2007 +++ llvm/lib/Bytecode/Reader/Reader.cpp Sat Apr 21 13:36:27 2007 @@ -831,31 +831,13 @@ &Idx[0], Idx.size()); break; } - case 62: { // attributed load - if (Oprnds.size() != 2 || !isa(InstTy)) - error("Invalid attributed load instruction!"); - signed Log2AlignVal = ((Oprnds[1]>>1)-1); - Result = new LoadInst(getValue(iType, Oprnds[0]), "", (Oprnds[1] & 1), - ((Log2AlignVal < 0) ? 0 : 1<(InstTy)) error("Invalid load instruction!"); - Result = new LoadInst(getValue(iType, Oprnds[0]), ""); + Result = new LoadInst(getValue(iType, Oprnds[0]), "", Opcode == 62); break; - case 63: { // attributed store - if (!isa(InstTy) || Oprnds.size() != 3) - error("Invalid store instruction!"); - - Value *Ptr = getValue(iType, Oprnds[1]); - const Type *ValTy = cast(Ptr->getType())->getElementType(); - signed Log2AlignVal = ((Oprnds[2]>>1)-1); - Result = new StoreInst(getValue(getTypeSlot(ValTy), Oprnds[0]), Ptr, - (Oprnds[2] & 1), - ((Log2AlignVal < 0) ? 0 : 1<(InstTy) || Oprnds.size() != 2) error("Invalid store instruction!"); From reid at x10sys.com Sat Apr 21 13:37:03 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 21 Apr 2007 13:37:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp SelectionDAG.cpp SelectionDAGISel.cpp Message-ID: <200704211837.l3LIb3c8022526@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.294 -> 1.295 SelectionDAG.cpp updated: 1.399 -> 1.400 SelectionDAGISel.cpp updated: 1.422 -> 1.423 --- Log message: Revert Christopher Lamb's load/store alignment changes. --- Diffs of the changes: (+36 -79) DAGCombiner.cpp | 70 +++++++++++++-------------------------------------- SelectionDAG.cpp | 33 ++++++++---------------- SelectionDAGISel.cpp | 12 +++----- 3 files changed, 36 insertions(+), 79 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.294 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.295 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.294 Sat Apr 21 03:16:25 2007 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sat Apr 21 13:36:27 2007 @@ -1263,9 +1263,7 @@ (!AfterLegalize || TLI.isLoadXLegal(ISD::ZEXTLOAD, EVT))) { SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), - LN0->getSrcValueOffset(), EVT, - LN0->isVolatile(), - LN0->getAlignment()); + LN0->getSrcValueOffset(), EVT); AddToWorkList(N); CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1)); return SDOperand(N, 0); // Return N so it doesn't get rechecked! @@ -1282,9 +1280,7 @@ (!AfterLegalize || TLI.isLoadXLegal(ISD::ZEXTLOAD, EVT))) { SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), - LN0->getSrcValueOffset(), EVT, - LN0->isVolatile(), - LN0->getAlignment()); + LN0->getSrcValueOffset(), EVT); AddToWorkList(N); CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1)); return SDOperand(N, 0); // Return N so it doesn't get rechecked! @@ -1324,8 +1320,7 @@ AddToWorkList(NewPtr.Val); SDOperand Load = DAG.getExtLoad(ISD::ZEXTLOAD, VT, LN0->getChain(), NewPtr, - LN0->getSrcValue(), LN0->getSrcValueOffset(), EVT, - LN0->isVolatile(), LN0->getAlignment()); + LN0->getSrcValue(), LN0->getSrcValueOffset(), EVT); AddToWorkList(N); CombineTo(N0.Val, Load, Load.getValue(1)); return SDOperand(N, 0); // Return N so it doesn't get rechecked! @@ -2125,8 +2120,7 @@ SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), - N0.getValueType(), - LN0->isVolatile()); + N0.getValueType()); CombineTo(N, ExtLoad); CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), ExtLoad.getValue(1)); @@ -2142,9 +2136,7 @@ if (!AfterLegalize || TLI.isLoadXLegal(ISD::SEXTLOAD, EVT)) { SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), - LN0->getSrcValueOffset(), EVT, - LN0->isVolatile(), - LN0->getAlignment()); + LN0->getSrcValueOffset(), EVT); CombineTo(N, ExtLoad); CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), ExtLoad.getValue(1)); @@ -2220,9 +2212,7 @@ SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), - N0.getValueType(), - LN0->isVolatile(), - LN0->getAlignment()); + N0.getValueType()); CombineTo(N, ExtLoad); CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), ExtLoad.getValue(1)); @@ -2237,9 +2227,7 @@ MVT::ValueType EVT = LN0->getLoadedVT(); SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), - LN0->getSrcValueOffset(), EVT, - LN0->isVolatile(), - LN0->getAlignment()); + LN0->getSrcValueOffset(), EVT); CombineTo(N, ExtLoad); CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), ExtLoad.getValue(1)); @@ -2315,9 +2303,7 @@ SDOperand ExtLoad = DAG.getExtLoad(ISD::EXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), - N0.getValueType(), - LN0->isVolatile(), - LN0->getAlignment()); + N0.getValueType()); CombineTo(N, ExtLoad); CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), ExtLoad.getValue(1)); @@ -2335,9 +2321,7 @@ SDOperand ExtLoad = DAG.getExtLoad(LN0->getExtensionType(), VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), - LN0->getSrcValueOffset(), EVT, - LN0->isVolatile(), - LN0->getAlignment()); + LN0->getSrcValueOffset(), EVT); CombineTo(N, ExtLoad); CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), ExtLoad.getValue(1)); @@ -2414,11 +2398,9 @@ AddToWorkList(NewPtr.Val); SDOperand Load = (ExtType == ISD::NON_EXTLOAD) ? DAG.getLoad(VT, LN0->getChain(), NewPtr, - LN0->getSrcValue(), LN0->getSrcValueOffset(), - LN0->isVolatile(), LN0->getAlignment()) + LN0->getSrcValue(), LN0->getSrcValueOffset()) : DAG.getExtLoad(ExtType, VT, LN0->getChain(), NewPtr, - LN0->getSrcValue(), LN0->getSrcValueOffset(), EVT, - LN0->isVolatile(), LN0->getAlignment()); + LN0->getSrcValue(), LN0->getSrcValueOffset(), EVT); AddToWorkList(N); if (CombineSRL) { std::vector NowDead; @@ -2497,9 +2479,7 @@ LoadSDNode *LN0 = cast(N0); SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), - LN0->getSrcValueOffset(), EVT, - LN0->isVolatile(), - LN0->getAlignment()); + LN0->getSrcValueOffset(), EVT); CombineTo(N, ExtLoad); CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1)); return SDOperand(N, 0); // Return N so it doesn't get rechecked! @@ -2512,9 +2492,7 @@ LoadSDNode *LN0 = cast(N0); SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), - LN0->getSrcValueOffset(), EVT, - LN0->isVolatile(), - LN0->getAlignment()); + LN0->getSrcValueOffset(), EVT); CombineTo(N, ExtLoad); CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1)); return SDOperand(N, 0); // Return N so it doesn't get rechecked! @@ -2574,8 +2552,7 @@ if (0 && ISD::isNON_EXTLoad(N0.Val) && N0.hasOneUse()) { LoadSDNode *LN0 = cast(N0); SDOperand Load = DAG.getLoad(VT, LN0->getChain(), LN0->getBasePtr(), - LN0->getSrcValue(), LN0->getSrcValueOffset(), - LN0->isVolatile(), LN0->getAlignment()); + LN0->getSrcValue(), LN0->getSrcValueOffset()); AddToWorkList(N); CombineTo(N0.Val, DAG.getNode(ISD::BIT_CONVERT, N0.getValueType(), Load), Load.getValue(1)); @@ -2965,9 +2942,7 @@ SDOperand ExtLoad = DAG.getExtLoad(ISD::EXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), - N0.getValueType(), - LN0->isVolatile(), - LN0->getAlignment()); + N0.getValueType()); CombineTo(N, ExtLoad); CombineTo(N0.Val, DAG.getNode(ISD::FP_ROUND, N0.getValueType(), ExtLoad), ExtLoad.getValue(1)); @@ -3356,16 +3331,13 @@ // Replace the chain to void dependency. if (LD->getExtensionType() == ISD::NON_EXTLOAD) { ReplLoad = DAG.getLoad(N->getValueType(0), BetterChain, Ptr, - LD->getSrcValue(), LD->getSrcValueOffset(), - LD->isVolatile(), LD->getAlignment()); + LD->getSrcValue(), LD->getSrcValueOffset()); } else { ReplLoad = DAG.getExtLoad(LD->getExtensionType(), LD->getValueType(0), BetterChain, Ptr, LD->getSrcValue(), LD->getSrcValueOffset(), - LD->getLoadedVT(), - LD->isVolatile(), - LD->getAlignment()); + LD->getLoadedVT()); } // Create token factor to keep old chain connected. @@ -4068,17 +4040,13 @@ if (LLD->getExtensionType() == ISD::NON_EXTLOAD) Load = DAG.getLoad(TheSelect->getValueType(0), LLD->getChain(), Addr,LLD->getSrcValue(), - LLD->getSrcValueOffset(), - LLD->isVolatile(), - LLD->getAlignment()); + LLD->getSrcValueOffset()); else { Load = DAG.getExtLoad(LLD->getExtensionType(), TheSelect->getValueType(0), LLD->getChain(), Addr, LLD->getSrcValue(), LLD->getSrcValueOffset(), - LLD->getLoadedVT(), - LLD->isVolatile(), - LLD->getAlignment()); + LLD->getLoadedVT()); } // Users of the select now use the result of the load. CombineTo(TheSelect, Load); Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.399 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.400 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.399 Sat Apr 21 03:16:25 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Sat Apr 21 13:36:27 2007 @@ -20,7 +20,6 @@ #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/Support/MathExtras.h" -#include "llvm/Target/TargetData.h" #include "llvm/Target/MRegisterInfo.h" #include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetInstrInfo.h" @@ -1540,7 +1539,9 @@ SDOperand SelectionDAG::getLoad(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, const Value *SV, int SVOffset, - bool isVolatile, unsigned Alignment) { + bool isVolatile) { + // FIXME: Alignment == 1 for now. + unsigned Alignment = 1; SDVTList VTs = getVTList(VT, MVT::Other); SDOperand Undef = getNode(ISD::UNDEF, Ptr.getValueType()); SDOperand Ops[] = { Chain, Ptr, Undef }; @@ -1556,10 +1557,6 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); - if (Alignment == 0) { // Ensure that codegen never sees alignment 0 - const Type *Ty = MVT::getTypeForValueType(VT); - Alignment = TLI.getTargetData()->getABITypeAlignment(Ty); - } SDNode *N = new LoadSDNode(Ops, VTs, ISD::UNINDEXED, ISD::NON_EXTLOAD, VT, SV, SVOffset, Alignment, isVolatile); @@ -1572,7 +1569,7 @@ SDOperand Chain, SDOperand Ptr, const Value *SV, int SVOffset, MVT::ValueType EVT, - bool isVolatile, unsigned Alignment) { + bool isVolatile) { // If they are asking for an extending load from/to the same thing, return a // normal load. if (VT == EVT) @@ -1587,6 +1584,8 @@ assert(MVT::isInteger(VT) == MVT::isInteger(EVT) && "Cannot convert from FP to Int or Int -> FP!"); + // FIXME: Alignment == 1 for now. + unsigned Alignment = 1; SDVTList VTs = getVTList(VT, MVT::Other); SDOperand Undef = getNode(ISD::UNDEF, Ptr.getValueType()); SDOperand Ops[] = { Chain, Ptr, Undef }; @@ -1602,10 +1601,6 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); - if (Alignment == 0) { // Ensure that codegen never sees alignment 0 - const Type *Ty = MVT::getTypeForValueType(VT); - Alignment = TLI.getTargetData()->getABITypeAlignment(Ty); - } SDNode *N = new LoadSDNode(Ops, VTs, ISD::UNINDEXED, ExtType, EVT, SV, SVOffset, Alignment, isVolatile); CSEMap.InsertNode(N, IP); @@ -1653,9 +1648,11 @@ SDOperand SelectionDAG::getStore(SDOperand Chain, SDOperand Val, SDOperand Ptr, const Value *SV, int SVOffset, - bool isVolatile, unsigned Alignment) { + bool isVolatile) { MVT::ValueType VT = Val.getValueType(); + // FIXME: Alignment == 1 for now. + unsigned Alignment = 1; SDVTList VTs = getVTList(MVT::Other); SDOperand Undef = getNode(ISD::UNDEF, Ptr.getValueType()); SDOperand Ops[] = { Chain, Val, Ptr, Undef }; @@ -1671,10 +1668,6 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); - if (Alignment == 0) { // Ensure that codegen never sees alignment 0 - const Type *Ty = MVT::getTypeForValueType(VT); - Alignment = TLI.getTargetData()->getABITypeAlignment(Ty); - } SDNode *N = new StoreSDNode(Ops, VTs, ISD::UNINDEXED, false, VT, SV, SVOffset, Alignment, isVolatile); CSEMap.InsertNode(N, IP); @@ -1685,7 +1678,7 @@ SDOperand SelectionDAG::getTruncStore(SDOperand Chain, SDOperand Val, SDOperand Ptr, const Value *SV, int SVOffset, MVT::ValueType SVT, - bool isVolatile, unsigned Alignment) { + bool isVolatile) { MVT::ValueType VT = Val.getValueType(); bool isTrunc = VT != SVT; @@ -1693,6 +1686,8 @@ assert(MVT::isInteger(VT) == MVT::isInteger(SVT) && "Can't do FP-INT conversion!"); + // FIXME: Alignment == 1 for now. + unsigned Alignment = 1; SDVTList VTs = getVTList(MVT::Other); SDOperand Undef = getNode(ISD::UNDEF, Ptr.getValueType()); SDOperand Ops[] = { Chain, Val, Ptr, Undef }; @@ -1708,10 +1703,6 @@ void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); - if (Alignment == 0) { // Ensure that codegen never sees alignment 0 - const Type *Ty = MVT::getTypeForValueType(VT); - Alignment = TLI.getTargetData()->getABITypeAlignment(Ty); - } SDNode *N = new StoreSDNode(Ops, VTs, ISD::UNINDEXED, isTrunc, SVT, SV, SVOffset, Alignment, isVolatile); CSEMap.InsertNode(N, IP); Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.422 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.423 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.422 Sat Apr 21 03:16:25 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sat Apr 21 13:36:27 2007 @@ -498,7 +498,7 @@ SDOperand getLoadFrom(const Type *Ty, SDOperand Ptr, const Value *SV, SDOperand Root, - bool isVolatile, unsigned Alignment); + bool isVolatile); SDOperand getIntPtrConstant(uint64_t Val) { return DAG.getConstant(Val, TLI.getPointerTy()); @@ -2313,21 +2313,19 @@ } setValue(&I, getLoadFrom(I.getType(), Ptr, I.getOperand(0), - Root, I.isVolatile(), I.getAlignment())); + Root, I.isVolatile())); } SDOperand SelectionDAGLowering::getLoadFrom(const Type *Ty, SDOperand Ptr, const Value *SV, SDOperand Root, - bool isVolatile, - unsigned Alignment) { + bool isVolatile) { SDOperand L; if (const VectorType *PTy = dyn_cast(Ty)) { MVT::ValueType PVT = TLI.getValueType(PTy->getElementType()); L = DAG.getVecLoad(PTy->getNumElements(), PVT, Root, Ptr, DAG.getSrcValue(SV)); } else { - L = DAG.getLoad(TLI.getValueType(Ty), Root, Ptr, SV, 0, - isVolatile, Alignment); + L = DAG.getLoad(TLI.getValueType(Ty), Root, Ptr, SV, 0, isVolatile); } if (isVolatile) @@ -2344,7 +2342,7 @@ SDOperand Src = getValue(SrcV); SDOperand Ptr = getValue(I.getOperand(1)); DAG.setRoot(DAG.getStore(getRoot(), Src, Ptr, I.getOperand(1), 0, - I.isVolatile(), I.getAlignment())); + I.isVolatile())); } /// IntrinsicCannotAccessMemory - Return true if the specified intrinsic cannot From reid at x10sys.com Sat Apr 21 13:37:01 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 21 Apr 2007 13:37:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y llvmAsmParser.y.cvs Message-ID: <200704211837.l3LIb1gp022493@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp.cvs updated: 1.89 -> 1.90 llvmAsmParser.h.cvs updated: 1.67 -> 1.68 llvmAsmParser.y updated: 1.344 -> 1.345 llvmAsmParser.y.cvs updated: 1.90 -> 1.91 --- Log message: Revert Christopher Lamb's load/store alignment changes. --- Diffs of the changes: (+4331 -3269) llvmAsmParser.cpp.cvs | 7108 ++++++++++++++++++++++++++++---------------------- llvmAsmParser.h.cvs | 448 ++- llvmAsmParser.y | 8 llvmAsmParser.y.cvs | 8 4 files changed, 4331 insertions(+), 3241 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.89 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.90 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.89 Sat Apr 21 03:16:25 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Sat Apr 21 13:36:27 2007 @@ -1,150 +1,342 @@ +/* A Bison parser, made by GNU Bison 2.1. */ -/* A Bison parser, made from /Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y - by GNU Bison version 1.28 */ +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -#define YYBISON 1 /* Identify Bison output. */ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* Written by Richard Stallman by simplifying the original so called + ``semantic'' parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.1" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 +/* Substitute the variable and function names. */ #define yyparse llvmAsmparse -#define yylex llvmAsmlex +#define yylex llvmAsmlex #define yyerror llvmAsmerror -#define yylval llvmAsmlval -#define yychar llvmAsmchar +#define yylval llvmAsmlval +#define yychar llvmAsmchar #define yydebug llvmAsmdebug #define yynerrs llvmAsmnerrs -#define ESINT64VAL 257 -#define EUINT64VAL 258 -#define ESAPINTVAL 259 -#define EUAPINTVAL 260 -#define LOCALVAL_ID 261 -#define GLOBALVAL_ID 262 -#define FPVAL 263 -#define VOID 264 -#define INTTYPE 265 -#define FLOAT 266 -#define DOUBLE 267 -#define LABEL 268 -#define TYPE 269 -#define LOCALVAR 270 -#define GLOBALVAR 271 -#define LABELSTR 272 -#define STRINGCONSTANT 273 -#define ATSTRINGCONSTANT 274 -#define ZEROINITIALIZER 275 -#define TRUETOK 276 -#define FALSETOK 277 -#define BEGINTOK 278 -#define ENDTOK 279 -#define DECLARE 280 -#define DEFINE 281 -#define GLOBAL 282 -#define CONSTANT 283 -#define SECTION 284 -#define VOLATILE 285 -#define THREAD_LOCAL 286 -#define TO 287 -#define DOTDOTDOT 288 -#define NULL_TOK 289 -#define UNDEF 290 -#define INTERNAL 291 -#define LINKONCE 292 -#define WEAK 293 -#define APPENDING 294 -#define DLLIMPORT 295 -#define DLLEXPORT 296 -#define EXTERN_WEAK 297 -#define OPAQUE 298 -#define EXTERNAL 299 -#define TARGET 300 -#define TRIPLE 301 -#define ALIGN 302 -#define DEPLIBS 303 -#define CALL 304 -#define TAIL 305 -#define ASM_TOK 306 -#define MODULE 307 -#define SIDEEFFECT 308 -#define CC_TOK 309 -#define CCC_TOK 310 -#define FASTCC_TOK 311 -#define COLDCC_TOK 312 -#define X86_STDCALLCC_TOK 313 -#define X86_FASTCALLCC_TOK 314 -#define DATALAYOUT 315 -#define RET 316 -#define BR 317 -#define SWITCH 318 -#define INVOKE 319 -#define UNWIND 320 -#define UNREACHABLE 321 -#define ADD 322 -#define SUB 323 -#define MUL 324 -#define UDIV 325 -#define SDIV 326 -#define FDIV 327 -#define UREM 328 -#define SREM 329 -#define FREM 330 -#define AND 331 -#define OR 332 -#define XOR 333 -#define SHL 334 -#define LSHR 335 -#define ASHR 336 -#define ICMP 337 -#define FCMP 338 -#define EQ 339 -#define NE 340 -#define SLT 341 -#define SGT 342 -#define SLE 343 -#define SGE 344 -#define ULT 345 -#define UGT 346 -#define ULE 347 -#define UGE 348 -#define OEQ 349 -#define ONE 350 -#define OLT 351 -#define OGT 352 -#define OLE 353 -#define OGE 354 -#define ORD 355 -#define UNO 356 -#define UEQ 357 -#define UNE 358 -#define MALLOC 359 -#define ALLOCA 360 -#define FREE 361 -#define LOAD 362 -#define STORE 363 -#define GETELEMENTPTR 364 -#define TRUNC 365 -#define ZEXT 366 -#define SEXT 367 -#define FPTRUNC 368 -#define FPEXT 369 -#define BITCAST 370 -#define UITOFP 371 -#define SITOFP 372 -#define FPTOUI 373 -#define FPTOSI 374 -#define INTTOPTR 375 -#define PTRTOINT 376 -#define PHI_TOK 377 -#define SELECT 378 -#define VAARG 379 -#define EXTRACTELEMENT 380 -#define INSERTELEMENT 381 -#define SHUFFLEVECTOR 382 -#define NORETURN 383 -#define INREG 384 -#define SRET 385 -#define NOUNWIND 386 -#define DEFAULT 387 -#define HIDDEN 388 -#line 14 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + ESINT64VAL = 258, + EUINT64VAL = 259, + ESAPINTVAL = 260, + EUAPINTVAL = 261, + LOCALVAL_ID = 262, + GLOBALVAL_ID = 263, + FPVAL = 264, + VOID = 265, + INTTYPE = 266, + FLOAT = 267, + DOUBLE = 268, + LABEL = 269, + TYPE = 270, + LOCALVAR = 271, + GLOBALVAR = 272, + LABELSTR = 273, + STRINGCONSTANT = 274, + ATSTRINGCONSTANT = 275, + ZEROINITIALIZER = 276, + TRUETOK = 277, + FALSETOK = 278, + BEGINTOK = 279, + ENDTOK = 280, + DECLARE = 281, + DEFINE = 282, + GLOBAL = 283, + CONSTANT = 284, + SECTION = 285, + VOLATILE = 286, + THREAD_LOCAL = 287, + TO = 288, + DOTDOTDOT = 289, + NULL_TOK = 290, + UNDEF = 291, + INTERNAL = 292, + LINKONCE = 293, + WEAK = 294, + APPENDING = 295, + DLLIMPORT = 296, + DLLEXPORT = 297, + EXTERN_WEAK = 298, + OPAQUE = 299, + EXTERNAL = 300, + TARGET = 301, + TRIPLE = 302, + ALIGN = 303, + DEPLIBS = 304, + CALL = 305, + TAIL = 306, + ASM_TOK = 307, + MODULE = 308, + SIDEEFFECT = 309, + CC_TOK = 310, + CCC_TOK = 311, + FASTCC_TOK = 312, + COLDCC_TOK = 313, + X86_STDCALLCC_TOK = 314, + X86_FASTCALLCC_TOK = 315, + DATALAYOUT = 316, + RET = 317, + BR = 318, + SWITCH = 319, + INVOKE = 320, + UNWIND = 321, + UNREACHABLE = 322, + ADD = 323, + SUB = 324, + MUL = 325, + UDIV = 326, + SDIV = 327, + FDIV = 328, + UREM = 329, + SREM = 330, + FREM = 331, + AND = 332, + OR = 333, + XOR = 334, + SHL = 335, + LSHR = 336, + ASHR = 337, + ICMP = 338, + FCMP = 339, + EQ = 340, + NE = 341, + SLT = 342, + SGT = 343, + SLE = 344, + SGE = 345, + ULT = 346, + UGT = 347, + ULE = 348, + UGE = 349, + OEQ = 350, + ONE = 351, + OLT = 352, + OGT = 353, + OLE = 354, + OGE = 355, + ORD = 356, + UNO = 357, + UEQ = 358, + UNE = 359, + MALLOC = 360, + ALLOCA = 361, + FREE = 362, + LOAD = 363, + STORE = 364, + GETELEMENTPTR = 365, + TRUNC = 366, + ZEXT = 367, + SEXT = 368, + FPTRUNC = 369, + FPEXT = 370, + BITCAST = 371, + UITOFP = 372, + SITOFP = 373, + FPTOUI = 374, + FPTOSI = 375, + INTTOPTR = 376, + PTRTOINT = 377, + PHI_TOK = 378, + SELECT = 379, + VAARG = 380, + EXTRACTELEMENT = 381, + INSERTELEMENT = 382, + SHUFFLEVECTOR = 383, + NORETURN = 384, + INREG = 385, + SRET = 386, + NOUNWIND = 387, + DEFAULT = 388, + HIDDEN = 389 + }; +#endif +/* Tokens. */ +#define ESINT64VAL 258 +#define EUINT64VAL 259 +#define ESAPINTVAL 260 +#define EUAPINTVAL 261 +#define LOCALVAL_ID 262 +#define GLOBALVAL_ID 263 +#define FPVAL 264 +#define VOID 265 +#define INTTYPE 266 +#define FLOAT 267 +#define DOUBLE 268 +#define LABEL 269 +#define TYPE 270 +#define LOCALVAR 271 +#define GLOBALVAR 272 +#define LABELSTR 273 +#define STRINGCONSTANT 274 +#define ATSTRINGCONSTANT 275 +#define ZEROINITIALIZER 276 +#define TRUETOK 277 +#define FALSETOK 278 +#define BEGINTOK 279 +#define ENDTOK 280 +#define DECLARE 281 +#define DEFINE 282 +#define GLOBAL 283 +#define CONSTANT 284 +#define SECTION 285 +#define VOLATILE 286 +#define THREAD_LOCAL 287 +#define TO 288 +#define DOTDOTDOT 289 +#define NULL_TOK 290 +#define UNDEF 291 +#define INTERNAL 292 +#define LINKONCE 293 +#define WEAK 294 +#define APPENDING 295 +#define DLLIMPORT 296 +#define DLLEXPORT 297 +#define EXTERN_WEAK 298 +#define OPAQUE 299 +#define EXTERNAL 300 +#define TARGET 301 +#define TRIPLE 302 +#define ALIGN 303 +#define DEPLIBS 304 +#define CALL 305 +#define TAIL 306 +#define ASM_TOK 307 +#define MODULE 308 +#define SIDEEFFECT 309 +#define CC_TOK 310 +#define CCC_TOK 311 +#define FASTCC_TOK 312 +#define COLDCC_TOK 313 +#define X86_STDCALLCC_TOK 314 +#define X86_FASTCALLCC_TOK 315 +#define DATALAYOUT 316 +#define RET 317 +#define BR 318 +#define SWITCH 319 +#define INVOKE 320 +#define UNWIND 321 +#define UNREACHABLE 322 +#define ADD 323 +#define SUB 324 +#define MUL 325 +#define UDIV 326 +#define SDIV 327 +#define FDIV 328 +#define UREM 329 +#define SREM 330 +#define FREM 331 +#define AND 332 +#define OR 333 +#define XOR 334 +#define SHL 335 +#define LSHR 336 +#define ASHR 337 +#define ICMP 338 +#define FCMP 339 +#define EQ 340 +#define NE 341 +#define SLT 342 +#define SGT 343 +#define SLE 344 +#define SGE 345 +#define ULT 346 +#define UGT 347 +#define ULE 348 +#define UGE 349 +#define OEQ 350 +#define ONE 351 +#define OLT 352 +#define OGT 353 +#define OLE 354 +#define OGE 355 +#define ORD 356 +#define UNO 357 +#define UEQ 358 +#define UNE 359 +#define MALLOC 360 +#define ALLOCA 361 +#define FREE 362 +#define LOAD 363 +#define STORE 364 +#define GETELEMENTPTR 365 +#define TRUNC 366 +#define ZEXT 367 +#define SEXT 368 +#define FPTRUNC 369 +#define FPEXT 370 +#define BITCAST 371 +#define UITOFP 372 +#define SITOFP 373 +#define FPTOUI 374 +#define FPTOSI 375 +#define INTTOPTR 376 +#define PTRTOINT 377 +#define PHI_TOK 378 +#define SELECT 379 +#define VAARG 380 +#define EXTRACTELEMENT 381 +#define INSERTELEMENT 382 +#define SHUFFLEVECTOR 383 +#define NORETURN 384 +#define INREG 385 +#define SRET 386 +#define NOUNWIND 387 +#define DEFAULT 388 +#define HIDDEN 389 + + + + +/* Copy the first part of user declarations. */ +#line 14 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1068,8 +1260,28 @@ } -#line 938 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -typedef union { + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#line 938 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -1115,1068 +1327,1499 @@ llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; } YYSTYPE; -#include +/* Line 196 of yacc.c. */ +#line 1332 "llvmAsmParser.tab.c" +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ + + +/* Line 219 of yacc.c. */ +#line 1344 "llvmAsmParser.tab.c" + +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ +#endif +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int +#endif + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +#if ! defined (yyoverflow) || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# else +# define YYSTACK_ALLOC alloca +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYINCLUDED_STDLIB_H +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) +# endif +# ifdef __cplusplus +extern "C" { +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifdef __cplusplus +} +# endif +# endif +#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif -#endif +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + short int yyss; + YYSTYPE yyvs; + }; -#define YYFINAL 565 -#define YYFLAG -32768 -#define YYNTBASE 149 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 388 ? yytranslate[x] : 227) - -static const short yytranslate[] = { 0, - 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, 2, 2, 2, 2, 2, 139, - 140, 137, 2, 136, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 144, - 135, 145, 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, - 141, 138, 143, 2, 2, 2, 2, 2, 148, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 142, - 2, 2, 146, 2, 147, 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, 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, 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, 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, 1, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 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, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134 -}; +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, - 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, - 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, - 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, - 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, - 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, - 119, 122, 123, 125, 127, 130, 131, 133, 135, 137, - 139, 141, 143, 145, 147, 148, 150, 151, 153, 155, - 156, 158, 160, 162, 164, 165, 167, 169, 171, 173, - 175, 178, 180, 182, 184, 186, 187, 190, 192, 194, - 196, 197, 200, 201, 204, 205, 209, 212, 213, 215, - 216, 220, 222, 225, 227, 229, 231, 233, 235, 237, - 240, 242, 245, 251, 257, 263, 269, 273, 276, 282, - 287, 290, 292, 294, 296, 300, 302, 306, 308, 309, - 311, 315, 320, 324, 328, 333, 338, 342, 349, 355, - 358, 361, 364, 367, 370, 373, 376, 379, 382, 385, - 388, 391, 398, 404, 413, 420, 427, 435, 443, 450, - 459, 468, 472, 474, 476, 478, 480, 481, 483, 484, - 486, 489, 490, 494, 495, 499, 503, 507, 511, 512, - 520, 521, 530, 531, 540, 543, 547, 549, 553, 557, - 561, 565, 567, 568, 574, 578, 580, 584, 586, 587, - 597, 599, 601, 606, 608, 610, 613, 617, 618, 620, - 622, 624, 626, 628, 630, 632, 634, 636, 640, 642, - 648, 650, 652, 654, 656, 658, 660, 663, 666, 669, - 673, 676, 677, 679, 682, 685, 689, 699, 709, 718, - 733, 735, 737, 744, 750, 753, 760, 768, 772, 778, - 779, 780, 784, 787, 789, 795, 801, 808, 815, 820, - 827, 832, 837, 844, 851, 854, 863, 865, 867, 868, - 872, 879, 883, 890, 893, 899, 907 -}; +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined (__GNUC__) && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) -static const short yyrhs[] = { 68, - 0, 69, 0, 70, 0, 71, 0, 72, 0, 73, - 0, 74, 0, 75, 0, 76, 0, 80, 0, 81, - 0, 82, 0, 77, 0, 78, 0, 79, 0, 111, - 0, 112, 0, 113, 0, 114, 0, 115, 0, 116, - 0, 117, 0, 118, 0, 119, 0, 120, 0, 121, - 0, 122, 0, 85, 0, 86, 0, 87, 0, 88, - 0, 89, 0, 90, 0, 91, 0, 92, 0, 93, - 0, 94, 0, 95, 0, 96, 0, 97, 0, 98, - 0, 99, 0, 100, 0, 101, 0, 102, 0, 103, - 0, 104, 0, 91, 0, 92, 0, 93, 0, 94, - 0, 22, 0, 23, 0, 11, 0, 12, 0, 13, - 0, 16, 0, 19, 0, 156, 0, 0, 156, 135, - 0, 0, 17, 0, 20, 0, 159, 135, 0, 0, - 37, 0, 39, 0, 38, 0, 40, 0, 42, 0, - 41, 0, 43, 0, 45, 0, 0, 134, 0, 0, - 41, 0, 43, 0, 0, 37, 0, 38, 0, 39, - 0, 42, 0, 0, 56, 0, 57, 0, 58, 0, - 59, 0, 60, 0, 55, 4, 0, 112, 0, 113, - 0, 130, 0, 131, 0, 0, 168, 167, 0, 129, - 0, 132, 0, 167, 0, 0, 170, 169, 0, 0, - 48, 4, 0, 0, 136, 48, 4, 0, 30, 19, - 0, 0, 173, 0, 0, 136, 176, 175, 0, 173, - 0, 48, 4, 0, 11, 0, 12, 0, 13, 0, - 14, 0, 44, 0, 177, 0, 178, 137, 0, 211, - 0, 138, 4, 0, 178, 139, 182, 140, 170, 0, - 10, 139, 182, 140, 170, 0, 141, 4, 142, 178, - 143, 0, 144, 4, 142, 178, 145, 0, 146, 183, - 147, 0, 146, 147, 0, 144, 146, 183, 147, 145, - 0, 144, 146, 147, 145, 0, 178, 168, 0, 178, - 0, 10, 0, 179, 0, 181, 136, 179, 0, 181, - 0, 181, 136, 34, 0, 34, 0, 0, 178, 0, - 183, 136, 178, 0, 178, 141, 186, 143, 0, 178, - 141, 143, 0, 178, 148, 19, 0, 178, 144, 186, - 145, 0, 178, 146, 186, 147, 0, 178, 146, 147, - 0, 178, 144, 146, 186, 147, 145, 0, 178, 144, - 146, 147, 145, 0, 178, 35, 0, 178, 36, 0, - 178, 211, 0, 178, 185, 0, 178, 21, 0, 154, - 3, 0, 154, 5, 0, 154, 4, 0, 154, 6, - 0, 11, 22, 0, 11, 23, 0, 155, 9, 0, - 151, 139, 184, 33, 178, 140, 0, 110, 139, 184, - 222, 140, 0, 124, 139, 184, 136, 184, 136, 184, - 140, 0, 149, 139, 184, 136, 184, 140, 0, 150, - 139, 184, 136, 184, 140, 0, 83, 152, 139, 184, - 136, 184, 140, 0, 84, 153, 139, 184, 136, 184, - 140, 0, 126, 139, 184, 136, 184, 140, 0, 127, - 139, 184, 136, 184, 136, 184, 140, 0, 128, 139, - 184, 136, 184, 136, 184, 140, 0, 186, 136, 184, - 0, 184, 0, 28, 0, 29, 0, 32, 0, 0, - 190, 0, 0, 191, 0, 190, 191, 0, 0, 27, - 192, 207, 0, 0, 26, 193, 208, 0, 53, 52, - 197, 0, 158, 15, 178, 0, 158, 15, 10, 0, - 0, 160, 163, 188, 187, 184, 194, 175, 0, 0, - 160, 161, 163, 188, 187, 184, 195, 175, 0, 0, - 160, 162, 163, 188, 187, 178, 196, 175, 0, 46, - 198, 0, 49, 135, 199, 0, 19, 0, 47, 135, - 19, 0, 61, 135, 19, 0, 141, 200, 143, 0, - 200, 136, 19, 0, 19, 0, 0, 201, 136, 178, - 168, 157, 0, 178, 168, 157, 0, 201, 0, 201, - 136, 34, 0, 34, 0, 0, 166, 180, 159, 139, - 202, 140, 170, 174, 171, 0, 24, 0, 146, 0, - 165, 163, 203, 204, 0, 25, 0, 147, 0, 214, - 206, 0, 164, 163, 203, 0, 0, 54, 0, 3, - 0, 4, 0, 9, 0, 22, 0, 23, 0, 35, - 0, 36, 0, 21, 0, 144, 186, 145, 0, 185, - 0, 52, 209, 19, 136, 19, 0, 7, 0, 8, - 0, 156, 0, 159, 0, 211, 0, 210, 0, 178, - 212, 0, 214, 215, 0, 205, 215, 0, 216, 158, - 217, 0, 216, 219, 0, 0, 18, 0, 62, 213, - 0, 62, 10, 0, 63, 14, 212, 0, 63, 11, - 212, 136, 14, 212, 136, 14, 212, 0, 64, 154, - 212, 136, 14, 212, 141, 218, 143, 0, 64, 154, - 212, 136, 14, 212, 141, 143, 0, 65, 166, 180, - 212, 139, 221, 140, 170, 33, 14, 212, 66, 14, - 212, 0, 66, 0, 67, 0, 218, 154, 210, 136, - 14, 212, 0, 154, 210, 136, 14, 212, 0, 158, - 224, 0, 178, 141, 212, 136, 212, 143, 0, 220, - 136, 141, 212, 136, 212, 143, 0, 178, 212, 168, - 0, 221, 136, 178, 212, 168, 0, 0, 0, 222, - 136, 213, 0, 51, 50, 0, 50, 0, 149, 178, - 212, 136, 212, 0, 150, 178, 212, 136, 212, 0, - 83, 152, 178, 212, 136, 212, 0, 84, 153, 178, - 212, 136, 212, 0, 151, 213, 33, 178, 0, 124, - 213, 136, 213, 136, 213, 0, 125, 213, 136, 178, - 0, 126, 213, 136, 213, 0, 127, 213, 136, 213, - 136, 213, 0, 128, 213, 136, 213, 136, 213, 0, - 123, 220, 0, 223, 166, 180, 212, 139, 221, 140, - 170, 0, 226, 0, 31, 0, 0, 105, 178, 172, - 0, 105, 178, 136, 11, 212, 172, 0, 106, 178, - 172, 0, 106, 178, 136, 11, 212, 172, 0, 107, - 213, 0, 225, 108, 178, 212, 172, 0, 225, 109, - 213, 136, 178, 212, 172, 0, 110, 178, 212, 222, - 0 -}; +#endif +#if defined (__STDC__) || defined (__cplusplus) + typedef signed char yysigned_char; +#else + typedef short int yysigned_char; #endif -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1094, - 1094, 1094, 1094, 1094, 1094, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1096, 1096, 1096, 1096, 1096, 1099, 1099, 1100, - 1100, 1101, 1101, 1102, 1102, 1103, 1103, 1107, 1107, 1108, - 1108, 1109, 1109, 1110, 1110, 1111, 1111, 1112, 1112, 1113, - 1113, 1114, 1115, 1120, 1121, 1121, 1123, 1123, 1124, 1124, - 1128, 1132, 1137, 1137, 1139, 1143, 1149, 1150, 1151, 1152, - 1153, 1157, 1158, 1159, 1163, 1164, 1168, 1169, 1170, 1174, - 1175, 1176, 1177, 1178, 1181, 1181, 1182, 1183, 1184, 1185, - 1186, 1194, 1195, 1196, 1197, 1200, 1201, 1206, 1207, 1208, - 1211, 1212, 1219, 1219, 1226, 1226, 1235, 1243, 1243, 1249, - 1249, 1251, 1256, 1269, 1269, 1269, 1269, 1272, 1276, 1280, - 1287, 1292, 1300, 1326, 1353, 1358, 1370, 1380, 1384, 1394, - 1401, 1408, 1415, 1420, 1425, 1432, 1433, 1440, 1447, 1455, - 1461, 1473, 1501, 1517, 1546, 1574, 1599, 1618, 1644, 1664, - 1676, 1683, 1749, 1759, 1769, 1775, 1785, 1791, 1801, 1806, - 1811, 1819, 1831, 1853, 1861, 1867, 1878, 1883, 1888, 1894, - 1900, 1909, 1913, 1921, 1921, 1924, 1924, 1935, 1940, 1948, - 1949, 1953, 1953, 1957, 1957, 1960, 1963, 1987, 1998, 2005, - 2008, 2013, 2016, 2022, 2026, 2029, 2035, 2048, 2052, 2057, - 2059, 2064, 2069, 2078, 2088, 2099, 2103, 2112, 2121, 2126, - 2245, 2245, 2247, 2256, 2256, 2258, 2263, 2275, 2279, 2284, - 2288, 2292, 2296, 2300, 2304, 2308, 2312, 2316, 2341, 2345, - 2359, 2363, 2367, 2371, 2377, 2377, 2383, 2392, 2396, 2405, - 2414, 2423, 2427, 2432, 2436, 2440, 2445, 2455, 2474, 2483, - 2559, 2563, 2570, 2581, 2594, 2604, 2615, 2625, 2634, 2643, - 2646, 2647, 2654, 2658, 2663, 2684, 2701, 2715, 2729, 2741, - 2749, 2756, 2762, 2768, 2774, 2789, 2870, 2875, 2879, 2886, - 2893, 2901, 2908, 2916, 2924, 2938, 2955 +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 39 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 1317 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 149 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 79 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 288 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 563 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 389 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const unsigned char yytranslate[] = +{ + 0, 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, 2, 2, 2, 2, 2, + 139, 140, 137, 2, 136, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 144, 135, 145, 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, 141, 138, 143, 2, 2, 2, 2, 2, 148, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 142, 2, 2, 146, 2, 147, 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, + 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, 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, 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, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 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, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134 }; -#endif +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const unsigned short int yyprhs[] = +{ + 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, + 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, + 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, + 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, + 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, + 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, + 119, 121, 122, 125, 126, 128, 130, 133, 134, 136, + 138, 140, 142, 144, 146, 148, 150, 151, 153, 154, + 156, 158, 159, 161, 163, 165, 167, 168, 170, 172, + 174, 176, 178, 181, 183, 185, 187, 189, 190, 193, + 195, 197, 199, 200, 203, 204, 207, 208, 212, 215, + 216, 218, 219, 223, 225, 228, 230, 232, 234, 236, + 238, 240, 243, 245, 248, 254, 260, 266, 272, 276, + 279, 285, 290, 293, 295, 297, 299, 303, 305, 309, + 311, 312, 314, 318, 323, 327, 331, 336, 341, 345, + 352, 358, 361, 364, 367, 370, 373, 376, 379, 382, + 385, 388, 391, 394, 401, 407, 416, 423, 430, 438, + 446, 453, 462, 471, 475, 477, 479, 481, 483, 484, + 486, 487, 489, 492, 493, 497, 498, 502, 506, 510, + 514, 515, 523, 524, 533, 534, 543, 546, 550, 552, + 556, 560, 564, 568, 570, 571, 577, 581, 583, 587, + 589, 590, 600, 602, 604, 609, 611, 613, 616, 620, + 621, 623, 625, 627, 629, 631, 633, 635, 637, 639, + 643, 645, 651, 653, 655, 657, 659, 661, 663, 666, + 669, 672, 676, 679, 680, 682, 685, 688, 692, 702, + 712, 721, 736, 738, 740, 747, 753, 756, 763, 771, + 775, 781, 782, 783, 787, 790, 792, 798, 804, 811, + 818, 823, 830, 835, 840, 847, 854, 857, 866, 868, + 870, 871, 875, 882, 886, 893, 896, 901, 908 +}; -#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const short int yyrhs[] = +{ + 190, 0, -1, 68, -1, 69, -1, 70, -1, 71, + -1, 72, -1, 73, -1, 74, -1, 75, -1, 76, + -1, 80, -1, 81, -1, 82, -1, 77, -1, 78, + -1, 79, -1, 111, -1, 112, -1, 113, -1, 114, + -1, 115, -1, 116, -1, 117, -1, 118, -1, 119, + -1, 120, -1, 121, -1, 122, -1, 85, -1, 86, + -1, 87, -1, 88, -1, 89, -1, 90, -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, 91, -1, 92, + -1, 93, -1, 94, -1, 22, -1, 23, -1, 11, + -1, 12, -1, 13, -1, 16, -1, 19, -1, 157, + -1, -1, 157, 135, -1, -1, 17, -1, 20, -1, + 160, 135, -1, -1, 37, -1, 39, -1, 38, -1, + 40, -1, 42, -1, 41, -1, 43, -1, 45, -1, + -1, 134, -1, -1, 41, -1, 43, -1, -1, 37, + -1, 38, -1, 39, -1, 42, -1, -1, 56, -1, + 57, -1, 58, -1, 59, -1, 60, -1, 55, 4, + -1, 112, -1, 113, -1, 130, -1, 131, -1, -1, + 169, 168, -1, 129, -1, 132, -1, 168, -1, -1, + 171, 170, -1, -1, 48, 4, -1, -1, 136, 48, + 4, -1, 30, 19, -1, -1, 174, -1, -1, 136, + 177, 176, -1, 174, -1, 48, 4, -1, 11, -1, + 12, -1, 13, -1, 14, -1, 44, -1, 178, -1, + 179, 137, -1, 212, -1, 138, 4, -1, 179, 139, + 183, 140, 171, -1, 10, 139, 183, 140, 171, -1, + 141, 4, 142, 179, 143, -1, 144, 4, 142, 179, + 145, -1, 146, 184, 147, -1, 146, 147, -1, 144, + 146, 184, 147, 145, -1, 144, 146, 147, 145, -1, + 179, 169, -1, 179, -1, 10, -1, 180, -1, 182, + 136, 180, -1, 182, -1, 182, 136, 34, -1, 34, + -1, -1, 179, -1, 184, 136, 179, -1, 179, 141, + 187, 143, -1, 179, 141, 143, -1, 179, 148, 19, + -1, 179, 144, 187, 145, -1, 179, 146, 187, 147, + -1, 179, 146, 147, -1, 179, 144, 146, 187, 147, + 145, -1, 179, 144, 146, 147, 145, -1, 179, 35, + -1, 179, 36, -1, 179, 212, -1, 179, 186, -1, + 179, 21, -1, 155, 3, -1, 155, 5, -1, 155, + 4, -1, 155, 6, -1, 11, 22, -1, 11, 23, + -1, 156, 9, -1, 152, 139, 185, 33, 179, 140, + -1, 110, 139, 185, 223, 140, -1, 124, 139, 185, + 136, 185, 136, 185, 140, -1, 150, 139, 185, 136, + 185, 140, -1, 151, 139, 185, 136, 185, 140, -1, + 83, 153, 139, 185, 136, 185, 140, -1, 84, 154, + 139, 185, 136, 185, 140, -1, 126, 139, 185, 136, + 185, 140, -1, 127, 139, 185, 136, 185, 136, 185, + 140, -1, 128, 139, 185, 136, 185, 136, 185, 140, + -1, 187, 136, 185, -1, 185, -1, 28, -1, 29, + -1, 32, -1, -1, 191, -1, -1, 192, -1, 191, + 192, -1, -1, 27, 193, 208, -1, -1, 26, 194, + 209, -1, 53, 52, 198, -1, 159, 15, 179, -1, + 159, 15, 10, -1, -1, 161, 164, 189, 188, 185, + 195, 176, -1, -1, 161, 162, 164, 189, 188, 185, + 196, 176, -1, -1, 161, 163, 164, 189, 188, 179, + 197, 176, -1, 46, 199, -1, 49, 135, 200, -1, + 19, -1, 47, 135, 19, -1, 61, 135, 19, -1, + 141, 201, 143, -1, 201, 136, 19, -1, 19, -1, + -1, 202, 136, 179, 169, 158, -1, 179, 169, 158, + -1, 202, -1, 202, 136, 34, -1, 34, -1, -1, + 167, 181, 160, 139, 203, 140, 171, 175, 172, -1, + 24, -1, 146, -1, 166, 164, 204, 205, -1, 25, + -1, 147, -1, 215, 207, -1, 165, 164, 204, -1, + -1, 54, -1, 3, -1, 4, -1, 9, -1, 22, + -1, 23, -1, 35, -1, 36, -1, 21, -1, 144, + 187, 145, -1, 186, -1, 52, 210, 19, 136, 19, + -1, 7, -1, 8, -1, 157, -1, 160, -1, 212, + -1, 211, -1, 179, 213, -1, 215, 216, -1, 206, + 216, -1, 217, 159, 218, -1, 217, 220, -1, -1, + 18, -1, 62, 214, -1, 62, 10, -1, 63, 14, + 213, -1, 63, 11, 213, 136, 14, 213, 136, 14, + 213, -1, 64, 155, 213, 136, 14, 213, 141, 219, + 143, -1, 64, 155, 213, 136, 14, 213, 141, 143, + -1, 65, 167, 181, 213, 139, 222, 140, 171, 33, + 14, 213, 66, 14, 213, -1, 66, -1, 67, -1, + 219, 155, 211, 136, 14, 213, -1, 155, 211, 136, + 14, 213, -1, 159, 225, -1, 179, 141, 213, 136, + 213, 143, -1, 221, 136, 141, 213, 136, 213, 143, + -1, 179, 213, 169, -1, 222, 136, 179, 213, 169, + -1, -1, -1, 223, 136, 214, -1, 51, 50, -1, + 50, -1, 150, 179, 213, 136, 213, -1, 151, 179, + 213, 136, 213, -1, 83, 153, 179, 213, 136, 213, + -1, 84, 154, 179, 213, 136, 213, -1, 152, 214, + 33, 179, -1, 124, 214, 136, 214, 136, 214, -1, + 125, 214, 136, 179, -1, 126, 214, 136, 214, -1, + 127, 214, 136, 214, 136, 214, -1, 128, 214, 136, + 214, 136, 214, -1, 123, 221, -1, 224, 167, 181, + 213, 139, 222, 140, 171, -1, 227, -1, 31, -1, + -1, 105, 179, 173, -1, 105, 179, 136, 11, 213, + 173, -1, 106, 179, 173, -1, 106, 179, 136, 11, + 213, 173, -1, 107, 214, -1, 226, 108, 179, 213, + -1, 226, 109, 214, 136, 179, 213, -1, 110, 179, + 213, 223, -1 +}; -static const char * const yytname[] = { "$","error","$undefined.","ESINT64VAL", -"EUINT64VAL","ESAPINTVAL","EUAPINTVAL","LOCALVAL_ID","GLOBALVAL_ID","FPVAL", -"VOID","INTTYPE","FLOAT","DOUBLE","LABEL","TYPE","LOCALVAR","GLOBALVAR","LABELSTR", -"STRINGCONSTANT","ATSTRINGCONSTANT","ZEROINITIALIZER","TRUETOK","FALSETOK","BEGINTOK", -"ENDTOK","DECLARE","DEFINE","GLOBAL","CONSTANT","SECTION","VOLATILE","THREAD_LOCAL", -"TO","DOTDOTDOT","NULL_TOK","UNDEF","INTERNAL","LINKONCE","WEAK","APPENDING", -"DLLIMPORT","DLLEXPORT","EXTERN_WEAK","OPAQUE","EXTERNAL","TARGET","TRIPLE", -"ALIGN","DEPLIBS","CALL","TAIL","ASM_TOK","MODULE","SIDEEFFECT","CC_TOK","CCC_TOK", -"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","NORETURN","INREG","SRET","NOUNWIND", -"DEFAULT","HIDDEN","'='","','","'*'","'\\\\'","'('","')'","'['","'x'","']'", -"'<'","'>'","'{'","'}'","'c'","ArithmeticOps","LogicalOps","CastOps","IPredicates", -"FPredicates","IntType","FPType","LocalName","OptLocalName","OptLocalAssign", -"GlobalName","OptGlobalAssign","GVInternalLinkage","GVExternalLinkage","GVVisibilityStyle", -"FunctionDeclareLinkage","FunctionDefineLinkage","OptCallingConv","ParamAttr", -"OptParamAttrs","FuncAttr","OptFuncAttrs","OptAlign","OptCAlign","SectionString", -"OptSection","GlobalVarAttributes","GlobalVarAttribute","PrimType","Types","ArgType", -"ResultTypes","ArgTypeList","ArgTypeListI","TypeListI","ConstVal","ConstExpr", -"ConstVector","GlobalType","ThreadLocal","Module","DefinitionList","Definition", -"@1","@2","@3","@4","@5","AsmBlock","TargetDefinition","LibrariesDefinition", -"LibList","ArgListH","ArgList","FunctionHeaderH","BEGIN","FunctionHeader","END", -"Function","FunctionProto","OptSideEffect","ConstValueRef","SymbolicValueRef", -"ValueRef","ResolvedVal","BasicBlockList","BasicBlock","InstructionList","BBTerminatorInst", -"JumpTable","Inst","PHIList","ValueRefList","IndexList","OptTailCall","InstVal", -"OptVolatile","MemoryInst", NULL +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const unsigned short int yyrline[] = +{ + 0, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, + 1093, 1094, 1094, 1094, 1094, 1094, 1094, 1095, 1095, 1095, + 1095, 1095, 1095, 1096, 1096, 1096, 1096, 1096, 1096, 1099, + 1099, 1100, 1100, 1101, 1101, 1102, 1102, 1103, 1103, 1107, + 1107, 1108, 1108, 1109, 1109, 1110, 1110, 1111, 1111, 1112, + 1112, 1113, 1113, 1114, 1115, 1120, 1121, 1121, 1123, 1123, + 1124, 1124, 1128, 1132, 1137, 1137, 1139, 1143, 1149, 1150, + 1151, 1152, 1153, 1157, 1158, 1159, 1163, 1164, 1168, 1169, + 1170, 1174, 1175, 1176, 1177, 1178, 1181, 1182, 1183, 1184, + 1185, 1186, 1187, 1194, 1195, 1196, 1197, 1200, 1201, 1206, + 1207, 1208, 1211, 1212, 1219, 1220, 1226, 1227, 1235, 1243, + 1244, 1249, 1250, 1251, 1256, 1269, 1269, 1269, 1269, 1272, + 1276, 1280, 1287, 1292, 1300, 1326, 1353, 1358, 1370, 1380, + 1384, 1394, 1401, 1408, 1415, 1420, 1425, 1432, 1433, 1440, + 1447, 1455, 1461, 1473, 1501, 1517, 1546, 1574, 1599, 1618, + 1644, 1664, 1676, 1683, 1749, 1759, 1769, 1775, 1785, 1791, + 1801, 1806, 1811, 1819, 1831, 1853, 1861, 1867, 1878, 1883, + 1888, 1894, 1900, 1909, 1913, 1921, 1921, 1924, 1924, 1935, + 1940, 1948, 1949, 1953, 1953, 1957, 1957, 1960, 1963, 1987, + 1998, 1998, 2008, 2008, 2016, 2016, 2026, 2029, 2035, 2048, + 2052, 2057, 2059, 2064, 2069, 2078, 2088, 2099, 2103, 2112, + 2121, 2126, 2245, 2245, 2247, 2256, 2256, 2258, 2263, 2275, + 2279, 2284, 2288, 2292, 2296, 2300, 2304, 2308, 2312, 2316, + 2341, 2345, 2359, 2363, 2367, 2371, 2377, 2377, 2383, 2392, + 2396, 2405, 2414, 2423, 2427, 2432, 2436, 2440, 2445, 2455, + 2474, 2483, 2559, 2563, 2570, 2581, 2594, 2604, 2615, 2625, + 2634, 2643, 2646, 2647, 2654, 2658, 2663, 2684, 2701, 2715, + 2729, 2741, 2749, 2756, 2762, 2768, 2774, 2789, 2870, 2875, + 2879, 2886, 2893, 2901, 2908, 2916, 2924, 2938, 2955 }; #endif -static const short yyr1[] = { 0, - 149, 149, 149, 149, 149, 149, 149, 149, 149, 150, - 150, 150, 150, 150, 150, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 154, 155, 155, 156, 156, 157, 157, - 158, 158, 159, 159, 160, 160, 161, 161, 161, 161, - 161, 162, 162, 162, 163, 163, 164, 164, 164, 165, - 165, 165, 165, 165, 166, 166, 166, 166, 166, 166, - 166, 167, 167, 167, 167, 168, 168, 169, 169, 169, - 170, 170, 171, 171, 172, 172, 173, 174, 174, 175, - 175, 176, 176, 177, 177, 177, 177, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 179, 180, 180, 181, 181, 182, 182, 182, 182, 183, - 183, 184, 184, 184, 184, 184, 184, 184, 184, 184, - 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, - 184, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, - 190, 192, 191, 193, 191, 191, 191, 191, 194, 191, - 195, 191, 196, 191, 191, 191, 197, 198, 198, 199, - 200, 200, 200, 201, 201, 202, 202, 202, 202, 203, - 204, 204, 205, 206, 206, 207, 208, 209, 209, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, - 211, 211, 211, 211, 212, 212, 213, 214, 214, 215, - 216, 216, 216, 217, 217, 217, 217, 217, 217, 217, - 217, 217, 218, 218, 219, 220, 220, 221, 221, 221, - 222, 222, 223, 223, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 225, 225, 226, - 226, 226, 226, 226, 226, 226, 226 +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL", + "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE", + "FLOAT", "DOUBLE", "LABEL", "TYPE", "LOCALVAR", "GLOBALVAR", "LABELSTR", + "STRINGCONSTANT", "ATSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK", + "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL", + "CONSTANT", "SECTION", "VOLATILE", "THREAD_LOCAL", "TO", "DOTDOTDOT", + "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK", "APPENDING", + "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", "EXTERNAL", "TARGET", + "TRIPLE", "ALIGN", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE", + "SIDEEFFECT", "CC_TOK", "CCC_TOK", "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", "NORETURN", "INREG", "SRET", "NOUNWIND", "DEFAULT", + "HIDDEN", "'='", "','", "'*'", "'\\\\'", "'('", "')'", "'['", "'x'", + "']'", "'<'", "'>'", "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", + "LogicalOps", "CastOps", "IPredicates", "FPredicates", "IntType", + "FPType", "LocalName", "OptLocalName", "OptLocalAssign", "GlobalName", + "OptGlobalAssign", "GVInternalLinkage", "GVExternalLinkage", + "GVVisibilityStyle", "FunctionDeclareLinkage", "FunctionDefineLinkage", + "OptCallingConv", "ParamAttr", "OptParamAttrs", "FuncAttr", + "OptFuncAttrs", "OptAlign", "OptCAlign", "SectionString", "OptSection", + "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", "Types", + "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", "TypeListI", + "ConstVal", "ConstExpr", "ConstVector", "GlobalType", "ThreadLocal", + "Module", "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", + "AsmBlock", "TargetDefinition", "LibrariesDefinition", "LibList", + "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", + "END", "Function", "FunctionProto", "OptSideEffect", "ConstValueRef", + "SymbolicValueRef", "ValueRef", "ResolvedVal", "BasicBlockList", + "BasicBlock", "InstructionList", "BBTerminatorInst", "JumpTable", "Inst", + "PHIList", "ValueRefList", "IndexList", "OptTailCall", "InstVal", + "OptVolatile", "MemoryInst", 0 }; +#endif -static const short yyr2[] = { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 2, 0, 1, 1, 2, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, - 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, - 2, 1, 1, 1, 1, 0, 2, 1, 1, 1, - 0, 2, 0, 2, 0, 3, 2, 0, 1, 0, - 3, 1, 2, 1, 1, 1, 1, 1, 1, 2, - 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, 6, 8, - 8, 3, 1, 1, 1, 1, 0, 1, 0, 1, - 2, 0, 3, 0, 3, 3, 3, 3, 0, 7, - 0, 8, 0, 8, 2, 3, 1, 3, 3, 3, - 3, 1, 0, 5, 3, 1, 3, 1, 0, 9, - 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, 2, 2, 3, - 2, 0, 1, 2, 2, 3, 9, 9, 8, 14, - 1, 1, 6, 5, 2, 6, 7, 3, 5, 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, 4 +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const unsigned short int yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 61, 44, 42, 92, 40, + 41, 91, 120, 93, 60, 62, 123, 125, 99 }; +# endif -static const short yydefact[] = { 66, - 57, 63, 58, 64, 184, 182, 0, 0, 0, 0, - 0, 0, 75, 66, 180, 77, 80, 0, 0, 195, - 0, 0, 61, 0, 65, 67, 69, 68, 70, 72, - 71, 73, 74, 76, 75, 75, 177, 181, 78, 79, - 75, 185, 81, 82, 83, 84, 75, 242, 183, 242, - 0, 0, 203, 196, 197, 186, 231, 232, 188, 114, - 115, 116, 117, 118, 0, 0, 0, 0, 233, 234, - 119, 187, 121, 177, 177, 176, 0, 85, 85, 243, - 239, 62, 214, 215, 216, 238, 198, 199, 202, 0, - 139, 122, 0, 0, 0, 0, 128, 140, 0, 120, - 139, 0, 0, 174, 175, 0, 0, 86, 87, 88, - 89, 90, 0, 217, 0, 279, 241, 0, 200, 138, - 96, 134, 136, 0, 0, 0, 0, 0, 0, 127, - 0, 0, 0, 114, 115, 116, 0, 0, 0, 189, - 91, 133, 132, 0, 211, 212, 213, 278, 264, 0, - 0, 0, 0, 85, 251, 252, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 13, 14, 15, 10, 11, - 12, 0, 0, 0, 0, 0, 0, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 240, 85, - 255, 0, 277, 201, 131, 0, 101, 0, 0, 130, - 0, 141, 101, 191, 193, 159, 160, 155, 157, 156, - 158, 161, 154, 150, 151, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 153, - 152, 110, 0, 263, 245, 0, 244, 0, 0, 54, - 0, 0, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 0, 52, 53, 48, 49, 50, 51, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 0, - 105, 105, 284, 0, 0, 275, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 92, 93, 94, - 95, 97, 137, 135, 124, 125, 126, 129, 123, 110, - 110, 0, 0, 0, 0, 0, 0, 0, 143, 173, - 0, 0, 0, 147, 0, 144, 0, 0, 0, 0, - 190, 209, 220, 221, 222, 227, 223, 224, 225, 226, - 218, 0, 229, 236, 235, 237, 0, 246, 0, 0, - 0, 0, 0, 280, 0, 282, 261, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 98, 99, 100, 102, 192, 194, 0, 0, 261, 0, - 0, 0, 0, 0, 142, 128, 140, 0, 145, 146, - 0, 0, 0, 0, 0, 112, 110, 208, 96, 206, - 0, 219, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 287, 0, 0, 0, 271, 272, 0, 0, - 0, 0, 269, 0, 105, 0, 0, 0, 0, 0, - 0, 0, 0, 172, 149, 0, 0, 0, 0, 107, - 113, 111, 60, 0, 101, 0, 228, 0, 0, 260, - 0, 0, 105, 106, 105, 0, 0, 0, 0, 0, - 0, 265, 266, 260, 0, 285, 0, 0, 0, 163, - 0, 0, 0, 0, 148, 0, 0, 0, 59, 205, - 207, 96, 108, 0, 0, 0, 0, 0, 267, 268, - 281, 283, 262, 0, 0, 270, 273, 274, 0, 105, - 0, 0, 0, 169, 0, 0, 165, 166, 162, 60, - 109, 103, 230, 0, 0, 96, 0, 101, 256, 0, - 101, 286, 167, 168, 0, 0, 0, 204, 0, 210, - 0, 249, 0, 0, 258, 0, 0, 257, 276, 164, - 170, 171, 104, 247, 0, 248, 0, 96, 0, 0, - 0, 259, 0, 0, 0, 0, 254, 0, 0, 253, - 0, 250, 0, 0, 0 +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const unsigned char yyr1[] = +{ + 0, 149, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 151, 151, 151, 151, 151, 151, 152, 152, 152, + 152, 152, 152, 152, 152, 152, 152, 152, 152, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 154, + 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, + 154, 154, 154, 154, 154, 155, 156, 156, 157, 157, + 158, 158, 159, 159, 160, 160, 161, 161, 162, 162, + 162, 162, 162, 163, 163, 163, 164, 164, 165, 165, + 165, 166, 166, 166, 166, 166, 167, 167, 167, 167, + 167, 167, 167, 168, 168, 168, 168, 169, 169, 170, + 170, 170, 171, 171, 172, 172, 173, 173, 174, 175, + 175, 176, 176, 177, 177, 178, 178, 178, 178, 179, + 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, + 179, 179, 180, 181, 181, 182, 182, 183, 183, 183, + 183, 184, 184, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 187, 187, 188, 188, 189, 189, 190, + 190, 191, 191, 193, 192, 194, 192, 192, 192, 192, + 195, 192, 196, 192, 197, 192, 192, 192, 198, 199, + 199, 200, 201, 201, 201, 202, 202, 203, 203, 203, + 203, 204, 205, 205, 206, 207, 207, 208, 209, 210, + 210, 211, 211, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 212, 212, 212, 212, 213, 213, 214, 215, + 215, 216, 217, 217, 217, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 219, 219, 220, 221, 221, 222, + 222, 222, 223, 223, 224, 224, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, 225, 226, + 226, 227, 227, 227, 227, 227, 227, 227, 227 }; -static const short yydefgoto[] = { 237, - 238, 239, 263, 280, 137, 138, 69, 480, 11, 70, - 13, 35, 36, 37, 41, 47, 113, 302, 205, 374, - 305, 530, 354, 396, 512, 331, 397, 71, 139, 122, - 144, 123, 124, 99, 320, 343, 321, 106, 77, 563, - 14, 15, 17, 16, 242, 310, 311, 56, 20, 54, - 90, 400, 401, 114, 147, 48, 85, 49, 42, 403, - 344, 73, 346, 247, 50, 81, 82, 199, 534, 117, - 286, 488, 413, 200, 201, 202, 203 +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const unsigned char yyr2[] = +{ + 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 0, 2, 0, 1, 1, 2, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, + 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, + 1, 1, 2, 1, 1, 1, 1, 0, 2, 1, + 1, 1, 0, 2, 0, 2, 0, 3, 2, 0, + 1, 0, 3, 1, 2, 1, 1, 1, 1, 1, + 1, 2, 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, + 6, 8, 8, 3, 1, 1, 1, 1, 0, 1, + 0, 1, 2, 0, 3, 0, 3, 3, 3, 3, + 0, 7, 0, 8, 0, 8, 2, 3, 1, 3, + 3, 3, 3, 1, 0, 5, 3, 1, 3, 1, + 0, 9, 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, 2, + 2, 3, 2, 0, 1, 2, 2, 3, 9, 9, + 8, 14, 1, 1, 6, 5, 2, 6, 7, 3, + 5, 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, 4, 6, 4 }; -static const short yypact[] = { 593, --32768,-32768,-32768,-32768,-32768,-32768, -1, -87, 11, -41, - 89, -13, 46, 1408,-32768, 185, 82, 13, 55,-32768, - 81, 211,-32768, 1122,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768, 98, 98, 206,-32768,-32768,-32768, - 98,-32768,-32768,-32768,-32768,-32768, 98, 235,-32768, 8, - 242, 251, 252,-32768,-32768,-32768,-32768,-32768, 128,-32768, --32768,-32768,-32768,-32768, 272, 274, 4, 122,-32768,-32768, --32768, 61,-32768, 206, 206,-32768, 183, 290, 290,-32768, --32768, 121,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -92, - 979,-32768, 137, 139, 284, 128,-32768, 61, -70,-32768, - 979, 183, 183,-32768,-32768, 1136, 278,-32768,-32768,-32768, --32768,-32768, 1178,-32768, -15, 1277,-32768, 264,-32768,-32768, - 61,-32768, 148, 153, 1192, 1192, 160, -66, 1192,-32768, - 162, 1136, 1192, 32, 297, 298, 215, 301, 761,-32768, --32768, 128, 61, 145,-32768,-32768,-32768,-32768,-32768, 262, - 1234, 248, 304, 290,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768, 157, 422, 1192, 1192, 1192, 1192,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1192, - 1192, 1192, 1192, 1192, 1192, 1192, 1192, 1192,-32768, 290, --32768, -34,-32768,-32768, -33, 1019,-32768, 71, -22,-32768, - 173, 61,-32768,-32768, 61,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 157, 422, 180, 181, 182, - 184, 186, 1038, 1276, 448, 305, 187, 188, 191,-32768, --32768, 193, 192,-32768, 128, 614,-32768, 740, 740,-32768, - 740, 1178,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768, 1192,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1192, - 88, 119,-32768, 614, 62, 197, 198, 199, 200, 207, - 217, 614, 614, 309, 1178, 1192, 1192,-32768,-32768,-32768, --32768,-32768,-32768,-32768, -73,-32768,-32768,-32768, -73, 193, - 193, 212, 216, 1136, 1136, 1136, 1136, 1136,-32768,-32768, - -44, 933, -69,-32768, -40,-32768, 1136, 1136, 1136, -5, --32768, 1077,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - 300, 1136,-32768,-32768,-32768,-32768, 220,-32768, 221, 740, - 614, 614, 17,-32768, 23,-32768,-32768, 740, 218, 1192, - 1192, 1192, 1192, 1192, 222, 225, 1192, 740, 614, 226, --32768,-32768,-32768,-32768,-32768,-32768, 1136, 1136,-32768, 227, - 229, 230, 231, 1136,-32768, 228, 761, -35,-32768,-32768, - 234, 236, 341, 356, 372,-32768, 193,-32768, 61, 241, - 238,-32768, 360, -36, 366, 367, 243, 253, 254, 740, - 387, 740, 256, 257, 740, 258, 61,-32768, 259, 266, - 740, 740, 61, 261, 269, 1192, 270, 271, -67, 1136, - 1136, 1136, 1136,-32768,-32768, 263, 1136, 1136, 1192,-32768, --32768,-32768, 33, 1093,-32768, 273,-32768, 740, 740, 1192, - 740, 740, 269,-32768, 269, 1192, 740, 275, 1192, 1192, - 1192,-32768,-32768, 1192, 362,-32768, 614, 1136, 1136,-32768, - 279, 277, 288, 293,-32768, 280, 292, 42,-32768,-32768, --32768, 61, 65, 395, 299, 308, 614, 7,-32768,-32768, --32768,-32768,-32768, 291, 740,-32768,-32768,-32768, 73, 269, - 302, 306, 1136,-32768, 1136, 1136,-32768,-32768,-32768, 33, --32768, 391,-32768, 426, 1,-32768, 1192,-32768,-32768, 307, --32768,-32768,-32768,-32768, 311, 312, 313,-32768, 453,-32768, - 740,-32768, 890, 18, -33, 614, 75,-32768, -73,-32768, --32768,-32768,-32768,-32768, 327,-32768, 890,-32768, 452, 455, - 337, -33, 740, 740, 460, 409,-32768, 740, 462,-32768, - 740,-32768, 477, 479,-32768 +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const unsigned short int yydefact[] = +{ + 67, 58, 64, 59, 65, 185, 183, 0, 0, 0, + 0, 0, 0, 76, 0, 67, 181, 78, 81, 0, + 0, 196, 0, 0, 62, 0, 66, 68, 70, 69, + 71, 73, 72, 74, 75, 77, 76, 76, 178, 1, + 182, 79, 80, 76, 186, 82, 83, 84, 85, 76, + 243, 184, 243, 0, 0, 204, 197, 198, 187, 232, + 233, 189, 115, 116, 117, 118, 119, 0, 0, 0, + 0, 234, 235, 120, 188, 122, 178, 178, 177, 0, + 86, 86, 244, 240, 63, 215, 216, 217, 239, 199, + 200, 203, 0, 140, 123, 0, 0, 0, 0, 129, + 141, 0, 121, 140, 0, 0, 175, 176, 0, 0, + 87, 88, 89, 90, 91, 0, 218, 0, 280, 242, + 0, 201, 139, 97, 135, 137, 0, 0, 0, 0, + 0, 0, 128, 0, 0, 0, 115, 116, 117, 0, + 0, 0, 190, 92, 134, 133, 0, 212, 213, 214, + 279, 265, 0, 0, 0, 0, 86, 252, 253, 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, 241, 86, 256, 0, 278, 202, 132, 0, 102, + 0, 0, 131, 0, 142, 102, 192, 194, 160, 161, + 156, 158, 157, 159, 162, 155, 151, 152, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 154, 153, 111, 0, 264, 246, 0, 245, + 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, 106, 106, 285, 0, 0, 276, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 93, 94, 95, 96, 98, 138, 136, 125, 126, 127, + 130, 124, 111, 111, 0, 0, 0, 0, 0, 0, + 0, 144, 174, 0, 0, 0, 148, 0, 145, 0, + 0, 0, 0, 191, 210, 221, 222, 223, 228, 224, + 225, 226, 227, 219, 0, 230, 237, 236, 238, 0, + 247, 0, 0, 0, 0, 0, 281, 0, 283, 262, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 99, 100, 101, 103, 193, 195, 0, + 0, 262, 0, 0, 0, 0, 0, 143, 129, 141, + 0, 146, 147, 0, 0, 0, 0, 0, 113, 111, + 209, 97, 207, 0, 220, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 288, 0, 0, 0, 272, + 273, 0, 0, 0, 0, 270, 0, 286, 0, 0, + 0, 0, 0, 0, 0, 0, 173, 150, 0, 0, + 0, 0, 108, 114, 112, 61, 0, 102, 0, 229, + 0, 0, 261, 0, 0, 106, 107, 106, 0, 0, + 0, 0, 0, 0, 266, 267, 261, 0, 0, 0, + 164, 0, 0, 0, 0, 149, 0, 0, 0, 60, + 206, 208, 97, 109, 0, 0, 0, 0, 0, 268, + 269, 0, 282, 284, 263, 0, 0, 271, 274, 275, + 0, 287, 0, 0, 0, 170, 0, 0, 166, 167, + 163, 61, 110, 104, 231, 0, 0, 97, 0, 102, + 257, 0, 102, 168, 169, 0, 0, 0, 205, 0, + 211, 0, 250, 0, 0, 259, 0, 0, 258, 277, + 165, 171, 172, 105, 248, 0, 249, 0, 97, 0, + 0, 0, 260, 0, 0, 0, 0, 255, 0, 0, + 254, 0, 251 }; -static const short yypgoto[] = { 364, - 365, 368, 260, 255, -151,-32768, 0, -27, 403, 16, --32768,-32768,-32768, 6,-32768,-32768, -139, -298, -389,-32768, - -210,-32768, -269, 10,-32768, -279,-32768,-32768, -23, 281, - -233,-32768, 389, 396, 70, -133, -217, 134, 190,-32768, --32768, 481,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768, 417,-32768,-32768,-32768,-32768,-32768,-32768, - -483, -135, 120, -171,-32768, 447,-32768,-32768,-32768,-32768, --32768, 34, 125,-32768,-32768,-32768,-32768 +/* YYDEFGOTO[NTERM-NUM]. */ +static const short int yydefgoto[] = +{ + -1, 239, 240, 241, 265, 282, 139, 140, 71, 480, + 11, 72, 13, 36, 37, 38, 43, 49, 115, 304, + 207, 376, 307, 530, 356, 398, 513, 333, 399, 73, + 141, 124, 146, 125, 126, 101, 322, 345, 323, 108, + 79, 14, 15, 16, 18, 17, 244, 312, 313, 58, + 21, 56, 92, 402, 403, 116, 149, 50, 87, 51, + 44, 405, 346, 75, 348, 249, 52, 83, 84, 201, + 534, 119, 288, 488, 415, 202, 203, 204, 205 }; - -#define YYLAST 1461 - - -static const short yytable[] = { 10, - 72, 251, 309, 241, 283, 240, 373, 94, 145, 443, - 373, 250, 356, 10, 252, 12, 323, 325, 350, 287, - 288, 289, 290, 291, 394, 80, 294, 410, 250, 12, - 375, 376, 83, 412, -54, -54, -54, -54, 298, 299, - 74, 75, 395, 118, 98, 18, 78, 21, 1, 545, - 119, 3, 79, 216, 217, 371, 300, 301, 372, 19, - 295, 368, 22, 551, 411, 129, 384, 121, 456, 129, - 411, 98, 470, 296, 297, 389, 130, 121, 298, 299, - 211, 10, 26, 27, 28, 29, 30, 31, 32, 143, - 33, 384, 510, 23, 394, 384, 300, 301, 385, 384, - 384, 208, 209, 24, 388, 212, 390, 549, 447, 215, - 345, 436, 345, 345, 100, 345, 101, 442, 43, 44, - 45, 25, 307, 46, 404, 370, 535, 246, 57, 58, - 146, 96, 60, 61, 62, 63, 1, 1, 2, 3, - 3, 4, 517, 532, 298, 299, 518, 51, 345, 95, - 281, 282, 246, 284, 84, 466, 345, 345, 552, 243, - 546, 2, 300, 301, 4, 64, 285, 246, 246, 246, - 246, 246, 292, 293, 246, 140, 298, 299, 100, 34, - 101, 509, 121, 491, 373, 492, 298, 299, 416, 52, - 418, 419, 420, 371, 300, 301, 372, 100, 100, 101, - 101, 214, 358, 371, 300, 301, 372, 100, 517, 101, - 104, 105, 521, 306, 345, 345, 345, 218, 219, 220, - 221, 53, 345, 353, 100, 39, 101, 40, 143, 55, - 522, 34, 345, 345, 483, 132, 133, 76, 373, 351, - 373, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 241, 80, 240, 355, 100, 352, 101, 248, 65, - 87, 249, 66, 102, 103, 67, 91, 68, 97, 88, - 89, 143, 369, 246, 345, 92, 345, 93, 125, 345, - 126, 141, 204, 206, 493, 345, 345, 496, 497, 498, - 57, 58, 207, 96, 60, 61, 62, 63, 387, 1, - 2, 213, 3, 4, 210, -55, -56, 537, 399, 222, - 539, 244, 345, 345, 250, 345, 345, 308, 314, 315, - 316, 345, 317, 326, 318, 327, 328, 64, 330, 329, - 332, 345, 359, 360, 361, 362, 246, 417, 246, 246, - 246, 367, 363, 423, 107, 108, 109, 110, 111, 112, - 377, 345, 364, 402, 378, 405, 406, 421, 415, 345, - 422, 426, 430, 533, 431, 432, 433, 347, 348, 437, - 349, 438, 435, 439, 440, 441, 444, 445, 446, 448, - 449, 450, 547, 379, 380, 381, 382, 383, 451, 452, - 454, 456, 457, 459, 460, 345, 391, 392, 393, 464, - 345, 461, 467, 357, 465, 468, 469, 475, 484, 411, - 495, 365, 366, 513, 503, 478, 504, 345, 345, 507, - 482, 65, 345, 505, 66, 345, 487, 67, 506, 68, - 127, 508, 246, 519, 514, 246, 246, 246, 529, 531, - 487, 523, 479, 264, 265, 524, 427, 428, 515, 538, - 540, 541, 542, 434, 57, 58, 543, 96, 134, 135, - 136, 63, 550, 1, 2, 553, 3, 4, 554, 407, - 408, 409, 555, 558, 559, 561, 564, 414, 565, 196, - 197, 313, 528, 198, 116, 312, 304, 424, 425, 131, - 128, 64, 511, 536, 38, 115, 86, 499, 0, 471, - 472, 473, 474, 429, 0, 0, 476, 477, 0, 479, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 0, 0, 0, 453, - 0, 455, 0, 0, 458, 0, 0, 501, 502, 0, - 462, 463, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 485, 486, 0, - 489, 490, 525, 0, 526, 527, 494, 0, 0, 0, - 0, 0, 0, 0, 0, 65, 500, 0, 66, 0, - 0, 67, -179, 68, 324, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 516, -62, 1, 2, - 0, 3, 4, 0, 520, 0, 333, 334, 5, 6, - 57, 58, 335, 0, 0, 0, 0, 0, 0, 1, - 2, 0, 3, 4, 336, 337, 338, 0, 7, 0, - 0, 8, 0, 0, 0, 9, 0, 0, 339, 340, - 544, 0, 0, 0, 0, 548, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 341, 0, 0, 0, 0, - 0, 0, 556, 557, 0, 0, 0, 560, 0, 0, - 562, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 226, 227, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 228, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 0, 229, 0, 230, - 231, 232, 333, 334, 0, 0, 57, 58, 335, 0, - 100, 0, 101, 0, 0, 1, 2, 342, 3, 4, - 336, 337, 338, 0, 0, 0, 0, 57, 58, 0, - 0, 0, 0, 0, 339, 340, 1, 2, 0, 3, - 4, 223, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 341, 0, 0, 0, 224, 225, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 226, 227, 0, 0, 0, 0, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 226, 227, 0, 0, 0, 0, 228, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 0, 229, 0, 230, 231, 232, 0, 0, - 228, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 342, 229, 0, 230, 231, 232, 0, - 0, 0, 333, 334, 0, 0, 0, 100, 335, 101, - 0, 233, 0, 0, 234, 0, 235, 0, 236, 0, - 336, 337, 338, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 339, 340, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, - 58, 341, 96, 134, 135, 136, 63, 0, 1, 2, - 0, 3, 4, 0, 0, 0, 0, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 226, 227, 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 0, 57, 58, 0, 96, 60, - 61, 62, 63, 0, 1, 2, 0, 3, 4, 228, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 120, 229, 0, 230, 231, 232, 0, 0, - 0, 0, 64, 0, 0, 57, 58, 0, 96, 60, - 61, 62, 63, 342, 1, 2, 0, 3, 4, 0, - 0, 0, 0, 0, 57, 58, 0, 96, 134, 135, - 136, 63, 303, 1, 2, 0, 3, 4, 0, 0, - 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, - 65, 0, 0, 66, 0, 0, 67, 0, 68, 386, - 0, 64, 0, 57, 58, 0, 96, 60, 61, 62, - 63, 0, 1, 2, 0, 3, 4, 0, 0, 57, - 58, 0, 96, 60, 61, 62, 63, 0, 1, 2, - 398, 3, 4, 0, 0, 0, 65, 0, 0, 66, - 64, 0, 67, 0, 68, 0, 481, 0, 57, 58, - 0, 59, 60, 61, 62, 63, 64, 1, 2, 0, - 3, 4, 57, 58, 0, 96, 134, 135, 136, 63, - 0, 1, 2, 0, 3, 4, 65, 0, 0, 66, - 0, 0, 67, 0, 68, 64, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 65, 0, 0, 66, 64, - 319, 67, 0, 68, 57, 58, 0, 142, 60, 61, - 62, 63, 0, 1, 2, 0, 3, 4, 57, 58, - 0, 96, 60, 61, 62, 63, 0, 1, 2, 0, - 3, 4, 0, 0, 65, 0, 0, 66, 0, 0, - 67, 64, 68, 0, 0, 0, 0, 0, 0, 0, - 65, 0, 0, 66, 0, 64, 67, 0, 68, 0, - 57, 58, 0, 245, 60, 61, 62, 63, 0, 1, - 2, 0, 3, 4, 0, 0, 0, 0, 0, 65, - 0, 0, 66, 0, 0, 67, 0, 68, 0, 0, - 0, 0, 0, 65, 0, 0, 66, 64, 0, 67, - 0, 68, 57, 58, 0, 96, 134, 135, 136, 63, - 0, 1, 2, 0, 3, 4, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 148, 0, 0, - 0, 0, 0, 0, 0, 65, 0, 0, 66, 64, - 0, 67, 0, 68, 0, 0, 149, 150, 0, 65, - 0, 0, 66, 0, 0, 67, 0, 68, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 65, 0, 0, 66, 0, 0, 67, 0, 68, - 0, 174, 175, 176, 0, 0, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 0, 0, -178, 0, 0, - 0, 0, 0, 65, 0, 0, 66, 0, 0, 67, - 0, 322, -62, 1, 2, 0, 3, 4, 0, 0, - 0, 0, 0, 5, 6, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 7, 0, 0, 8, 0, 0, 0, - 9 +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -476 +static const short int yypact[] = +{ + 28, -476, -476, -476, -476, -476, -476, -10, -55, 8, + -33, 97, 3, 55, 167, 394, -476, 172, 210, 86, + 98, -476, 102, 219, -476, 1017, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, 123, 123, 218, -476, + -476, -476, -476, 123, -476, -476, -476, -476, -476, 123, + 241, -476, 2, 242, 251, 253, -476, -476, -476, -476, + -476, 137, -476, -476, -476, -476, -476, 274, 283, 1, + 456, -476, -476, -476, 83, -476, 218, 218, -476, 103, + 291, 291, -476, -476, 121, -476, -476, -476, -476, -476, + -476, -476, -26, 874, -476, 148, 149, 470, 137, -476, + 83, -97, -476, 874, 103, 103, -476, -476, 1031, 288, + -476, -476, -476, -476, -476, 1073, -476, -7, 1172, -476, + 282, -476, -476, 83, -476, 157, 162, 1087, 1087, 158, + -61, 1087, -476, 165, 1031, 1087, 60, 297, 298, 201, + 299, 656, -476, -476, 137, 83, 217, -476, -476, -476, + -476, -476, 262, 1129, 257, 302, 291, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, 461, 273, 1087, 1087, 1087, 1087, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, + 1087, -476, 291, -476, 74, -476, -476, -25, 914, -476, + 19, 41, -476, 175, 83, -476, -476, 83, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, 461, 273, + 178, 182, 183, 184, 186, 933, 1171, 552, 309, 190, + 191, 194, -476, -476, 199, 197, -476, 137, 509, -476, + 635, 635, -476, 635, 1073, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, 1087, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, 1087, -17, 92, -476, 509, 75, 207, 208, + 220, 221, 222, 223, 509, 509, 304, 1073, 1087, 1087, + -476, -476, -476, -476, -476, -476, -476, 154, -476, -476, + -476, 154, 199, 199, 214, 215, 1031, 1031, 1031, 1031, + 1031, -476, -476, -22, 828, -75, -476, -58, -476, 1031, + 1031, 1031, 5, -476, 972, -476, -476, -476, -476, -476, + -476, -476, -476, 301, 1031, -476, -476, -476, -476, 224, + -476, 226, 635, 509, 509, 14, -476, 23, -476, -476, + 635, 237, 1087, 1087, 1087, 1087, 1087, 243, 244, 1087, + 635, 509, 246, -476, -476, -476, -476, -476, -476, 1031, + 1031, -476, 247, 248, 254, 255, 1031, -476, 250, 656, + -46, -476, -476, 256, 261, 360, 383, 399, -476, 199, + -476, 83, 269, 266, -476, 388, -60, 398, 401, 277, + 272, 289, 635, 420, 635, 293, 294, 635, 295, 83, + -476, 296, 300, 635, 635, 83, 305, -476, 1087, 310, + 314, -98, 1031, 1031, 1031, 1031, -476, -476, 290, 1031, + 1031, 1087, -476, -476, -476, 33, 988, -476, 315, -476, + 635, 635, 1087, 635, 635, 316, -476, 316, 1087, 635, + 317, 1087, 1087, 1087, -476, -476, 1087, 509, 1031, 1031, + -476, 318, 287, 320, 321, -476, 319, 322, 116, -476, + -476, -476, 83, 79, 414, 324, 330, 509, 21, -476, + -476, 393, -476, -476, -476, 331, 635, -476, -476, -476, + 59, -476, 325, 339, 1031, -476, 1031, 1031, -476, -476, + -476, 33, -476, 410, -476, 447, -2, -476, 1087, -476, + -476, 342, -476, -476, -476, 348, 351, 352, -476, 489, + -476, 635, -476, 785, -1, -25, 509, 133, -476, 154, + -476, -476, -476, -476, -476, 359, -476, 785, -476, 482, + 483, 362, -25, 635, 635, 485, 439, -476, 635, 492, + -476, 635, -476 }; -static const short yycheck[] = { 0, - 24, 153, 213, 139, 176, 139, 305, 4, 24, 399, - 309, 11, 282, 14, 154, 0, 234, 235, 252, 191, - 192, 193, 194, 195, 30, 18, 198, 11, 11, 14, - 310, 311, 25, 11, 3, 4, 5, 6, 112, 113, - 35, 36, 48, 136, 68, 47, 41, 135, 16, 533, - 143, 19, 47, 22, 23, 129, 130, 131, 132, 61, - 200, 295, 52, 547, 48, 136, 136, 91, 136, 136, - 48, 95, 140, 108, 109, 145, 147, 101, 112, 113, - 147, 82, 37, 38, 39, 40, 41, 42, 43, 113, - 45, 136, 482, 135, 30, 136, 130, 131, 143, 136, - 136, 125, 126, 15, 322, 129, 147, 33, 145, 133, - 246, 147, 248, 249, 137, 251, 139, 397, 37, 38, - 39, 135, 145, 42, 342, 297, 516, 151, 7, 8, - 146, 10, 11, 12, 13, 14, 16, 16, 17, 19, - 19, 20, 136, 143, 112, 113, 140, 135, 284, 146, - 174, 175, 176, 177, 147, 425, 292, 293, 548, 144, - 143, 17, 130, 131, 20, 44, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 106, 112, 113, 137, 134, - 139, 140, 206, 453, 483, 455, 112, 113, 360, 135, - 362, 363, 364, 129, 130, 131, 132, 137, 137, 139, - 139, 132, 141, 129, 130, 131, 132, 137, 136, 139, - 28, 29, 140, 143, 350, 351, 352, 3, 4, 5, - 6, 141, 358, 136, 137, 41, 139, 43, 252, 19, - 500, 134, 368, 369, 445, 102, 103, 32, 537, 263, - 539, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 387, 18, 387, 136, 137, 280, 139, 11, 138, - 19, 14, 141, 74, 75, 144, 139, 146, 147, 19, - 19, 295, 296, 297, 410, 4, 412, 4, 142, 415, - 142, 4, 19, 136, 456, 421, 422, 459, 460, 461, - 7, 8, 140, 10, 11, 12, 13, 14, 322, 16, - 17, 140, 19, 20, 145, 9, 9, 518, 332, 9, - 521, 50, 448, 449, 11, 451, 452, 145, 139, 139, - 139, 457, 139, 19, 139, 139, 139, 44, 136, 139, - 139, 467, 136, 136, 136, 136, 360, 361, 362, 363, - 364, 33, 136, 367, 55, 56, 57, 58, 59, 60, - 139, 487, 136, 54, 139, 136, 136, 136, 141, 495, - 136, 136, 136, 515, 136, 136, 136, 248, 249, 136, - 251, 136, 145, 33, 19, 4, 136, 140, 19, 14, - 14, 139, 534, 314, 315, 316, 317, 318, 136, 136, - 4, 136, 136, 136, 136, 531, 327, 328, 329, 139, - 536, 136, 426, 284, 136, 136, 136, 145, 136, 48, - 136, 292, 293, 19, 136, 439, 140, 553, 554, 140, - 444, 138, 558, 136, 141, 561, 450, 144, 136, 146, - 147, 140, 456, 143, 136, 459, 460, 461, 48, 14, - 464, 140, 443, 22, 23, 140, 377, 378, 141, 143, - 140, 140, 140, 384, 7, 8, 4, 10, 11, 12, - 13, 14, 136, 16, 17, 14, 19, 20, 14, 350, - 351, 352, 136, 14, 66, 14, 0, 358, 0, 116, - 116, 227, 510, 116, 82, 226, 206, 368, 369, 101, - 95, 44, 483, 517, 14, 79, 50, 464, -1, 430, - 431, 432, 433, 379, -1, -1, 437, 438, -1, 510, - -1, -1, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, -1, -1, -1, 410, - -1, 412, -1, -1, 415, -1, -1, 468, 469, -1, - 421, 422, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 448, 449, -1, - 451, 452, 503, -1, 505, 506, 457, -1, -1, -1, - -1, -1, -1, -1, -1, 138, 467, -1, 141, -1, - -1, 144, 0, 146, 147, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 487, 15, 16, 17, - -1, 19, 20, -1, 495, -1, 3, 4, 26, 27, - 7, 8, 9, -1, -1, -1, -1, -1, -1, 16, - 17, -1, 19, 20, 21, 22, 23, -1, 46, -1, - -1, 49, -1, -1, -1, 53, -1, -1, 35, 36, - 531, -1, -1, -1, -1, 536, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, - -1, -1, 553, 554, -1, -1, -1, 558, -1, -1, - 561, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, -1, 124, -1, 126, - 127, 128, 3, 4, -1, -1, 7, 8, 9, -1, - 137, -1, 139, -1, -1, 16, 17, 144, 19, 20, - 21, 22, 23, -1, -1, -1, -1, 7, 8, -1, - -1, -1, -1, -1, 35, 36, 16, 17, -1, 19, - 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 52, -1, -1, -1, 35, 36, -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, -1, -1, -1, -1, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, -1, -1, -1, -1, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, -1, 124, -1, 126, 127, 128, -1, -1, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 144, 124, -1, 126, 127, 128, -1, - -1, -1, 3, 4, -1, -1, -1, 137, 9, 139, - -1, 141, -1, -1, 144, -1, 146, -1, 148, -1, - 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 35, 36, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 7, - 8, 52, 10, 11, 12, 13, 14, -1, 16, 17, - -1, 19, 20, -1, -1, -1, -1, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, -1, -1, 44, -1, -1, -1, - -1, -1, -1, -1, -1, 7, 8, -1, 10, 11, - 12, 13, 14, -1, 16, 17, -1, 19, 20, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 34, 124, -1, 126, 127, 128, -1, -1, - -1, -1, 44, -1, -1, 7, 8, -1, 10, 11, - 12, 13, 14, 144, 16, 17, -1, 19, 20, -1, - -1, -1, -1, -1, 7, 8, -1, 10, 11, 12, - 13, 14, 34, 16, 17, -1, 19, 20, -1, -1, - -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, - 138, -1, -1, 141, -1, -1, 144, -1, 146, 147, - -1, 44, -1, 7, 8, -1, 10, 11, 12, 13, - 14, -1, 16, 17, -1, 19, 20, -1, -1, 7, - 8, -1, 10, 11, 12, 13, 14, -1, 16, 17, - 34, 19, 20, -1, -1, -1, 138, -1, -1, 141, - 44, -1, 144, -1, 146, -1, 34, -1, 7, 8, - -1, 10, 11, 12, 13, 14, 44, 16, 17, -1, - 19, 20, 7, 8, -1, 10, 11, 12, 13, 14, - -1, 16, 17, -1, 19, 20, 138, -1, -1, 141, - -1, -1, 144, -1, 146, 44, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 138, -1, -1, 141, 44, - 143, 144, -1, 146, 7, 8, -1, 10, 11, 12, - 13, 14, -1, 16, 17, -1, 19, 20, 7, 8, - -1, 10, 11, 12, 13, 14, -1, 16, 17, -1, - 19, 20, -1, -1, 138, -1, -1, 141, -1, -1, - 144, 44, 146, -1, -1, -1, -1, -1, -1, -1, - 138, -1, -1, 141, -1, 44, 144, -1, 146, -1, - 7, 8, -1, 10, 11, 12, 13, 14, -1, 16, - 17, -1, 19, 20, -1, -1, -1, -1, -1, 138, - -1, -1, 141, -1, -1, 144, -1, 146, -1, -1, - -1, -1, -1, 138, -1, -1, 141, 44, -1, 144, - -1, 146, 7, 8, -1, 10, 11, 12, 13, 14, - -1, 16, 17, -1, 19, 20, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 31, -1, -1, - -1, -1, -1, -1, -1, 138, -1, -1, 141, 44, - -1, 144, -1, 146, -1, -1, 50, 51, -1, 138, - -1, -1, 141, -1, -1, 144, -1, 146, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 138, -1, -1, 141, -1, -1, 144, -1, 146, - -1, 105, 106, 107, -1, -1, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, -1, -1, 0, -1, -1, - -1, -1, -1, 138, -1, -1, 141, -1, -1, 144, - -1, 146, 15, 16, 17, -1, 19, 20, -1, -1, - -1, -1, -1, 26, 27, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 46, -1, -1, 49, -1, -1, -1, - 53 +/* YYPGOTO[NTERM-NUM]. */ +static const short int yypgoto[] = +{ + -476, 389, 392, 397, 292, 306, -153, -476, 0, 10, + 435, 4, -476, -476, -476, 87, -476, -476, -145, -295, + -383, -476, -208, -476, -276, 39, -476, -291, -476, -476, + -24, 326, -241, -476, 421, 426, 69, -138, -196, 89, + 204, -476, -476, 512, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, 452, -476, -476, -476, -476, + -476, -476, -475, -135, -227, -164, -476, 484, -476, -476, + -476, -476, -476, 73, 159, -476, -476, -476, -476 }; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/share/bison.simple" -/* This file comes from bison-1.28. */ - -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -#ifndef YYSTACK_USE_ALLOCA -#ifdef alloca -#define YYSTACK_USE_ALLOCA -#else /* alloca not defined */ -#ifdef __GNUC__ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) -#define YYSTACK_USE_ALLOCA -#include -#else /* not sparc */ -/* We think this test detects Watcom and Microsoft C. */ -/* This used to test MSDOS, but that is a bad idea - since that symbol is in the user namespace. */ -#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) -#if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ -#include -#endif -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -/* I don't know what this was needed for, but it pollutes the namespace. - So I turned it off. rms, 2 May 1997. */ -/* #include */ - #pragma alloca -#define YYSTACK_USE_ALLOCA -#else /* not MSDOS, or __TURBOC__, or _AIX */ -#if 0 -#ifdef __hpux /* haible at ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#endif /* __hpux */ -#endif -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc */ -#endif /* not GNU C */ -#endif /* alloca not defined */ -#endif /* YYSTACK_USE_ALLOCA not defined */ +/* 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 -181 +static const short int yytable[] = +{ + 10, 74, 253, 242, 12, 96, 243, 311, 358, 252, + 252, 254, 375, 352, 285, 10, 375, 147, 445, 12, + 82, 377, 378, 349, 350, 412, 351, 85, -180, 289, + 290, 291, 292, 293, 414, 396, 296, 19, 458, 131, + 325, 327, 470, -63, 1, 2, 100, 3, 4, 1, + 132, 20, 3, 397, 5, 6, 370, 297, 545, 359, + 23, 386, 413, -55, -55, -55, -55, 367, 368, 123, + 391, 413, 551, 100, 7, 131, 386, 8, 386, 123, + 22, 9, 218, 219, 10, 449, 213, 300, 301, 392, + 386, 145, 27, 28, 29, 30, 31, 32, 33, 511, + 34, 438, 24, 210, 211, 302, 303, 214, 444, 396, + 120, 217, 25, 347, 386, 347, 347, 121, 347, 355, + 102, 387, 103, 76, 77, 409, 410, 411, 390, 248, + 80, 106, 107, 416, 535, 372, 81, 1, 26, 148, + 3, 532, 546, 426, 427, 300, 301, 97, 406, 86, + 245, 347, 283, 284, 248, 286, 102, 518, 103, 347, + 347, 519, 308, 302, 303, 552, 549, 39, 287, 248, + 248, 248, 248, 248, 294, 295, 248, 142, 102, 492, + 103, 493, 298, 299, 123, 455, 309, 457, 375, 35, + 460, 300, 301, 134, 135, 518, 464, 465, 418, 522, + 420, 421, 422, 216, 220, 221, 222, 223, 373, 302, + 303, 374, 102, 41, 103, 42, 360, 347, 347, 347, + 102, 53, 103, 485, 486, 347, 489, 490, 357, 102, + 145, 103, 495, 54, 2, 347, 347, 4, 57, 483, + 501, 353, 375, 55, 375, 300, 301, 45, 46, 47, + 78, 242, 48, 102, 243, 103, 510, 35, 354, 82, + 517, 89, 373, 302, 303, 374, 300, 301, 250, 521, + 90, 251, 91, 145, 371, 248, 93, 347, 94, 347, + 104, 105, 347, 373, 302, 303, 374, 95, 347, 347, + 127, 128, 143, 208, 494, 266, 267, 497, 498, 499, + 389, 206, 209, 212, 544, 215, -56, -57, 224, 548, + 401, 537, 246, 252, 539, 347, 347, 316, 347, 347, + 310, 317, 318, 319, 347, 320, 556, 557, 328, 329, + 330, 560, 347, 331, 562, 332, 334, 369, 248, 419, + 248, 248, 248, 361, 362, 425, 109, 110, 111, 112, + 113, 114, 347, 379, 380, 404, 363, 364, 365, 366, + 407, 347, 408, 533, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 417, 423, + 424, 547, 428, 432, 433, 381, 382, 383, 384, 385, + 434, 435, 439, 441, -179, 437, 347, 440, 393, 394, + 395, 347, 442, 443, 467, 446, 447, 448, 453, -63, + 1, 2, 450, 3, 4, 451, 452, 478, 347, 347, + 5, 6, 482, 347, 456, 454, 347, 505, 487, 458, + 459, 461, 462, 514, 248, 475, 463, 248, 248, 248, + 7, 413, 487, 8, 466, 479, 468, 9, 429, 430, + 469, 484, 491, 496, 504, 436, 506, 507, 529, 508, + 515, 531, 509, 59, 60, 523, 98, 62, 63, 64, + 65, 516, 1, 2, 520, 3, 4, 59, 60, 524, + 98, 62, 63, 64, 65, 538, 1, 2, 540, 3, + 4, 541, 542, 543, 536, 550, 553, 554, 555, 558, + 66, 471, 472, 473, 474, 559, 561, 198, 476, 477, + 199, 479, 335, 336, 66, 200, 59, 60, 337, 118, + 314, 528, 512, 130, 133, 1, 2, 40, 3, 4, + 338, 339, 340, 117, 306, 315, 88, 502, 503, 500, + 431, 0, 0, 0, 341, 342, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 0, 0, 0, 59, + 60, 343, 98, 136, 137, 138, 65, 0, 1, 2, + 0, 3, 4, 525, 0, 526, 527, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 228, 229, 67, 0, 66, 68, 0, 0, + 69, 0, 70, 99, 0, 0, 0, 0, 67, 0, + 0, 68, 0, 0, 69, 0, 70, 129, 0, 230, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 0, 231, 0, 232, 233, 234, 335, 336, + 0, 0, 59, 60, 337, 0, 102, 0, 103, 0, + 0, 1, 2, 344, 3, 4, 338, 339, 340, 0, + 0, 0, 0, 59, 60, 0, 0, 0, 0, 0, + 341, 342, 1, 2, 0, 3, 4, 225, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 343, 0, 0, + 67, 226, 227, 68, 0, 0, 69, 0, 70, 326, + 0, 0, 0, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 228, 229, + 0, 0, 0, 0, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 228, + 229, 0, 0, 0, 0, 230, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 0, 231, + 0, 232, 233, 234, 0, 0, 230, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 344, + 231, 0, 232, 233, 234, 0, 0, 0, 335, 336, + 0, 0, 0, 102, 337, 103, 0, 235, 0, 0, + 236, 0, 237, 0, 238, 0, 338, 339, 340, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 341, 342, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 59, 60, 343, 98, 136, + 137, 138, 65, 0, 1, 2, 0, 3, 4, 0, + 0, 0, 0, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 228, 229, + 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, + 0, 59, 60, 0, 98, 62, 63, 64, 65, 0, + 1, 2, 0, 3, 4, 230, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 122, 231, + 0, 232, 233, 234, 0, 0, 0, 0, 66, 0, + 0, 59, 60, 0, 98, 62, 63, 64, 65, 344, + 1, 2, 0, 3, 4, 0, 0, 0, 0, 0, + 59, 60, 0, 98, 136, 137, 138, 65, 305, 1, + 2, 0, 3, 4, 0, 0, 0, 0, 66, 0, + 0, 0, 0, 0, 0, 0, 67, 0, 0, 68, + 0, 0, 69, 0, 70, 388, 0, 66, 0, 59, + 60, 0, 98, 62, 63, 64, 65, 0, 1, 2, + 0, 3, 4, 0, 0, 59, 60, 0, 98, 62, + 63, 64, 65, 0, 1, 2, 400, 3, 4, 0, + 0, 0, 67, 0, 0, 68, 66, 0, 69, 0, + 70, 0, 481, 0, 59, 60, 0, 61, 62, 63, + 64, 65, 66, 1, 2, 0, 3, 4, 59, 60, + 0, 98, 136, 137, 138, 65, 0, 1, 2, 0, + 3, 4, 67, 0, 0, 68, 0, 0, 69, 0, + 70, 66, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 67, 0, 0, 68, 66, 321, 69, 0, 70, + 59, 60, 0, 144, 62, 63, 64, 65, 0, 1, + 2, 0, 3, 4, 59, 60, 0, 98, 62, 63, + 64, 65, 0, 1, 2, 0, 3, 4, 0, 0, + 67, 0, 0, 68, 0, 0, 69, 66, 70, 0, + 0, 0, 0, 0, 0, 0, 67, 0, 0, 68, + 0, 66, 69, 0, 70, 0, 59, 60, 0, 247, + 62, 63, 64, 65, 0, 1, 2, 0, 3, 4, + 0, 0, 0, 0, 0, 67, 0, 0, 68, 0, + 0, 69, 0, 70, 0, 0, 0, 0, 0, 67, + 0, 0, 68, 66, 0, 69, 0, 70, 59, 60, + 0, 98, 136, 137, 138, 65, 0, 1, 2, 0, + 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 150, 0, 0, 0, 0, 0, 0, + 0, 67, 0, 0, 68, 66, 0, 69, 0, 70, + 0, 0, 151, 152, 0, 67, 0, 0, 68, 0, + 0, 69, 0, 70, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, + 68, 0, 0, 69, 0, 70, 0, 176, 177, 178, + 0, 0, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 0, 0, 0, 0, 0, 0, 0, 0, 67, + 0, 0, 68, 0, 0, 69, 0, 324 +}; -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc -#endif +static const short int yycheck[] = +{ + 0, 25, 155, 141, 0, 4, 141, 215, 284, 11, + 11, 156, 307, 254, 178, 15, 311, 24, 401, 15, + 18, 312, 313, 250, 251, 11, 253, 25, 0, 193, + 194, 195, 196, 197, 11, 30, 200, 47, 136, 136, + 236, 237, 140, 15, 16, 17, 70, 19, 20, 16, + 147, 61, 19, 48, 26, 27, 297, 202, 533, 286, + 52, 136, 48, 3, 4, 5, 6, 294, 295, 93, + 145, 48, 547, 97, 46, 136, 136, 49, 136, 103, + 135, 53, 22, 23, 84, 145, 147, 112, 113, 147, + 136, 115, 37, 38, 39, 40, 41, 42, 43, 482, + 45, 147, 135, 127, 128, 130, 131, 131, 399, 30, + 136, 135, 15, 248, 136, 250, 251, 143, 253, 136, + 137, 143, 139, 36, 37, 352, 353, 354, 324, 153, + 43, 28, 29, 360, 517, 299, 49, 16, 135, 146, + 19, 143, 143, 370, 371, 112, 113, 146, 344, 147, + 146, 286, 176, 177, 178, 179, 137, 136, 139, 294, + 295, 140, 143, 130, 131, 548, 33, 0, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 108, 137, 455, + 139, 457, 108, 109, 208, 412, 145, 414, 483, 134, + 417, 112, 113, 104, 105, 136, 423, 424, 362, 140, + 364, 365, 366, 134, 3, 4, 5, 6, 129, 130, + 131, 132, 137, 41, 139, 43, 141, 352, 353, 354, + 137, 135, 139, 450, 451, 360, 453, 454, 136, 137, + 254, 139, 459, 135, 17, 370, 371, 20, 19, 447, + 467, 265, 537, 141, 539, 112, 113, 37, 38, 39, + 32, 389, 42, 137, 389, 139, 140, 134, 282, 18, + 487, 19, 129, 130, 131, 132, 112, 113, 11, 496, + 19, 14, 19, 297, 298, 299, 139, 412, 4, 414, + 76, 77, 417, 129, 130, 131, 132, 4, 423, 424, + 142, 142, 4, 136, 458, 22, 23, 461, 462, 463, + 324, 19, 140, 145, 531, 140, 9, 9, 9, 536, + 334, 519, 50, 11, 522, 450, 451, 139, 453, 454, + 145, 139, 139, 139, 459, 139, 553, 554, 19, 139, + 139, 558, 467, 139, 561, 136, 139, 33, 362, 363, + 364, 365, 366, 136, 136, 369, 55, 56, 57, 58, + 59, 60, 487, 139, 139, 54, 136, 136, 136, 136, + 136, 496, 136, 516, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 141, 136, + 136, 534, 136, 136, 136, 316, 317, 318, 319, 320, + 136, 136, 136, 33, 0, 145, 531, 136, 329, 330, + 331, 536, 19, 4, 428, 136, 140, 19, 136, 15, + 16, 17, 14, 19, 20, 14, 139, 441, 553, 554, + 26, 27, 446, 558, 4, 136, 561, 140, 452, 136, + 136, 136, 136, 19, 458, 145, 136, 461, 462, 463, + 46, 48, 466, 49, 139, 445, 136, 53, 379, 380, + 136, 136, 136, 136, 136, 386, 136, 136, 48, 140, + 136, 14, 140, 7, 8, 140, 10, 11, 12, 13, + 14, 141, 16, 17, 143, 19, 20, 7, 8, 140, + 10, 11, 12, 13, 14, 143, 16, 17, 140, 19, + 20, 140, 140, 4, 518, 136, 14, 14, 136, 14, + 44, 432, 433, 434, 435, 66, 14, 118, 439, 440, + 118, 511, 3, 4, 44, 118, 7, 8, 9, 84, + 228, 511, 483, 97, 103, 16, 17, 15, 19, 20, + 21, 22, 23, 81, 208, 229, 52, 468, 469, 466, + 381, -1, -1, -1, 35, 36, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, -1, -1, -1, 7, + 8, 52, 10, 11, 12, 13, 14, -1, 16, 17, + -1, 19, 20, 504, -1, 506, 507, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 138, -1, 44, 141, -1, -1, + 144, -1, 146, 147, -1, -1, -1, -1, 138, -1, + -1, 141, -1, -1, 144, -1, 146, 147, -1, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, -1, 124, -1, 126, 127, 128, 3, 4, + -1, -1, 7, 8, 9, -1, 137, -1, 139, -1, + -1, 16, 17, 144, 19, 20, 21, 22, 23, -1, + -1, -1, -1, 7, 8, -1, -1, -1, -1, -1, + 35, 36, 16, 17, -1, 19, 20, 21, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 52, -1, -1, + 138, 35, 36, 141, -1, -1, 144, -1, 146, 147, + -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, -1, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, -1, 124, + -1, 126, 127, 128, -1, -1, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 144, + 124, -1, 126, 127, 128, -1, -1, -1, 3, 4, + -1, -1, -1, 137, 9, 139, -1, 141, -1, -1, + 144, -1, 146, -1, 148, -1, 21, 22, 23, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 35, 36, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 7, 8, 52, 10, 11, + 12, 13, 14, -1, 16, 17, -1, 19, 20, -1, + -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, + -1, 7, 8, -1, 10, 11, 12, 13, 14, -1, + 16, 17, -1, 19, 20, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 34, 124, + -1, 126, 127, 128, -1, -1, -1, -1, 44, -1, + -1, 7, 8, -1, 10, 11, 12, 13, 14, 144, + 16, 17, -1, 19, 20, -1, -1, -1, -1, -1, + 7, 8, -1, 10, 11, 12, 13, 14, 34, 16, + 17, -1, 19, 20, -1, -1, -1, -1, 44, -1, + -1, -1, -1, -1, -1, -1, 138, -1, -1, 141, + -1, -1, 144, -1, 146, 147, -1, 44, -1, 7, + 8, -1, 10, 11, 12, 13, 14, -1, 16, 17, + -1, 19, 20, -1, -1, 7, 8, -1, 10, 11, + 12, 13, 14, -1, 16, 17, 34, 19, 20, -1, + -1, -1, 138, -1, -1, 141, 44, -1, 144, -1, + 146, -1, 34, -1, 7, 8, -1, 10, 11, 12, + 13, 14, 44, 16, 17, -1, 19, 20, 7, 8, + -1, 10, 11, 12, 13, 14, -1, 16, 17, -1, + 19, 20, 138, -1, -1, 141, -1, -1, 144, -1, + 146, 44, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 138, -1, -1, 141, 44, 143, 144, -1, 146, + 7, 8, -1, 10, 11, 12, 13, 14, -1, 16, + 17, -1, 19, 20, 7, 8, -1, 10, 11, 12, + 13, 14, -1, 16, 17, -1, 19, 20, -1, -1, + 138, -1, -1, 141, -1, -1, 144, 44, 146, -1, + -1, -1, -1, -1, -1, -1, 138, -1, -1, 141, + -1, 44, 144, -1, 146, -1, 7, 8, -1, 10, + 11, 12, 13, 14, -1, 16, 17, -1, 19, 20, + -1, -1, -1, -1, -1, 138, -1, -1, 141, -1, + -1, 144, -1, 146, -1, -1, -1, -1, -1, 138, + -1, -1, 141, 44, -1, 144, -1, 146, 7, 8, + -1, 10, 11, 12, 13, 14, -1, 16, 17, -1, + 19, 20, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 31, -1, -1, -1, -1, -1, -1, + -1, 138, -1, -1, 141, 44, -1, 144, -1, 146, + -1, -1, 50, 51, -1, 138, -1, -1, 141, -1, + -1, 144, -1, 146, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 138, -1, -1, + 141, -1, -1, 144, -1, 146, -1, 105, 106, 107, + -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, -1, -1, -1, -1, -1, -1, -1, -1, 138, + -1, -1, 141, -1, -1, 144, -1, 146 +}; -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const unsigned char yystos[] = +{ + 0, 16, 17, 19, 20, 26, 27, 46, 49, 53, + 157, 159, 160, 161, 190, 191, 192, 194, 193, 47, + 61, 199, 135, 52, 135, 15, 135, 37, 38, 39, + 40, 41, 42, 43, 45, 134, 162, 163, 164, 0, + 192, 41, 43, 165, 209, 37, 38, 39, 42, 166, + 206, 208, 215, 135, 135, 141, 200, 19, 198, 7, + 8, 10, 11, 12, 13, 14, 44, 138, 141, 144, + 146, 157, 160, 178, 179, 212, 164, 164, 32, 189, + 164, 164, 18, 216, 217, 25, 147, 207, 216, 19, + 19, 19, 201, 139, 4, 4, 4, 146, 10, 147, + 179, 184, 137, 139, 189, 189, 28, 29, 188, 55, + 56, 57, 58, 59, 60, 167, 204, 204, 159, 220, + 136, 143, 34, 179, 180, 182, 183, 142, 142, 147, + 184, 136, 147, 183, 188, 188, 11, 12, 13, 155, + 156, 179, 185, 4, 10, 179, 181, 24, 146, 205, + 31, 50, 51, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 105, 106, 107, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 150, 151, + 152, 218, 224, 225, 226, 227, 19, 169, 136, 140, + 179, 179, 145, 147, 179, 140, 185, 179, 22, 23, + 3, 4, 5, 6, 9, 21, 35, 36, 83, 84, + 110, 124, 126, 127, 128, 141, 144, 146, 148, 150, + 151, 152, 186, 212, 195, 160, 50, 10, 179, 214, + 11, 14, 11, 155, 167, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 153, 22, 23, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 154, 179, 179, 214, 179, 179, 221, 214, + 214, 214, 214, 214, 179, 179, 214, 167, 108, 109, + 112, 113, 130, 131, 168, 34, 180, 171, 143, 145, + 145, 171, 196, 197, 153, 154, 139, 139, 139, 139, + 139, 143, 185, 187, 146, 187, 147, 187, 19, 139, + 139, 139, 136, 176, 139, 3, 4, 9, 21, 22, + 23, 35, 36, 52, 144, 186, 211, 212, 213, 213, + 213, 213, 181, 179, 179, 136, 173, 136, 173, 213, + 141, 136, 136, 136, 136, 136, 136, 213, 213, 33, + 181, 179, 214, 129, 132, 168, 170, 176, 176, 139, + 139, 185, 185, 185, 185, 185, 136, 143, 147, 179, + 187, 145, 147, 185, 185, 185, 30, 48, 174, 177, + 34, 179, 202, 203, 54, 210, 187, 136, 136, 213, + 213, 213, 11, 48, 11, 223, 213, 141, 214, 179, + 214, 214, 214, 136, 136, 179, 213, 213, 136, 185, + 185, 223, 136, 136, 136, 136, 185, 145, 147, 136, + 136, 33, 19, 4, 176, 169, 136, 140, 19, 145, + 14, 14, 139, 136, 136, 213, 4, 213, 136, 136, + 213, 136, 136, 136, 213, 213, 139, 179, 136, 136, + 140, 185, 185, 185, 185, 145, 185, 185, 179, 157, + 158, 34, 179, 171, 136, 213, 213, 179, 222, 213, + 213, 136, 173, 173, 214, 213, 136, 214, 214, 214, + 222, 213, 185, 185, 136, 140, 136, 136, 140, 140, + 140, 169, 174, 175, 19, 136, 141, 213, 136, 140, + 143, 213, 140, 140, 140, 185, 185, 185, 158, 48, + 172, 14, 143, 155, 219, 169, 179, 171, 143, 171, + 140, 140, 140, 4, 213, 211, 143, 155, 213, 33, + 136, 211, 169, 14, 14, 136, 213, 213, 14, 66, + 213, 14, 213 +}; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 +#define YYEMPTY (-2) #define YYEOF 0 + #define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 -/* Like YYERROR except do call yyerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ + #define YYFAIL goto yyerrlab + #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ + +#define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ - { yychar = (token), yylval = (value); \ - yychar1 = YYTRANSLATE (yychar); \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ - { yyerror ("syntax error: cannot back up"); YYERROR; } \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ while (0) + #define YYTERROR 1 #define YYERRCODE 256 -#ifndef YYPURE -#define YYLEX yylex() + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (0) #endif -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval, &yylloc) + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif #endif -#else /* not YYLSP_NEEDED */ + + +/* YYLEX -- calling `yylex' with the right arguments. */ + #ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, YYLEX_PARAM) +# define YYLEX yylex (YYLEX_PARAM) #else -#define YYLEX yylex(&yylval) -#endif -#endif /* not YYLSP_NEEDED */ +# define YYLEX yylex () #endif -/* If nonreentrant, generate the variables here */ +/* Enable debugging if requested. */ +#if YYDEBUG -#ifndef YYPURE +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yysymprint (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) -int yychar; /* the lookahead symbol */ -YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_stack_print (short int *bottom, short int *top) +#else +static void +yy_stack_print (bottom, top) + short int *bottom; + short int *top; #endif +{ + YYFPRINTF (stderr, "Stack now"); + for (/* Nothing. */; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ -#if YYDEBUG != 0 -int yydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_reduce_print (int yyrule) +#else +static void +yy_reduce_print (yyrule) + int yyrule; #endif +{ + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", + yyrule - 1, yylno); + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); +} -/* YYINITDEPTH indicates the initial size of the parser's stacks */ +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (Rule); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + +/* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -#define YYINITDEPTH 200 +# define YYINITDEPTH 200 #endif -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 +# define YYMAXDEPTH 10000 #endif + -/* Define __yy_memcpy. Note that the size argument - should be passed with type unsigned int, because that is what the non-GCC - definitions require. With GCC, __builtin_memcpy takes an arg - of type size_t, but it can handle unsigned int. */ - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (to, from, count) - char *to; - char *from; - unsigned int count; +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined (__GLIBC__) && defined (_STRING_H) +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +# if defined (__STDC__) || defined (__cplusplus) +yystrlen (const char *yystr) +# else +yystrlen (yystr) + const char *yystr; +# endif { - register char *f = from; - register char *t = to; - register int i = count; + const char *yys = yystr; + + while (*yys++ != '\0') + continue; - while (i-- > 0) - *t++ = *f++; + return yys - yystr - 1; } +# endif +# endif -#else /* __cplusplus */ +# ifndef yystpcpy +# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +# if defined (__STDC__) || defined (__cplusplus) +yystpcpy (char *yydest, const char *yysrc) +# else +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +# endif +{ + char *yyd = yydest; + const char *yys = yysrc; -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *to, char *from, unsigned int count) + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) { - register char *t = to; - register char *f = from; - register int i = count; + if (*yystr == '"') + { + size_t yyn = 0; + char const *yyp = yystr; - while (i-- > 0) - *t++ = *f++; + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; } +# endif + +#endif /* YYERROR_VERBOSE */ + + + +#if YYDEBUG +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ +#if defined (__STDC__) || defined (__cplusplus) +static void +yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) +#else +static void +yysymprint (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE *yyvaluep; #endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + switch (yytype) + { + default: + break; + } + YYFPRINTF (yyoutput, ")"); +} + +#endif /* ! YYDEBUG */ +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; #endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} -#line 217 "/usr/share/bison.simple" -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ +/* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM -#ifdef __cplusplus -#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#else /* not __cplusplus */ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#endif /* not __cplusplus */ -#else /* not YYPARSE_PARAM */ -#define YYPARSE_PARAM_ARG -#define YYPARSE_PARAM_DECL -#endif /* not YYPARSE_PARAM */ +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM); +# else +int yyparse (); +# endif +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + +/* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*----------. +| yyparse. | +`----------*/ -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ #ifdef YYPARSE_PARAM -int yyparse (void *); +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM) +# else +int yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +# endif +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) +int +yyparse (void) #else -int yyparse (void); +int +yyparse () + #endif #endif - -int -yyparse(YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL { - register int yystate; - register int yyn; - register short *yyssp; - register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int yychar1 = 0; /* lookahead token as an internal (translated) token number */ - - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + short int yyssa[YYINITDEPTH]; + short int *yyss = yyssa; + short int *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + -#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) -#else #define YYPOPSTACK (yyvsp--, yyssp--) -#endif - int yystacksize = YYINITDEPTH; - int yyfree_stacks = 0; + YYSIZE_T yystacksize = YYINITDEPTH; -#ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ int yylen; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); -#endif + YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; @@ -2188,650 +2831,682 @@ so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss - 1; + yyssp = yyss; yyvsp = yyvs; -#ifdef YYLSP_NEEDED - yylsp = yyls; -#endif -/* Push a new state, which is found in yystate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: - - *++yyssp = yystate; - - if (yyssp >= yyss + yystacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. + */ + yyssp++; + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; + YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); -#else - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); -#endif + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + short int *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), - yyss = yyss1; yyvs = yyvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } #else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - { - yyerror("parser stack overflow"); - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 2; - } + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) + if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; -#ifndef YYSTACK_USE_ALLOCA - yyfree_stacks = 1; -#endif - yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); -#endif + + { + short int *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif #endif /* no yyoverflow */ - yyssp = yyss + size - 1; - yyvsp = yyvs + size - 1; -#ifdef YYLSP_NEEDED - yylsp = yyls + size - 1; -#endif + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); -#endif - if (yyssp >= yyss + yystacksize - 1) + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) YYABORT; } -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Entering state %d\n", yystate); -#endif + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; - yybackup: + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: /* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ +/* Read a look-ahead token if we need one and don't already have one. */ /* yyresume: */ - /* First try to decide what to do without reference to lookahead token. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; - if (yyn == YYFLAG) + if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ - - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ + /* Not known => get a look-ahead token if don't already have one. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Reading a token: "); -#endif + YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ + if (yychar <= YYEOF) { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Now at end of input.\n"); -#endif + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); } else { - yychar1 = YYTRANSLATE(yychar); - -#if YYDEBUG != 0 - if (yydebug) - { - fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -#endif - fprintf (stderr, ")\n"); - } -#endif + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) + if (yyn <= 0) { - if (yyn == YYFLAG) + if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } - else if (yyn == 0) - goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); -#endif + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; yystate = yyn; goto yynewstate; -/* Do the default action for the current state. */ -yydefault: +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; + goto yyreduce; + -/* Do a reduction. yyn is the number of a rule to reduce with. */ +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ yyreduce: + /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1-yylen]; /* implement default value of the action */ -#if YYDEBUG != 0 - if (yydebug) + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) { - int i; + case 29: +#line 1099 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} + break; - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); + case 30: +#line 1099 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} + break; - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif + case 31: +#line 1100 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} + break; + case 32: +#line 1100 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} + break; - switch (yyn) { + case 33: +#line 1101 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} + break; -case 28: -#line 1099 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_EQ; ; - break;} -case 29: -#line 1099 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_NE; ; - break;} -case 30: -#line 1100 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SLT; ; - break;} -case 31: -#line 1100 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SGT; ; - break;} -case 32: -#line 1101 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SLE; ; - break;} -case 33: -#line 1101 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SGE; ; - break;} -case 34: -#line 1102 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_ULT; ; - break;} -case 35: -#line 1102 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_UGT; ; - break;} -case 36: -#line 1103 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_ULE; ; - break;} -case 37: -#line 1103 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_UGE; ; - break;} -case 38: -#line 1107 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OEQ; ; - break;} -case 39: -#line 1107 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ONE; ; - break;} -case 40: -#line 1108 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OLT; ; - break;} -case 41: -#line 1108 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OGT; ; - break;} -case 42: -#line 1109 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OLE; ; - break;} -case 43: -#line 1109 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OGE; ; - break;} -case 44: -#line 1110 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ORD; ; - break;} -case 45: -#line 1110 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UNO; ; - break;} -case 46: -#line 1111 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UEQ; ; - break;} -case 47: -#line 1111 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UNE; ; - break;} -case 48: -#line 1112 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ULT; ; - break;} -case 49: -#line 1112 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UGT; ; - break;} -case 50: -#line 1113 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ULE; ; - break;} -case 51: -#line 1113 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UGE; ; - break;} -case 52: -#line 1114 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_TRUE; ; - break;} -case 53: -#line 1115 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_FALSE; ; - break;} -case 60: -#line 1124 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = 0; ; - break;} -case 61: -#line 1128 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = yyvsp[-1].StrVal; - CHECK_FOR_ERROR - ; - break;} -case 62: -#line 1132 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = 0; - CHECK_FOR_ERROR - ; - break;} -case 65: -#line 1139 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = yyvsp[-1].StrVal; - CHECK_FOR_ERROR - ; - break;} -case 66: -#line 1143 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = 0; - CHECK_FOR_ERROR - ; - break;} -case 67: -#line 1149 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::InternalLinkage; ; - break;} -case 68: -#line 1150 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::WeakLinkage; ; - break;} -case 69: -#line 1151 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; - break;} -case 70: -#line 1152 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::AppendingLinkage; ; - break;} -case 71: -#line 1153 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; - break;} -case 72: -#line 1157 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; - break;} -case 73: -#line 1158 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; - break;} -case 74: -#line 1159 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 75: -#line 1163 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Visibility = GlobalValue::DefaultVisibility; ; - break;} -case 76: -#line 1164 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Visibility = GlobalValue::HiddenVisibility; ; - break;} -case 77: -#line 1168 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 78: -#line 1169 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; - break;} -case 79: -#line 1170 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; - break;} -case 80: -#line 1174 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 81: -#line 1175 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::InternalLinkage; ; - break;} -case 82: -#line 1176 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; - break;} -case 83: -#line 1177 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::WeakLinkage; ; - break;} -case 84: -#line 1178 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; - break;} -case 85: -#line 1181 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::C; ; - break;} -case 86: -#line 1182 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::C; ; - break;} -case 87: -#line 1183 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::Fast; ; - break;} -case 88: -#line 1184 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::Cold; ; - break;} -case 89: -#line 1185 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::X86_StdCall; ; - break;} -case 90: -#line 1186 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::X86_FastCall; ; - break;} -case 91: -#line 1187 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val) - GEN_ERROR("Calling conv too large"); - yyval.UIntVal = yyvsp[0].UInt64Val; - CHECK_FOR_ERROR - ; - break;} -case 92: -#line 1194 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::ZExt; ; - break;} -case 93: -#line 1195 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::SExt; ; - break;} -case 94: -#line 1196 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::InReg; ; - break;} -case 95: -#line 1197 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::StructRet; ; - break;} -case 96: -#line 1200 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::None; ; - break;} -case 97: -#line 1201 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ParamAttrs = yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs; - ; - break;} -case 98: -#line 1206 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::NoReturn; ; - break;} -case 99: -#line 1207 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::NoUnwind; ; - break;} -case 101: -#line 1211 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::None; ; - break;} -case 102: -#line 1212 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ParamAttrs = yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs; - ; - break;} -case 103: -#line 1219 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = 0; ; - break;} -case 104: -#line 1220 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.UIntVal = yyvsp[0].UInt64Val; - if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) + case 34: +#line 1101 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} + break; + + case 35: +#line 1102 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} + break; + + case 36: +#line 1102 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} + break; + + case 37: +#line 1103 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} + break; + + case 38: +#line 1103 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} + break; + + case 39: +#line 1107 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} + break; + + case 40: +#line 1107 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} + break; + + case 41: +#line 1108 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} + break; + + case 42: +#line 1108 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} + break; + + case 43: +#line 1109 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} + break; + + case 44: +#line 1109 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} + break; + + case 45: +#line 1110 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} + break; + + case 46: +#line 1110 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} + break; + + case 47: +#line 1111 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} + break; + + case 48: +#line 1111 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} + break; + + case 49: +#line 1112 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} + break; + + case 50: +#line 1112 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} + break; + + case 51: +#line 1113 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} + break; + + case 52: +#line 1113 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} + break; + + case 53: +#line 1114 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} + break; + + case 54: +#line 1115 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} + break; + + case 61: +#line 1124 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = 0; ;} + break; + + case 62: +#line 1128 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = (yyvsp[-1].StrVal); + CHECK_FOR_ERROR + ;} + break; + + case 63: +#line 1132 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = 0; + CHECK_FOR_ERROR + ;} + break; + + case 66: +#line 1139 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = (yyvsp[-1].StrVal); + CHECK_FOR_ERROR + ;} + break; + + case 67: +#line 1143 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = 0; + CHECK_FOR_ERROR + ;} + break; + + case 68: +#line 1149 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} + break; + + case 69: +#line 1150 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} + break; + + case 70: +#line 1151 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} + break; + + case 71: +#line 1152 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} + break; + + case 72: +#line 1153 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} + break; + + case 73: +#line 1157 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} + break; + + case 74: +#line 1158 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} + break; + + case 75: +#line 1159 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 76: +#line 1163 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} + break; + + case 77: +#line 1164 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} + break; + + case 78: +#line 1168 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 79: +#line 1169 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} + break; + + case 80: +#line 1170 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} + break; + + case 81: +#line 1174 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 82: +#line 1175 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} + break; + + case 83: +#line 1176 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} + break; + + case 84: +#line 1177 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} + break; + + case 85: +#line 1178 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} + break; + + case 86: +#line 1181 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::C; ;} + break; + + case 87: +#line 1182 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::C; ;} + break; + + case 88: +#line 1183 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::Fast; ;} + break; + + case 89: +#line 1184 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::Cold; ;} + break; + + case 90: +#line 1185 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} + break; + + case 91: +#line 1186 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} + break; + + case 92: +#line 1187 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) + GEN_ERROR("Calling conv too large"); + (yyval.UIntVal) = (yyvsp[0].UInt64Val); + CHECK_FOR_ERROR + ;} + break; + + case 93: +#line 1194 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} + break; + + case 94: +#line 1195 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::SExt; ;} + break; + + case 95: +#line 1196 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::InReg; ;} + break; + + case 96: +#line 1197 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} + break; + + case 97: +#line 1200 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::None; ;} + break; + + case 98: +#line 1201 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ParamAttrs) = (yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs); + ;} + break; + + case 99: +#line 1206 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} + break; + + case 100: +#line 1207 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} + break; + + case 102: +#line 1211 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::None; ;} + break; + + case 103: +#line 1212 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ParamAttrs) = (yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs); + ;} + break; + + case 104: +#line 1219 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = 0; ;} + break; + + case 105: +#line 1220 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.UIntVal) = (yyvsp[0].UInt64Val); + if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) GEN_ERROR("Alignment must be a power of two"); CHECK_FOR_ERROR -; - break;} -case 105: -#line 1226 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = 0; ; - break;} -case 106: -#line 1227 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.UIntVal = yyvsp[0].UInt64Val; - if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) +;} + break; + + case 106: +#line 1226 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = 0; ;} + break; + + case 107: +#line 1227 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.UIntVal) = (yyvsp[0].UInt64Val); + if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) GEN_ERROR("Alignment must be a power of two"); CHECK_FOR_ERROR -; - break;} -case 107: -#line 1235 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - for (unsigned i = 0, e = strlen(yyvsp[0].StrVal); i != e; ++i) - if (yyvsp[0].StrVal[i] == '"' || yyvsp[0].StrVal[i] == '\\') +;} + break; + + case 108: +#line 1235 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i) + if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\') GEN_ERROR("Invalid character in section name"); - yyval.StrVal = yyvsp[0].StrVal; + (yyval.StrVal) = (yyvsp[0].StrVal); CHECK_FOR_ERROR -; - break;} -case 108: -#line 1243 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = 0; ; - break;} -case 109: -#line 1244 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = yyvsp[0].StrVal; ; - break;} -case 110: -#line 1249 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{; - break;} -case 111: -#line 1250 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{; - break;} -case 112: -#line 1251 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurGV->setSection(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); +;} + break; + + case 109: +#line 1243 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = 0; ;} + break; + + case 110: +#line 1244 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = (yyvsp[0].StrVal); ;} + break; + + case 111: +#line 1249 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + {;} + break; + + case 112: +#line 1250 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + {;} + break; + + case 113: +#line 1251 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + CurGV->setSection((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); CHECK_FOR_ERROR - ; - break;} -case 113: -#line 1256 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[0].UInt64Val != 0 && !isPowerOf2_32(yyvsp[0].UInt64Val)) + ;} + break; + + case 114: +#line 1256 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val))) GEN_ERROR("Alignment must be a power of two"); - CurGV->setAlignment(yyvsp[0].UInt64Val); + CurGV->setAlignment((yyvsp[0].UInt64Val)); CHECK_FOR_ERROR - ; - break;} -case 118: -#line 1272 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeVal = new PATypeHolder(OpaqueType::get()); + ;} + break; + + case 119: +#line 1272 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR - ; - break;} -case 119: -#line 1276 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); + ;} + break; + + case 120: +#line 1276 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); CHECK_FOR_ERROR - ; - break;} -case 120: -#line 1280 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Pointer type? - if (*yyvsp[-1].TypeVal == Type::LabelTy) + ;} + break; + + case 121: +#line 1280 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // Pointer type? + if (*(yyvsp[-1].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); - yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-1].TypeVal))); - delete yyvsp[-1].TypeVal; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[-1].TypeVal)))); + delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 122: +#line 1287 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // Named types are also simple types... + const Type* tmp = getTypeVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - ; - break;} -case 121: -#line 1287 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Named types are also simple types... - const Type* tmp = getTypeVal(yyvsp[0].ValIDVal); - CHECK_FOR_ERROR - yyval.TypeVal = new PATypeHolder(tmp); - ; - break;} -case 122: -#line 1292 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Type UpReference - if (yyvsp[0].UInt64Val > (uint64_t)~0U) GEN_ERROR("Value out of range"); + (yyval.TypeVal) = new PATypeHolder(tmp); + ;} + break; + + case 123: +#line 1292 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // Type UpReference + if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder - UpRefs.push_back(UpRefRecord((unsigned)yyvsp[0].UInt64Val, OT)); // Add to vector... - yyval.TypeVal = new PATypeHolder(OT); + UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[0].UInt64Val), OT)); // Add to vector... + (yyval.TypeVal) = new PATypeHolder(OT); UR_OUT("New Upreference!\n"); CHECK_FOR_ERROR - ; - break;} -case 123: -#line 1300 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 124: +#line 1300 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { std::vector Params; ParamAttrsList Attrs; - if (yyvsp[0].ParamAttrs != ParamAttr::None) - Attrs.addAttributes(0, yyvsp[0].ParamAttrs); + if ((yyvsp[0].ParamAttrs) != ParamAttr::None) + Attrs.addAttributes(0, (yyvsp[0].ParamAttrs)); unsigned index = 1; - TypeWithAttrsList::iterator I = yyvsp[-2].TypeWithAttrsList->begin(), E = yyvsp[-2].TypeWithAttrsList->end(); + TypeWithAttrsList::iterator I = (yyvsp[-2].TypeWithAttrsList)->begin(), E = (yyvsp[-2].TypeWithAttrsList)->end(); for (; I != E; ++I, ++index) { const Type *Ty = I->Ty->get(); Params.push_back(Ty); @@ -2845,21 +3520,22 @@ ParamAttrsList *ActualAttrs = 0; if (!Attrs.empty()) ActualAttrs = new ParamAttrsList(Attrs); - FunctionType *FT = FunctionType::get(*yyvsp[-4].TypeVal, Params, isVarArg, ActualAttrs); - delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list - delete yyvsp[-4].TypeVal; // Delete the return type handle - yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT)); - CHECK_FOR_ERROR - ; - break;} -case 124: -#line 1326 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + FunctionType *FT = FunctionType::get(*(yyvsp[-4].TypeVal), Params, isVarArg, ActualAttrs); + delete (yyvsp[-2].TypeWithAttrsList); // Delete the argument list + delete (yyvsp[-4].TypeVal); // Delete the return type handle + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); + CHECK_FOR_ERROR + ;} + break; + + case 125: +#line 1326 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { std::vector Params; ParamAttrsList Attrs; - if (yyvsp[0].ParamAttrs != ParamAttr::None) - Attrs.addAttributes(0, yyvsp[0].ParamAttrs); - TypeWithAttrsList::iterator I = yyvsp[-2].TypeWithAttrsList->begin(), E = yyvsp[-2].TypeWithAttrsList->end(); + if ((yyvsp[0].ParamAttrs) != ParamAttr::None) + Attrs.addAttributes(0, (yyvsp[0].ParamAttrs)); + TypeWithAttrsList::iterator I = (yyvsp[-2].TypeWithAttrsList)->begin(), E = (yyvsp[-2].TypeWithAttrsList)->end(); unsigned index = 1; for ( ; I != E; ++I, ++index) { const Type* Ty = I->Ty->get(); @@ -2875,284 +3551,305 @@ if (!Attrs.empty()) ActualAttrs = new ParamAttrsList(Attrs); - FunctionType *FT = FunctionType::get(yyvsp[-4].PrimType, Params, isVarArg, ActualAttrs); - delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list - yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT)); - CHECK_FOR_ERROR - ; - break;} -case 125: -#line 1353 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Sized array type? - yyval.TypeVal = new PATypeHolder(HandleUpRefs(ArrayType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); - delete yyvsp[-1].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 126: -#line 1358 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Vector type? - const llvm::Type* ElemTy = yyvsp[-1].TypeVal->get(); - if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val) + FunctionType *FT = FunctionType::get((yyvsp[-4].PrimType), Params, isVarArg, ActualAttrs); + delete (yyvsp[-2].TypeWithAttrsList); // Delete the argument list + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); + CHECK_FOR_ERROR + ;} + break; + + case 126: +#line 1353 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // Sized array type? + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val)))); + delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 127: +#line 1358 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // Vector type? + const llvm::Type* ElemTy = (yyvsp[-1].TypeVal)->get(); + if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) GEN_ERROR("Unsigned result not equal to signed result"); if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger()) GEN_ERROR("Element type of a VectorType must be primitive"); - if (!isPowerOf2_32(yyvsp[-3].UInt64Val)) + if (!isPowerOf2_32((yyvsp[-3].UInt64Val))) GEN_ERROR("Vector length should be a power of 2"); - yyval.TypeVal = new PATypeHolder(HandleUpRefs(VectorType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); - delete yyvsp[-1].TypeVal; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val)))); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 127: -#line 1370 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Structure type? + ;} + break; + + case 128: +#line 1370 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // Structure type? std::vector Elements; - for (std::list::iterator I = yyvsp[-1].TypeList->begin(), - E = yyvsp[-1].TypeList->end(); I != E; ++I) + for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(), + E = (yyvsp[-1].TypeList)->end(); I != E; ++I) Elements.push_back(*I); - yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); - delete yyvsp[-1].TypeList; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); + delete (yyvsp[-1].TypeList); CHECK_FOR_ERROR - ; - break;} -case 128: -#line 1380 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Empty structure type? - yyval.TypeVal = new PATypeHolder(StructType::get(std::vector())); - CHECK_FOR_ERROR - ; - break;} -case 129: -#line 1384 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 129: +#line 1380 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // Empty structure type? + (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); + CHECK_FOR_ERROR + ;} + break; + + case 130: +#line 1384 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { std::vector Elements; - for (std::list::iterator I = yyvsp[-2].TypeList->begin(), - E = yyvsp[-2].TypeList->end(); I != E; ++I) + for (std::list::iterator I = (yyvsp[-2].TypeList)->begin(), + E = (yyvsp[-2].TypeList)->end(); I != E; ++I) Elements.push_back(*I); - yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); - delete yyvsp[-2].TypeList; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); + delete (yyvsp[-2].TypeList); CHECK_FOR_ERROR - ; - break;} -case 130: -#line 1394 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Empty structure type? - yyval.TypeVal = new PATypeHolder(StructType::get(std::vector(), true)); - CHECK_FOR_ERROR - ; - break;} -case 131: -#line 1401 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrs.Ty = yyvsp[-1].TypeVal; - yyval.TypeWithAttrs.Attrs = yyvsp[0].ParamAttrs; - ; - break;} -case 132: -#line 1408 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 131: +#line 1394 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // Empty structure type? + (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); + CHECK_FOR_ERROR + ;} + break; + + case 132: +#line 1401 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrs).Ty = (yyvsp[-1].TypeVal); + (yyval.TypeWithAttrs).Attrs = (yyvsp[0].ParamAttrs); + ;} + break; + + case 133: +#line 1408 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); - if (!(*yyvsp[0].TypeVal)->isFirstClassType()) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); + if (!(*(yyvsp[0].TypeVal))->isFirstClassType()) GEN_ERROR("LLVM functions cannot return aggregate types"); - yyval.TypeVal = yyvsp[0].TypeVal; - ; - break;} -case 133: -#line 1415 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeVal = new PATypeHolder(Type::VoidTy); - ; - break;} -case 134: -#line 1420 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrsList = new TypeWithAttrsList(); - yyval.TypeWithAttrsList->push_back(yyvsp[0].TypeWithAttrs); + (yyval.TypeVal) = (yyvsp[0].TypeVal); + ;} + break; + + case 134: +#line 1415 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); + ;} + break; + + case 135: +#line 1420 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); + (yyval.TypeWithAttrsList)->push_back((yyvsp[0].TypeWithAttrs)); CHECK_FOR_ERROR - ; - break;} -case 135: -#line 1425 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList)->push_back(yyvsp[0].TypeWithAttrs); + ;} + break; + + case 136: +#line 1425 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + ((yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList))->push_back((yyvsp[0].TypeWithAttrs)); CHECK_FOR_ERROR - ; - break;} -case 137: -#line 1433 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList; + ;} + break; + + case 138: +#line 1433 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); - yyval.TypeWithAttrsList->push_back(TWA); + (yyval.TypeWithAttrsList)->push_back(TWA); CHECK_FOR_ERROR - ; - break;} -case 138: -#line 1440 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrsList = new TypeWithAttrsList; + ;} + break; + + case 139: +#line 1440 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); - yyval.TypeWithAttrsList->push_back(TWA); + (yyval.TypeWithAttrsList)->push_back(TWA); CHECK_FOR_ERROR - ; - break;} -case 139: -#line 1447 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrsList = new TypeWithAttrsList(); + ;} + break; + + case 140: +#line 1447 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR - ; - break;} -case 140: -#line 1455 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeList = new std::list(); - yyval.TypeList->push_back(*yyvsp[0].TypeVal); - delete yyvsp[0].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 141: -#line 1461 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal); - delete yyvsp[0].TypeVal; + ;} + break; + + case 141: +#line 1455 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeList) = new std::list(); + (yyval.TypeList)->push_back(*(yyvsp[0].TypeVal)); + delete (yyvsp[0].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 142: +#line 1461 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(*(yyvsp[0].TypeVal)); + delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 142: -#line 1473 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Nonempty unsized arr + ;} + break; + + case 143: +#line 1473 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - const ArrayType *ATy = dyn_cast(yyvsp[-3].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); + const ArrayType *ATy = dyn_cast((yyvsp[-3].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*yyvsp[-3].TypeVal)->getDescription() + "'"); + (*(yyvsp[-3].TypeVal))->getDescription() + "'"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) + if (NumElements != -1 && NumElements != (int)(yyvsp[-1].ConstVector)->size()) GEN_ERROR("Type mismatch: constant sized array initialized with " + - utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + + utostr((yyvsp[-1].ConstVector)->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! - for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { - if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) + for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { + if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); + (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); } - yyval.ConstVal = ConstantArray::get(ATy, *yyvsp[-1].ConstVector); - delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; + (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[-1].ConstVector)); + delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR - ; - break;} -case 143: -#line 1501 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 144: +#line 1501 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*yyvsp[-2].TypeVal)->getDescription() + "'"); + (*(yyvsp[-2].TypeVal))->getDescription() + "'"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) GEN_ERROR("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +""); - yyval.ConstVal = ConstantArray::get(ATy, std::vector()); - delete yyvsp[-2].TypeVal; + (yyval.ConstVal) = ConstantArray::get(ATy, std::vector()); + delete (yyvsp[-2].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 144: -#line 1517 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 145: +#line 1517 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*yyvsp[-2].TypeVal)->getDescription() + "'"); + (*(yyvsp[-2].TypeVal))->getDescription() + "'"); int NumElements = ATy->getNumElements(); const Type *ETy = ATy->getElementType(); - char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); - if (NumElements != -1 && NumElements != (EndStr-yyvsp[0].StrVal)) + char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); + if (NumElements != -1 && NumElements != (EndStr-(yyvsp[0].StrVal))) GEN_ERROR("Can't build string constant of size " + - itostr((int)(EndStr-yyvsp[0].StrVal)) + + itostr((int)(EndStr-(yyvsp[0].StrVal))) + " when array has size " + itostr(NumElements) + ""); std::vector Vals; if (ETy == Type::Int8Ty) { - for (unsigned char *C = (unsigned char *)yyvsp[0].StrVal; + for (unsigned char *C = (unsigned char *)(yyvsp[0].StrVal); C != (unsigned char*)EndStr; ++C) Vals.push_back(ConstantInt::get(ETy, *C)); } else { - free(yyvsp[0].StrVal); + free((yyvsp[0].StrVal)); GEN_ERROR("Cannot build string arrays of non byte sized elements"); } - free(yyvsp[0].StrVal); - yyval.ConstVal = ConstantArray::get(ATy, Vals); - delete yyvsp[-2].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 145: -#line 1546 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Nonempty unsized arr + free((yyvsp[0].StrVal)); + (yyval.ConstVal) = ConstantArray::get(ATy, Vals); + delete (yyvsp[-2].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 146: +#line 1546 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - const VectorType *PTy = dyn_cast(yyvsp[-3].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); + const VectorType *PTy = dyn_cast((yyvsp[-3].TypeVal)->get()); if (PTy == 0) GEN_ERROR("Cannot make packed constant with type: '" + - (*yyvsp[-3].TypeVal)->getDescription() + "'"); + (*(yyvsp[-3].TypeVal))->getDescription() + "'"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) + if (NumElements != -1 && NumElements != (int)(yyvsp[-1].ConstVector)->size()) GEN_ERROR("Type mismatch: constant sized packed initialized with " + - utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + + utostr((yyvsp[-1].ConstVector)->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! - for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { - if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) + for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { + if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); + (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); } - yyval.ConstVal = ConstantVector::get(PTy, *yyvsp[-1].ConstVector); - delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; + (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[-1].ConstVector)); + delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR - ; - break;} -case 146: -#line 1574 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const StructType *STy = dyn_cast(yyvsp[-3].TypeVal->get()); + ;} + break; + + case 147: +#line 1574 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + const StructType *STy = dyn_cast((yyvsp[-3].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*yyvsp[-3].TypeVal)->getDescription() + "'"); + (*(yyvsp[-3].TypeVal))->getDescription() + "'"); - if (yyvsp[-1].ConstVector->size() != STy->getNumContainedTypes()) + if ((yyvsp[-1].ConstVector)->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = yyvsp[-1].ConstVector->size(); i != e; ++i) - if ((*yyvsp[-1].ConstVector)[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = (yyvsp[-1].ConstVector)->size(); i != e; ++i) + if ((*(yyvsp[-1].ConstVector))[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -3162,20 +3859,21 @@ if (STy->isPacked()) GEN_ERROR("Unpacked Initializer to vector type '" + STy->getDescription() + "'"); - yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-1].ConstVector); - delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; + (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[-1].ConstVector)); + delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR - ; - break;} -case 147: -#line 1599 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 148: +#line 1599 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - const StructType *STy = dyn_cast(yyvsp[-2].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + const StructType *STy = dyn_cast((yyvsp[-2].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*yyvsp[-2].TypeVal)->getDescription() + "'"); + (*(yyvsp[-2].TypeVal))->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type"); @@ -3184,25 +3882,26 @@ if (STy->isPacked()) GEN_ERROR("Unpacked Initializer to vector type '" + STy->getDescription() + "'"); - yyval.ConstVal = ConstantStruct::get(STy, std::vector()); - delete yyvsp[-2].TypeVal; + (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); + delete (yyvsp[-2].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 148: -#line 1618 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const StructType *STy = dyn_cast(yyvsp[-5].TypeVal->get()); + ;} + break; + + case 149: +#line 1618 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + const StructType *STy = dyn_cast((yyvsp[-5].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*yyvsp[-5].TypeVal)->getDescription() + "'"); + (*(yyvsp[-5].TypeVal))->getDescription() + "'"); - if (yyvsp[-2].ConstVector->size() != STy->getNumContainedTypes()) + if ((yyvsp[-2].ConstVector)->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = yyvsp[-2].ConstVector->size(); i != e; ++i) - if ((*yyvsp[-2].ConstVector)[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = (yyvsp[-2].ConstVector)->size(); i != e; ++i) + if ((*(yyvsp[-2].ConstVector))[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -3213,20 +3912,21 @@ GEN_ERROR("Vector initializer to non-vector type '" + STy->getDescription() + "'"); - yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-2].ConstVector); - delete yyvsp[-5].TypeVal; delete yyvsp[-2].ConstVector; + (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[-2].ConstVector)); + delete (yyvsp[-5].TypeVal); delete (yyvsp[-2].ConstVector); CHECK_FOR_ERROR - ; - break;} -case 149: -#line 1644 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 150: +#line 1644 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); - const StructType *STy = dyn_cast(yyvsp[-4].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); + const StructType *STy = dyn_cast((yyvsp[-4].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*yyvsp[-4].TypeVal)->getDescription() + "'"); + (*(yyvsp[-4].TypeVal))->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type"); @@ -3236,42 +3936,45 @@ GEN_ERROR("Vector initializer to non-vector type '" + STy->getDescription() + "'"); - yyval.ConstVal = ConstantStruct::get(STy, std::vector()); - delete yyvsp[-4].TypeVal; + (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); + delete (yyvsp[-4].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 150: -#line 1664 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 151: +#line 1664 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - const PointerType *PTy = dyn_cast(yyvsp[-1].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal)->get()); if (PTy == 0) GEN_ERROR("Cannot make null pointer constant with type: '" + - (*yyvsp[-1].TypeVal)->getDescription() + "'"); + (*(yyvsp[-1].TypeVal))->getDescription() + "'"); - yyval.ConstVal = ConstantPointerNull::get(PTy); - delete yyvsp[-1].TypeVal; + (yyval.ConstVal) = ConstantPointerNull::get(PTy); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 151: -#line 1676 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 152: +#line 1676 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - yyval.ConstVal = UndefValue::get(yyvsp[-1].TypeVal->get()); - delete yyvsp[-1].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 152: -#line 1683 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + (yyval.ConstVal) = UndefValue::get((yyvsp[-1].TypeVal)->get()); + delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 153: +#line 1683 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - const PointerType *Ty = dyn_cast(yyvsp[-1].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + const PointerType *Ty = dyn_cast((yyvsp[-1].TypeVal)->get()); if (Ty == 0) GEN_ERROR("Global const reference must be a pointer type"); @@ -3285,7 +3988,7 @@ Function *SavedCurFn = CurFun.CurrentFunction; CurFun.CurrentFunction = 0; - Value *V = getExistingVal(Ty, yyvsp[0].ValIDVal); + Value *V = getExistingVal(Ty, (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR CurFun.CurrentFunction = SavedCurFn; @@ -3300,16 +4003,16 @@ // First check to see if the forward references value is already created! PerModuleInfo::GlobalRefsType::iterator I = - CurModule.GlobalRefs.find(std::make_pair(PT, yyvsp[0].ValIDVal)); + CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[0].ValIDVal))); if (I != CurModule.GlobalRefs.end()) { V = I->second; // Placeholder already exists, use it... - yyvsp[0].ValIDVal.destroy(); + (yyvsp[0].ValIDVal).destroy(); } else { std::string Name; - if (yyvsp[0].ValIDVal.Type == ValID::GlobalName) - Name = yyvsp[0].ValIDVal.Name; - else if (yyvsp[0].ValIDVal.Type != ValID::GlobalID) + if ((yyvsp[0].ValIDVal).Type == ValID::GlobalName) + Name = (yyvsp[0].ValIDVal).Name; + else if ((yyvsp[0].ValIDVal).Type != ValID::GlobalID) GEN_ERROR("Invalid reference to global"); // Create the forward referenced global. @@ -3325,307 +4028,340 @@ } // Keep track of the fact that we have a forward ref to recycle it - CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, yyvsp[0].ValIDVal), GV)); + CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[0].ValIDVal)), GV)); V = GV; } } - yyval.ConstVal = cast(V); - delete yyvsp[-1].TypeVal; // Free the type handle + (yyval.ConstVal) = cast(V); + delete (yyvsp[-1].TypeVal); // Free the type handle CHECK_FOR_ERROR - ; - break;} -case 153: -#line 1749 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 154: +#line 1749 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - if (yyvsp[-1].TypeVal->get() != yyvsp[0].ConstVal->getType()) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + if ((yyvsp[-1].TypeVal)->get() != (yyvsp[0].ConstVal)->getType()) GEN_ERROR("Mismatched types for constant expression: " + - (*yyvsp[-1].TypeVal)->getDescription() + " and " + yyvsp[0].ConstVal->getType()->getDescription()); - yyval.ConstVal = yyvsp[0].ConstVal; - delete yyvsp[-1].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 154: -#line 1759 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (*(yyvsp[-1].TypeVal))->getDescription() + " and " + (yyvsp[0].ConstVal)->getType()->getDescription()); + (yyval.ConstVal) = (yyvsp[0].ConstVal); + delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 155: +#line 1759 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - const Type *Ty = yyvsp[-1].TypeVal->get(); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + const Type *Ty = (yyvsp[-1].TypeVal)->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) GEN_ERROR("Cannot create a null initialized value of this type"); - yyval.ConstVal = Constant::getNullValue(Ty); - delete yyvsp[-1].TypeVal; + (yyval.ConstVal) = Constant::getNullValue(Ty); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 155: -#line 1769 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // integral constants - if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].SInt64Val)) + ;} + break; + + case 156: +#line 1769 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // integral constants + if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); - yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].SInt64Val, true); + (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val), true); CHECK_FOR_ERROR - ; - break;} -case 156: -#line 1775 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // arbitrary precision integer constants - uint32_t BitWidth = cast(yyvsp[-1].PrimType)->getBitWidth(); - if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) { + ;} + break; + + case 157: +#line 1775 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // arbitrary precision integer constants + uint32_t BitWidth = cast((yyvsp[-1].PrimType))->getBitWidth(); + if ((yyvsp[0].APIntVal)->getBitWidth() > BitWidth) { GEN_ERROR("Constant value does not fit in type"); } - yyvsp[0].APIntVal->sextOrTrunc(BitWidth); - yyval.ConstVal = ConstantInt::get(*yyvsp[0].APIntVal); - delete yyvsp[0].APIntVal; - CHECK_FOR_ERROR - ; - break;} -case 157: -#line 1785 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // integral constants - if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].UInt64Val)) + (yyvsp[0].APIntVal)->sextOrTrunc(BitWidth); + (yyval.ConstVal) = ConstantInt::get(*(yyvsp[0].APIntVal)); + delete (yyvsp[0].APIntVal); + CHECK_FOR_ERROR + ;} + break; + + case 158: +#line 1785 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // integral constants + if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); - yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].UInt64Val, false); + (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val), false); CHECK_FOR_ERROR - ; - break;} -case 158: -#line 1791 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // arbitrary precision integer constants - uint32_t BitWidth = cast(yyvsp[-1].PrimType)->getBitWidth(); - if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) { + ;} + break; + + case 159: +#line 1791 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // arbitrary precision integer constants + uint32_t BitWidth = cast((yyvsp[-1].PrimType))->getBitWidth(); + if ((yyvsp[0].APIntVal)->getBitWidth() > BitWidth) { GEN_ERROR("Constant value does not fit in type"); } - yyvsp[0].APIntVal->zextOrTrunc(BitWidth); - yyval.ConstVal = ConstantInt::get(*yyvsp[0].APIntVal); - delete yyvsp[0].APIntVal; - CHECK_FOR_ERROR - ; - break;} -case 159: -#line 1801 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Boolean constants - assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?"); - yyval.ConstVal = ConstantInt::getTrue(); - CHECK_FOR_ERROR - ; - break;} -case 160: -#line 1806 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Boolean constants - assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?"); - yyval.ConstVal = ConstantInt::getFalse(); - CHECK_FOR_ERROR - ; - break;} -case 161: -#line 1811 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Float & Double constants - if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].FPVal)) + (yyvsp[0].APIntVal)->zextOrTrunc(BitWidth); + (yyval.ConstVal) = ConstantInt::get(*(yyvsp[0].APIntVal)); + delete (yyvsp[0].APIntVal); + CHECK_FOR_ERROR + ;} + break; + + case 160: +#line 1801 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // Boolean constants + assert(cast((yyvsp[-1].PrimType))->getBitWidth() == 1 && "Not Bool?"); + (yyval.ConstVal) = ConstantInt::getTrue(); + CHECK_FOR_ERROR + ;} + break; + + case 161: +#line 1806 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // Boolean constants + assert(cast((yyvsp[-1].PrimType))->getBitWidth() == 1 && "Not Bool?"); + (yyval.ConstVal) = ConstantInt::getFalse(); + CHECK_FOR_ERROR + ;} + break; + + case 162: +#line 1811 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { // Float & Double constants + if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].FPVal))) GEN_ERROR("Floating point constant invalid for type"); - yyval.ConstVal = ConstantFP::get(yyvsp[-1].PrimType, yyvsp[0].FPVal); + (yyval.ConstVal) = ConstantFP::get((yyvsp[-1].PrimType), (yyvsp[0].FPVal)); CHECK_FOR_ERROR - ; - break;} -case 162: -#line 1819 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 163: +#line 1819 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - Constant *Val = yyvsp[-3].ConstVal; - const Type *DestTy = yyvsp[-1].TypeVal->get(); - if (!CastInst::castIsValid(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); + Constant *Val = (yyvsp[-3].ConstVal); + const Type *DestTy = (yyvsp[-1].TypeVal)->get(); + if (!CastInst::castIsValid((yyvsp[-5].CastOpVal), (yyvsp[-3].ConstVal), DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'"); - yyval.ConstVal = ConstantExpr::getCast(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy); - delete yyvsp[-1].TypeVal; - ; - break;} -case 163: -#line 1831 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!isa(yyvsp[-2].ConstVal->getType())) + (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[-5].CastOpVal), (yyvsp[-3].ConstVal), DestTy); + delete (yyvsp[-1].TypeVal); + ;} + break; + + case 164: +#line 1831 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + if (!isa((yyvsp[-2].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); const Type *IdxTy = - GetElementPtrInst::getIndexedType(yyvsp[-2].ConstVal->getType(), &(*yyvsp[-1].ValueList)[0], yyvsp[-1].ValueList->size(), + GetElementPtrInst::getIndexedType((yyvsp[-2].ConstVal)->getType(), &(*(yyvsp[-1].ValueList))[0], (yyvsp[-1].ValueList)->size(), true); if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr"); SmallVector IdxVec; - for (unsigned i = 0, e = yyvsp[-1].ValueList->size(); i != e; ++i) - if (Constant *C = dyn_cast((*yyvsp[-1].ValueList)[i])) + for (unsigned i = 0, e = (yyvsp[-1].ValueList)->size(); i != e; ++i) + if (Constant *C = dyn_cast((*(yyvsp[-1].ValueList))[i])) IdxVec.push_back(C); else GEN_ERROR("Indices to constant getelementptr must be constants"); - delete yyvsp[-1].ValueList; + delete (yyvsp[-1].ValueList); - yyval.ConstVal = ConstantExpr::getGetElementPtr(yyvsp[-2].ConstVal, &IdxVec[0], IdxVec.size()); + (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[-2].ConstVal), &IdxVec[0], IdxVec.size()); CHECK_FOR_ERROR - ; - break;} -case 164: -#line 1853 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-5].ConstVal->getType() != Type::Int1Ty) + ;} + break; + + case 165: +#line 1853 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[-5].ConstVal)->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("Select operand types must match"); - yyval.ConstVal = ConstantExpr::getSelect(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 165: -#line 1861 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + ;} + break; + + case 166: +#line 1861 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("Binary operator types must match"); CHECK_FOR_ERROR; - yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ; - break;} -case 166: -#line 1867 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + ;} + break; + + case 167: +#line 1867 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("Logical operator types must match"); - if (!yyvsp[-3].ConstVal->getType()->isInteger()) { - if (Instruction::isShift(yyvsp[-5].BinaryOpVal) || !isa(yyvsp[-3].ConstVal->getType()) || - !cast(yyvsp[-3].ConstVal->getType())->getElementType()->isInteger()) + if (!(yyvsp[-3].ConstVal)->getType()->isInteger()) { + if (Instruction::isShift((yyvsp[-5].BinaryOpVal)) || !isa((yyvsp[-3].ConstVal)->getType()) || + !cast((yyvsp[-3].ConstVal)->getType())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } - yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 167: -#line 1878 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + ;} + break; + + case 168: +#line 1878 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("icmp operand types must match"); - yyval.ConstVal = ConstantExpr::getICmp(yyvsp[-5].IPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ; - break;} -case 168: -#line 1883 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[-5].IPredicate), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + ;} + break; + + case 169: +#line 1883 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("fcmp operand types must match"); - yyval.ConstVal = ConstantExpr::getFCmp(yyvsp[-5].FPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ; - break;} -case 169: -#line 1888 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!ExtractElementInst::isValidOperands(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) + (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[-5].FPredicate), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + ;} + break; + + case 170: +#line 1888 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid extractelement operands"); - yyval.ConstVal = ConstantExpr::getExtractElement(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 170: -#line 1894 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!InsertElementInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) + ;} + break; + + case 171: +#line 1894 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid insertelement operands"); - yyval.ConstVal = ConstantExpr::getInsertElement(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 171: -#line 1900 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!ShuffleVectorInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) + ;} + break; + + case 172: +#line 1900 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid shufflevector operands"); - yyval.ConstVal = ConstantExpr::getShuffleVector(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 172: -#line 1909 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal); + ;} + break; + + case 173: +#line 1909 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 173: -#line 1913 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ConstVector = new std::vector(); - yyval.ConstVector->push_back(yyvsp[0].ConstVal); + ;} + break; + + case 174: +#line 1913 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ConstVector) = new std::vector(); + (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 174: -#line 1921 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.BoolVal = false; ; - break;} -case 175: -#line 1921 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.BoolVal = true; ; - break;} -case 176: -#line 1924 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.BoolVal = true; ; - break;} -case 177: -#line 1924 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.BoolVal = false; ; - break;} -case 178: -#line 1935 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ModuleVal = ParserResult = CurModule.CurrentModule; + ;} + break; + + case 175: +#line 1921 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = false; ;} + break; + + case 176: +#line 1921 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = true; ;} + break; + + case 177: +#line 1924 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = true; ;} + break; + + case 178: +#line 1924 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = false; ;} + break; + + case 179: +#line 1935 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ; - break;} -case 179: -#line 1940 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ModuleVal = ParserResult = CurModule.CurrentModule; + ;} + break; + + case 180: +#line 1940 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ; - break;} -case 182: -#line 1953 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ CurFun.isDeclare = false; ; - break;} -case 183: -#line 1953 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 183: +#line 1953 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { CurFun.isDeclare = false; ;} + break; + + case 184: +#line 1953 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { CurFun.FunctionDone(); CHECK_FOR_ERROR - ; - break;} -case 184: -#line 1957 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ CurFun.isDeclare = true; ; - break;} -case 185: -#line 1957 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 185: +#line 1957 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { CurFun.isDeclare = true; ;} + break; + + case 186: +#line 1957 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { CHECK_FOR_ERROR - ; - break;} -case 186: -#line 1960 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 187: +#line 1960 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { CHECK_FOR_ERROR - ; - break;} -case 187: -#line 1963 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 188: +#line 1963 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: // @@ -3635,228 +4371,250 @@ // If types are not resolved eagerly, then the two types will not be // determined to be the same type! // - ResolveTypeTo(yyvsp[-2].StrVal, *yyvsp[0].TypeVal); + ResolveTypeTo((yyvsp[-2].StrVal), *(yyvsp[0].TypeVal)); - if (!setTypeName(*yyvsp[0].TypeVal, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { + if (!setTypeName(*(yyvsp[0].TypeVal), (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back(*yyvsp[0].TypeVal); + CurModule.Types.push_back(*(yyvsp[0].TypeVal)); } - delete yyvsp[0].TypeVal; + delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 188: -#line 1987 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - ResolveTypeTo(yyvsp[-2].StrVal, yyvsp[0].PrimType); + ;} + break; + + case 189: +#line 1987 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + ResolveTypeTo((yyvsp[-2].StrVal), (yyvsp[0].PrimType)); - if (!setTypeName(yyvsp[0].PrimType, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { + if (!setTypeName((yyvsp[0].PrimType), (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back(yyvsp[0].PrimType); + CurModule.Types.push_back((yyvsp[0].PrimType)); } CHECK_FOR_ERROR - ; - break;} -case 189: -#line 1998 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 190: +#line 1998 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { /* "Externally Visible" Linkage */ - if (yyvsp[0].ConstVal == 0) + if ((yyvsp[0].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable(yyvsp[-4].StrVal, GlobalValue::ExternalLinkage, - yyvsp[-3].Visibility, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal, yyvsp[-2].BoolVal); + CurGV = ParseGlobalVariable((yyvsp[-4].StrVal), GlobalValue::ExternalLinkage, + (yyvsp[-3].Visibility), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal), (yyvsp[-2].BoolVal)); CHECK_FOR_ERROR - ; - break;} -case 190: -#line 2005 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 191: +#line 2005 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { CurGV = 0; - ; - break;} -case 191: -#line 2008 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[0].ConstVal == 0) + ;} + break; + + case 192: +#line 2008 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[0].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable(yyvsp[-5].StrVal, yyvsp[-4].Linkage, yyvsp[-3].Visibility, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal, yyvsp[-2].BoolVal); + CurGV = ParseGlobalVariable((yyvsp[-5].StrVal), (yyvsp[-4].Linkage), (yyvsp[-3].Visibility), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal), (yyvsp[-2].BoolVal)); CHECK_FOR_ERROR - ; - break;} -case 192: -#line 2013 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 193: +#line 2013 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { CurGV = 0; - ; - break;} -case 193: -#line 2016 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 194: +#line 2016 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); - CurGV = ParseGlobalVariable(yyvsp[-5].StrVal, yyvsp[-4].Linkage, yyvsp[-3].Visibility, yyvsp[-1].BoolVal, *yyvsp[0].TypeVal, 0, yyvsp[-2].BoolVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); + CurGV = ParseGlobalVariable((yyvsp[-5].StrVal), (yyvsp[-4].Linkage), (yyvsp[-3].Visibility), (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0, (yyvsp[-2].BoolVal)); CHECK_FOR_ERROR - delete yyvsp[0].TypeVal; - ; - break;} -case 194: -#line 2022 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[0].TypeVal); + ;} + break; + + case 195: +#line 2022 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { CurGV = 0; CHECK_FOR_ERROR - ; - break;} -case 195: -#line 2026 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CHECK_FOR_ERROR - ; - break;} -case 196: -#line 2029 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 196: +#line 2026 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { CHECK_FOR_ERROR - ; - break;} -case 197: -#line 2035 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 197: +#line 2029 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + CHECK_FOR_ERROR + ;} + break; + + case 198: +#line 2035 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); - char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); - std::string NewAsm(yyvsp[0].StrVal, EndStr); - free(yyvsp[0].StrVal); + char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); + std::string NewAsm((yyvsp[0].StrVal), EndStr); + free((yyvsp[0].StrVal)); if (AsmSoFar.empty()) CurModule.CurrentModule->setModuleInlineAsm(NewAsm); else CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+NewAsm); CHECK_FOR_ERROR -; - break;} -case 198: -#line 2048 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->setTargetTriple(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); - ; - break;} -case 199: -#line 2052 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->setDataLayout(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); - ; - break;} -case 201: -#line 2059 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); +;} + break; + + case 199: +#line 2048 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); + ;} + break; + + case 200: +#line 2052 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); + ;} + break; + + case 202: +#line 2059 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); CHECK_FOR_ERROR - ; - break;} -case 202: -#line 2064 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); + ;} + break; + + case 203: +#line 2064 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); CHECK_FOR_ERROR - ; - break;} -case 203: -#line 2069 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 204: +#line 2069 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { CHECK_FOR_ERROR - ; - break;} -case 204: -#line 2078 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 205: +#line 2078 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - if (*yyvsp[-2].TypeVal == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + if (*(yyvsp[-2].TypeVal) == Type::VoidTy) GEN_ERROR("void typed arguments are invalid"); - ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal; - yyval.ArgList = yyvsp[-4].ArgList; - yyvsp[-4].ArgList->push_back(E); - CHECK_FOR_ERROR - ; - break;} -case 205: -#line 2088 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ArgListEntry E; E.Attrs = (yyvsp[-1].ParamAttrs); E.Ty = (yyvsp[-2].TypeVal); E.Name = (yyvsp[0].StrVal); + (yyval.ArgList) = (yyvsp[-4].ArgList); + (yyvsp[-4].ArgList)->push_back(E); + CHECK_FOR_ERROR + ;} + break; + + case 206: +#line 2088 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - if (*yyvsp[-2].TypeVal == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + if (*(yyvsp[-2].TypeVal) == Type::VoidTy) GEN_ERROR("void typed arguments are invalid"); - ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal; - yyval.ArgList = new ArgListType; - yyval.ArgList->push_back(E); - CHECK_FOR_ERROR - ; - break;} -case 206: -#line 2099 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = yyvsp[0].ArgList; + ArgListEntry E; E.Attrs = (yyvsp[-1].ParamAttrs); E.Ty = (yyvsp[-2].TypeVal); E.Name = (yyvsp[0].StrVal); + (yyval.ArgList) = new ArgListType; + (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR - ; - break;} -case 207: -#line 2103 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = yyvsp[-2].ArgList; + ;} + break; + + case 207: +#line 2099 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = (yyvsp[0].ArgList); + CHECK_FOR_ERROR + ;} + break; + + case 208: +#line 2103 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = (yyvsp[-2].ArgList); struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = ParamAttr::None; - yyval.ArgList->push_back(E); + (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR - ; - break;} -case 208: -#line 2112 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = new ArgListType; + ;} + break; + + case 209: +#line 2112 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = new ArgListType; struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = ParamAttr::None; - yyval.ArgList->push_back(E); + (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR - ; - break;} -case 209: -#line 2121 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = 0; + ;} + break; + + case 210: +#line 2121 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = 0; CHECK_FOR_ERROR - ; - break;} -case 210: -#line 2127 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - UnEscapeLexed(yyvsp[-