[llvm-commits] CVS: llvm/lib/Target/IA64/IA64InstrInfo.td

2005-11-03 Thread Duraid Madina


Changes in directory llvm/lib/Target/IA64:

IA64InstrInfo.td updated: 1.26 -> 1.27
---
Log message:

add pattern to load constant 0 into a predicate reg



---
Diffs of the changes:  (+2 -0)

 IA64InstrInfo.td |2 ++
 1 files changed, 2 insertions(+)


Index: llvm/lib/Target/IA64/IA64InstrInfo.td
diff -u llvm/lib/Target/IA64/IA64InstrInfo.td:1.26 
llvm/lib/Target/IA64/IA64InstrInfo.td:1.27
--- llvm/lib/Target/IA64/IA64InstrInfo.td:1.26  Wed Nov  2 23:45:34 2005
+++ llvm/lib/Target/IA64/IA64InstrInfo.td   Thu Nov  3 04:09:32 2005
@@ -361,6 +361,8 @@
 def : Pat<(i64 immSExt14:$imm), (ADDS r0, immSExt14:$imm)>;
 def : Pat<(i64 imm64:$imm), (MOVL imm64:$imm)>;
 def : Pat<(i1 -1), (CMPEQ r0, r0)>; // TODO: this should just be a ref to p0
+def : Pat<(i1  0), (CMPNE r0, r0)>; // TODO: any instruction actually *using*
+//   this predicate should be killed!
 
 // TODO: support postincrement (reg, imm9) loads+stores - this needs more
 // tablegen support



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [release_16] CVS: llvm/autoconf/configure.ac

2005-11-03 Thread John Criswell


Changes in directory llvm/autoconf:

configure.ac updated: 1.195 -> 1.195.4.1
---
Log message:

Updated the version number.
Get the UIUC copyright to actually print.



---
Diffs of the changes:  (+2 -2)

 configure.ac |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/autoconf/configure.ac
diff -u llvm/autoconf/configure.ac:1.195 llvm/autoconf/configure.ac:1.195.4.1
--- llvm/autoconf/configure.ac:1.195Wed Aug 24 05:43:10 2005
+++ llvm/autoconf/configure.ac  Thu Nov  3 09:25:04 2005
@@ -31,12 +31,12 @@
 
dnl===---===
 dnl Initialize autoconf and define the package name, version number and
 dnl email address for reporting bugs.
-AC_INIT([[llvm]],[[1.6cvs]],[EMAIL PROTECTED])
+AC_INIT([[llvm]],[[1.6]],[EMAIL PROTECTED])
 
 dnl Provide a copyright substitution and ensure the copyright notice is 
included
 dnl in the output of --version option of the generated configure script.
 AC_SUBST(LLVM_COPYRIGHT,["Copyright (c) 2003-2005 University of Illinois at 
Urbana-Champaign."])
-AC_COPYRIGHT($LLVM_COPYRIGHT)
+AC_COPYRIGHT([Copyright (c) 2003-2005 University of Illinois at 
Urbana-Champaign.])
 
 dnl Indicate that we require autoconf 2.59 or later. Ths is needed because we
 dnl use some autoconf macros only available in 2.59.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [release_16] CVS: llvm/configure

2005-11-03 Thread John Criswell


Changes in directory llvm:

configure updated: 1.198 -> 1.198.4.1
---
Log message:

Updated the version number.
Get the UIUC copyright to actually print.


---
Diffs of the changes:  (+11 -11)

 configure |   22 +++---
 1 files changed, 11 insertions(+), 11 deletions(-)


Index: llvm/configure
diff -u llvm/configure:1.198 llvm/configure:1.198.4.1
--- llvm/configure:1.198Wed Aug 24 05:07:21 2005
+++ llvm/configure  Thu Nov  3 09:24:58 2005
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for llvm 1.6cvs.
+# Generated by GNU Autoconf 2.59 for llvm 1.6.
 #
 # Report bugs to <[EMAIL PROTECTED]>.
 #
@@ -8,7 +8,7 @@
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 #
-# $LLVM_COPYRIGHT
+# Copyright (c) 2003-2005 University of Illinois at Urbana-Champaign.
 ## - ##
 ## M4sh Initialization.  ##
 ## - ##
@@ -425,8 +425,8 @@
 # Identity of this package.
 PACKAGE_NAME='llvm'
 PACKAGE_TARNAME='-llvm-'
-PACKAGE_VERSION='1.6cvs'
-PACKAGE_STRING='llvm 1.6cvs'
+PACKAGE_VERSION='1.6'
+PACKAGE_STRING='llvm 1.6'
 PACKAGE_BUGREPORT='[EMAIL PROTECTED]'
 
 ac_unique_file="lib/VMCore/Module.cpp"
@@ -964,7 +964,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures llvm 1.6cvs to adapt to many kinds of systems.
+\`configure' configures llvm 1.6 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1026,7 +1026,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of llvm 1.6cvs:";;
+ short | recursive ) echo "Configuration of llvm 1.6:";;
esac
   cat <<\_ACEOF
 
@@ -1173,14 +1173,14 @@
 test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
-llvm configure 1.6cvs
+llvm configure 1.6
 generated by GNU Autoconf 2.59
 
 Copyright (C) 2003 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 
-$LLVM_COPYRIGHT
+Copyright (c) 2003-2005 University of Illinois at Urbana-Champaign.
 _ACEOF
   exit 0
 fi
@@ -1189,7 +1189,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by llvm $as_me 1.6cvs, which was
+It was created by llvm $as_me 1.6, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
@@ -31044,7 +31044,7 @@
 } >&5
 cat >&5 <<_CSEOF
 
-This file was extended by llvm $as_me 1.6cvs, which was
+This file was extended by llvm $as_me 1.6, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -31107,7 +31107,7 @@
 
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-llvm config.status 1.6cvs
+llvm config.status 1.6
 configured by $0, generated by GNU Autoconf 2.59,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/&/g'`\\"
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [release_16] CVS: llvm/tools/gccld/GenerateCode.cpp

2005-11-03 Thread John Criswell


Changes in directory llvm/tools/gccld:

GenerateCode.cpp updated: 1.54 -> 1.54.4.1
---
Log message:

Merge in hack from Chris that discards libg.


---
Diffs of the changes:  (+4 -1)

 GenerateCode.cpp |5 -
 1 files changed, 4 insertions(+), 1 deletion(-)


Index: llvm/tools/gccld/GenerateCode.cpp
diff -u llvm/tools/gccld/GenerateCode.cpp:1.54 
llvm/tools/gccld/GenerateCode.cpp:1.54.4.1
--- llvm/tools/gccld/GenerateCode.cpp:1.54  Tue Oct 18 01:29:43 2005
+++ llvm/tools/gccld/GenerateCode.cpp   Thu Nov  3 09:42:27 2005
@@ -423,7 +423,10 @@
 
   // Add in the libraries to link.
   for (unsigned index = 0; index < Libraries.size(); index++)
-if (Libraries[index] != "crtend") {
+// HACK: If this is libg, discard it.  This gets added by the compiler
+// driver when doing: 'llvm-gcc main.c -Wl,-native -o a.out -g'. Note that
+// this should really be fixed by changing the llvm-gcc compiler driver.
+if (Libraries[index] != "crtend" && Libraries[index] != "g") {
   std::string Tmp = "-l"+Libraries[index];
   StringsToDelete.push_back(strdup(Tmp.c_str()));
   args.push_back(StringsToDelete.back());



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [release_16] CVS: llvm/docs/GettingStarted.html

2005-11-03 Thread John Criswell


Changes in directory llvm/docs:

GettingStarted.html updated: 1.120 -> 1.120.4.1
---
Log message:

Include the CVS tag for the 1.6 release.


---
Diffs of the changes:  (+2 -1)

 GettingStarted.html |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/docs/GettingStarted.html
diff -u llvm/docs/GettingStarted.html:1.120 
llvm/docs/GettingStarted.html:1.120.4.1
--- llvm/docs/GettingStarted.html:1.120 Mon Sep  5 23:07:15 2005
+++ llvm/docs/GettingStarted.html   Thu Nov  3 12:26:14 2005
@@ -661,6 +661,7 @@
 labels:
 
 
+Release 1.6: RELEASE_16
 Release 1.5: RELEASE_15
 Release 1.4: RELEASE_14
 Release 1.3: RELEASE_13
@@ -1540,7 +1541,7 @@
   mailto:[EMAIL PROTECTED]">Chris Lattner
   http://llvm.x10sys.com/rspencer/";>Reid Spencer
   http://llvm.cs.uiuc.edu";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2005/09/06 04:07:15 $
+  Last modified: $Date: 2005/11/03 18:26:14 $
 
 
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/docs/GettingStarted.html

2005-11-03 Thread Chris Lattner


Changes in directory llvm/docs:

GettingStarted.html updated: 1.120 -> 1.121
---
Log message:

Per bug 655: http://llvm.cs.uiuc.edu/PR655 , give people more options in case 
1.35 doesn't build on their
system.


---
Diffs of the changes:  (+2 -2)

 GettingStarted.html |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/docs/GettingStarted.html
diff -u llvm/docs/GettingStarted.html:1.120 llvm/docs/GettingStarted.html:1.121
--- llvm/docs/GettingStarted.html:1.120 Mon Sep  5 23:07:15 2005
+++ llvm/docs/GettingStarted.html   Thu Nov  3 12:28:22 2005
@@ -362,7 +362,7 @@
 
 
   http://www.gnu.org/software/bison/bison.html";>Bison
-  1.35
+  1.28, 1.35, or 2.0
   YACC compiler
 
 
@@ -1540,7 +1540,7 @@
   mailto:[EMAIL PROTECTED]">Chris Lattner
   http://llvm.x10sys.com/rspencer/";>Reid Spencer
   http://llvm.cs.uiuc.edu";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2005/09/06 04:07:15 $
+  Last modified: $Date: 2005/11/03 18:28:22 $
 
 
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/docs/GettingStarted.html

2005-11-03 Thread Chris Lattner


Changes in directory llvm/docs:

GettingStarted.html updated: 1.121 -> 1.122
---
Log message:

Add more bison versions, thanks to Vladimir


---
Diffs of the changes:  (+2 -2)

 GettingStarted.html |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/docs/GettingStarted.html
diff -u llvm/docs/GettingStarted.html:1.121 llvm/docs/GettingStarted.html:1.122
--- llvm/docs/GettingStarted.html:1.121 Thu Nov  3 12:28:22 2005
+++ llvm/docs/GettingStarted.html   Thu Nov  3 12:32:06 2005
@@ -362,7 +362,7 @@
 
 
   http://www.gnu.org/software/bison/bison.html";>Bison
-  1.28, 1.35, or 2.0
+  1.28, 1.35, 1.75, or 2.0 (not 1.85)
   YACC compiler
 
 
@@ -1540,7 +1540,7 @@
   mailto:[EMAIL PROTECTED]">Chris Lattner
   http://llvm.x10sys.com/rspencer/";>Reid Spencer
   http://llvm.cs.uiuc.edu";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2005/11/03 18:28:22 $
+  Last modified: $Date: 2005/11/03 18:32:06 $
 
 
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-test/Makefile.programs

2005-11-03 Thread Duraid Madina


Changes in directory llvm-test:

Makefile.programs updated: 1.176 -> 1.177
---
Log message:

fun with scheduling on ia64



---
Diffs of the changes:  (+1 -1)

 Makefile.programs |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm-test/Makefile.programs
diff -u llvm-test/Makefile.programs:1.176 llvm-test/Makefile.programs:1.177
--- llvm-test/Makefile.programs:1.176   Mon Oct 31 15:18:30 2005
+++ llvm-test/Makefile.programs Thu Nov  3 16:00:16 2005
@@ -194,7 +194,7 @@
 #-enable-alpha-intfpdiv -enable-alpha-FTOI
 endif
 ifeq ($(ARCH),IA64)
-LLCBETAOPTION := -enable-ia64-dag-isel
+LLCBETAOPTION := -enable-ia64-dag-isel -sched=simple
 endif
 ifeq ($(ARCH),x86)
 LLCBETAOPTION := -enable-x86-fastcc



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/docs/ReleaseNotes.html

2005-11-03 Thread Chris Lattner


Changes in directory llvm/docs:

ReleaseNotes.html updated: 1.340 -> 1.341
---
Log message:

Fix mac os spelling


---
Diffs of the changes:  (+5 -5)

 ReleaseNotes.html |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)


Index: llvm/docs/ReleaseNotes.html
diff -u llvm/docs/ReleaseNotes.html:1.340 llvm/docs/ReleaseNotes.html:1.341
--- llvm/docs/ReleaseNotes.html:1.340   Mon Oct 31 13:07:29 2005
+++ llvm/docs/ReleaseNotes.html Thu Nov  3 16:33:48 2005
@@ -64,7 +64,7 @@
 release incorporates a large number of enhancements and additions (primarily in
 the code generator), which combine to improve the quality of the code generated
 by LLVM by up to 30% in some cases.  This release is also the first release to
-have first-class support for Mac OS/X: all of the major bugs have been shaken
+have first-class support for Mac OS X: all of the major bugs have been shaken
 out and it is now as well supported as Linux on X86.
 
 
@@ -172,7 +172,7 @@
 giving up completely.  In addition, http://llvm.org/PR576";>the JIT
 debugging mode of bugpoint is much faster.
   LLVM now includes Xcode project files in the llvm/Xcode directory.
-  LLVM now supports Mac OS/X on Intel.
+  LLVM now supports Mac OS X on Intel.
   LLVM now builds cleanly with GCC 4.1.
 
 
@@ -193,7 +193,7 @@
   we find that it often speeds up programs from 10-40% depending on the
   program.
   The code produced when exception handling is enabled is far more
-  efficient in some cases, particularly on Mac OS/X.
+  efficient in some cases, particularly on Mac OS X.
 
 
 
@@ -229,7 +229,7 @@
 
 
   A vast number of bugs have been fixed in the PowerPC backend and in
-  llvm-gcc when configured for Mac OS/X (particularly relating to ABI
+  llvm-gcc when configured for Mac OS X (particularly relating to ABI
   issues).  For example:
   http://llvm.org/PR603";>PR449,
   http://llvm.org/PR594";>PR594, 
@@ -715,7 +715,7 @@
   src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!" />
 
   http://llvm.org/";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2005/10/31 19:07:29 $
+  Last modified: $Date: 2005/11/03 22:33:48 $
 
 
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-www/testresults/index.html

2005-11-03 Thread Chris Lattner


Changes in directory llvm-www/testresults:

index.html updated: 1.37 -> 1.38
---
Log message:

persephone got upgraded to tiger


---
Diffs of the changes:  (+1 -1)

 index.html |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm-www/testresults/index.html
diff -u llvm-www/testresults/index.html:1.37 
llvm-www/testresults/index.html:1.38
--- llvm-www/testresults/index.html:1.37Sat Oct 29 11:32:45 2005
+++ llvm-www/testresults/index.html Thu Nov  3 16:34:38 2005
@@ -41,7 +41,7 @@
 PowerPC
 
 
-http://persephone.cs.uiuc.edu/~oscar/nightlytest/";>Mac OS X 10.3
+http://persephone.cs.uiuc.edu/~oscar/nightlytest/";>Mac OS X 10.4
 "Panther" on PowerPC G5 (dual 1.8Ghz CPU) -- debug build
 
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Target/TargetInstrItineraries.h

2005-11-03 Thread Jim Laskey


Changes in directory llvm/include/llvm/Target:

TargetInstrItineraries.h updated: 1.3 -> 1.4
---
Log message:

1. Remove ranges from itinerary data.

2. Tidy up the subtarget emittined code.



---
Diffs of the changes:  (+7 -20)

 TargetInstrItineraries.h |   27 +++
 1 files changed, 7 insertions(+), 20 deletions(-)


Index: llvm/include/llvm/Target/TargetInstrItineraries.h
diff -u llvm/include/llvm/Target/TargetInstrItineraries.h:1.3 
llvm/include/llvm/Target/TargetInstrItineraries.h:1.4
--- llvm/include/llvm/Target/TargetInstrItineraries.h:1.3   Tue Nov  1 
22:03:16 2005
+++ llvm/include/llvm/Target/TargetInstrItineraries.h   Thu Nov  3 16:47:42 2005
@@ -16,7 +16,6 @@
 #ifndef LLVM_TARGET_TARGETINSTRITINERARIES_H
 #define LLVM_TARGET_TARGETINSTRITINERARIES_H
 
-#include "llvm/Support/Debug.h"
 #include 
 
 namespace llvm {
@@ -49,36 +48,26 @@
 // Instruction itinerary Data - Itinerary data supplied by a subtarget to be
 // used by a target.
 //
-class InstrItineraryData {
+struct InstrItineraryData {
   InstrStage *Stages; // Array of stages selected
-  unsignedNStages;// Number of stages
   InstrItinerary *Itineratries;   // Array of itineraries selected
-  unsignedNItineraries;   // Number of itineraries (actually classes)
 
-public:
-
-  //
-  // Ctors.
-  //
-  InstrItineraryData()
-  : Stages(NULL), NStages(0), Itineratries(NULL), NItineraries(0)
-  {}
-  InstrItineraryData(InstrStage *S, unsigned NS, InstrItinerary *I, unsigned 
NI)
-  : Stages(S), NStages(NS), Itineratries(I), NItineraries(NI)
-  {}
+//
+// Ctors.
+//
+  InstrItineraryData() : Stages(NULL), Itineratries(NULL) {}
+  InstrItineraryData(InstrStage *S, InstrItinerary *I) : Stages(S), 
Itineratries(I) {}
   
   //
   // isEmpty - Returns true if there are no itineraries.
   //
-  inline bool isEmpty() const { return NItineraries == 0; }
+  inline bool isEmpty() const { return Itineratries == NULL; }
   
   //
   // begin - Return the first stage of the itinerary.
   // 
   inline InstrStage *begin(unsigned ItinClassIndx) const {
-assert(ItinClassIndx < NItineraries && "Itinerary index out of range");
 unsigned StageIdx = Itineratries[ItinClassIndx].First;
-assert(StageIdx < NStages && "Stage index out of range");
 return Stages + StageIdx;
   }
 
@@ -86,9 +75,7 @@
   // end - Return the last+1 stage of the itinerary.
   // 
   inline InstrStage *end(unsigned ItinClassIndx) const {
-assert(ItinClassIndx < NItineraries && "Itinerary index out of range");
 unsigned StageIdx = Itineratries[ItinClassIndx].Last;
-assert(StageIdx < NStages && "Stage index out of range");
 return Stages + StageIdx;
   }
 };



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/utils/TableGen/SubtargetEmitter.cpp

2005-11-03 Thread Jim Laskey


Changes in directory llvm/utils/TableGen:

SubtargetEmitter.cpp updated: 1.13 -> 1.14
---
Log message:

1. Remove ranges from itinerary data.

2. Tidy up the subtarget emittined code.



---
Diffs of the changes:  (+11 -9)

 SubtargetEmitter.cpp |   20 +++-
 1 files changed, 11 insertions(+), 9 deletions(-)


Index: llvm/utils/TableGen/SubtargetEmitter.cpp
diff -u llvm/utils/TableGen/SubtargetEmitter.cpp:1.13 
llvm/utils/TableGen/SubtargetEmitter.cpp:1.14
--- llvm/utils/TableGen/SubtargetEmitter.cpp:1.13   Tue Nov  1 14:07:00 2005
+++ llvm/utils/TableGen/SubtargetEmitter.cppThu Nov  3 16:47:42 2005
@@ -223,7 +223,7 @@
   
 // Form string as ,{ cycles, u1 | u2 | ... | un }
 int Cycles = Stage->getValueAsInt("Cycles");
-ItinString += "  ,{ " + itostr(Cycles) + ", ";
+ItinString += "  { " + itostr(Cycles) + ", ";
 
 // Get unit list
 std::vector UnitList = Stage->getValueAsListOfDefs("Units");
@@ -260,7 +260,7 @@
 
   // Begin stages table
   OS << "static llvm::InstrStage Stages[] = {\n"
-"  { 0, 0 } // No itinerary\n";
+"  { 0, 0 }, // No itinerary\n";
 
   unsigned ItinEnum = 1;
   std::map ItinMap;
@@ -296,8 +296,9 @@
   
   // If new itinerary
   if (Find == 0) {
-// Emit as ,{ cycles, u1 | u2 | ... | un } // index
-OS << ItinString << " // " << ItinEnum << "\n";
+// Emit as { cycles, u1 | u2 | ... | un }, // index
+OS << ItinString << ", // " << ItinEnum << "\n";
+// Record Itin class number
 ItinMap[ItinString] = Find = ItinEnum++;
   }
   
@@ -316,6 +317,8 @@
 ProcList.push_back(ItinList);
   }
   
+  // Closing stage
+  OS << "  { 0, 0 } // End itinerary\n";
   // End stages table
   OS << "};\n";
   
@@ -390,7 +393,7 @@
   // Begin processor table
   OS << "\n";
   OS << "// Sorted (by key) array of itineraries for CPU subtype.\n"
- << "static const llvm::SubtargetInfoKV SubTypeInfoKV[] = {\n";
+ << "static const llvm::SubtargetInfoKV ProcItinKV[] = {\n";
  
   // For each processor
   for (unsigned i = 0, N = ProcessorList.size(); i < N;) {
@@ -418,7 +421,7 @@
 
   // Emit size of table
   OS<<"\nenum {\n";
-  OS<<"  SubTypeInfoKVSize = sizeof(SubTypeInfoKV)/"
+  OS<<"  ProcItinKVSize = sizeof(ProcItinKV)/"
 "sizeof(llvm::SubtargetInfoKV)\n";
   OS<<"};\n";
 }
@@ -479,9 +482,8 @@
   if (HasItineraries) {
 OS << "\n"
<< "  InstrItinerary *Itinerary = (InstrItinerary *)"
-"Features.getInfo(SubTypeInfoKV, SubTypeInfoKVSize);\n"
-  "  InstrItins = InstrItineraryData(Stages, StagesSize, "
- "Itinerary, ItinClassesSize);\n";
+"Features.getInfo(ProcItinKV, ProcItinKVSize);\n"
+  "  InstrItins = InstrItineraryData(Stages, Itinerary);\n";
   }
   
   OS << "}\n";



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-www/testresults/index.html

2005-11-03 Thread Chris Lattner


Changes in directory llvm-www/testresults:

index.html updated: 1.38 -> 1.39
---
Log message:

update codename


---
Diffs of the changes:  (+1 -1)

 index.html |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm-www/testresults/index.html
diff -u llvm-www/testresults/index.html:1.38 
llvm-www/testresults/index.html:1.39
--- llvm-www/testresults/index.html:1.38Thu Nov  3 16:34:38 2005
+++ llvm-www/testresults/index.html Thu Nov  3 18:28:36 2005
@@ -42,7 +42,7 @@
 
 
 http://persephone.cs.uiuc.edu/~oscar/nightlytest/";>Mac OS X 10.4
-"Panther" on PowerPC G5 (dual 1.8Ghz CPU) -- debug build
+"Tiger" on PowerPC G5 (dual 1.8Ghz CPU) -- debug build
 
 
 Sparc V9



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/IA64/IA64InstrInfo.td

2005-11-03 Thread Duraid Madina


Changes in directory llvm/lib/Target/IA64:

IA64InstrInfo.td updated: 1.27 -> 1.28
---
Log message:

fun with predicates! (add TRUNC i64->i1, AND i1 i1, fix XOR i1 i1)



---
Diffs of the changes:  (+97 -41)

 IA64InstrInfo.td |  137 ++-
 1 files changed, 97 insertions(+), 40 deletions(-)


Index: llvm/lib/Target/IA64/IA64InstrInfo.td
diff -u llvm/lib/Target/IA64/IA64InstrInfo.td:1.27 
llvm/lib/Target/IA64/IA64InstrInfo.td:1.28
--- llvm/lib/Target/IA64/IA64InstrInfo.td:1.27  Thu Nov  3 04:09:32 2005
+++ llvm/lib/Target/IA64/IA64InstrInfo.td   Thu Nov  3 18:57:56 2005
@@ -105,6 +105,10 @@
"adds $dst = $imm, $src1;;",
   [(set GR:$dst, (add GR:$src1, immSExt14:$imm))]>;
  
+def PADDS: AForm_DAG<0x03, 0x0b, (ops GR:$dst, GR:$src1, s14imm:$imm, PR:$qp),
+   "($qp) adds $dst = $imm, $src1;;",
+  []>;
+
 def MOVL : AForm_DAG<0x03, 0x0b, (ops GR:$dst, s64imm:$imm),
"movl $dst = $imm;;",
   [(set GR:$dst, imm64:$imm)]>;
@@ -225,47 +229,6 @@
 def pOR   : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2, PR:$qp),
   "($qp) or $dst = $src1, $src2;;">;
 
-def PCMPEQUNCR0R0 : AForm<0x03, 0x0b, (ops PR:$dst, PR:$qp),
-"($qp) cmp.eq.unc $dst, p0 = r0, r0;;">;
-
-let isTwoAddress=1 in
-def TPCMPEQR0R0 : AForm<0x03, 0x0b, (ops PR:$dst, PR:$bogus, PR:$qp),
-  "($qp) cmp.eq $dst, p0 = r0, r0;;">;
-  
-/* our pseudocode for OR on predicates is:
-pC = pA OR pB
--
-(pA) cmp.eq.unc pC,p0 = r0,r0  // pC = pA
- ;;
-(pB) cmp.eq pC,p0 = r0,r0 // if (pB) pC = 1 */
-
-def bOR   : Pat<(or PR:$src1, PR:$src2),
-  (TPCMPEQR0R0 (PCMPEQUNCR0R0 PR:$src1), PR:$src2)>;
-
-// FIXME: these are bogus
-def bXOR  : Pat<(xor PR:$src1, PR:$src2),
-  (PCMPEQUNCR0R0 PR:$src1)>;
-
-def XOR   : AForm_DAG<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2),
-  "xor $dst = $src1, $src2;;",
- [(set GR:$dst, (xor GR:$src1, GR:$src2))]>;
-
-def SHLADD: AForm_DAG<0x03, 0x0b, (ops GR:$dst,GR:$src1,s64imm:$imm,GR:$src2),
-  "shladd $dst = $src1, $imm, $src2;;",
-  [(set GR:$dst, (add GR:$src2, (shl GR:$src1, isSHLADDimm:$imm)))]>;
-
-def SHL   : AForm_DAG<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2),
-  "shl $dst = $src1, $src2;;",
- [(set GR:$dst, (shl GR:$src1, GR:$src2))]>;
-
-def SHRU  : AForm_DAG<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2),
-  "shr.u $dst = $src1, $src2;;",
- [(set GR:$dst, (srl GR:$src1, GR:$src2))]>;
-
-def SHRS  : AForm_DAG<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2),
-  "shr $dst = $src1, $src2;;",
- [(set GR:$dst, (sra GR:$src1, GR:$src2))]>;
-
 // the following are all a bit unfortunate: we throw away the complement
 // of the compare!
 def CMPEQ : AForm_DAG<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2),
@@ -331,6 +294,99 @@
   "fcmp.geu $dst, p0 = $src1, $src2;;",
  [(set PR:$dst, (setuge FP:$src1, FP:$src2))]>;
 
+def PCMPEQUNCR0R0 : AForm<0x03, 0x0b, (ops PR:$dst, PR:$qp),
+"($qp) cmp.eq.unc $dst, p0 = r0, r0;;">;
+
+def : Pat<(trunc GR:$src),  // truncate i64 to i1
+  (CMPNE GR:$src, r0)>; // $src!=0? If so, PR:$dst=true
+ 
+let isTwoAddress=1 in {
+  def TPCMPEQR0R0 : AForm<0x03, 0x0b, (ops PR:$dst, PR:$bogus, PR:$qp),
+"($qp) cmp.eq $dst, p0 = r0, r0;;">;
+  def TPCMPNER0R0 : AForm<0x03, 0x0b, (ops PR:$dst, PR:$bogus, PR:$qp),
+"($qp) cmp.ne $dst, p0 = r0, r0;;">;
+}
+
+/* our pseudocode for OR on predicates is:
+pC = pA OR pB
+-
+(pA) cmp.eq.unc pC,p0 = r0,r0  // pC = pA
+ ;;
+(pB) cmp.eq pC,p0 = r0,r0 // if (pB) pC = 1 */
+
+def bOR   : Pat<(or PR:$src1, PR:$src2),
+  (TPCMPEQR0R0 (PCMPEQUNCR0R0 PR:$src1), PR:$src2)>;
+
+/* our pseudocode for AND on predicates is:
+ *
+(pA) cmp.eq.unc pC,p0 = r0,r0   // pC = pA
+ cmp.eq pTemp,p0 = r0,r0// pTemp = NOT pB
+ ;;
+(pB) cmp.ne pTemp,p0 = r0,r0
+ ;;
+(pTemp)cmp.ne pC,p0 = r0,r0// if (NOT pB) pC = 0  */
+
+def bAND  : Pat<(and PR:$src1, PR:$src2),
+  ( TPCMPNER0R0 (PCMPEQUNCR0R0 PR:$src1),
+   (TPCMPNER0R0 (CMPEQ r0, r0), PR:$src2) )>;
+
+/* one possible routine for XOR on predicates is:
+
+  // Compute px = py ^ pz
+// using sum of products: px = (py & !pz) | (pz & !py)
+// Uses 5 instructions in 3 cycles.
+// cycle 1
+(pz)cmp.eq.unc  px = r0, r0 // px = pz
+(py)cmp.eq.unc  pt = r0, r0 // pt = py
+;;
+// cycle 2
+(pt)cmp.ne.and  px = r0, r0 // px = px & !pt (px = pz & !pt)
+(pz)cmp.ne.and  pt = r0, r0 // pt = pt & !pz
+;;
+} { .mmi
+// cycle 3
+(pt)cmp.eq.or   px = r0, r0 // px = px | pt
+
+*** Another, which we use here, requires one scratch GR. it is:
+
+mov rt = 0  // initialize rt off critical path
+;;
+
+// cycle 1
+(pz)cmp.eq.unc  px = r0, r0 // px = pz
+(pz)mov  

[llvm-commits] CVS: llvm/include/llvm/Target/TargetInstrItineraries.h

2005-11-03 Thread Duraid Madina


Changes in directory llvm/include/llvm/Target:

TargetInstrItineraries.h updated: 1.4 -> 1.5
---
Log message:

change NULL to 0, unbreaks the ppc target when building on ia64



---
Diffs of the changes:  (+2 -2)

 TargetInstrItineraries.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/Target/TargetInstrItineraries.h
diff -u llvm/include/llvm/Target/TargetInstrItineraries.h:1.4 
llvm/include/llvm/Target/TargetInstrItineraries.h:1.5
--- llvm/include/llvm/Target/TargetInstrItineraries.h:1.4   Thu Nov  3 
16:47:42 2005
+++ llvm/include/llvm/Target/TargetInstrItineraries.h   Thu Nov  3 19:45:04 2005
@@ -55,13 +55,13 @@
 //
 // Ctors.
 //
-  InstrItineraryData() : Stages(NULL), Itineratries(NULL) {}
+  InstrItineraryData() : Stages(0), Itineratries(0) {}
   InstrItineraryData(InstrStage *S, InstrItinerary *I) : Stages(S), 
Itineratries(I) {}
   
   //
   // isEmpty - Returns true if there are no itineraries.
   //
-  inline bool isEmpty() const { return Itineratries == NULL; }
+  inline bool isEmpty() const { return Itineratries == 0; }
   
   //
   // begin - Return the first stage of the itinerary.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Target/TargetInstrItineraries.h

2005-11-03 Thread Jeff Cohen


Changes in directory llvm/include/llvm/Target:

TargetInstrItineraries.h updated: 1.5 -> 1.6
---
Log message:

 no longer required to make VC++ happy.

---
Diffs of the changes:  (+0 -2)

 TargetInstrItineraries.h |2 --
 1 files changed, 2 deletions(-)


Index: llvm/include/llvm/Target/TargetInstrItineraries.h
diff -u llvm/include/llvm/Target/TargetInstrItineraries.h:1.5 
llvm/include/llvm/Target/TargetInstrItineraries.h:1.6
--- llvm/include/llvm/Target/TargetInstrItineraries.h:1.5   Thu Nov  3 
19:45:04 2005
+++ llvm/include/llvm/Target/TargetInstrItineraries.h   Thu Nov  3 20:59:17 2005
@@ -16,8 +16,6 @@
 #ifndef LLVM_TARGET_TARGETINSTRITINERARIES_H
 #define LLVM_TARGET_TARGETINSTRITINERARIES_H
 
-#include 
-
 namespace llvm {
 
 
//===--===//



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp

2005-11-03 Thread Jim Laskey


Changes in directory llvm/lib/CodeGen/SelectionDAG:

ScheduleDAG.cpp updated: 1.39 -> 1.40
---
Log message:

Scheduling now uses itinerary data.

---
Diffs of the changes:  (+202 -167)

 ScheduleDAG.cpp |  369 ++--
 1 files changed, 202 insertions(+), 167 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.39 
llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.40
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.39  Mon Oct 31 06:49:09 2005
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp   Thu Nov  3 22:05:35 2005
@@ -21,6 +21,7 @@
 #include "llvm/CodeGen/SSARegMap.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/TargetInstrInfo.h"
+#include "llvm/Target/TargetInstrItineraries.h"
 #include "llvm/Target/TargetLowering.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
@@ -32,6 +33,7 @@
   enum ScheduleChoices {
 noScheduling,
 simpleScheduling,
+simpleNoItinScheduling
   };
 } // namespace
 
@@ -43,6 +45,8 @@
   "Trivial emission with no analysis"),
 clEnumValN(simpleScheduling, "simple",
   "Minimize critical path and maximize processor utilization"),
+clEnumValN(simpleNoItinScheduling, "simple-noitin",
+  "Same as simple except using generic latency"),
clEnumValEnd));
 
 
@@ -97,65 +101,59 @@
   typedef typename std::vector::iterator Iter;
 // Tally iterator 
   
-  /// AllInUse - Test to see if all of the resources in the slot are busy 
(set.)
-  inline bool AllInUse(Iter Cursor, unsigned ResourceSet) {
-return (*Cursor & ResourceSet) == ResourceSet;
-  }
-
-  /// Skip - Skip over slots that use all of the specified resource (all are
-  /// set.)
-  Iter Skip(Iter Cursor, unsigned ResourceSet) {
-assert(ResourceSet && "At least one resource bit needs to bet set");
-
-// Continue to the end
-while (true) {
-  // Break out if one of the resource bits is not set
-  if (!AllInUse(Cursor, ResourceSet)) return Cursor;
-  // Try next slot
-  Cursor++;
-  assert(Cursor < Tally.end() && "Tally is not large enough for schedule");
-}
-  }
-  
-  /// FindSlots - Starting from Begin, locate N consecutive slots where at 
least 
-  /// one of the resource bits is available.  Returns the address of first 
slot.
-  Iter FindSlots(Iter Begin, unsigned N, unsigned ResourceSet,
- unsigned &Resource) {
-// Track position  
-Iter Cursor = Begin;
+  /// SlotsAvailable - Returns the an iterator equal to Begin if all units
+  /// are available.  Otherwise return an iterator to a better Begin.
+  Iter SlotsAvailable(Iter Begin, unsigned N, unsigned ResourceSet,
+  unsigned &Resource) {
+assert(N && "Must check availability with N != 0");
+// Determine end of interval
+Iter End = Begin + N;
+// Alternate result
+Iter Better = End;
+assert(End <= Tally.end() && "Tally is not large enough for schedule");
 
-// Try all possible slots forward
-while (true) {
-  // Skip full slots
-  Cursor = Skip(Cursor, ResourceSet);
-  // Determine end of interval
-  Iter End = Cursor + N;
-  assert(End <= Tally.end() && "Tally is not large enough for schedule");
+// Iterate thru each resource
+BitsIterator Resources(ResourceSet & ~*Begin);
+while (unsigned Res = Resources.Next()) {
+  // Check if resource is available for next N slots
+  Iter Interval = End;
+  do {
+Interval--;
+if (*Interval & Res) break;
+  } while (Interval != Begin);
   
-  // Iterate thru each resource
-  BitsIterator Resources(ResourceSet & ~*Cursor);
-  while (unsigned Res = Resources.Next()) {
-// Check if resource is available for next N slots
-// Break out if resource is busy
-Iter Interval = Cursor;
-for (; Interval < End && !(*Interval & Res); Interval++) {}
-
-// If available for interval, return where and which resource
-if (Interval == End) {
-  Resource = Res;
-  return Cursor;
-}
-// Otherwise, check if worth checking other resources
-if (AllInUse(Interval, ResourceSet)) {
-  // Start looking beyond interval
-  Cursor = Interval;
-  break;
-}
+  // If available for N
+  if (Interval == Begin) {
+// Success
+Resource = Res;
+return Begin;
   }
-  Cursor++;
+  if (Better > Interval) Better = Interval;
 }
+
+// No luck
+return Better;
   }
   
+  /// FindAndReserveStages - Return true if the stages can be completed. If
+  /// so mark as busy.
+  bool FindAndReserveStages(Iter Begin,
+InstrStage *Stage, InstrStage *StageEnd) {
+// If 

[llvm-commits] CVS: llvm-test/Makefile.programs

2005-11-03 Thread Duraid Madina


Changes in directory llvm-test:

Makefile.programs updated: 1.177 -> 1.178
---
Log message:

chicken out: sched=simple breaks quite a bit of the testsuite currently.
will look at this again later :)



---
Diffs of the changes:  (+1 -1)

 Makefile.programs |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm-test/Makefile.programs
diff -u llvm-test/Makefile.programs:1.177 llvm-test/Makefile.programs:1.178
--- llvm-test/Makefile.programs:1.177   Thu Nov  3 16:00:16 2005
+++ llvm-test/Makefile.programs Thu Nov  3 23:29:38 2005
@@ -194,7 +194,7 @@
 #-enable-alpha-intfpdiv -enable-alpha-FTOI
 endif
 ifeq ($(ARCH),IA64)
-LLCBETAOPTION := -enable-ia64-dag-isel -sched=simple
+LLCBETAOPTION := -enable-ia64-dag-isel 
 endif
 ifeq ($(ARCH),x86)
 LLCBETAOPTION := -enable-x86-fastcc



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-gcc/gcc/llvm-types.c

2005-11-03 Thread Chris Lattner


Changes in directory llvm-gcc/gcc:

llvm-types.c updated: 1.30 -> 1.31
---
Log message:

This ugly patch fixes the regressions compiling namd and gcc on X86, suitable 
for the 1.6 release.  This can be solved in a more elegant way in the future.



---
Diffs of the changes:  (+39 -3)

 llvm-types.c |   42 +++---
 1 files changed, 39 insertions(+), 3 deletions(-)


Index: llvm-gcc/gcc/llvm-types.c
diff -u llvm-gcc/gcc/llvm-types.c:1.30 llvm-gcc/gcc/llvm-types.c:1.31
--- llvm-gcc/gcc/llvm-types.c:1.30  Sat Sep 24 15:55:31 2005
+++ llvm-gcc/gcc/llvm-types.c   Fri Nov  4 00:18:30 2005
@@ -120,10 +120,11 @@
   return PrimitiveAlignments[Ty->ID];
 }
 case ArrayTyID:
-  //assert(Ty->x.Array.Alignment && "Array does not have alignment set!");
+  /*assert(Ty->x.Array.Alignment && "Array does not have alignment 
set!");*/
   return Ty->x.Array.Alignment ? Ty->x.Array.Alignment : 4;
 case StructTyID:
-  //assert(Ty->x.Struct.Alignment && "Struct does not have alignment 
set!");
+  /*assert(Ty->x.Struct.Alignment && "Struct does not have alignment 
set!");
+  */
   return Ty->x.Struct.Alignment ? Ty->x.Struct.Alignment : 4;
 default: 
   fprintf(stderr, "ERROR: Type doesn't have size: ");
@@ -752,7 +753,12 @@
   llvm_type *Ty = llvm_type_get_from_tree(TREE_TYPE(field));
   /* Get the starting offset in the record... */
   unsigned StartOffset = GetFieldOffset(field);   /* In bits */
+#ifdef LLVM_TARGET_MAX_ALIGN_IS_POINTER_SIZE
   unsigned ByteAlignment = llvm_type_get_alignment(Ty);
+#else
+  unsigned BitAlignment = GetFieldAlignmentInBits(field);
+  unsigned ByteAlignment = (BitAlignment+7)/8;
+#endif
   
   if (!TypeIsRecursivelyIntegral(Ty)) { /* Not an integral field? 
*/
 unsigned OrigSize = *Size;
@@ -767,6 +773,7 @@
  * to ensure that the LLVM conception of where this element lands is the
  * same as what GCC thinks.
  */
+#ifdef LLVM_TARGET_MAX_ALIGN_IS_POINTER_SIZE
 if (*Size < StartOffset/8) {
   unsigned PadBytes = StartOffset/8 - OrigSize;
   if (PadBytes == 1)
@@ -778,6 +785,17 @@
   ++*Idx;
   *Size = OrigSize + PadBytes;
 }
+#else
+if (*Size < StartOffset/8)
+  /* Only fix things if it is because of this "magic padding" */
+  if (*Size + ByteAlignment == StartOffset/8) {
+ElementTys[*Idx] = UByteTy;/* Random pad element */
+ElementOffsets[*Idx] = *Size;
+ElementAlignments[*Idx] = 1;
+++*Idx;
+*Size = StartOffset/8;
+  }
+#endif
 
 #if 0  /* FIXME: This assertion should be kept!!! */
 assert(*Size == StartOffset/8 &&
@@ -796,10 +814,16 @@
 unsigned FieldCByteAlignment = (FieldCBitAlignment+7)/8;
 /* Is it attempting to align the current offset to some value? */
 if (DeclSize == 0) {
+#ifdef LLVM_TARGET_MAX_ALIGN_IS_POINTER_SIZE
   NumPads = FieldCByteAlignment - (*Size % FieldCByteAlignment);
   if (NumPads == FieldCByteAlignment) NumPads = 0;
   assert((*Size+NumPads) % FieldCByteAlignment == 0 &&
  "Incorrect padding calc?");
+#else
+  NumPads = ByteAlignment - (*Size % ByteAlignment);
+  if (NumPads == ByteAlignment) NumPads = 0;
+  assert((*Size+NumPads) % ByteAlignment == 0 && "Incorrect padding 
calc?");
+#endif
 #if DEBUG_STRUCT_LAYOUT
   fprintf(stderr, "Anon field: align=%db pads = %d ",
   FieldCByteAlignment, NumPads);
@@ -839,7 +863,8 @@
 
 int HasSignedField;
 unsigned StartByte;
-if (ElSizeInBits) ElSizeInBits = MAX(ElSizeInBits, FieldCBitAlignment);
+if (ElSizeInBits)
+  ElSizeInBits = MAX(ElSizeInBits, FieldCBitAlignment);
 
 HasSignedField = !TREE_UNSIGNED(TREE_TYPE(field));
 
@@ -906,6 +931,7 @@
  * to ensure that the LLVM conception of where this element lands is the
  * same as what GCC thinks.
  */
+#ifdef LLVM_TARGET_MAX_ALIGN_IS_POINTER_SIZE
 if (((*Size + ByteAlignment - 1) & ~(ByteAlignment-1)) < StartOffset/8) {
   unsigned PadBytes = StartOffset/8 - *Size;
   if (PadBytes == 1)
@@ -917,6 +943,7 @@
   ++*Idx;
   *Size = *Size + PadBytes;
 }
+#endif
 
 /* Check to see if there is "magic padding" that got inserted into the
  * structure.  This can happen, for example, when the C++ ABI declares that
@@ -1472,6 +1499,7 @@
  * elements so that the LLVM code will have the right size for the
  * structure.
  */
+#ifdef LLVM_TARGET_MAX_ALIGN_IS_POINTER_SIZE
 if (TYPE_SIZE(type) && TREE_CODE(TYPE_SIZE(type)) == INTEGER_CST) {
   unsigned GCCTypeSize = ((unsigned)TREE_INT_CST_LOW(TYPE_SIZE(type))+7)/8;
   unsigned LLVMTypeSize, LLVMStructAlign = 1, i;
@@ -1506,6 +1534,14 @@
 Size += PadBytes;
   }
 }
+#else
+/* Empty C++ structures == { ubyte } in LLVM so that sizes are correct. */
+if (Idx == 0 && (int)TREE_INT_CST_LOW(TYPE_SIZE(type)) == 8) {
+  StructElements[0] = UByteTy;
+  El