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

2007-05-17 Thread Chris Lattner


Changes in directory llvm/docs:

ReleaseNotes.html updated: 1.368 -> 1.368.2.1
---
Log message:

first cut of llvm 2.0 release notes


---
Diffs of the changes:  (+411 -242)

 ReleaseNotes.html |  653 +-
 1 files changed, 411 insertions(+), 242 deletions(-)


Index: llvm/docs/ReleaseNotes.html
diff -u llvm/docs/ReleaseNotes.html:1.368 llvm/docs/ReleaseNotes.html:1.368.2.1
--- llvm/docs/ReleaseNotes.html:1.368   Tue Apr  3 23:14:31 2007
+++ llvm/docs/ReleaseNotes.html Fri May 18 01:39:06 2007
@@ -4,11 +4,11 @@
 
   
   
-  LLVM 1.9 Release Notes
+  LLVM 2.0 Release Notes
 
 
 
-LLVM 1.9 Release Notes
+LLVM 2.0 Release Notes
  
 
   Introduction
@@ -32,13 +32,10 @@
 
 
 This document contains the release notes for the LLVM compiler
-infrastructure, release 1.9.  Here we describe the status of LLVM, including 
any
-known problems and major improvements from the previous release.  The most
-up-to-date version of this document (corresponding to LLVM CVS) can be found
-on the http://llvm.org/releases/";>LLVM releases web site.  If you are
-not reading this on the LLVM web pages, you should probably go there because
-this document may be updated after the release.
+infrastructure, release 2.0.  Here we describe the status of LLVM, including 
any
+known problems and major improvements from the previous release.  All LLVM
+releases may be downloaded from the http://llvm.org/releases/";>LLVM
+releases web site.
 
 For more information about LLVM, including information about the latest
 release, please check out the http://llvm.org/";>main LLVM
@@ -61,67 +58,175 @@
 
 
 
-This is the tenth public release of the LLVM Compiler Infrastructure. This
-release incorporates a large number of enhancements, new features, and bug
-fixes.  We recommend that all users of previous LLVM versions upgrade.
-
+This is the eleventh public release of the LLVM Compiler Infrastructure. 
+Being the first major release since 1.0, this release is different in several
+ways from our previous releases:
+
+
+We took this as an opportunity to
+break backwards compatibility with the LLVM 1.x bytecode and .ll file format.
+If you have LLVM 1.9 .ll files that you would like to upgrade to LLVM 2.x, we 
+recommend the use of the stand alone llvm-upgrade
+tool (which is included with 2.0).  We intend to keep compatibility with .ll 
+and .bc formats within the 2.x release series, like we did within the 1.x 
+series.
+There are several significant change to the LLVM IR and internal APIs, such
+as a major overhaul of the type system, the completely new bitcode file
+format, etc (described below).
+We designed the release around a 6 month release cycle instead of the usual
+3-month cycle.  This gave us extra time to develop and test some of the
+more invasive features in this release.
+LLVM 2.0 no longer supports the llvm-gcc3 front-end.  Users are required to
+upgrade to llvm-gcc4.  llvm-gcc4 includes many features over
+llvm-gcc3, is faster, and is much easier to
+build from source.
+
+
+Note that while this is a major version bump, this release has been
+   extensively tested on a wide range of software.  It is easy to say that this
+   is our best release yet, in terms of both features and correctness.  This is
+   the first LLVM release to correctly compile and optimize major software like
+   LLVM itself, Mozilla/Seamonkey, Qt 4.3rc1, kOffice, etc out of the box on
+   linux/x86.
+   
 
 
 
 

 
-New Features in LLVM 1.9
+New Features in LLVM 2.0
 
 
 

-New X86-64 Backend
+Major Changes
 
-LLVM 1.9 now fully supports the x86-64 instruction set on Mac OS/X, and
-supports it on Linux (and other operating systems) when compiling in -static
-mode. LLVM includes JIT support for X86-64, and supports both Intel EMT-64T
-and AMD-64 architectures.  The X86-64 instruction set permits addressing a
-64-bit addressing space and provides the compiler with twice the
-number of integer registers to use.
-
 
-
-Link-Time Optimization integration
-with native linkers
-
-LLVM now includes liblto which can
-be used to integrate LLVM Link-Time Optimization support into a native linker.
-This allows LLVM .bc to transparently participate with linking an application,
-even when some .o files are in LLVM form and some are not.
+Changes to the LLVM IR itself:
+
+
+
+Integer types are now completely signless. This means that we
+have types like i8/i16/i32 instead of ubyte/sbyte/short/ushort/int
+etc. LLVM operations that depend on sign have been split up into 
+separate instructions (http://llvm.org/PR950";>PR950).  This
+eliminates cast instructions that just change the sign of the operands 
(e.g.
+int -> uint), which reduces the size of the IR and makes optimizers
+simpler to write.
+
+Integer types with arbitrary bitwidths (e.g. i13, i36, i42, i1057, etc) are
+now supported in the LLVM IR and optimizations (http://llvm.org/PR1043";>PR1043).  However, neither llvm

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

2007-05-17 Thread Chris Lattner


Changes in directory llvm/docs:

ReleaseNotes.html updated: 1.383 -> 1.384
---
Log message:

finished the first draft


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

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


Index: llvm/docs/ReleaseNotes.html
diff -u llvm/docs/ReleaseNotes.html:1.383 llvm/docs/ReleaseNotes.html:1.384
--- llvm/docs/ReleaseNotes.html:1.383   Fri May 18 01:33:02 2007
+++ llvm/docs/ReleaseNotes.html Fri May 18 01:38:51 2007
@@ -157,6 +157,8 @@
 into MSIL (".net") bytecode.  This is still fairly early development 
 with a number of limitations.
 
+A new llvm-upgrade tool 
+exists to migrates LLVM 1.9 .ll files to LLVM 2.0 syntax.
 
 
 
@@ -378,15 +380,11 @@
 Other Improvements
 
 
-This release includes many other improvements, including
-performance work, specifically designed to tune datastructure
-usage. This makes several critical components faster.
-
 More specific changes include:
 
 
 LLVM no longer relies on static destructors to shut itself down.  Instead,
-it lazily initializes itself and shuts down when llvm_shutdown() is 
+it lazily initializes itself and shuts down when llvm_shutdown() 
is 
 explicitly called.
 
 LLVM now has significantly fewer static constructors, reducing startup 
time.
@@ -397,16 +395,11 @@
 
 Construction of intrinsic function declarations has been simplified.
 
-The llvm-upgrade tool now exists. This migrates LLVM 1.9 .ll files to 
-LLVM 2.0 syntax.
-
-The gccas/gccld tools have been removed.
+The gccas/gccld tools have been replaced with small shell scripts.
 
 Support has been added to llvm-test for running on low-memory  
 or slow machines (make SMALL_PROBLEM_SIZE=1).
 
-llvm-test is now more portable and should build with MS Visual Studio.
-
 
 
 
@@ -856,7 +849,7 @@
   src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!" />
 
   http://llvm.org/";>LLVM Compiler Infrastructure
-  Last modified: $Date: 2007/05/18 06:33:02 $
+  Last modified: $Date: 2007/05/18 06:38:51 $
 
 
 



___
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

2007-05-17 Thread Chris Lattner


Changes in directory llvm/docs:

ReleaseNotes.html updated: 1.382 -> 1.383
---
Log message:

crank out notes


---
Diffs of the changes:  (+134 -129)

 ReleaseNotes.html |  263 +++---
 1 files changed, 134 insertions(+), 129 deletions(-)


Index: llvm/docs/ReleaseNotes.html
diff -u llvm/docs/ReleaseNotes.html:1.382 llvm/docs/ReleaseNotes.html:1.383
--- llvm/docs/ReleaseNotes.html:1.382   Thu May 17 19:44:29 2007
+++ llvm/docs/ReleaseNotes.html Fri May 18 01:33:02 2007
@@ -72,16 +72,23 @@
 series.
 There are several significant change to the LLVM IR and internal APIs, such
 as a major overhaul of the type system, the completely new bitcode file
-format, etc.
+format, etc (described below).
 We designed the release around a 6 month release cycle instead of the usual
 3-month cycle.  This gave us extra time to develop and test some of the
 more invasive features in this release.
-LLVM 2.0 no longer supports the llvm-gcc3 front-end.
+LLVM 2.0 no longer supports the llvm-gcc3 front-end.  Users are required to
+upgrade to llvm-gcc4.  llvm-gcc4 includes many features over
+llvm-gcc3, is faster, and is much easier to
+build from source.
 
 
 Note that while this is a major version bump, this release has been
extensively tested on a wide range of software.  It is easy to say that this
-   is our best release yet, in terms of both features and correctness.
+   is our best release yet, in terms of both features and correctness.  This is
+   the first LLVM release to correctly compile and optimize major software like
+   LLVM itself, Mozilla/Seamonkey, Qt 4.3rc1, kOffice, etc out of the box on
+   linux/x86.
+   
 
 
 
@@ -93,26 +100,27 @@
 

 Major Changes
 
-blah
-
 
-
+Changes to the LLVM IR itself:
 
-llvm-gcc3 is now officially unsupported.  Users are required to
-upgrade to llvm-gcc4.  llvm-gcc4 includes many features over
-llvm-gcc3, is faster, and is much easier to build.
+
 
 Integer types are now completely signless. This means that we
 have types like i8/i16/i32 instead of ubyte/sbyte/short/ushort/int
 etc. LLVM operations that depend on sign have been split up into 
-separate instructions (http://llvm.org/PR950";>PR950).
+separate instructions (http://llvm.org/PR950";>PR950).  This
+eliminates cast instructions that just change the sign of the operands 
(e.g.
+int -> uint), which reduces the size of the IR and makes optimizers
+simpler to write.
+
+Integer types with arbitrary bitwidths (e.g. i13, i36, i42, i1057, etc) are
+now supported in the LLVM IR and optimizations (http://llvm.org/PR1043";>PR1043).  However, neither llvm-gcc
+(http://llvm.org/PR1284";>PR1284) nor the native code 
generators
+(http://llvm.org/PR1270";>PR1270) support non-standard width
+integers yet.
 
-Arbitrary bitwidth integers (e.g. i13, i36, i42, etc) are now
-supported in the LLVM IR and optimizations. However, neither llvm-gcc nor
-the native code generators support non-standard width integers 
-(http://llvm.org/PR1043";>PR1043).
-
-'type planes' have been removed (http://llvm.org/PR411";>PR411).
+'Type planes' have been removed (http://llvm.org/PR411";>PR411).
 It is no longer possible to have two values with the same name in the 
 same symbol table.  This simplifies LLVM internals, allowing significant 
 speedups.
@@ -121,36 +129,36 @@
 @ instead of % (http://llvm.org/PR645";>PR645).
 
 The LLVM 1.x "bytecode" format has been replaced with a  
-completely new binary representation, named 'bitcode'.  Because we  
-plan to maintain binary compatibility between LLVM 2.x ".bc" files,  
-this is an important change to get right.  Bitcode brings a number of  
-advantages to the LLVM over the old bytecode format.  It is denser  
+completely new binary representation, named 'bitcode'. The Bitcode Format brings a
+number of advantages to the LLVM over the old bytecode format: it is 
denser  
 (files are smaller), more extensible, requires less memory to read,  
 is easier to keep backwards compatible (so LLVM 2.5 will read 2.0 .bc  
 files), and has many other nice features.
 
-Support was added for alignment values on load and store
-instructions (http://www.llvm.org/PR400";>PR400).  This 
-allows the IR to express loads that are not
-sufficiently aligned (e.g. due to pragma packed) or to capture extra
-alignment information. 
-
-LLVM now has a new MSIL backend. llc - march=msil will now turn LLVM 
-into MSIL (".net") bytecode.  This is still fairly early development 
-with a number of limitations.
+Load and store instructions now track the alignment of their pointer
+(http://www.llvm.org/PR400";>PR400).  This allows the IR to
+express loads that are not sufficiently aligned (e.g. due to '#pragma
+packed') or to capture extra alignment information.
+
 
-Support has been added for 'protected visibilit

[llvm-commits] [release_20] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp

2007-05-17 Thread Tanya Lattner


Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.399.2.1 -> 1.399.2.2
---
Log message:

Merge from mainline


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

 X86ISelLowering.cpp |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.399.2.1 
llvm/lib/Target/X86/X86ISelLowering.cpp:1.399.2.2
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.399.2.1   Fri May 18 00:59:52 2007
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Fri May 18 01:21:50 2007
@@ -2675,7 +2675,8 @@
   return Op;
 }
 
-if (X86::isSHUFPMask(PermMask.Val))
+if (X86::isSHUFPMask(PermMask.Val) &&
+MVT::getSizeInBits(VT) != 64)// Don't do this for MMX.
   return Op;
 
 // Handle v8i16 shuffle high / low shuffle node pair.
@@ -2712,7 +2713,9 @@
 }
   }
 
-  if (NumElems == 4) {
+  if (NumElems == 4 && 
+  // Don't do this for MMX.
+  MVT::getSizeInBits(VT) != 64) {
 MVT::ValueType MaskVT = PermMask.getValueType();
 MVT::ValueType MaskEVT = MVT::getVectorBaseType(MaskVT);
 SmallVector, 8> Locs;



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


[llvm-commits] [release_20] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp BitcodeReader.h

2007-05-17 Thread Tanya Lattner


Changes in directory llvm/lib/Bitcode/Reader:

BitcodeReader.cpp updated: 1.47.2.1 -> 1.47.2.2
BitcodeReader.h updated: 1.19 -> 1.19.2.1
---
Log message:

Merge from mainline.


---
Diffs of the changes:  (+93 -44)

 BitcodeReader.cpp |  124 +++---
 BitcodeReader.h   |   13 -
 2 files changed, 93 insertions(+), 44 deletions(-)


Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.47.2.1 
llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.47.2.2
--- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.47.2.1  Tue May  8 01:37:35 2007
+++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp   Fri May 18 01:20:09 2007
@@ -24,8 +24,15 @@
 #include "llvm/Support/MemoryBuffer.h"
 using namespace llvm;
 
-BitcodeReader::~BitcodeReader() {
+void BitcodeReader::FreeState() {
   delete Buffer;
+  Buffer = 0;
+  std::vector().swap(TypeList);
+  ValueList.clear();
+  std::vector().swap(ParamAttrs);
+  std::vector().swap(FunctionBBs);
+  std::vector().swap(FunctionsWithBodies);
+  DeferredFunctionInfo.clear();
 }
 
 
//===--===//
@@ -1102,42 +1109,6 @@
 }
 
 
-bool BitcodeReader::materializeFunction(Function *F, std::string *ErrInfo) {
-  // If it already is material, ignore the request.
-  if (!F->hasNotBeenReadFromBytecode()) return false;
-
-  DenseMap >::iterator DFII = 
-DeferredFunctionInfo.find(F);
-  assert(DFII != DeferredFunctionInfo.end() && "Deferred function not found!");
-  
-  // Move the bit stream to the saved position of the deferred function body 
and
-  // restore the real linkage type for the function.
-  Stream.JumpToBit(DFII->second.first);
-  F->setLinkage((GlobalValue::LinkageTypes)DFII->second.second);
-  DeferredFunctionInfo.erase(DFII);
-  
-  if (ParseFunctionBody(F)) {
-if (ErrInfo) *ErrInfo = ErrorString;
-return true;
-  }
-  
-  return false;
-}
-
-Module *BitcodeReader::materializeModule(std::string *ErrInfo) {
-  DenseMap >::iterator I = 
-DeferredFunctionInfo.begin();
-  while (!DeferredFunctionInfo.empty()) {
-Function *F = (*I++).first;
-assert(F->hasNotBeenReadFromBytecode() &&
-   "Deserialized function found in map!");
-if (materializeFunction(F, ErrInfo))
-  return 0;
-  }
-  return TheModule;
-}
-
-
 /// ParseFunctionBody - Lazily parse the specified function body block.
 bool BitcodeReader::ParseFunctionBody(Function *F) {
   if (Stream.EnterSubBlock(bitc::FUNCTION_BLOCK_ID))
@@ -1586,6 +1557,69 @@
   return false;
 }
 
+//===--===//
+// ModuleProvider implementation
+//===--===//
+
+
+bool BitcodeReader::materializeFunction(Function *F, std::string *ErrInfo) {
+  // If it already is material, ignore the request.
+  if (!F->hasNotBeenReadFromBytecode()) return false;
+  
+  DenseMap >::iterator DFII = 
+DeferredFunctionInfo.find(F);
+  assert(DFII != DeferredFunctionInfo.end() && "Deferred function not found!");
+  
+  // Move the bit stream to the saved position of the deferred function body 
and
+  // restore the real linkage type for the function.
+  Stream.JumpToBit(DFII->second.first);
+  F->setLinkage((GlobalValue::LinkageTypes)DFII->second.second);
+  
+  if (ParseFunctionBody(F)) {
+if (ErrInfo) *ErrInfo = ErrorString;
+return true;
+  }
+  
+  return false;
+}
+
+void BitcodeReader::dematerializeFunction(Function *F) {
+  // If this function isn't materialized, or if it is a proto, this is a noop.
+  if (F->hasNotBeenReadFromBytecode() || F->isDeclaration())
+return;
+  
+  assert(DeferredFunctionInfo.count(F) && "No info to read function later?");
+  
+  // Just forget the function body, we can remat it later.
+  F->deleteBody();
+  F->setLinkage(GlobalValue::GhostLinkage);
+}
+
+
+Module *BitcodeReader::materializeModule(std::string *ErrInfo) {
+  for (DenseMap >::iterator I = 
+   DeferredFunctionInfo.begin(), E = DeferredFunctionInfo.end(); I != E;
+   ++I) {
+Function *F = I->first;
+if (F->hasNotBeenReadFromBytecode() &&
+materializeFunction(F, ErrInfo))
+  return 0;
+  }
+  return TheModule;
+}
+
+
+/// This method is provided by the parent ModuleProvde class and overriden
+/// here. It simply releases the module from its provided and frees up our
+/// state.
+/// @brief Release our hold on the generated module
+Module *BitcodeReader::releaseModule(std::string *ErrInfo) {
+  // Since we're losing control of this Module, we must hand it back complete
+  Module *M = ModuleProvider::releaseModule(ErrInfo);
+  FreeState();
+  return M;
+}
+
 
 
//===--===//
 // External interface
@@ -1615,12 +1649,18 @@
   R = static_cast(getBitcodeModuleProvider(Buffer, ErrMsg));
   if (!R) return 0;
   
-  // Read the whole module, get a pointer to it, te

[llvm-commits] [release_20] CVS: llvm/lib/Target/X86/X86InstrMMX.td

2007-05-17 Thread Tanya Lattner


Changes in directory llvm/lib/Target/X86:

X86InstrMMX.td updated: 1.31 -> 1.31.2.1
---
Log message:

Merge from mainline


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

 X86InstrMMX.td |4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/X86/X86InstrMMX.td
diff -u llvm/lib/Target/X86/X86InstrMMX.td:1.31 
llvm/lib/Target/X86/X86InstrMMX.td:1.31.2.1
--- llvm/lib/Target/X86/X86InstrMMX.td:1.31 Tue Apr 24 16:18:37 2007
+++ llvm/lib/Target/X86/X86InstrMMX.td  Fri May 18 01:08:42 2007
@@ -493,7 +493,9 @@
 
 // Misc.
 def MMX_MASKMOVQ : MMXI<0xF7, MRMDestMem, (ops VR64:$src, VR64:$mask),
-"maskmovq {$mask, $src|$src, $mask}", []>;
+"maskmovq {$mask, $src|$src, $mask}",
+[(int_x86_mmx_maskmovq VR64:$src, VR64:$mask, EDI)]>,
+Imp<[EDI],[]>;
 
 
//===--===//
 // Alias Instructions



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


[llvm-commits] [release_20] CVS: llvm/include/llvm/IntrinsicsX86.td

2007-05-17 Thread Tanya Lattner


Changes in directory llvm/include/llvm:

IntrinsicsX86.td updated: 1.44 -> 1.44.2.1
---
Log message:

Merge from mainline


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

 IntrinsicsX86.td |4 
 1 files changed, 4 insertions(+)


Index: llvm/include/llvm/IntrinsicsX86.td
diff -u llvm/include/llvm/IntrinsicsX86.td:1.44 
llvm/include/llvm/IntrinsicsX86.td:1.44.2.1
--- llvm/include/llvm/IntrinsicsX86.td:1.44 Tue Apr 24 16:18:37 2007
+++ llvm/include/llvm/IntrinsicsX86.td  Fri May 18 01:05:30 2007
@@ -702,6 +702,10 @@
 
 // Misc.
 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
+  def int_x86_mmx_maskmovq : GCCBuiltin<"__builtin_ia32_maskmovq">,
+  Intrinsic<[llvm_void_ty, llvm_v8i8_ty, llvm_v8i8_ty, 
llvm_ptr_ty],
+[IntrWriteMem]>;
+
   def int_x86_mmx_pmovmskb : GCCBuiltin<"__builtin_ia32_pmovmskb">,
   Intrinsic<[llvm_i32_ty, llvm_v8i8_ty], [IntrNoMem]>;
 



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


[llvm-commits] [release_20] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

2007-05-17 Thread Tanya Lattner


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.762 -> 1.762.2.1
---
Log message:

Merge from mainline.


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

 InstructionCombining.cpp |   23 ---
 1 files changed, 16 insertions(+), 7 deletions(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.762 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.762.2.1
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.762   Sun May  6 
08:37:16 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri May 18 01:03:55 2007
@@ -6449,16 +6449,25 @@
   while (Offset) {
 if (const StructType *STy = dyn_cast(GEPIdxTy)) {
   const StructLayout *SL = TD->getStructLayout(STy);
-  unsigned Elt = SL->getElementContainingOffset(Offset);
-  NewIndices.push_back(ConstantInt::get(Type::Int32Ty, Elt));
+  if (Offset < (int64_t)SL->getSizeInBytes()) {
+unsigned Elt = SL->getElementContainingOffset(Offset);
+NewIndices.push_back(ConstantInt::get(Type::Int32Ty, Elt));
   
-  Offset -= SL->getElementOffset(Elt);
-  GEPIdxTy = STy->getElementType(Elt);
+Offset -= SL->getElementOffset(Elt);
+GEPIdxTy = STy->getElementType(Elt);
+  } else {
+// Otherwise, we can't index into this, bail out.
+Offset = 0;
+OrigBase = 0;
+  }
 } else if (isa(GEPIdxTy) || isa(GEPIdxTy)) {
   const SequentialType *STy = cast(GEPIdxTy);
-  uint64_t EltSize = TD->getTypeSize(STy->getElementType());
-  NewIndices.push_back(ConstantInt::get(IntPtrTy, Offset/EltSize));
-  Offset %= EltSize;
+  if (uint64_t EltSize = TD->getTypeSize(STy->getElementType())) {
+
NewIndices.push_back(ConstantInt::get(IntPtrTy,Offset/EltSize));
+Offset %= EltSize;
+  } else {
+NewIndices.push_back(ConstantInt::get(IntPtrTy, 0));
+  }
   GEPIdxTy = STy->getElementType();
 } else {
   // Otherwise, we can't index into this, bail out.



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


[llvm-commits] [release_20] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp

2007-05-17 Thread Tanya Lattner


Changes in directory llvm/lib/Transforms/IPO:

GlobalOpt.cpp updated: 1.105.2.1 -> 1.105.2.2
---
Log message:

Merge from mainline.


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

 GlobalOpt.cpp |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.105.2.1 
llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.105.2.2
--- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.105.2.1 Fri May 18 01:02:03 2007
+++ llvm/lib/Transforms/IPO/GlobalOpt.cpp   Fri May 18 01:02:45 2007
@@ -623,9 +623,10 @@
   Loads.push_back(LI);
   Changed |= OptimizeAwayTrappingUsesOfValue(LI, LV);
 } else {
-  // If we get here we could have stores, loads, or phi nodes whose values
+  // If we get here we could have stores, selects, or phi nodes whose 
values
   // are loaded.
-  assert((isa(*GUI) || isa(*GUI)) &&
+  assert((isa(*GUI) || isa(*GUI) ||
+  isa(*GUI)) &&
  "Only expect load and stores!");
 }
 



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


[llvm-commits] [release_20] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp

2007-05-17 Thread Tanya Lattner


Changes in directory llvm/lib/Transforms/IPO:

GlobalOpt.cpp updated: 1.105 -> 1.105.2.1
---
Log message:

Merge from mainline.


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

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


Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.105 
llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.105.2.1
--- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.105 Sun May  6 08:37:16 2007
+++ llvm/lib/Transforms/IPO/GlobalOpt.cpp   Fri May 18 01:02:03 2007
@@ -623,7 +623,10 @@
   Loads.push_back(LI);
   Changed |= OptimizeAwayTrappingUsesOfValue(LI, LV);
 } else {
-  assert(isa(*GUI) && "Only expect load and stores!");
+  // If we get here we could have stores, loads, or phi nodes whose values
+  // are loaded.
+  assert((isa(*GUI) || isa(*GUI)) &&
+ "Only expect load and stores!");
 }
 
   if (Changed) {



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


[llvm-commits] [release_20] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp

2007-05-17 Thread Tanya Lattner


Changes in directory llvm/lib/Target/PowerPC:

PPCISelLowering.cpp updated: 1.269 -> 1.269.2.1
---
Log message:

Merging from mainline.


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

 PPCISelLowering.cpp |   26 +-
 1 files changed, 17 insertions(+), 9 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.269 
llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.269.2.1
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.269   Mon Apr  9 17:10:05 2007
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Fri May 18 00:57:28 2007
@@ -3326,31 +3326,39 @@
   case 'N':
   case 'O':
   case 'P': {
-if (!isa(Op)) return SDOperand(0,0);// Must be an 
immediate.
-unsigned Value = cast(Op)->getValue();
+ConstantSDNode *CST = dyn_cast(Op);
+if (!CST) return SDOperand(0, 0); // Must be an immediate to match.
+unsigned Value = CST->getValue();
 switch (Letter) {
 default: assert(0 && "Unknown constraint letter!");
 case 'I':  // "I" is a signed 16-bit constant.
-  if ((short)Value == (int)Value) return Op;
+  if ((short)Value == (int)Value)
+return DAG.getTargetConstant(Value, Op.getValueType());
   break;
 case 'J':  // "J" is a constant with only the high-order 16 bits nonzero.
 case 'L':  // "L" is a signed 16-bit constant shifted left 16 bits.
-  if ((short)Value == 0) return Op;
+  if ((short)Value == 0)
+return DAG.getTargetConstant(Value, Op.getValueType());
   break;
 case 'K':  // "K" is a constant with only the low-order 16 bits nonzero.
-  if ((Value >> 16) == 0) return Op;
+  if ((Value >> 16) == 0)
+return DAG.getTargetConstant(Value, Op.getValueType());
   break;
 case 'M':  // "M" is a constant that is greater than 31.
-  if (Value > 31) return Op;
+  if (Value > 31)
+return DAG.getTargetConstant(Value, Op.getValueType());
   break;
 case 'N':  // "N" is a positive constant that is an exact power of two.
-  if ((int)Value > 0 && isPowerOf2_32(Value)) return Op;
+  if ((int)Value > 0 && isPowerOf2_32(Value))
+return DAG.getTargetConstant(Value, Op.getValueType());
   break;
 case 'O':  // "O" is the constant zero. 
-  if (Value == 0) return Op;
+  if (Value == 0)
+return DAG.getTargetConstant(Value, Op.getValueType());
   break;
 case 'P':  // "P" is a constant whose negation is a signed 16-bit constant.
-  if ((short)-Value == (int)-Value) return Op;
+  if ((short)-Value == (int)-Value)
+return DAG.getTargetConstant(Value, Op.getValueType());
   break;
 }
 break;



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


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

2007-05-17 Thread Tanya Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.449.2.1 -> 1.449.2.2
---
Log message:

Merging from mainline (inline asm fix)


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

 SelectionDAGISel.cpp |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.449.2.1 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.449.2.2
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.449.2.1Wed May 
 9 23:42:32 2007
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Fri May 18 00:55:42 2007
@@ -3448,7 +3448,8 @@
 
 // Add information to the INLINEASM node to know about this output.
 unsigned ResOpType = 4/*MEM*/ | (1 << 3);
-AsmNodeOperands.push_back(DAG.getConstant(ResOpType, MVT::i32));
+AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType, 
+TLI.getPointerTy()));
 AsmNodeOperands.push_back(OpInfo.CallOperand);
 break;
   }
@@ -3540,7 +3541,8 @@
 
 // Add information to the INLINEASM node to know about this input.
 unsigned ResOpType = 3 /*IMM*/ | (1 << 3);
-AsmNodeOperands.push_back(DAG.getConstant(ResOpType, MVT::i32));
+AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType, 
+TLI.getPointerTy()));
 AsmNodeOperands.push_back(InOperandVal);
 break;
   } else if (OpInfo.ConstraintType == TargetLowering::C_Memory) {
@@ -3550,7 +3552,8 @@

 // Add information to the INLINEASM node to know about this input.
 unsigned ResOpType = 4/*MEM*/ | (1 << 3);
-AsmNodeOperands.push_back(DAG.getConstant(ResOpType, MVT::i32));
+AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType,
+TLI.getPointerTy()));
 AsmNodeOperands.push_back(InOperandVal);
 break;
   }



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


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

2007-05-17 Thread Tanya Lattner


Changes in directory llvm/utils/TableGen:

DAGISelEmitter.cpp updated: 1.294 -> 1.294.2.1
---
Log message:

Merge inline asm fix from mainline.


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

 DAGISelEmitter.cpp |   12 +++-
 1 files changed, 7 insertions(+), 5 deletions(-)


Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.294 
llvm/utils/TableGen/DAGISelEmitter.cpp:1.294.2.1
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.294Thu Apr 26 12:03:22 2007
+++ llvm/utils/TableGen/DAGISelEmitter.cpp  Fri May 18 00:51:20 2007
@@ -3678,11 +3678,12 @@
   // Emit boilerplate.
   OS << "SDNode *Select_INLINEASM(SDOperand N) {\n"
  << "  std::vector Ops(N.Val->op_begin(), N.Val->op_end());\n"
- << "  AddToISelQueue(N.getOperand(0)); // Select the chain.\n\n"
- << "  // Select the flag operand.\n"
- << "  if (Ops.back().getValueType() == MVT::Flag)\n"
- << "AddToISelQueue(Ops.back());\n"
- << "  SelectInlineAsmMemoryOperands(Ops, *CurDAG);\n"
+ << "  SelectInlineAsmMemoryOperands(Ops, *CurDAG);\n\n"
+
+ << "  // Ensure that the asm operands are themselves selected.\n"
+ << "  for (unsigned j = 0, e = Ops.size(); j != e; ++j)\n"
+ << "AddToISelQueue(Ops[j]);\n\n"
+
  << "  std::vector VTs;\n"
  << "  VTs.push_back(MVT::Other);\n"
  << "  VTs.push_back(MVT::Flag);\n"
@@ -3718,6 +3719,7 @@
  << "  case ISD::TargetConstant:\n"
  << "  case ISD::TargetConstantPool:\n"
  << "  case ISD::TargetFrameIndex:\n"
+ << "  case ISD::TargetExternalSymbol:\n"
  << "  case ISD::TargetJumpTable:\n"
  << "  case ISD::TargetGlobalTLSAddress:\n"
  << "  case ISD::TargetGlobalAddress: {\n"



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


[llvm-commits] [release_20] CVS: llvm/docs/BitCodeFormat.html

2007-05-17 Thread Chris Lattner


Changes in directory llvm/docs:

BitCodeFormat.html updated: 1.1 -> 1.1.2.1
---
Log message:

merge in from mainline


---
Diffs of the changes:  (+582 -29)

 BitCodeFormat.html |  611 ++---
 1 files changed, 582 insertions(+), 29 deletions(-)


Index: llvm/docs/BitCodeFormat.html
diff -u llvm/docs/BitCodeFormat.html:1.1 llvm/docs/BitCodeFormat.html:1.1.2.1
--- llvm/docs/BitCodeFormat.html:1.1Sat Jan 20 17:21:08 2007
+++ llvm/docs/BitCodeFormat.htmlFri May 18 00:51:57 2007
@@ -1,61 +1,614 @@
-http://www.w3.org/TR/html4/strict.dtd";>
+http://www.w3.org/TR/html4/strict.dtd";>
 
 
   
   LLVM Bitcode File Format
   
-  
-TR, TD { border: 2px solid gray; padding-left: 4pt; padding-right: 4pt; 
- padding-top: 2pt; padding-bottom: 2pt; }
-TH { border: 2px solid gray; font-weight: bold; font-size: 105%; }
-TABLE { text-align: center; border: 2px solid black; 
-  border-collapse: collapse; margin-top: 1em; margin-left: 1em; 
-  margin-right: 1em; margin-bottom: 1em; }
-.td_left { border: 2px solid gray; text-align: left; }
-  
 
 
  LLVM Bitcode File Format 
 
   Abstract
-  Concepts
+  Overview
+  Bitstream Format
+
+Magic Numbers
+Primitives
+Abbreviation IDs
+Blocks
+Data Records
+Abbreviations
+Standard Blocks
+
+  
+  LLVM IR Encoding
+
+Basics
+
+  
 
 
-  Written by mailto:[EMAIL PROTECTED]">Reid Spencer and
-  mailto:[EMAIL PROTECTED]">Chris Lattner.
+  Written by mailto:[EMAIL PROTECTED]">Chris Lattner.
 
 
+
 
- Abstract 
+ Abstract
 
+
 
-This document describes the LLVM bitcode file format. It specifies
-the binary encoding rules of the bitcode file format so that
-equivalent systems can encode bitcode files correctly. The LLVM
-bitcode representation is used to store the intermediate
-representation on disk in a compacted form.
-This document supercedes the LLVM bytecode file format for the 2.0
-release.
+
+This document describes the LLVM bitstream file format and the encoding of
+the LLVM IR into it.
+
 
+
 
- Concepts 
+ Overview
 
+
 
-This section describes the general concepts of the bitcode file
-format without getting into specific layout details. It is recommended
-that you read this section thoroughly before interpreting the detailed
-descriptions.
+
+
+What is commonly known as the LLVM bitcode file format (also, sometimes
+anachronistically known as bytecode) is actually two things: a bitstream container format
+and an encoding of LLVM IR into the container format.
+
+
+The bitstream format is an abstract encoding of structured data, very
+similar to XML in some ways.  Like XML, bitstream files contain tags, and 
nested
+structures, and you can parse the file without having to understand the tags.
+Unlike XML, the bitstream format is a binary encoding, and unlike XML it
+provides a mechanism for the file to self-describe "abbreviations", which are
+effectively size optimizations for the content.
+
+This document first describes the LLVM bitstream format, then describes the
+record structure used by LLVM IR files.
+
+
+
+
+
+ Bitstream Format
+
+
+
+
+
+The bitstream format is literally a stream of bits, with a very simple
+structure.  This structure consists of the following concepts:
+
+
+
+A "magic number" that identifies the contents of
+the stream.
+Encoding primitives like variable bit-rate
+integers. 
+Blocks, which define nested content. 
+Data Records, which describe entities within the
+file. 
+Abbreviations, which specify compression optimizations for the file. 
+
+
+Note that the llvm-bcanalyzer tool can be
+used to dump and inspect arbitrary bitstreams, which is very useful for
+understanding the encoding.
+
+
+
+
+Magic Numbers
+
+
+
+
+The first four bytes of the stream identify the encoding of the file.  This
+is used by a reader to know what is contained in the file.
+
+
+
+
+Primitives
+
+
+
+
+
+A bitstream literally consists of a stream of bits.  This stream is made up of 
a
+number of primitive values that encode a stream of unsigned integer values.
+These
+integers are are encoded in two ways: either as Fixed
+Width Integers or as Variable Width
+Integers.
+
+
+
+
+
+ Fixed Width Integers
+
+
+
+
+Fixed-width integer values have their low bits emitted directly to the file.
+   For example, a 3-bit integer value encodes 1 as 001.  Fixed width integers
+   are used when there are a well-known number of options for a field.  For
+   example, boolean values are usually encoded with a 1-bit wide integer. 
+
+
+
+
+
+ Variable Width
+Integers
+
+
+
+Variable-width integer (VBR) values encode values of arbitrary size,
+optimizing for the case where the values are small.  Given a 4-bit VBR field,
+any 3-bit value (0 through 7) is encoded directly, with the high bit set to
+zero.  Values larger than N-1 bits emit their bits in a series of N-1 bit
+chunks, where all but the last set the high bit.
+
+For example, the value 2

[llvm-commits] [release_20] CVS: llvm/docs/WritingAnLLVMPass.html

2007-05-17 Thread Chris Lattner


Changes in directory llvm/docs:

WritingAnLLVMPass.html updated: 1.59 -> 1.59.2.1
---
Log message:

merge from mainline


---
Diffs of the changes:  (+8 -6)

 WritingAnLLVMPass.html |   14 --
 1 files changed, 8 insertions(+), 6 deletions(-)


Index: llvm/docs/WritingAnLLVMPass.html
diff -u llvm/docs/WritingAnLLVMPass.html:1.59 
llvm/docs/WritingAnLLVMPass.html:1.59.2.1
--- llvm/docs/WritingAnLLVMPass.html:1.59   Wed May  2 20:11:53 2007
+++ llvm/docs/WritingAnLLVMPass.htmlFri May 18 00:48:38 2007
@@ -264,7 +264,7 @@
 
 
  static char ID;
- Hello() : FunctionPass((intptr_t)&ID) {}
+ Hello() : FunctionPass((intptr_t)&ID) {}
 
 
  This declares pass identifier used by LLVM to identify pass. This allows 
LLVM to
@@ -312,7 +312,7 @@
   struct Hello : public FunctionPass 
{
 
 static char ID;
-Hello() : FunctionPass((intptr_t)&ID) {}
+Hello() : FunctionPass((intptr_t)&ID) {}
 
 virtual bool runOnFunction(Function 
&F) {
   llvm::cerr << "Hello: " << F.getName() << "\n";
@@ -485,7 +485,7 @@
 functions.  Because nothing is known about the behavior of ModulePass
 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).  
+ getAnalysis(Function).  
 
 To write a correct ModulePass subclass, derive from
 ModulePass and overload the runOnModule method with the
@@ -746,7 +746,7 @@
   virtual bool doInitialization(Loop *, LPPassManager &LPM);
 
 
-The doInitialization method is designed to do simple initialization 
+The doInitialization method is designed to do simple 
initialization 
 type of stuff that does not depend on the functions being processed.  The 
 doInitialization method call is not scheduled to overlap with any 
 other pass executions (thus it should be very fast). LPPassManager 
@@ -1159,7 +1159,7 @@
}
 
 
-In above example, runOnFunction for DominatorTree is called by pass manager
+In above example, runOnFunction for DominatorTree is called by pass manager
 before returning a reference to the desired pass.
 
 
@@ -1797,6 +1797,8 @@
 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.
 
+
+
 
 
 
@@ -1807,7 +1809,7 @@
 
   mailto:[EMAIL PROTECTED]">Chris Lattner
   http://llvm.org";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2007/05/03 01:11:53 $
+  Last modified: $Date: 2007/05/18 05:48:38 $
 
 
 



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


[llvm-commits] CVS: llvm-www/DevMtgMay2007.html

2007-05-17 Thread Chris Lattner


Changes in directory llvm-www:

DevMtgMay2007.html updated: 1.144 -> 1.145
---
Log message:

stop oppression of the christophers


---
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.144 llvm-www/DevMtgMay2007.html:1.145
--- llvm-www/DevMtgMay2007.html:1.144   Fri May 18 00:40:18 2007
+++ llvm-www/DevMtgMay2007.html Fri May 18 00:41:43 2007
@@ -155,7 +155,7 @@
 Session 3:Discussions
   StartStopLeaderDiscussion Topic
 
-15:3015:45Chrisopher Lamb
+15:3015:45Christopher Lamb
   Concurrency Primitives.  For multi-threaded shared memory 
 models. Though I don't claim to be any sort of expert myself, I've 
 spent some time looking over the Java Memory Model revision and 
@@ -352,6 +352,6 @@
   src="http://jigsaw.w3.org/css-validator/images/vcss"; alt="Valid CSS!">
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
-Last modified: $Date: 2007/05/18 05:40:18 $
+Last modified: $Date: 2007/05/18 05:41:43 $
 
 



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


[llvm-commits] CVS: llvm-www/DevMtgMay2007.html

2007-05-17 Thread Chris Lattner


Changes in directory llvm-www:

DevMtgMay2007.html updated: 1.143 -> 1.144
---
Log message:

ted is coming


---
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.143 llvm-www/DevMtgMay2007.html:1.144
--- llvm-www/DevMtgMay2007.html:1.143   Tue May 15 20:18:09 2007
+++ llvm-www/DevMtgMay2007.html Fri May 18 00:40:18 2007
@@ -294,19 +294,20 @@
 Stuart HastingsApple Inc.
 Robert HundtGoogle
 Dale JohannesenApple Inc.
+Ted KremenekIndependent
 Christopher LambAgeia Technologies, Inc.
 Chris LattnerApple Inc.
 Tanya LattnerIndependent
 Andrew LenharthUIUC
 Julien LerougeApple Inc.
 Nick LewyckyIndependent
-Efrem LipkinCoDesign
   
   
   
   
 Confirmed Attendees
 NameOrganization
+Efrem LipkinCoDesign
 Gabe McArthurIndependent
 Paul McJonesAdobe Systems Incorporated.
 Scott MichelAerospace
@@ -333,7 +334,7 @@
   
 
   
-  Total confirmed: 45
+  Total confirmed: 46
   
 Unconfirmed Attendees
 NameOrganization
@@ -351,6 +352,6 @@
   src="http://jigsaw.w3.org/css-validator/images/vcss"; alt="Valid CSS!">
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
-Last modified: $Date: 2007/05/16 01:18:09 $
+Last modified: $Date: 2007/05/18 05:40:18 $
 
 



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


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

2007-05-17 Thread Chris Lattner


Changes in directory llvm/docs:

WritingAnLLVMPass.html updated: 1.60 -> 1.61
---
Log message:

validation fix


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

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


Index: llvm/docs/WritingAnLLVMPass.html
diff -u llvm/docs/WritingAnLLVMPass.html:1.60 
llvm/docs/WritingAnLLVMPass.html:1.61
--- llvm/docs/WritingAnLLVMPass.html:1.60   Fri May 18 00:36:14 2007
+++ llvm/docs/WritingAnLLVMPass.htmlFri May 18 00:38:44 2007
@@ -312,7 +312,7 @@
   struct Hello : public FunctionPass 
{
 
 static char ID;
-Hello() : FunctionPass((intptr_t)&ID) {}
+Hello() : FunctionPass((intptr_t)&ID) {}
 
 virtual bool runOnFunction(Function 
&F) {
   llvm::cerr << "Hello: " << F.getName() << "\n";
@@ -1809,7 +1809,7 @@
 
   mailto:[EMAIL PROTECTED]">Chris Lattner
   http://llvm.org";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2007/05/18 05:36:14 $
+  Last modified: $Date: 2007/05/18 05:38:44 $
 
 
 



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


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

2007-05-17 Thread Chris Lattner


Changes in directory llvm/docs:

WritingAnLLVMPass.html updated: 1.59 -> 1.60
---
Log message:

validation fixes


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

 WritingAnLLVMPass.html |   12 +++-
 1 files changed, 7 insertions(+), 5 deletions(-)


Index: llvm/docs/WritingAnLLVMPass.html
diff -u llvm/docs/WritingAnLLVMPass.html:1.59 
llvm/docs/WritingAnLLVMPass.html:1.60
--- llvm/docs/WritingAnLLVMPass.html:1.59   Wed May  2 20:11:53 2007
+++ llvm/docs/WritingAnLLVMPass.htmlFri May 18 00:36:14 2007
@@ -264,7 +264,7 @@
 
 
  static char ID;
- Hello() : FunctionPass((intptr_t)&ID) {}
+ Hello() : FunctionPass((intptr_t)&ID) {}
 
 
  This declares pass identifier used by LLVM to identify pass. This allows 
LLVM to
@@ -485,7 +485,7 @@
 functions.  Because nothing is known about the behavior of ModulePass
 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).  
+ getAnalysis(Function).  
 
 To write a correct ModulePass subclass, derive from
 ModulePass and overload the runOnModule method with the
@@ -746,7 +746,7 @@
   virtual bool doInitialization(Loop *, LPPassManager &LPM);
 
 
-The doInitialization method is designed to do simple initialization 
+The doInitialization method is designed to do simple 
initialization 
 type of stuff that does not depend on the functions being processed.  The 
 doInitialization method call is not scheduled to overlap with any 
 other pass executions (thus it should be very fast). LPPassManager 
@@ -1159,7 +1159,7 @@
}
 
 
-In above example, runOnFunction for DominatorTree is called by pass manager
+In above example, runOnFunction for DominatorTree is called by pass manager
 before returning a reference to the desired pass.
 
 
@@ -1797,6 +1797,8 @@
 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.
 
+
+
 
 
 
@@ -1807,7 +1809,7 @@
 
   mailto:[EMAIL PROTECTED]">Chris Lattner
   http://llvm.org";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2007/05/03 01:11:53 $
+  Last modified: $Date: 2007/05/18 05:36:14 $
 
 
 



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


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

2007-05-17 Thread Chris Lattner

On May 17, 2007, at 5:48 PM, Nick Lewycky wrote:

> Chris Lattner wrote:
>> +Pass registration is slightly different in LLVM 2.0 (you now  
>> needs an
>
> Either s/you/LLVM/ or s/needs/need/ .

Fixed, thanks!

-Chris

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


[llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp BitcodeReader.h

2007-05-17 Thread Chris Lattner


Changes in directory llvm/lib/Bitcode/Reader:

BitcodeReader.cpp updated: 1.49 -> 1.50
BitcodeReader.h updated: 1.20 -> 1.21
---
Log message:

Fix PR1434: http://llvm.org/PR1434  and test/Linker/link-archive.ll, this is a 
regression from 1.9.


---
Diffs of the changes:  (+91 -54)

 BitcodeReader.cpp |  135 --
 BitcodeReader.h   |   10 +++-
 2 files changed, 91 insertions(+), 54 deletions(-)


Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.49 
llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.50
--- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.49  Tue May 15 01:29:44 2007
+++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp   Thu May 17 23:02:46 2007
@@ -24,8 +24,15 @@
 #include "llvm/Support/MemoryBuffer.h"
 using namespace llvm;
 
-BitcodeReader::~BitcodeReader() {
+void BitcodeReader::FreeState() {
   delete Buffer;
+  Buffer = 0;
+  std::vector().swap(TypeList);
+  ValueList.clear();
+  std::vector().swap(ParamAttrs);
+  std::vector().swap(FunctionBBs);
+  std::vector().swap(FunctionsWithBodies);
+  DeferredFunctionInfo.clear();
 }
 
 
//===--===//
@@ -1102,53 +1109,6 @@
 }
 
 
-bool BitcodeReader::materializeFunction(Function *F, std::string *ErrInfo) {
-  // If it already is material, ignore the request.
-  if (!F->hasNotBeenReadFromBytecode()) return false;
-
-  DenseMap >::iterator DFII = 
-DeferredFunctionInfo.find(F);
-  assert(DFII != DeferredFunctionInfo.end() && "Deferred function not found!");
-  
-  // Move the bit stream to the saved position of the deferred function body 
and
-  // restore the real linkage type for the function.
-  Stream.JumpToBit(DFII->second.first);
-  F->setLinkage((GlobalValue::LinkageTypes)DFII->second.second);
-  
-  if (ParseFunctionBody(F)) {
-if (ErrInfo) *ErrInfo = ErrorString;
-return true;
-  }
-  
-  return false;
-}
-
-void BitcodeReader::dematerializeFunction(Function *F) {
-  // If this function isn't materialized, or if it is a proto, this is a noop.
-  if (F->hasNotBeenReadFromBytecode() || F->isDeclaration())
-return;
-  
-  assert(DeferredFunctionInfo.count(F) && "No info to read function later?");
-  
-  // Just forget the function body, we can remat it later.
-  F->deleteBody();
-  F->setLinkage(GlobalValue::GhostLinkage);
-}
-
-
-Module *BitcodeReader::materializeModule(std::string *ErrInfo) {
-  for (DenseMap >::iterator I = 
-   DeferredFunctionInfo.begin(), E = DeferredFunctionInfo.end(); I != E;
-   ++I) {
-Function *F = I->first;
-if (F->hasNotBeenReadFromBytecode() &&
-materializeFunction(F, ErrInfo))
-  return 0;
-  }
-  return TheModule;
-}
-
-
 /// ParseFunctionBody - Lazily parse the specified function body block.
 bool BitcodeReader::ParseFunctionBody(Function *F) {
   if (Stream.EnterSubBlock(bitc::FUNCTION_BLOCK_ID))
@@ -1597,6 +1557,69 @@
   return false;
 }
 
+//===--===//
+// ModuleProvider implementation
+//===--===//
+
+
+bool BitcodeReader::materializeFunction(Function *F, std::string *ErrInfo) {
+  // If it already is material, ignore the request.
+  if (!F->hasNotBeenReadFromBytecode()) return false;
+  
+  DenseMap >::iterator DFII = 
+DeferredFunctionInfo.find(F);
+  assert(DFII != DeferredFunctionInfo.end() && "Deferred function not found!");
+  
+  // Move the bit stream to the saved position of the deferred function body 
and
+  // restore the real linkage type for the function.
+  Stream.JumpToBit(DFII->second.first);
+  F->setLinkage((GlobalValue::LinkageTypes)DFII->second.second);
+  
+  if (ParseFunctionBody(F)) {
+if (ErrInfo) *ErrInfo = ErrorString;
+return true;
+  }
+  
+  return false;
+}
+
+void BitcodeReader::dematerializeFunction(Function *F) {
+  // If this function isn't materialized, or if it is a proto, this is a noop.
+  if (F->hasNotBeenReadFromBytecode() || F->isDeclaration())
+return;
+  
+  assert(DeferredFunctionInfo.count(F) && "No info to read function later?");
+  
+  // Just forget the function body, we can remat it later.
+  F->deleteBody();
+  F->setLinkage(GlobalValue::GhostLinkage);
+}
+
+
+Module *BitcodeReader::materializeModule(std::string *ErrInfo) {
+  for (DenseMap >::iterator I = 
+   DeferredFunctionInfo.begin(), E = DeferredFunctionInfo.end(); I != E;
+   ++I) {
+Function *F = I->first;
+if (F->hasNotBeenReadFromBytecode() &&
+materializeFunction(F, ErrInfo))
+  return 0;
+  }
+  return TheModule;
+}
+
+
+/// This method is provided by the parent ModuleProvde class and overriden
+/// here. It simply releases the module from its provided and frees up our
+/// state.
+/// @brief Release our hold on the generated module
+Module *BitcodeReader::releaseModule(std::string *ErrInfo) {
+  // Since we're losing

[llvm-commits] CVS: llvm/test/Linker/link-archive.ll

2007-05-17 Thread Reid Spencer


Changes in directory llvm/test/Linker:

link-archive.ll added (r1.1)
---
Log message:

Add a test case for PR1434: http://llvm.org/PR1434 


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

 link-archive.ll |   15 +++
 1 files changed, 15 insertions(+)


Index: llvm/test/Linker/link-archive.ll
diff -c /dev/null llvm/test/Linker/link-archive.ll:1.1
*** /dev/null   Thu May 17 22:47:00 2007
--- llvm/test/Linker/link-archive.llThu May 17 22:46:50 2007
***
*** 0 
--- 1,15 
+ ; Test linking of a bc file to an archive via llvm-ld. 
+ ; PR1434
+ ; RUN: llvm-as %s -o %t.bar.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-ar rf %t.foo.a %t.foo.bc
+ ; RUN: llvm-ar rf %t.bar.a %t.bar.bc
+ ; RUN: llvm-ld -disable-opt %t.bar.bc %t.foo.a -o %t.bc 
+ ; RUN: llvm-ld -disable-opt %t.foo.bc %t.bar.a -o %t.bc
+ declare i32* @foo(...)
+ define i32* @bar() {
+   %ret = call i32* (...)* @foo( i32 123 )
+   ret i32* %ret
+ }
+ @baz = global i32 0



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


[llvm-commits] CVS: llvm-test/RunSafely.sh

2007-05-17 Thread Reid Spencer


Changes in directory llvm-test:

RunSafely.sh updated: 1.30 -> 1.31
---
Log message:

Don't execute ulimit in a sub-shell as its effects are only for the shell
that it executes in. Use "eval" instead of "sh -c". This also saves a fork.

Patch by Emil Mikulic


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

 RunSafely.sh |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm-test/RunSafely.sh
diff -u llvm-test/RunSafely.sh:1.30 llvm-test/RunSafely.sh:1.31
--- llvm-test/RunSafely.sh:1.30 Fri May  4 16:31:42 2007
+++ llvm-test/RunSafely.sh  Thu May 17 22:34:23 2007
@@ -35,6 +35,7 @@
 #  is the path to the program to run
 #  are the arguments to pass to the program.
 #
+
 if [ $# -lt 4 ]; then
   echo "./RunSafely.sh  
"
   exit 1
@@ -102,7 +103,7 @@
 fi
 
 if [ "x$RHOST" = x ] ; then
-  ( sh -c "$ULIMITCMD"; time -p sh -c "$COMMAND >$OUTFILE 2>&1 < $INFILE" ; 
echo exit $? ) 2>&1 \
+  ( eval $ULIMITCMD time -p sh -c "$COMMAND >$OUTFILE 2>&1 < $INFILE" ; echo 
exit $? ) 2>&1 \
 | awk -- '\
 BEGIN { cpu = 0.0; }
 /^user/   { cpu += $2; print; }



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


Re: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrInfo.td

2007-05-17 Thread Chris Lattner
> Mark calls non-predicable for now. Need to ensure it's the last  
> instruction in the if-converted block or make sure it preserve  
> condition code.

Plz add this to the readme file, so it doesn't get forgotten,

-Chris

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


[llvm-commits] CVS: llvm/test/TestRunner.sh

2007-05-17 Thread Reid Spencer


Changes in directory llvm/test:

TestRunner.sh updated: 1.19 -> 1.20
---
Log message:

Avoid an infinite loop when TestRunner.sh is run outside of the test dir.


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

 TestRunner.sh |   12 +++-
 1 files changed, 7 insertions(+), 5 deletions(-)


Index: llvm/test/TestRunner.sh
diff -u llvm/test/TestRunner.sh:1.19 llvm/test/TestRunner.sh:1.20
--- llvm/test/TestRunner.sh:1.19Wed May 16 12:56:56 2007
+++ llvm/test/TestRunner.sh Thu May 17 21:06:03 2007
@@ -13,11 +13,13 @@
 #
 TESTPATH=`pwd`
 SUBDIR=""
-while test `basename $TESTPATH` != "test" -a ! -z "$TESTPATH" ; do
-  tmp=`basename $TESTPATH`
-  SUBDIR="$tmp/$SUBDIR"
-  TESTPATH=`dirname $TESTPATH`
-done
+if test `dirname $1` == "." ; then
+  while test `basename $TESTPATH` != "test" -a ! -z "$TESTPATH" ; do
+tmp=`basename $TESTPATH`
+SUBDIR="$tmp/$SUBDIR"
+TESTPATH=`dirname $TESTPATH`
+  done
+fi
 
 for TESTFILE in "$@" ; do 
   if test `dirname $TESTFILE` == . ; then



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


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

2007-05-17 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen:

IfConversion.cpp updated: 1.5 -> 1.6
---
Log message:

If true / false blocks fallthrough before ifcvt, add unconditional branches to 
ifcvt'd block.

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

 IfConversion.cpp |   23 +++
 1 files changed, 19 insertions(+), 4 deletions(-)


Index: llvm/lib/CodeGen/IfConversion.cpp
diff -u llvm/lib/CodeGen/IfConversion.cpp:1.5 
llvm/lib/CodeGen/IfConversion.cpp:1.6
--- llvm/lib/CodeGen/IfConversion.cpp:1.5   Thu May 17 19:20:58 2007
+++ llvm/lib/CodeGen/IfConversion.cpp   Thu May 17 20:55:58 2007
@@ -87,8 +87,6 @@
   TII = MF.getTarget().getInstrInfo();
   if (!TII) return false;
 
-  MadeChange = false;
-
   MF.RenumberBlocks();
   unsigned NumBBs = MF.getNumBlockIDs();
   BBAnalysis.resize(NumBBs);
@@ -98,6 +96,7 @@
   // candidates to perform if-convesion.
   InitialFunctionAnalysis(MF, Candidates);
 
+  MadeChange = false;
   for (unsigned i = 0, e = Candidates.size(); i != e; ++i) {
 BBInfo &BBI = BBAnalysis[Candidates[i]];
 switch (BBI.Kind) {
@@ -111,6 +110,9 @@
   break;
 }
   }
+
+  BBAnalysis.clear();
+
   return MadeChange;
 }
 
@@ -150,6 +152,10 @@
   if (TrueBBI.Kind != ICNotClassfied)
 return;
 
+  // TODO: Only handle very simple cases for now.
+  if (TrueBBI.FalseBB || TrueBBI.Cond.size())
+return;
+
   // No false branch. This BB must end with a conditional branch and a
   // fallthrough.
   if (!BBI.FalseBB)
@@ -168,8 +174,7 @@
 return;
 
   // TODO: Only handle very simple cases for now.
-  if (TrueBBI.FalseBB || FalseBBI.FalseBB ||
-  TrueBBI.Cond.size() || FalseBBI.Cond.size())
+  if (FalseBBI.FalseBB || FalseBBI.Cond.size())
 return;
 
   if (TrueBBI.TrueBB && TrueBBI.TrueBB == BBI.FalseBB) {
@@ -309,11 +314,21 @@
 TrueBBI.Size -= TII->RemoveBranch(*BBI.TrueBB);
 PredicateBlock(BBI.TrueBB, BBI.Cond);
 
+// Either the 'true' block fallthrough to another block or it ends with a
+// return. If it's the former, add a conditional branch to its successor.
+if (!TrueBBI.TrueBB)
+  TII->InsertBranch(*BBI.TrueBB, *BBI.TrueBB->succ_begin(), NULL, 
BBI.Cond);
+
 // Predicate the 'false' block.
 std::vector NewCond(BBI.Cond);
 TII->ReverseBranchCondition(NewCond);
 PredicateBlock(BBI.FalseBB, NewCond, true);
 
+// Either the 'false' block fallthrough to another block or it ends with a
+// return. If it's the former, add a conditional branch to its successor.
+if (!FalseBBI.TrueBB)
+  TII->InsertBranch(*BBI.FalseBB, *BBI.FalseBB->succ_begin(), 
NULL,NewCond);
+
 // Merge the 'true' and 'false' blocks by copying the instructions
 // from the 'false' block to the 'true' block.
 MergeBlocks(TrueBBI, FalseBBI);



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


[llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrInfo.td

2007-05-17 Thread Evan Cheng


Changes in directory llvm/lib/Target/ARM:

ARMInstrInfo.td updated: 1.103 -> 1.104
---
Log message:

Mark calls non-predicable for now. Need to ensure it's the last instruction in 
the if-converted block or make sure it preserve condition code.

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

 ARMInstrInfo.td |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)


Index: llvm/lib/Target/ARM/ARMInstrInfo.td
diff -u llvm/lib/Target/ARM/ARMInstrInfo.td:1.103 
llvm/lib/Target/ARM/ARMInstrInfo.td:1.104
--- llvm/lib/Target/ARM/ARMInstrInfo.td:1.103   Wed May 16 15:50:01 2007
+++ llvm/lib/Target/ARM/ARMInstrInfo.td Thu May 17 20:53:54 2007
@@ -575,17 +575,17 @@
 let isCall = 1, noResults = 1, 
   Defs = [R0, R1, R2, R3, R12, LR,
   D0, D1, D2, D3, D4, D5, D6, D7] in {
-  def BL  : AXI<(ops i32imm:$func, pred:$p, variable_ops),
-"bl$p ${func:call}",
+  def BL  : AXI<(ops i32imm:$func, variable_ops),
+"bl ${func:call}",
 [(ARMcall tglobaladdr:$func)]>;
   // ARMv5T and above
-  def BLX : AXI<(ops GPR:$dst, pred:$p, variable_ops),
-"blx$p $dst",
+  def BLX : AXI<(ops GPR:$dst, variable_ops),
+"blx $dst",
 [(ARMcall GPR:$dst)]>, Requires<[IsARM, HasV5T]>;
   let Uses = [LR] in {
 // ARMv4T
-def BX : AXIx2<(ops GPR:$dst, pred:$p, variable_ops),
-  "mov$p lr, pc\n\tbx$p $dst",
+def BX : AXIx2<(ops GPR:$dst, variable_ops),
+  "mov lr, pc\n\tbx $dst",
   [(ARMcall_nolink GPR:$dst)]>;
   }
 }
@@ -1110,8 +1110,8 @@
 // __aeabi_read_tp preserves the registers r1-r3.
 let isCall = 1,
   Defs = [R0, R12, LR] in {
-  def TPsoft : AI<(ops),
-   "bl", " __aeabi_read_tp",
+  def TPsoft : AXI<(ops),
+   "bl __aeabi_read_tp",
[(set R0, ARMthread_pointer)]>;
 }
 



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


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

2007-05-17 Thread Dale Johannesen


Changes in directory llvm/lib/CodeGen:

BranchFolding.cpp updated: 1.53 -> 1.54
---
Log message:

Remove some unneeded branches.  (spotted by Evan, thanks)


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

 BranchFolding.cpp |1 +
 1 files changed, 1 insertion(+)


Index: llvm/lib/CodeGen/BranchFolding.cpp
diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.53 
llvm/lib/CodeGen/BranchFolding.cpp:1.54
--- llvm/lib/CodeGen/BranchFolding.cpp:1.53 Tue May 15 16:19:17 2007
+++ llvm/lib/CodeGen/BranchFolding.cpp  Thu May 17 20:28:58 2007
@@ -595,6 +595,7 @@
 // Reinsert an unconditional branch if needed.
 // The 1 below can be either an original single predecessor, or a result
 // of removing blocks in TryMergeBlocks.
+PredBB = prior(I);  // this may have been changed in TryMergeBlocks
 if (MergePotentials.size()==1 && 
 (MergePotentials.begin())->second != PredBB)
   FixTail((MergePotentials.begin())->second, I, TII);



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


[llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp

2007-05-17 Thread Evan Cheng


Changes in directory llvm/lib/Target/ARM:

ARMISelLowering.cpp updated: 1.54 -> 1.55
---
Log message:

Silence some compilation warnings.

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

 ARMISelLowering.cpp |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/ARM/ARMISelLowering.cpp
diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.54 
llvm/lib/Target/ARM/ARMISelLowering.cpp:1.55
--- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.54Thu May 17 19:19:34 2007
+++ llvm/lib/Target/ARM/ARMISelLowering.cpp Thu May 17 20:19:57 2007
@@ -1369,7 +1369,7 @@
   unsigned SrcOff = 0, DstOff = 0;
   MVT::ValueType VT = MVT::i32;
   unsigned VTSize = 4;
-  const int MAX_LOADS_IN_LDM = 6;
+  const unsigned MAX_LOADS_IN_LDM = 6;
   SDOperand LoadChains[MAX_LOADS_IN_LDM];
   SDOperand Loads[MAX_LOADS_IN_LDM];
 
@@ -1377,7 +1377,7 @@
   // number of stores.  The loads and stores will get combined into
   // ldm/stm later on.
   while(EmittedNumMemOps < NumMemOps) {
-unsigned int i;
+unsigned i;
 for (i=0; ihttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2007-05-17 Thread Nick Lewycky
Chris Lattner wrote:
> +Pass registration is slightly different in LLVM 2.0 (you now needs an

Either s/you/LLVM/ or s/needs/need/ .

Nick
___
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

2007-05-17 Thread Chris Lattner


Changes in directory llvm/docs:

ReleaseNotes.html updated: 1.381 -> 1.382
---
Log message:

tweak


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

 ReleaseNotes.html |   13 ++---
 1 files changed, 6 insertions(+), 7 deletions(-)


Index: llvm/docs/ReleaseNotes.html
diff -u llvm/docs/ReleaseNotes.html:1.381 llvm/docs/ReleaseNotes.html:1.382
--- llvm/docs/ReleaseNotes.html:1.381   Thu May 17 17:03:43 2007
+++ llvm/docs/ReleaseNotes.html Thu May 17 19:44:29 2007
@@ -828,11 +828,10 @@
 
 
 A wide variety of additional information is available on the http://llvm.org";>LLVM web page, including http://llvm.org/docs/";>documentation and http://llvm.org/pubs/";>publications describing algorithms and
-components implemented in LLVM.  The web page also contains versions of the
-API documentation which is up-to-date with the CVS version of the source code.
+href="http://llvm.org";>LLVM web page, in particular in the http://llvm.org/docs/";>documentation section.  The web page also
+contains versions of the API documentation which is up-to-date with the CVS
+version of the source code.
 You can access versions of these documents specific to this release by going
 into the "llvm/doc/" directory in the LLVM tree.
 
@@ -851,8 +850,8 @@
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!" />
 
-  http://llvm.org/";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2007/05/17 22:03:43 $
+  http://llvm.org/";>LLVM Compiler Infrastructure
+  Last modified: $Date: 2007/05/18 00:44:29 $
 
 
 



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


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

2007-05-17 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen:

IfConversion.cpp updated: 1.4 -> 1.5
---
Log message:

Make use of target specific block size limits; bug fixes.

---
Diffs of the changes:  (+149 -64)

 IfConversion.cpp |  213 ++-
 1 files changed, 149 insertions(+), 64 deletions(-)


Index: llvm/lib/CodeGen/IfConversion.cpp
diff -u llvm/lib/CodeGen/IfConversion.cpp:1.4 
llvm/lib/CodeGen/IfConversion.cpp:1.5
--- llvm/lib/CodeGen/IfConversion.cpp:1.4   Wed May 16 16:54:37 2007
+++ llvm/lib/CodeGen/IfConversion.cpp   Thu May 17 19:20:58 2007
@@ -16,6 +16,7 @@
 #include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/Target/TargetInstrInfo.h"
+#include "llvm/Target/TargetLowering.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/ADT/Statistic.h"
@@ -37,22 +38,24 @@
 /// BBInfo - One per MachineBasicBlock, this is used to cache the result
 /// if-conversion feasibility analysis. This includes results from
 /// TargetInstrInfo::AnalyzeBranch() (i.e. TBB, FBB, and Cond), and its
-/// classification, and common merge block of its successors (if it's a
+/// classification, and common tail block of its successors (if it's a
 /// diamond shape).
 struct BBInfo {
   BBICKind Kind;
-  MachineBasicBlock *EBB;
-  MachineBasicBlock *TBB;
-  MachineBasicBlock *FBB;
-  MachineBasicBlock *CMBB;
+  MachineBasicBlock *BB;
+  MachineBasicBlock *TrueBB;
+  MachineBasicBlock *FalseBB;
+  MachineBasicBlock *TailBB;
   std::vector Cond;
-  BBInfo() : Kind(ICInvalid), EBB(0), TBB(0), FBB(0), CMBB(0) {}
+  unsigned Size;
+  BBInfo() : Kind(ICInvalid), BB(0), TrueBB(0), FalseBB(0), TailBB(0), 
Size(0) {}
 };
 
 /// BBAnalysis - Results of if-conversion feasibility analysis indexed by
 /// basic block number.
 std::vector BBAnalysis;
 
+const TargetLowering *TLI;
 const TargetInstrInfo *TII;
 bool MadeChange;
   public:
@@ -72,7 +75,7 @@
 void PredicateBlock(MachineBasicBlock *BB,
 std::vector &Cond,
 bool IgnoreTerm = false);
-void MergeBlocks(MachineBasicBlock *TBB, MachineBasicBlock *FBB);
+void MergeBlocks(BBInfo &TrueBBI, BBInfo &FalseBBI);
   };
   char IfConverter::ID = 0;
 }
@@ -80,6 +83,7 @@
 FunctionPass *llvm::createIfConverterPass() { return new IfConverter(); }
 
 bool IfConverter::runOnMachineFunction(MachineFunction &MF) {
+  TLI = MF.getTarget().getTargetLowering();
   TII = MF.getTarget().getInstrInfo();
   if (!TII) return false;
 
@@ -95,7 +99,7 @@
   InitialFunctionAnalysis(MF, Candidates);
 
   for (unsigned i = 0, e = Candidates.size(); i != e; ++i) {
-BBInfo &BBI = BBAnalysis[i];
+BBInfo &BBI = BBAnalysis[Candidates[i]];
 switch (BBI.Kind) {
 default: assert(false && "Unexpected!");
   break;
@@ -111,11 +115,11 @@
 }
 
 static MachineBasicBlock *findFalseBlock(MachineBasicBlock *BB,
- MachineBasicBlock *TBB) {
+ MachineBasicBlock *TrueBB) {
   for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(),
  E = BB->succ_end(); SI != E; ++SI) {
 MachineBasicBlock *SuccBB = *SI;
-if (SuccBB != TBB)
+if (SuccBB != TrueBB)
   return SuccBB;
   }
   return NULL;
@@ -126,36 +130,49 @@
 
   if (BBI.Kind != ICInvalid)
 return;  // Always analyzed.
-  BBI.EBB = BB;
+  BBI.BB = BB;
+  BBI.Size = std::distance(BB->begin(), BB->end());
 
   // Look for 'root' of a simple (non-nested) triangle or diamond.
   BBI.Kind = ICNotClassfied;
-  if (TII->AnalyzeBranch(*BB, BBI.TBB, BBI.FBB, BBI.Cond)
-  || !BBI.TBB || BBI.Cond.size() == 0)
+  if (TII->AnalyzeBranch(*BB, BBI.TrueBB, BBI.FalseBB, BBI.Cond)
+  || !BBI.TrueBB || BBI.Cond.size() == 0)
 return;
-  // Can't do it if 'true' block is already marked as to be if-converted.
-  AnalyzeBlock(BBI.TBB);
-  BBInfo &TBBI = BBAnalysis[BBI.TBB->getNumber()];
-  if (TBBI.Kind != ICNotClassfied)
+
+  // Not a candidate if 'true' block has another predecessor.
+  // FIXME: Use or'd predicate or predicated cmp.
+  if (BBI.TrueBB->pred_size() > 1)
+return;
+
+  // Not a candidate if 'true' block is going to be if-converted.
+  AnalyzeBlock(BBI.TrueBB);
+  BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()];
+  if (TrueBBI.Kind != ICNotClassfied)
 return;
 
   // No false branch. This BB must end with a conditional branch and a
   // fallthrough.
-  if (!BBI.FBB)
-BBI.FBB = findFalseBlock(BB, BBI.TBB);  
-  assert(BBI.FBB && "Expected to find the fallthrough block!");
-
-  // Can't do it if 'false' block is already marked as to be if-converted.
-  AnalyzeBlock(BBI.FBB);
-  BBInfo &FBBI = BBAnalysis[BBI.FBB->getNumber()];
-  if (FBBI.Kind != ICNotClassfied)
+  if (!BBI.FalseBB)
+BBI.FalseBB = findFalseBlock(BB, BBI.TrueBB);  
+  assert(

[llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp

2007-05-17 Thread Evan Cheng


Changes in directory llvm/lib/Target/ARM:

ARMISelLowering.cpp updated: 1.53 -> 1.54
---
Log message:

Set ARM if-conversion block size threshold to 10 instructions for now.

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

 ARMISelLowering.cpp |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/ARM/ARMISelLowering.cpp
diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.53 
llvm/lib/Target/ARM/ARMISelLowering.cpp:1.54
--- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.53Thu May 17 16:31:21 2007
+++ llvm/lib/Target/ARM/ARMISelLowering.cpp Thu May 17 19:19:34 2007
@@ -124,6 +124,7 @@
 addRegisterClass(MVT::f32, ARM::SPRRegisterClass);
 addRegisterClass(MVT::f64, ARM::DPRRegisterClass);
   }
+  computeRegisterProperties();
 
   // ARM does not have f32 extending load.
   setLoadXAction(ISD::EXTLOAD, MVT::f32, Expand);
@@ -252,9 +253,8 @@
   setOperationAction(ISD::FP_TO_SINT, MVT::i32, Custom);
 
   setStackPointerRegisterToSaveRestore(ARM::SP);
-
   setSchedulingPreference(SchedulingForRegPressure);
-  computeRegisterProperties();
+  setIfCvtBlockSizeLimit(Subtarget->isThumb() ? 0 : 10);
 
   maxStoresPerMemcpy = 1;    temporary - rewrite interface to use type
 }



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


[llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrInfo.h ARMInstrInfo.cpp

2007-05-17 Thread Evan Cheng


Changes in directory llvm/lib/Target/ARM:

ARMInstrInfo.h updated: 1.10 -> 1.11
ARMInstrInfo.cpp updated: 1.27 -> 1.28
---
Log message:

RemoveBranch() and InsertBranch() now returns number of instructions deleted / 
inserted.

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

 ARMInstrInfo.cpp |   16 +---
 ARMInstrInfo.h   |8 
 2 files changed, 13 insertions(+), 11 deletions(-)


Index: llvm/lib/Target/ARM/ARMInstrInfo.h
diff -u llvm/lib/Target/ARM/ARMInstrInfo.h:1.10 
llvm/lib/Target/ARM/ARMInstrInfo.h:1.11
--- llvm/lib/Target/ARM/ARMInstrInfo.h:1.10 Wed May 16 16:53:07 2007
+++ llvm/lib/Target/ARM/ARMInstrInfo.h  Thu May 17 19:18:17 2007
@@ -96,10 +96,10 @@
   virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
  MachineBasicBlock *&FBB,
  std::vector &Cond) const;
-  virtual void RemoveBranch(MachineBasicBlock &MBB) const;
-  virtual void InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
-MachineBasicBlock *FBB,
-const std::vector &Cond) const;
+  virtual unsigned RemoveBranch(MachineBasicBlock &MBB) const;
+  virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
+MachineBasicBlock *FBB,
+const std::vector &Cond) const;
   virtual bool BlockHasNoFallThrough(MachineBasicBlock &MBB) const;
   virtual bool ReverseBranchCondition(std::vector &Cond) const;
 


Index: llvm/lib/Target/ARM/ARMInstrInfo.cpp
diff -u llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.27 
llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.28
--- llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.27   Wed May 16 16:53:07 2007
+++ llvm/lib/Target/ARM/ARMInstrInfo.cppThu May 17 19:18:17 2007
@@ -349,33 +349,34 @@
 }
 
 
-void ARMInstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
+unsigned ARMInstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
   MachineFunction &MF = *MBB.getParent();
   ARMFunctionInfo *AFI = MF.getInfo();
   int BOpc   = AFI->isThumbFunction() ? ARM::tB : ARM::B;
   int BccOpc = AFI->isThumbFunction() ? ARM::tBcc : ARM::Bcc;
 
   MachineBasicBlock::iterator I = MBB.end();
-  if (I == MBB.begin()) return;
+  if (I == MBB.begin()) return 0;
   --I;
   if (I->getOpcode() != BOpc && I->getOpcode() != BccOpc)
-return;
+return 0;
   
   // Remove the branch.
   I->eraseFromParent();
   
   I = MBB.end();
   
-  if (I == MBB.begin()) return;
+  if (I == MBB.begin()) return 1;
   --I;
   if (I->getOpcode() != BccOpc)
-return;
+return 1;
   
   // Remove the branch.
   I->eraseFromParent();
+  return 2;
 }
 
-void ARMInstrInfo::InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
+unsigned ARMInstrInfo::InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock 
*TBB,
 MachineBasicBlock *FBB,
 const std::vector &Cond) const 
{
   MachineFunction &MF = *MBB.getParent();
@@ -393,12 +394,13 @@
   BuildMI(&MBB, get(BOpc)).addMBB(TBB);
 else
   BuildMI(&MBB, get(BccOpc)).addMBB(TBB).addImm(Cond[0].getImm());
-return;
+return 1;
   }
   
   // Two-way conditional branch.
   BuildMI(&MBB, get(BccOpc)).addMBB(TBB).addImm(Cond[0].getImm());
   BuildMI(&MBB, get(BOpc)).addMBB(FBB);
+  return 2;
 }
 
 bool ARMInstrInfo::BlockHasNoFallThrough(MachineBasicBlock &MBB) const {



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


[llvm-commits] CVS: llvm/lib/Target/Sparc/SparcInstrInfo.cpp SparcInstrInfo.h

2007-05-17 Thread Evan Cheng


Changes in directory llvm/lib/Target/Sparc:

SparcInstrInfo.cpp updated: 1.17 -> 1.18
SparcInstrInfo.h updated: 1.10 -> 1.11
---
Log message:

RemoveBranch() and InsertBranch() now returns number of instructions deleted / 
inserted.

---
Diffs of the changes:  (+8 -6)

 SparcInstrInfo.cpp |8 +---
 SparcInstrInfo.h   |6 +++---
 2 files changed, 8 insertions(+), 6 deletions(-)


Index: llvm/lib/Target/Sparc/SparcInstrInfo.cpp
diff -u llvm/lib/Target/Sparc/SparcInstrInfo.cpp:1.17 
llvm/lib/Target/Sparc/SparcInstrInfo.cpp:1.18
--- llvm/lib/Target/Sparc/SparcInstrInfo.cpp:1.17   Mon Nov 27 17:37:22 2006
+++ llvm/lib/Target/Sparc/SparcInstrInfo.cppThu May 17 19:17:28 2007
@@ -97,10 +97,12 @@
   return 0;
 }
 
-void SparcInstrInfo::InsertBranch(MachineBasicBlock &MBB,MachineBasicBlock 
*TBB,
-  MachineBasicBlock *FBB,
-  const std::vector 
&Cond)const{
+unsigned
+SparcInstrInfo::InsertBranch(MachineBasicBlock &MBB,MachineBasicBlock *TBB,
+ MachineBasicBlock *FBB,
+ const std::vector &Cond)const{
   // Can only insert uncond branches so far.
   assert(Cond.empty() && !FBB && TBB && "Can only handle uncond branches!");
   BuildMI(&MBB, get(SP::BA)).addMBB(TBB);
+  return 1;
 }


Index: llvm/lib/Target/Sparc/SparcInstrInfo.h
diff -u llvm/lib/Target/Sparc/SparcInstrInfo.h:1.10 
llvm/lib/Target/Sparc/SparcInstrInfo.h:1.11
--- llvm/lib/Target/Sparc/SparcInstrInfo.h:1.10 Tue Oct 24 11:39:19 2006
+++ llvm/lib/Target/Sparc/SparcInstrInfo.h  Thu May 17 19:17:28 2007
@@ -63,9 +63,9 @@
   virtual unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
   
   
-  virtual void InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
-MachineBasicBlock *FBB,
-const std::vector &Cond) const;
+  virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
+MachineBasicBlock *FBB,
+const std::vector &Cond) const;
 };
 
 }



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.cpp X86InstrInfo.h

2007-05-17 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86InstrInfo.cpp updated: 1.85 -> 1.86
X86InstrInfo.h updated: 1.63 -> 1.64
---
Log message:

RemoveBranch() and InsertBranch() now returns number of instructions deleted / 
inserted.

---
Diffs of the changes:  (+16 -13)

 X86InstrInfo.cpp |   21 -
 X86InstrInfo.h   |8 
 2 files changed, 16 insertions(+), 13 deletions(-)


Index: llvm/lib/Target/X86/X86InstrInfo.cpp
diff -u llvm/lib/Target/X86/X86InstrInfo.cpp:1.85 
llvm/lib/Target/X86/X86InstrInfo.cpp:1.86
--- llvm/lib/Target/X86/X86InstrInfo.cpp:1.85   Wed Apr 25 02:12:14 2007
+++ llvm/lib/Target/X86/X86InstrInfo.cppThu May 17 19:17:09 2007
@@ -431,31 +431,33 @@
   return true;
 }
 
-void X86InstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
+unsigned X86InstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
   MachineBasicBlock::iterator I = MBB.end();
-  if (I == MBB.begin()) return;
+  if (I == MBB.begin()) return 0;
   --I;
   if (I->getOpcode() != X86::JMP && 
   GetCondFromBranchOpc(I->getOpcode()) == X86::COND_INVALID)
-return;
+return 0;
   
   // Remove the branch.
   I->eraseFromParent();
   
   I = MBB.end();
   
-  if (I == MBB.begin()) return;
+  if (I == MBB.begin()) return 1;
   --I;
   if (GetCondFromBranchOpc(I->getOpcode()) == X86::COND_INVALID)
-return;
+return 1;
   
   // Remove the branch.
   I->eraseFromParent();
+  return 2;
 }
 
-void X86InstrInfo::InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
-MachineBasicBlock *FBB,
-const std::vector &Cond) const 
{
+unsigned
+X86InstrInfo::InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
+   MachineBasicBlock *FBB,
+   const std::vector &Cond) const {
   // Shouldn't be a fall through.
   assert(TBB && "InsertBranch must not be told to insert a fallthrough");
   assert((Cond.size() == 1 || Cond.size() == 0) &&
@@ -470,13 +472,14 @@
   unsigned Opc = GetCondBranchFromCond((X86::CondCode)Cond[0].getImm());
   BuildMI(&MBB, get(Opc)).addMBB(TBB);
 }
-return;
+return 1;
   }
   
   // Two-way Conditional branch.
   unsigned Opc = GetCondBranchFromCond((X86::CondCode)Cond[0].getImm());
   BuildMI(&MBB, get(Opc)).addMBB(TBB);
   BuildMI(&MBB, get(X86::JMP)).addMBB(FBB);
+  return 2;
 }
 
 bool X86InstrInfo::BlockHasNoFallThrough(MachineBasicBlock &MBB) const {


Index: llvm/lib/Target/X86/X86InstrInfo.h
diff -u llvm/lib/Target/X86/X86InstrInfo.h:1.63 
llvm/lib/Target/X86/X86InstrInfo.h:1.64
--- llvm/lib/Target/X86/X86InstrInfo.h:1.63 Tue Apr 10 17:10:25 2007
+++ llvm/lib/Target/X86/X86InstrInfo.h  Thu May 17 19:17:09 2007
@@ -263,10 +263,10 @@
   virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
  MachineBasicBlock *&FBB,
  std::vector &Cond) const;
-  virtual void RemoveBranch(MachineBasicBlock &MBB) const;
-  virtual void InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
-MachineBasicBlock *FBB,
-const std::vector &Cond) const;
+  virtual unsigned RemoveBranch(MachineBasicBlock &MBB) const;
+  virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
+MachineBasicBlock *FBB,
+const std::vector &Cond) const;
   virtual bool BlockHasNoFallThrough(MachineBasicBlock &MBB) const;
   virtual bool ReverseBranchCondition(std::vector &Cond) const;
 



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


[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp PPCInstrInfo.h

2007-05-17 Thread Evan Cheng


Changes in directory llvm/lib/Target/PowerPC:

PPCInstrInfo.cpp updated: 1.37 -> 1.38
PPCInstrInfo.h updated: 1.21 -> 1.22
---
Log message:

RemoveBranch() and InsertBranch() now returns number of instructions deleted / 
inserted.

---
Diffs of the changes:  (+16 -13)

 PPCInstrInfo.cpp |   21 -
 PPCInstrInfo.h   |8 
 2 files changed, 16 insertions(+), 13 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.37 
llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.38
--- llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.37   Wed Apr 25 02:12:14 2007
+++ llvm/lib/Target/PowerPC/PPCInstrInfo.cppThu May 17 19:05:48 2007
@@ -224,30 +224,32 @@
   return true;
 }
 
-void PPCInstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
+unsigned PPCInstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
   MachineBasicBlock::iterator I = MBB.end();
-  if (I == MBB.begin()) return;
+  if (I == MBB.begin()) return 0;
   --I;
   if (I->getOpcode() != PPC::B && I->getOpcode() != PPC::BCC)
-return;
+return 0;
   
   // Remove the branch.
   I->eraseFromParent();
   
   I = MBB.end();
 
-  if (I == MBB.begin()) return;
+  if (I == MBB.begin()) return 1;
   --I;
   if (I->getOpcode() != PPC::BCC)
-return;
+return 1;
   
   // Remove the branch.
   I->eraseFromParent();
+  return 2;
 }
 
-void PPCInstrInfo::InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
-MachineBasicBlock *FBB,
-const std::vector &Cond) const 
{
+unsigned
+PPCInstrInfo::InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
+   MachineBasicBlock *FBB,
+   const std::vector &Cond) const {
   // Shouldn't be a fall through.
   assert(TBB && "InsertBranch must not be told to insert a fallthrough");
   assert((Cond.size() == 2 || Cond.size() == 0) && 
@@ -260,13 +262,14 @@
 else// Conditional branch
   BuildMI(&MBB, get(PPC::BCC))
 .addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB);
-return;
+return 1;
   }
   
   // Two-way Conditional Branch.
   BuildMI(&MBB, get(PPC::BCC))
 .addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB);
   BuildMI(&MBB, get(PPC::B)).addMBB(FBB);
+  return 2;
 }
 
 bool PPCInstrInfo::BlockHasNoFallThrough(MachineBasicBlock &MBB) const {


Index: llvm/lib/Target/PowerPC/PPCInstrInfo.h
diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.h:1.21 
llvm/lib/Target/PowerPC/PPCInstrInfo.h:1.22
--- llvm/lib/Target/PowerPC/PPCInstrInfo.h:1.21 Fri Jan 26 08:34:51 2007
+++ llvm/lib/Target/PowerPC/PPCInstrInfo.h  Thu May 17 19:05:48 2007
@@ -99,10 +99,10 @@
   virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
  MachineBasicBlock *&FBB,
  std::vector &Cond) const;
-  virtual void RemoveBranch(MachineBasicBlock &MBB) const;
-  virtual void InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
-MachineBasicBlock *FBB,
-const std::vector &Cond) const;
+  virtual unsigned RemoveBranch(MachineBasicBlock &MBB) const;
+  virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
+MachineBasicBlock *FBB,
+const std::vector &Cond) const;
   virtual bool BlockHasNoFallThrough(MachineBasicBlock &MBB) const;
   virtual bool ReverseBranchCondition(std::vector &Cond) const;
 };



___
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.cpp IA64InstrInfo.h

2007-05-17 Thread Evan Cheng


Changes in directory llvm/lib/Target/IA64:

IA64InstrInfo.cpp updated: 1.8 -> 1.9
IA64InstrInfo.h updated: 1.3 -> 1.4
---
Log message:

RemoveBranch() and InsertBranch() now returns number of instructions deleted / 
inserted.

---
Diffs of the changes:  (+8 -6)

 IA64InstrInfo.cpp |8 +---
 IA64InstrInfo.h   |6 +++---
 2 files changed, 8 insertions(+), 6 deletions(-)


Index: llvm/lib/Target/IA64/IA64InstrInfo.cpp
diff -u llvm/lib/Target/IA64/IA64InstrInfo.cpp:1.8 
llvm/lib/Target/IA64/IA64InstrInfo.cpp:1.9
--- llvm/lib/Target/IA64/IA64InstrInfo.cpp:1.8  Wed Apr 25 02:12:14 2007
+++ llvm/lib/Target/IA64/IA64InstrInfo.cpp  Thu May 17 19:04:06 2007
@@ -47,10 +47,12 @@
 // move instruction
 }
 
-void IA64InstrInfo::InsertBranch(MachineBasicBlock &MBB,MachineBasicBlock *TBB,
- MachineBasicBlock *FBB,
- const std::vector &Cond)const 
{
+unsigned
+IA64InstrInfo::InsertBranch(MachineBasicBlock &MBB,MachineBasicBlock *TBB,
+MachineBasicBlock *FBB,
+const std::vector &Cond)const {
   // Can only insert uncond branches so far.
   assert(Cond.empty() && !FBB && TBB && "Can only handle uncond branches!");
   BuildMI(&MBB, get(IA64::BRL_NOTCALL)).addMBB(TBB);
+  return 1;
 }


Index: llvm/lib/Target/IA64/IA64InstrInfo.h
diff -u llvm/lib/Target/IA64/IA64InstrInfo.h:1.3 
llvm/lib/Target/IA64/IA64InstrInfo.h:1.4
--- llvm/lib/Target/IA64/IA64InstrInfo.h:1.3Tue Oct 24 11:44:55 2006
+++ llvm/lib/Target/IA64/IA64InstrInfo.hThu May 17 19:04:06 2007
@@ -37,9 +37,9 @@
   virtual bool isMoveInstr(const MachineInstr& MI,
unsigned& sourceReg,
unsigned& destReg) const;
-  virtual void InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
-MachineBasicBlock *FBB,
-const std::vector &Cond) const;
+  virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
+MachineBasicBlock *FBB,
+const std::vector &Cond) const;
 
 };
 



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


[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaInstrInfo.cpp AlphaInstrInfo.h

2007-05-17 Thread Evan Cheng


Changes in directory llvm/lib/Target/Alpha:

AlphaInstrInfo.cpp updated: 1.17 -> 1.18
AlphaInstrInfo.h updated: 1.7 -> 1.8
---
Log message:

RemoveBranch() and InsertBranch() now returns number of instructions deleted / 
inserted.

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

 AlphaInstrInfo.cpp |   16 +---
 AlphaInstrInfo.h   |4 ++--
 2 files changed, 11 insertions(+), 9 deletions(-)


Index: llvm/lib/Target/Alpha/AlphaInstrInfo.cpp
diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.cpp:1.17 
llvm/lib/Target/Alpha/AlphaInstrInfo.cpp:1.18
--- llvm/lib/Target/Alpha/AlphaInstrInfo.cpp:1.17   Wed Apr 25 02:12:14 2007
+++ llvm/lib/Target/Alpha/AlphaInstrInfo.cppThu May 17 19:02:59 2007
@@ -99,7 +99,7 @@
   }
 }
 
-void AlphaInstrInfo::InsertBranch(MachineBasicBlock &MBB,MachineBasicBlock 
*TBB,
+unsigned AlphaInstrInfo::InsertBranch(MachineBasicBlock &MBB,MachineBasicBlock 
*TBB,
   MachineBasicBlock *FBB,
   const std::vector 
&Cond)const{
   assert(TBB && "InsertBranch must not be told to insert a fallthrough");
@@ -117,7 +117,7 @@
   else
 BuildMI(&MBB, get(Alpha::COND_BRANCH_F))
   .addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB);
-return;
+return 1;
   }
   
   // Two-way Conditional Branch.
@@ -128,6 +128,7 @@
 BuildMI(&MBB, get(Alpha::COND_BRANCH_F))
   .addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB);
   BuildMI(&MBB, get(Alpha::BR)).addMBB(FBB);
+  return 2;
 }
 
 static unsigned AlphaRevCondCode(unsigned Opcode) {
@@ -203,28 +204,29 @@
   return true;
 }
 
-void AlphaInstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
+unsigned AlphaInstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
   MachineBasicBlock::iterator I = MBB.end();
-  if (I == MBB.begin()) return;
+  if (I == MBB.begin()) return 0;
   --I;
   if (I->getOpcode() != Alpha::BR && 
   I->getOpcode() != Alpha::COND_BRANCH_I &&
   I->getOpcode() != Alpha::COND_BRANCH_F)
-return;
+return 0;
   
   // Remove the branch.
   I->eraseFromParent();
   
   I = MBB.end();
 
-  if (I == MBB.begin()) return;
+  if (I == MBB.begin()) return 1;
   --I;
   if (I->getOpcode() != Alpha::COND_BRANCH_I && 
   I->getOpcode() != Alpha::COND_BRANCH_F)
-return;
+return 1;
   
   // Remove the branch.
   I->eraseFromParent();
+  return 2;
 }
 
 void AlphaInstrInfo::insertNoop(MachineBasicBlock &MBB, 


Index: llvm/lib/Target/Alpha/AlphaInstrInfo.h
diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.h:1.7 
llvm/lib/Target/Alpha/AlphaInstrInfo.h:1.8
--- llvm/lib/Target/Alpha/AlphaInstrInfo.h:1.7  Tue Oct 31 10:49:55 2006
+++ llvm/lib/Target/Alpha/AlphaInstrInfo.h  Thu May 17 19:02:59 2007
@@ -39,13 +39,13 @@
   virtual unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) 
const;
   virtual unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
   
-  virtual void InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
+  virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
 MachineBasicBlock *FBB,
 const std::vector &Cond) const;
   bool AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TBB,
  MachineBasicBlock *&FBB,
  std::vector &Cond) const;
-  void RemoveBranch(MachineBasicBlock &MBB) const;
+  unsigned RemoveBranch(MachineBasicBlock &MBB) const;
   void insertNoop(MachineBasicBlock &MBB, 
   MachineBasicBlock::iterator MI) const;
   bool BlockHasNoFallThrough(MachineBasicBlock &MBB) const;



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


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

2007-05-17 Thread Evan Cheng


Changes in directory llvm/include/llvm/Target:

TargetInstrInfo.h updated: 1.121 -> 1.122
---
Log message:

RemoveBranch() and InsertBranch() now returns number of instructions deleted / 
inserted.

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

 TargetInstrInfo.h |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)


Index: llvm/include/llvm/Target/TargetInstrInfo.h
diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.121 
llvm/include/llvm/Target/TargetInstrInfo.h:1.122
--- llvm/include/llvm/Target/TargetInstrInfo.h:1.121Wed May 16 19:10:58 2007
+++ llvm/include/llvm/Target/TargetInstrInfo.h  Thu May 17 19:01:09 2007
@@ -350,20 +350,24 @@
   }
   
   /// RemoveBranch - Remove the branching code at the end of the specific MBB.
-  /// this is only invoked in cases where AnalyzeBranch returns success.
-  virtual void RemoveBranch(MachineBasicBlock &MBB) const {
+  /// this is only invoked in cases where AnalyzeBranch returns success. It
+  /// returns the number of instructions that were removed.
+  virtual unsigned RemoveBranch(MachineBasicBlock &MBB) const {
 assert(0 && "Target didn't implement TargetInstrInfo::RemoveBranch!"); 
+return 0;
   }
   
   /// InsertBranch - Insert a branch into the end of the specified
   /// MachineBasicBlock.  This operands to this method are the same as those
   /// returned by AnalyzeBranch.  This is invoked in cases where AnalyzeBranch
   /// returns success and when an unconditional branch (TBB is non-null, FBB is
-  /// null, Cond is empty) needs to be inserted.
-  virtual void InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
+  /// null, Cond is empty) needs to be inserted. It returns the number of
+  /// instructions inserted.
+  virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
 MachineBasicBlock *FBB,
 const std::vector &Cond) const {
 assert(0 && "Target didn't implement TargetInstrInfo::InsertBranch!"); 
+return 0;
   }
   
   /// BlockHasNoFallThrough - Return true if the specified block does not



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


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

2007-05-17 Thread Evan Cheng


Changes in directory llvm/include/llvm/Target:

TargetLowering.h updated: 1.125 -> 1.126
---
Log message:

Fix comment.

---
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.125 
llvm/include/llvm/Target/TargetLowering.h:1.126
--- llvm/include/llvm/Target/TargetLowering.h:1.125 Wed May 16 18:44:08 2007
+++ llvm/include/llvm/Target/TargetLowering.h   Thu May 17 19:00:30 2007
@@ -757,8 +757,8 @@
 JumpBufAlignment = Align;
   }
 
-  /// setIfCvtBlockSizeLimit - Set the target's if-conversion block size limit;
-  /// default is 2.
+  /// setIfCvtBlockSizeLimit - Set the target's if-conversion block size
+  /// (in number of instructions); default is 2.
   void setIfCvtBlockSizeLimit(unsigned Limit) {
 IfCvtBlockSizeLimit = Limit;
   }



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


[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineBasicBlock.h

2007-05-17 Thread Evan Cheng


Changes in directory llvm/include/llvm/CodeGen:

MachineBasicBlock.h updated: 1.63 -> 1.64
---
Log message:

Move isSuccessor() offline, change it to use std::find.

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

 MachineBasicBlock.h |7 +--
 1 files changed, 1 insertion(+), 6 deletions(-)


Index: llvm/include/llvm/CodeGen/MachineBasicBlock.h
diff -u llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.63 
llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.64
--- llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.63  Tue May  8 13:55:03 2007
+++ llvm/include/llvm/CodeGen/MachineBasicBlock.h   Thu May 17 18:58:52 2007
@@ -217,12 +217,7 @@
   
   /// isSuccessor - Return true if the specified MBB is a successor of this
   /// block.
-  bool isSuccessor(MachineBasicBlock *MBB) const {
-for (const_succ_iterator I = succ_begin(), E = succ_end(); I != E; ++I)
-  if (*I == MBB)
-return true;
-return false;
-  }
+  bool isSuccessor(MachineBasicBlock *MBB) const;
 
   /// getFirstTerminator - returns an iterator to the first terminator
   /// instruction of this basic block. If a terminator does not exist,



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


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

2007-05-17 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen:

MachineBasicBlock.cpp updated: 1.44 -> 1.45
---
Log message:

Move isSuccessor() offline, change it to use std::find.

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

 MachineBasicBlock.cpp |6 ++
 1 files changed, 6 insertions(+)


Index: llvm/lib/CodeGen/MachineBasicBlock.cpp
diff -u llvm/lib/CodeGen/MachineBasicBlock.cpp:1.44 
llvm/lib/CodeGen/MachineBasicBlock.cpp:1.45
--- llvm/lib/CodeGen/MachineBasicBlock.cpp:1.44 Mon Apr 30 18:12:53 2007
+++ llvm/lib/CodeGen/MachineBasicBlock.cpp  Thu May 17 18:58:53 2007
@@ -192,3 +192,9 @@
   assert(I != Predecessors.end() && "Pred is not a predecessor of this 
block!");
   Predecessors.erase(I);
 }
+
+bool MachineBasicBlock::isSuccessor(MachineBasicBlock *MBB) const {
+  std::vector::const_iterator I =
+std::find(Successors.begin(), Successors.end(), MBB);
+  return I != Successors.end();
+}



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


[llvm-commits] [127367] Make ARM more aggressive about using target-dependent

2007-05-17 Thread johannes
Revision: 127367
Author:   johannes
Date: 2007-05-17 16:47:22 -0700 (Thu, 17 May 2007)

Log Message:
---
Make ARM more aggressive about using target-dependent
memcpy expansion for aggregate copy.

Modified Paths:
--
apple-local/branches/llvm/gcc/config/arm/arm.h
apple-local/branches/llvm/gcc/llvm-convert.cpp

Modified: apple-local/branches/llvm/gcc/config/arm/arm.h
===
--- apple-local/branches/llvm/gcc/config/arm/arm.h  2007-05-17 21:04:42 UTC 
(rev 127366)
+++ apple-local/branches/llvm/gcc/config/arm/arm.h  2007-05-17 23:47:22 UTC 
(rev 127367)
@@ -2923,4 +2923,8 @@
 #define LLVM_OVERRIDE_TARGET_ARCH() \
   (TARGET_THUMB ? "thumb" : "")
 
+/* Doing struct copy by partial-word loads and stores is not a good idea on 
ARM. */
+#define TARGET_LLVM_MIN_BYTES_COPY_BY_MEMCPY 4
+/* APPLE LOCAL end llvm */
+
 #endif /* ! GCC_ARM_H */

Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp
===
--- apple-local/branches/llvm/gcc/llvm-convert.cpp  2007-05-17 21:04:42 UTC 
(rev 127366)
+++ apple-local/branches/llvm/gcc/llvm-convert.cpp  2007-05-17 23:47:22 UTC 
(rev 127367)
@@ -1120,6 +1120,10 @@
   }
 }
 
+#ifndef TARGET_LLVM_MIN_BYTES_COPY_BY_MEMCPY
+#define TARGET_LLVM_MIN_BYTES_COPY_BY_MEMCPY 64
+#endif
+
 /// EmitAggregateCopy - Copy the elements from SrcPtr to DestPtr, using the
 /// GCC type specified by GCCType to know which elements to copy.
 void TreeToLLVM::EmitAggregateCopy(Value *DestPtr, Value *SrcPtr, tree type,
@@ -1129,7 +1133,8 @@
 
   // If the type is small, copy the elements instead of using a block copy.
   if (TREE_CODE(TYPE_SIZE(type)) == INTEGER_CST &&
-  TREE_INT_CST_LOW(TYPE_SIZE_UNIT(type)) < 64) {
+  TREE_INT_CST_LOW(TYPE_SIZE_UNIT(type)) <
+  TARGET_LLVM_MIN_BYTES_COPY_BY_MEMCPY) {
 const Type *LLVMTy = ConvertType(type);
 if (CountAggregateElements(LLVMTy) <= 8) {
   DestPtr = CastToType(Instruction::BitCast, DestPtr, 


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


[llvm-commits] CVS: llvm/Makefile.rules

2007-05-17 Thread Reid Spencer


Changes in directory llvm:

Makefile.rules updated: 1.434 -> 1.435
---
Log message:

Fix a problem with building .y files when BISON is not present. 
Merged from the release_20 branch.


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

 Makefile.rules |   15 +++
 1 files changed, 11 insertions(+), 4 deletions(-)


Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.434 llvm/Makefile.rules:1.435
--- llvm/Makefile.rules:1.434   Wed May  2 16:31:09 2007
+++ llvm/Makefile.rules Thu May 17 17:51:35 2007
@@ -1359,15 +1359,12 @@
 %.h: %.y
 
 # Rule for building the bison based parsers...
-$(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y
 ifneq ($(BISON),)
+$(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y
$(Echo) "Bisoning $*.y"
$(Verb) $(BISON) -v -d -p $(http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [release_20] CVS: llvm/Makefile.rules

2007-05-17 Thread Reid Spencer


Changes in directory llvm:

Makefile.rules updated: 1.434 -> 1.434.2.1
---
Log message:

Fix the rules for handling the case when BISON is not available. We want
this to succeed by copying the .h.cvs file to .h and the .cpp.cvs file to
.cpp. 


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

 Makefile.rules |   15 +++
 1 files changed, 11 insertions(+), 4 deletions(-)


Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.434 llvm/Makefile.rules:1.434.2.1
--- llvm/Makefile.rules:1.434   Wed May  2 16:31:09 2007
+++ llvm/Makefile.rules Thu May 17 17:42:28 2007
@@ -1359,15 +1359,12 @@
 %.h: %.y
 
 # Rule for building the bison based parsers...
-$(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y
 ifneq ($(BISON),)
+$(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y
$(Echo) "Bisoning $*.y"
$(Verb) $(BISON) -v -d -p $(http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [see] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp

2007-05-17 Thread Andrew Lenharth


Changes in directory llvm/lib/Analysis:

BasicAliasAnalysis.cpp updated: 1.89 -> 1.89.4.1
---
Log message:

aa info for some runtime functions

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

 BasicAliasAnalysis.cpp |8 +++-
 1 files changed, 7 insertions(+), 1 deletion(-)


Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.89 
llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.89.4.1
--- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.89   Fri Nov  3 15:58:48 2006
+++ llvm/lib/Analysis/BasicAliasAnalysis.cppThu May 17 17:16:56 2007
@@ -786,6 +786,9 @@
 
   // ISO C99:
   "__signbit", "__signbitf", "__signbitl",
+
+  //Kernel hack
+  "exactcheck1", "exactcheck2", "exactcheck3"
 };
 
 
@@ -810,7 +813,10 @@
 
   // File I/O
   "feof", "ferror", "fileno",
-  "feof_unlocked", "ferror_unlocked", "fileno_unlocked"
+  "feof_unlocked", "ferror_unlocked", "fileno_unlocked",
+
+  //Kernel hack
+  "getBounds", "getBegin", "getEnd"
 };
 
 static ManagedStatic > NoMemoryTable;



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


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/SCCP.cpp

2007-05-17 Thread Devang Patel


Changes in directory llvm/lib/Transforms/Scalar:

SCCP.cpp updated: 1.169 -> 1.170
---
Log message:

Fix PR1431: http://llvm.org/PR1431 
Test case at Transformations/SCCP/2007-05-16-InvokeCrash.ll


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

 SCCP.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.169 
llvm/lib/Transforms/Scalar/SCCP.cpp:1.170
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.169   Sun May  6 08:37:16 2007
+++ llvm/lib/Transforms/Scalar/SCCP.cpp Thu May 17 17:10:15 2007
@@ -1417,7 +1417,7 @@
 Instruction *Inst = BI++;
 if (Inst->getType() != Type::VoidTy) {
   LatticeVal &IV = Values[Inst];
-  if (IV.isConstant() || IV.isUndefined() &&
+  if ((IV.isConstant() || IV.isUndefined()) &&
   !isa(Inst)) {
 Constant *Const = IV.isConstant()
   ? IV.getConstant() : UndefValue::get(Inst->getType());



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


[llvm-commits] CVS: llvm/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll

2007-05-17 Thread Devang Patel


Changes in directory llvm/test/Transforms/SCCP:

2007-05-16-InvokeCrash.ll added (r1.1)
---
Log message:

New test.


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

 2007-05-16-InvokeCrash.ll |   50 ++
 1 files changed, 50 insertions(+)


Index: llvm/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll
diff -c /dev/null llvm/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll:1.1
*** /dev/null   Thu May 17 17:05:31 2007
--- llvm/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll Thu May 17 17:05:20 2007
***
*** 0 
--- 1,50 
+ ; RUN: llvm-upgrade < %s  | llvm-as | opt -sccp -disable-output
+ ; PR 1431
+ 
+ void @_ada_bench() {
+ entry:
+   br label %cond_next
+ 
+ cond_next:; preds = %cond_next, %entry
+   %indvar46 = phi i32 [ 0, %entry ], [ %indvar.next47, %cond_next ]   
;  [#uses=1]
+   %indvar.next47 = add i32 %indvar46, 1   ;  [#uses=2]
+   %exitcond48 = icmp eq i32 %indvar.next47, 1 ;  [#uses=1]
+   br i1 %exitcond48, label %cond_next40, label %cond_next
+ 
+ cond_next40:  ; preds = %cond_next40, %cond_next
+   %indvar43 = phi i32 [ %indvar.next44, %cond_next40 ], [ 0, %cond_next ] 
;  [#uses=1]
+   %indvar.next44 = add i32 %indvar43, 1   ;  [#uses=2]
+   %exitcond45 = icmp eq i32 %indvar.next44, 1 ;  [#uses=1]
+   br i1 %exitcond45, label %cond_next53, label %cond_next40
+ 
+ cond_next53:  ; preds = %cond_next53, %cond_next40
+   %indvar41 = phi i32 [ %indvar.next42, %cond_next53 ], [ 0, %cond_next40 
]   ;  [#uses=1]
+   %indvar.next42 = add i32 %indvar41, 1   ;  [#uses=2]
+   %exitcond = icmp eq i32 %indvar.next42, 1   ;  [#uses=1]
+   br i1 %exitcond, label %bb67, label %cond_next53
+ 
+ bb67: ; preds = %cond_next53
+   %tmp112 = invoke double @sin( double 5.00e-01 )
+   to label %bb114 unwind label %cleanup   ; 
 [#uses=0]
+ 
+ bb114:; preds = %bb67
+   %tmp147 = invoke double @log( double 5.00e-01 )
+   to label %bb149 unwind label %cleanup   ; 
 [#uses=0]
+ 
+ bb149:; preds = %bb114
+   %tmp175 = invoke double @sqrt( double 5.00e-01 )
+   to label %bb177 unwind label %cleanup   ; 
 [#uses=0]
+ 
+ bb177:; preds = %bb149
+   unreachable
+ 
+ cleanup:  ; preds = %bb149, %bb114, %bb67
+   unwind
+ }
+ 
+ declare double @sin(double)
+ 
+ declare double @log(double)
+ 
+ declare double @sqrt(double)
+ 



___
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

2007-05-17 Thread Chris Lattner


Changes in directory llvm/docs:

ReleaseNotes.html updated: 1.380 -> 1.381
---
Log message:

validation fixes


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

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


Index: llvm/docs/ReleaseNotes.html
diff -u llvm/docs/ReleaseNotes.html:1.380 llvm/docs/ReleaseNotes.html:1.381
--- llvm/docs/ReleaseNotes.html:1.380   Thu May 17 17:02:24 2007
+++ llvm/docs/ReleaseNotes.html Thu May 17 17:03:43 2007
@@ -339,8 +339,6 @@
 implemented.
 
 
-
-
 Other Target-Specific Code Generator Enhancements:
 
 
@@ -584,7 +582,7 @@
 Compilation for ARM Linux OABI (old ABI) is supported, but not fully 
tested.
 
 QEMU-ARM (<= 0.9.0) wrongly executes programs compiled with LLVM. A 
non-affected QEMU version must be used or this
-http://cvs.savannah.nongnu.org/viewcvs/qemu/target-arm/translate.c?root=qemu&r1=1.46&r2=1.47&makepatch=1&diff_format=h";>
+http://cvs.savannah.nongnu.org/viewcvs/qemu/target-arm/translate.c?root=qemu&r1=1.46&r2=1.47&makepatch=1&diff_format=h";>
 patch must be applied on QEMU.
 
 
@@ -854,7 +852,7 @@
   src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!" />
 
   http://llvm.org/";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2007/05/17 22:02:24 $
+  Last modified: $Date: 2007/05/17 22:03:43 $
 
 
 



___
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

2007-05-17 Thread Chris Lattner


Changes in directory llvm/docs:

ReleaseNotes.html updated: 1.379 -> 1.380
---
Log message:

llvm-gcc now supports almost all gcc extensions.  The key missing one is
builtin_apply.


---
Diffs of the changes:  (+27 -62)

 ReleaseNotes.html |   89 --
 1 files changed, 27 insertions(+), 62 deletions(-)


Index: llvm/docs/ReleaseNotes.html
diff -u llvm/docs/ReleaseNotes.html:1.379 llvm/docs/ReleaseNotes.html:1.380
--- llvm/docs/ReleaseNotes.html:1.379   Thu May 17 16:41:31 2007
+++ llvm/docs/ReleaseNotes.html Thu May 17 17:02:24 2007
@@ -679,8 +679,6 @@
 Optimization on most platforms "out-of-the-box".  Please inquire on the 
 llvmdev mailing list if you are interested.
 
-FIXME: the list of supported stuff below needs to be updated.  We do support
-tls now, what else??
 
 
 
@@ -689,85 +687,52 @@
 
 
 
-
 
 
-"long double" is transformed by the front-end into "double".  There is no
-support for floating point data types of any size other than 32 and 64
-bits.
+"long double" is silently transformed by the front-end into "double".  
There
+is no support for floating point data types of any size other than 32 and 64
+bits.
 
-Although many GCC extensions are supported, some are not.  In particular,
-the following extensions are known to not be supported:
-  
-  http://gcc.gnu.org/onlinedocs/gcc/Local-Labels.html#Local%20Labels";>Local 
Labels: Labels local to a block.
-  http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html#Nested%20Functions";>Nested
 Functions: As in Algol and Pascal, lexical scoping of functions.
-  http://gcc.gnu.org/onlinedocs/gcc/Constructing-Calls.html#Constructing%20Calls";>Constructing
 Calls: Dispatching a call to another function.
-  http://gcc.gnu.org/onlinedocs/gcc/Thread_002dLocal.html";>Thread-Local:
 Per-thread variables.
-  http://gcc.gnu.org/onlinedocs/gcc/Pragmas.html#Pragmas";>Pragmas: 
Pragmas accepted by GCC.
-  
-
-  The following GCC extensions are partially supported.  An ignored
-  attribute means that the LLVM compiler ignores the presence of the attribute,
-  but the code should still work.  An unsupported attribute is one which is
-  ignored by the LLVM compiler and will cause a different interpretation of
-  the program.
+llvm-gcc does not support __builtin_apply yet.
+  See http://gcc.gnu.org/onlinedocs/gcc/Constructing-Calls.html#Constructing%20Calls";>Constructing
 Calls: Dispatching a call to another function.
+
 
+llvm-gcc partially supports tthese GCC extensions:
   
-  http://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html#Variable%20Length";>Variable
 Length:
-  Arrays whose length is computed at run time.
-  Supported, but allocated stack space is not freed until the function 
returns (noted above).
+  http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html#Nested%20Functions";>Nested
 Functions: As in Algol and Pascal, lexical scoping of functions.
+  Nested functions are supported, but llvm-gcc does not support non-local
+  gotos or taking the address of a nested function.
 
   http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#Function%20Attributes";>Function
 Attributes:
 
   Declaring that functions have no side effects or that they can never
   return.
 
-  Supported: alias, constructor, 
destructor,
+  Supported: alias, always_inline, cdecl,
+  constructor, destructor,
   deprecated, fastcall, format, 
   format_arg, non_null, noreturn, 
regparm
   section, stdcall, unused, used, 
   visibility, warn_unused_result, weak
 
-  Ignored: noinline,
-  always_inline, pure, const, nothrow,
-  malloc, no_instrument_function, cdecl
-
-  Unsupported: All other target specific attributes
-   
-  http://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html#Variable%20Attributes";>Variable
 Attributes:
-  Specifying attributes of variables.
-  Supported: alias, cleanup, common,
-  nocommon, deprecated, dllimport, 
-  dllexport, section, transparent_union,
-  unused, used, weak
-
-  Unsupported: aligned, mode, packed,
-  shared, tls_model,
-  vector_size, all target specific attributes.
-  
-
-  http://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html#Type%20Attributes";>Type
 Attributes:  Specifying attributes of types.
-  Supported: transparent_union, unused,
-deprecated, may_alias
-
-  Unsupported: aligned, packed, 
-all target specific attributes.
-
-  http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#Other%20Builtins";>Other
 Builtins:
-  Other built-in functions.
-  We support all builtins which have a C language equivalent (e.g., 
- __builtin_cos),  __builtin_alloca, 
- __builtin_types_compatible_p, __builtin_choose_expr,
- __builtin_constant_p, and __builtin_expect
- (currently ignored).  We also support builtins for ISO C99 floating
- point com

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

2007-05-17 Thread Chris Lattner


Changes in directory llvm/docs:

ReleaseNotes.html updated: 1.378 -> 1.379
---
Log message:

add a section about API changes.


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

 ReleaseNotes.html |   71 +-
 1 files changed, 60 insertions(+), 11 deletions(-)


Index: llvm/docs/ReleaseNotes.html
diff -u llvm/docs/ReleaseNotes.html:1.378 llvm/docs/ReleaseNotes.html:1.379
--- llvm/docs/ReleaseNotes.html:1.378   Thu May 17 14:58:57 2007
+++ llvm/docs/ReleaseNotes.html Thu May 17 16:41:31 2007
@@ -295,13 +295,6 @@
 
 
 
-Further, several significant target-specific enhancements are included in
-LLVM 2.0:
-
-
-
-
-
 
 
 

@@ -389,9 +382,6 @@
 More specific changes include:
 
 
-ConstantBool, ConstantIntegral and ConstantInt classes have been merged 
-together, we now just have ConstantInt
-
 LLVM no longer relies on static destructors to shut itself down.  Instead,
 it lazily initializes itself and shuts down when llvm_shutdown() is 
 explicitly called.
@@ -417,6 +407,65 @@
 
 
 
+
+API Changes
+
+
+LLVM 2.0 contains a revamp of the type system and several other significant
+internal changes.  If you are programming to the C++ API, be aware of the
+following major changes:
+
+
+Pass registration is slightly different in LLVM 2.0 (you now needs an
+   intptr_t in your constructor), as explained in the Writing an LLVM Pass
+   document.
+   
+ConstantBool, ConstantIntegral and ConstantInt
+classes have been merged together, we now just have
+ConstantInt.
+
+Type::IntTy, Type::UIntTy, Type::SByteTy, ... 
are
+replaced by Type::Int8Ty, Type::Int16Ty, etc.  LLVM types
+have always corresponded to fixed size types
+(e.g. long was always 64-bits), but the type system no longer includes
+information about the sign of the type.
+
+Several classes (CallInst, GetElementPtrInst,
+ConstantArray, etc), that once took std::vector as
+ arguments now take ranges instead.   For example, you can create a
+GetElementPtrInst with code like:
+
+
+  Value *Ops[] = { Op1, Op2, Op3 };
+  GEP = new GetElementPtrInst(BasePtr, Ops, 3);
+
+
+This avoids creation of a temporary vector (and a call to malloc/free).  If
+you have an std::vector, use code like this:
+
+  std::vector Ops = ...;
+  GEP = new GetElementPtrInst(BasePtr, &Ops[0], Ops.size());
+
+
+
+
+CastInst is now abstract and its functionality is split into several parts,
+one for each of the new cast
+instructions.
+
+Instruction::getNext()/getPrev() are now private (along with
+BasicBlock::getNext, etc), for efficiency reasons (they are now no
+longer just simple pointers).  Please use BasicBlock::iterator, etc 
instead.
+
+
+Module::getNamedFunction() is now called
+Module::getFunction().
+
+SymbolTable.h has been split into ValueSymbolTable.h and 
+TypeSymbolTable.h.
+
+
 
 
 
@@ -840,7 +889,7 @@
   src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!" />
 
   http://llvm.org/";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2007/05/17 19:58:57 $
+  Last modified: $Date: 2007/05/17 21:41:31 $
 
 
 



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


[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/big_part_set.c

2007-05-17 Thread Reid Spencer


Changes in directory llvm-test/SingleSource/UnitTests/Integer:

big_part_set.c updated: 1.1 -> 1.2
---
Log message:

Change this code to match the reference output.


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

 big_part_set.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm-test/SingleSource/UnitTests/Integer/big_part_set.c
diff -u llvm-test/SingleSource/UnitTests/Integer/big_part_set.c:1.1 
llvm-test/SingleSource/UnitTests/Integer/big_part_set.c:1.2
--- llvm-test/SingleSource/UnitTests/Integer/big_part_set.c:1.1 Thu May 17 
13:04:41 2007
+++ llvm-test/SingleSource/UnitTests/Integer/big_part_set.c Thu May 17 
16:32:37 2007
@@ -23,7 +23,7 @@
   printBits(X);
   printf("\n");
   for (i = bitwidthof(BitType); i > 0; --i) {
-X = part_set(X, 1, i-1, bitwidthof(BitType)-1);
+X = part_set(X, 1, i-1, i-1);
 printf("0b0");
 printBits(X);
 printf("\n");



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


[llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.h ARMISelLowering.cpp

2007-05-17 Thread Dale Johannesen


Changes in directory llvm/lib/Target/ARM:

ARMISelLowering.h updated: 1.15 -> 1.16
ARMISelLowering.cpp updated: 1.52 -> 1.53
---
Log message:

More effective breakdown of memcpy into repeated load/store.  These are now
in the order lod;lod;lod;sto;sto;sto which means the load-store optimizer
has a better chance of producing ldm/stm.  Ideally you would get cooperation
from the RA as well but this is not there yet.


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

 ARMISelLowering.cpp |   77 +++-
 ARMISelLowering.h   |1 
 2 files changed, 77 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/ARM/ARMISelLowering.h
diff -u llvm/lib/Target/ARM/ARMISelLowering.h:1.15 
llvm/lib/Target/ARM/ARMISelLowering.h:1.16
--- llvm/lib/Target/ARM/ARMISelLowering.h:1.15  Fri Apr 27 08:54:47 2007
+++ llvm/lib/Target/ARM/ARMISelLowering.h   Thu May 17 16:31:21 2007
@@ -135,6 +135,7 @@
 SDOperand LowerGLOBAL_OFFSET_TABLE(SDOperand Op, SelectionDAG &DAG);
 SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG);
 SDOperand LowerBR_JT(SDOperand Op, SelectionDAG &DAG);
+SDOperand LowerMEMCPY(SDOperand Op, SelectionDAG &DAG);
   };
 }
 


Index: llvm/lib/Target/ARM/ARMISelLowering.cpp
diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.52 
llvm/lib/Target/ARM/ARMISelLowering.cpp:1.53
--- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.52Mon May 14 18:20:21 2007
+++ llvm/lib/Target/ARM/ARMISelLowering.cpp Thu May 17 16:31:21 2007
@@ -187,7 +187,7 @@
 
   // Expand mem operations genericly.
   setOperationAction(ISD::MEMSET  , MVT::Other, Expand);
-  setOperationAction(ISD::MEMCPY  , MVT::Other, Expand);
+  setOperationAction(ISD::MEMCPY  , MVT::Other, Custom);
   setOperationAction(ISD::MEMMOVE , MVT::Other, Expand);
   
   // Use the default implementation.
@@ -255,6 +255,8 @@
 
   setSchedulingPreference(SchedulingForRegPressure);
   computeRegisterProperties();
+
+  maxStoresPerMemcpy = 1;    temporary - rewrite interface to use type
 }
 
 
@@ -1328,6 +1330,78 @@
   return DAG.getNode(ISD::BUILD_PAIR, MVT::i64, Lo, Hi);
 }
 
+SDOperand ARMTargetLowering::LowerMEMCPY(SDOperand Op, SelectionDAG &DAG) {
+  SDOperand Chain = Op.getOperand(0);
+  SDOperand Dest = Op.getOperand(1);
+  SDOperand Src = Op.getOperand(2);
+  SDOperand Count = Op.getOperand(3);
+  unsigned Align =
+(unsigned)cast(Op.getOperand(4))->getValue();
+  if (Align == 0) Align = 1;
+
+  ConstantSDNode *I = dyn_cast(Count);
+  // Just call memcpy if:
+  // not 4-byte aligned
+  // size is unknown
+  // size is >= the threshold.
+  if ((Align & 3) != 0 || 
+   !I ||
+   I->getValue() >= 64 ||
+   (I->getValue() & 3) != 0) {
+MVT::ValueType IntPtr = getPointerTy();
+TargetLowering::ArgListTy Args;
+TargetLowering::ArgListEntry Entry;
+Entry.Ty = getTargetData()->getIntPtrType();
+Entry.Node = Op.getOperand(1); Args.push_back(Entry);
+Entry.Node = Op.getOperand(2); Args.push_back(Entry);
+Entry.Node = Op.getOperand(3); Args.push_back(Entry);
+std::pair CallResult =
+  LowerCallTo(Chain, Type::VoidTy, false, false, CallingConv::C, false,
+  DAG.getExternalSymbol("memcpy", IntPtr), Args, DAG);
+return CallResult.second;
+  }
+
+  // Otherwise do repeated 4-byte loads and stores.  To be improved.
+  assert((I->getValue() & 3) == 0);
+  assert((Align & 3) == 0);
+  unsigned NumMemOps = I->getValue() >> 2;
+  unsigned EmittedNumMemOps = 0;
+  unsigned SrcOff = 0, DstOff = 0;
+  MVT::ValueType VT = MVT::i32;
+  unsigned VTSize = 4;
+  const int MAX_LOADS_IN_LDM = 6;
+  SDOperand LoadChains[MAX_LOADS_IN_LDM];
+  SDOperand Loads[MAX_LOADS_IN_LDM];
+
+  // Emit up to 4 loads, then a TokenFactor barrier, then the same
+  // number of stores.  The loads and stores will get combined into
+  // ldm/stm later on.
+  while(EmittedNumMemOps < NumMemOps) {
+unsigned int i;
+for (i=0; ihttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Type.h

2007-05-17 Thread Dan Gohman


Changes in directory llvm/include/llvm:

Type.h updated: 1.107 -> 1.108
---
Log message:

Correct a name in a comment.


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

 Type.h |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/Type.h
diff -u llvm/include/llvm/Type.h:1.107 llvm/include/llvm/Type.h:1.108
--- llvm/include/llvm/Type.h:1.107  Fri Apr 20 17:33:47 2007
+++ llvm/include/llvm/Type.hThu May 17 16:30:39 2007
@@ -229,9 +229,10 @@
 return !isAbstract() || isSizedDerivedType();
   }
 
-  /// getPrimitiveSize - Return the basic size of this type if it is a 
primitive
-  /// type.  These are fixed by LLVM and are not target dependent.  This will
-  /// return zero if the type does not have a size or is not a primitive type.
+  /// getPrimitiveSizeInBits - Return the basic size of this type if it is a
+  /// primitive type.  These are fixed by LLVM and are not target dependent.
+  /// This will return zero if the type does not have a size or is not a
+  /// primitive type.
   ///
   unsigned getPrimitiveSizeInBits() const;
 



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


[llvm-commits] CVS: llvm/include/llvm/ADT/SmallVector.h

2007-05-17 Thread Chris Lattner


Changes in directory llvm/include/llvm/ADT:

SmallVector.h updated: 1.29 -> 1.30
---
Log message:

silence some "comparison between signed and unsigned integer expressions"
warnings


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

 SmallVector.h |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/ADT/SmallVector.h
diff -u llvm/include/llvm/ADT/SmallVector.h:1.29 
llvm/include/llvm/ADT/SmallVector.h:1.30
--- llvm/include/llvm/ADT/SmallVector.h:1.29Thu May 17 13:29:01 2007
+++ llvm/include/llvm/ADT/SmallVector.h Thu May 17 15:01:40 2007
@@ -147,7 +147,7 @@
   destroy_range(Begin+N, End);
   End = Begin+N;
 } else if (N > size()) {
-  if (Capacity-Begin < N)
+  if (unsigned(Capacity-Begin) < N)
 grow(N);
   construct_range(End, Begin+N, T());
   End = Begin+N;
@@ -159,7 +159,7 @@
   destroy_range(Begin+N, End);
   End = Begin+N;
 } else if (N > size()) {
-  if (Capacity-Begin < N)
+  if (unsigned(Capacity-Begin) < N)
 grow(N);
   construct_range(End, Begin+N, NV);
   End = Begin+N;
@@ -189,7 +189,7 @@
   
   void assign(unsigned NumElts, const T &Elt) {
 clear();
-if (Capacity-Begin < NumElts)
+if (unsigned(Capacity-Begin) < NumElts)
   grow(NumElts);
 End = Begin+NumElts;
 construct_range(Begin, End, Elt);



___
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

2007-05-17 Thread Chris Lattner


Changes in directory llvm/docs:

ReleaseNotes.html updated: 1.377 -> 1.378
---
Log message:

minor tweak


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

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


Index: llvm/docs/ReleaseNotes.html
diff -u llvm/docs/ReleaseNotes.html:1.377 llvm/docs/ReleaseNotes.html:1.378
--- llvm/docs/ReleaseNotes.html:1.377   Wed May 16 18:25:46 2007
+++ llvm/docs/ReleaseNotes.html Thu May 17 14:58:57 2007
@@ -67,8 +67,9 @@
 break backwards compatibility with the LLVM 1.x bytecode and .ll file format.
 If you have LLVM 1.9 .ll files that you would like to upgrade to LLVM 2.x, we 
 recommend the use of the stand alone llvm-upgrade
-tool.  We intend to keep compatibility with .ll and .bc formats within the 2.x
-release series, like we did within the 1.x series.
+tool (which is included with 2.0).  We intend to keep compatibility with .ll 
+and .bc formats within the 2.x release series, like we did within the 1.x 
+series.
 There are several significant change to the LLVM IR and internal APIs, such
 as a major overhaul of the type system, the completely new bitcode file
 format, etc.
@@ -356,7 +357,7 @@
 
 Improved support for the Linux/ppc ABI and the linux/ppc JIT is fully 
 functional now.  llvm-gcc and static compilation are not fully supported 
-yet though.<
+yet though.
 
 Many bugs fixed for PowerPC 64.
 
@@ -839,7 +840,7 @@
   src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!" />
 
   http://llvm.org/";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2007/05/16 23:25:46 $
+  Last modified: $Date: 2007/05/17 19:58:57 $
 
 
 



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


[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-05-17 Thread Reid Spencer


Changes in directory llvm/lib/Support:

APInt.cpp updated: 1.84 -> 1.85
---
Log message:

Get rid of leading zeros in the output of toString.


---
Diffs of the changes:  (+27 -8)

 APInt.cpp |   35 +++
 1 files changed, 27 insertions(+), 8 deletions(-)


Index: llvm/lib/Support/APInt.cpp
diff -u llvm/lib/Support/APInt.cpp:1.84 llvm/lib/Support/APInt.cpp:1.85
--- llvm/lib/Support/APInt.cpp:1.84 Thu May 17 01:26:29 2007
+++ llvm/lib/Support/APInt.cpp  Thu May 17 14:23:02 2007
@@ -1938,14 +1938,33 @@
   }
 
   if (radix != 10) {
-uint64_t mask = radix - 1;
-uint32_t shift = (radix == 16 ? 4 : radix  == 8 ? 3 : 1);
-uint32_t nibbles = APINT_BITS_PER_WORD / shift;
-for (uint32_t i = 0; i < getNumWords(); ++i) {
-  uint64_t value = pVal[i];
-  for (uint32_t j = 0; j < nibbles; ++j) {
-result.insert(0, digits[ value & mask ]);
-value >>= shift;
+// For the 2, 8 and 16 bit cases, we can just shift instead of divide 
+// because the number of bits per digit (1,3 and 4 respectively) divides 
+// equaly. We just shift until there value is zero.
+
+// First, check for a zero value and just short circuit the logic below.
+if (*this == 0)
+  result = "0";
+else {
+  APInt tmp(*this);
+  size_t insert_at = 0;
+  if (wantSigned && this->isNegative()) {
+// They want to print the signed version and it is a negative value
+// Flip the bits and add one to turn it into the equivalent positive
+// value and put a '-' in the result.
+tmp.flip();
+tmp++;
+result = "-";
+insert_at = 1;
+  }
+  // Just shift tmp right for each digit width until it becomes zero
+  uint32_t shift = (radix == 16 ? 4 : (radix == 8 ? 3 : 1));
+  uint64_t mask = radix - 1;
+  APInt zero(tmp.getBitWidth(), 0);
+  while (tmp.ne(zero)) {
+unsigned digit = tmp.getZExtValue() & mask;
+tmp = tmp.lshr(shift);
+result.insert(insert_at, digits[digit]);
   }
 }
 return result;



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


[llvm-commits] CVS: llvm/test/CodeGen/X86/2007-05-17-ShuffleISelBug.ll

2007-05-17 Thread Evan Cheng


Changes in directory llvm/test/CodeGen/X86:

2007-05-17-ShuffleISelBug.ll added (r1.1)
---
Log message:

New test case.

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

 2007-05-17-ShuffleISelBug.ll |   23 +++
 1 files changed, 23 insertions(+)


Index: llvm/test/CodeGen/X86/2007-05-17-ShuffleISelBug.ll
diff -c /dev/null llvm/test/CodeGen/X86/2007-05-17-ShuffleISelBug.ll:1.1
*** /dev/null   Thu May 17 13:50:00 2007
--- llvm/test/CodeGen/X86/2007-05-17-ShuffleISelBug.ll  Thu May 17 13:49:50 2007
***
*** 0 
--- 1,23 
+ ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
+ ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep punpckhwd
+ 
+ declare <8 x i16> @llvm.x86.sse2.packuswb.128(<8 x i16>, <8 x i16>)
+ 
+ declare <8 x i16> @llvm.x86.sse2.psrl.w(<8 x i16>, <4 x i32>)
+ 
+ define fastcc void @test(i32* %src, i32 %sbpr, i32* %dst, i32 %dbpr, i32 %w, 
i32 %h, i32 %dstalpha, i32 %mask) {
+   %tmp633 = shufflevector <8 x i16> zeroinitializer, <8 x i16> undef, <8 
x i32> < i32 4, i32 4, i32 5, i32 5, i32 6, i32 6, i32 7, i32 7 >
+   %tmp715 = mul <8 x i16> zeroinitializer, %tmp633
+   %tmp776 = bitcast <8 x i16> %tmp715 to <4 x i32>
+   %tmp777 = add <4 x i32> %tmp776, shufflevector (<4 x i32> < i32 65537, 
i32 0, i32 0, i32 0 >, <4 x i32> < i32 65537, i32 0, i32 0, i32 0 >, <4 x i32> 
zeroinitializer)
+   %tmp805 = add <4 x i32> %tmp777, zeroinitializer
+   %tmp832 = bitcast <4 x i32> %tmp805 to <8 x i16>
+   %tmp838 = tail call <8 x i16> @llvm.x86.sse2.psrl.w( <8 x i16> %tmp832, 
<4 x i32> < i32 8, i32 undef, i32 undef, i32 undef > )
+   %tmp1020 = tail call <8 x i16> @llvm.x86.sse2.packuswb.128( <8 x i16> 
zeroinitializer, <8 x i16> %tmp838 )
+   %tmp1030 = bitcast <8 x i16> %tmp1020 to <4 x i32>
+   %tmp1033 = add <4 x i32> zeroinitializer, %tmp1030
+   %tmp1048 = bitcast <4 x i32> %tmp1033 to <2 x i64>
+   %tmp1049 = or <2 x i64> %tmp1048, zeroinitializer
+   store <2 x i64> %tmp1049, <2 x i64>* null
+   ret void
+ }



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp

2007-05-17 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.403 -> 1.404
---
Log message:

Fix a bogus check that prevented folding VECTOR_SHUFFLE to UNDEF; add an 
optimization to fold VECTOR_SHUFFLE to a zero vector.

---
Diffs of the changes:  (+61 -24)

 X86ISelLowering.cpp |   85 +---
 1 files changed, 61 insertions(+), 24 deletions(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.403 
llvm/lib/Target/X86/X86ISelLowering.cpp:1.404
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.403   Thu May 17 12:13:13 2007
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Thu May 17 13:45:50 2007
@@ -1630,7 +1630,7 @@
   return ::isSHUFPMask(N->op_begin(), N->getNumOperands());
 }
 
-/// isCommutedSHUFP - Returns true if the shuffle mask is except
+/// isCommutedSHUFP - Returns true if the shuffle mask is exactly
 /// the reverse of what x86 shuffles want. x86 shuffles requires the lower
 /// half elements to come from vector 1 (which would equal the dest.) and
 /// the upper half to come from vector 2.
@@ -2188,7 +2188,7 @@
 /// isUndefShuffle - Returns true if N is a VECTOR_SHUFFLE that can be resolved
 /// to an undef.
 static bool isUndefShuffle(SDNode *N) {
-  if (N->getOpcode() != ISD::BUILD_VECTOR)
+  if (N->getOpcode() != ISD::VECTOR_SHUFFLE)
 return false;
 
   SDOperand V1 = N->getOperand(0);
@@ -2208,6 +2208,61 @@
   return true;
 }
 
+/// isZeroNode - Returns true if Elt is a constant zero or a floating point
+/// constant +0.0.
+static inline bool isZeroNode(SDOperand Elt) {
+  return ((isa(Elt) &&
+   cast(Elt)->getValue() == 0) ||
+  (isa(Elt) &&
+   cast(Elt)->isExactlyValue(0.0)));
+}
+
+/// isZeroShuffle - Returns true if N is a VECTOR_SHUFFLE that can be resolved
+/// to an zero vector.
+static bool isZeroShuffle(SDNode *N) {
+  if (N->getOpcode() != ISD::VECTOR_SHUFFLE)
+return false;
+
+  SDOperand V1 = N->getOperand(0);
+  SDOperand V2 = N->getOperand(1);
+  SDOperand Mask = N->getOperand(2);
+  unsigned NumElems = Mask.getNumOperands();
+  for (unsigned i = 0; i != NumElems; ++i) {
+SDOperand Arg = Mask.getOperand(i);
+if (Arg.getOpcode() != ISD::UNDEF) {
+  unsigned Idx = cast(Arg)->getValue();
+  if (Idx < NumElems) {
+unsigned Opc = V1.Val->getOpcode();
+if (Opc == ISD::UNDEF)
+  continue;
+if (Opc != ISD::BUILD_VECTOR ||
+!isZeroNode(V1.Val->getOperand(Idx)))
+  return false;
+  } else if (Idx >= NumElems) {
+unsigned Opc = V2.Val->getOpcode();
+if (Opc == ISD::UNDEF)
+  continue;
+if (Opc != ISD::BUILD_VECTOR ||
+!isZeroNode(V2.Val->getOperand(Idx - NumElems)))
+  return false;
+  }
+}
+  }
+  return true;
+}
+
+/// getZeroVector - Returns a vector of specified type with all zero elements.
+///
+static SDOperand getZeroVector(MVT::ValueType VT, SelectionDAG &DAG) {
+  assert(MVT::isVector(VT) && "Expected a vector type");
+  unsigned NumElems = getVectorNumElements(VT);
+  MVT::ValueType EVT = MVT::getVectorBaseType(VT);
+  bool isFP = MVT::isFloatingPoint(EVT);
+  SDOperand Zero = isFP ? DAG.getConstantFP(0.0, EVT) : DAG.getConstant(0, 
EVT);
+  SmallVector ZeroVec(NumElems, Zero);
+  return DAG.getNode(ISD::BUILD_VECTOR, VT, &ZeroVec[0], ZeroVec.size());
+}
+
 /// NormalizeMask - V2 is a splat, modify the mask (if needed) so all elements
 /// that point to V2 points to its first element.
 static SDOperand NormalizeMask(SDOperand Mask, SelectionDAG &DAG) {
@@ -2274,18 +2329,6 @@
   return DAG.getNode(ISD::BUILD_VECTOR, MaskVT, &MaskVec[0], MaskVec.size());
 }
 
-/// getZeroVector - Returns a vector of specified type with all zero elements.
-///
-static SDOperand getZeroVector(MVT::ValueType VT, SelectionDAG &DAG) {
-  assert(MVT::isVector(VT) && "Expected a vector type");
-  unsigned NumElems = getVectorNumElements(VT);
-  MVT::ValueType EVT = MVT::getVectorBaseType(VT);
-  bool isFP = MVT::isFloatingPoint(EVT);
-  SDOperand Zero = isFP ? DAG.getConstantFP(0.0, EVT) : DAG.getConstant(0, 
EVT);
-  SmallVector ZeroVec(NumElems, Zero);
-  return DAG.getNode(ISD::BUILD_VECTOR, VT, &ZeroVec[0], ZeroVec.size());
-}
-
 /// PromoteSplat - Promote a splat of v8i16 or v16i8 to v4i32.
 ///
 static SDOperand PromoteSplat(SDOperand Op, SelectionDAG &DAG) {
@@ -2307,17 +2350,8 @@
   return DAG.getNode(ISD::BIT_CONVERT, VT, Shuffle);
 }
 
-/// isZeroNode - Returns true if Elt is a constant zero or a floating point
-/// constant +0.0.
-static inline bool isZeroNode(SDOperand Elt) {
-  return ((isa(Elt) &&
-   cast(Elt)->getValue() == 0) ||
-  (isa(Elt) &&
-   cast(Elt)->isExactlyValue(0.0)));
-}
-
 /// getShuffleVectorZeroOrUndef - Return a vector_shuffle of the specified
-/// vector and zero or undef vector.
+/// vector of zero or undef vector.
 static SDOperand getShuffleVectorZeroOrUndef(SDOperand V2,

[llvm-commits] CVS: llvm/lib/Target/X86/X86InstrSSE.td

2007-05-17 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86InstrSSE.td updated: 1.182 -> 1.183
---
Log message:

Added missing patterns for UNPCKH* and PUNPCKH*.

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

 X86InstrSSE.td |   20 
 1 files changed, 20 insertions(+)


Index: llvm/lib/Target/X86/X86InstrSSE.td
diff -u llvm/lib/Target/X86/X86InstrSSE.td:1.182 
llvm/lib/Target/X86/X86InstrSSE.td:1.183
--- llvm/lib/Target/X86/X86InstrSSE.td:1.182Wed May  2 18:11:52 2007
+++ llvm/lib/Target/X86/X86InstrSSE.td  Thu May 17 13:44:37 2007
@@ -170,6 +170,10 @@
   return X86::isUNPCKL_v_undef_Mask(N);
 }]>;
 
+def UNPCKH_v_undef_shuffle_mask : PatLeaf<(build_vector), [{
+  return X86::isUNPCKH_v_undef_Mask(N);
+}]>;
+
 def PSHUFD_shuffle_mask : PatLeaf<(build_vector), [{
   return X86::isPSHUFDMask(N);
 }], SHUFFLE_get_shuf_imm>;
@@ -2266,6 +2270,22 @@
   (PUNPCKLDQrr VR128:$src, VR128:$src)>, Requires<[HasSSE1]>;
 }
 
+// vector_shuffle v1, , <2, 2, 3, 3, ...>
+let AddedComplexity = 10 in {
+def : Pat<(v4f32 (vector_shuffle VR128:$src, (undef),
+  UNPCKH_v_undef_shuffle_mask)),
+  (UNPCKHPSrr VR128:$src, VR128:$src)>, Requires<[HasSSE2]>;
+def : Pat<(v16i8 (vector_shuffle VR128:$src, (undef),
+  UNPCKH_v_undef_shuffle_mask)),
+  (PUNPCKHBWrr VR128:$src, VR128:$src)>, Requires<[HasSSE2]>;
+def : Pat<(v8i16 (vector_shuffle VR128:$src, (undef),
+  UNPCKH_v_undef_shuffle_mask)),
+  (PUNPCKHWDrr VR128:$src, VR128:$src)>, Requires<[HasSSE2]>;
+def : Pat<(v4i32 (vector_shuffle VR128:$src, (undef),
+  UNPCKH_v_undef_shuffle_mask)),
+  (PUNPCKHDQrr VR128:$src, VR128:$src)>, Requires<[HasSSE1]>;
+}
+
 let AddedComplexity = 15 in {
 // vector_shuffle v1, v2 <0, 1, 4, 5> using MOVLHPS
 def : Pat<(v4i32 (vector_shuffle VR128:$src1, VR128:$src2,



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


[llvm-commits] CVS: llvm/include/llvm/ADT/SmallVector.h

2007-05-17 Thread Dan Gohman


Changes in directory llvm/include/llvm/ADT:

SmallVector.h updated: 1.28 -> 1.29
---
Log message:

Fix some sporadic segfaults that are triggered when SmallVector's heap
storage lands near the end of the available address space. In the expression
Begin+N > Capacity, the Begin+N was overflowing. Fix this by replacing it
by with an expression that doesn't involve computation of an address
beyond the end of allocated memory.


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

 SmallVector.h |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/ADT/SmallVector.h
diff -u llvm/include/llvm/ADT/SmallVector.h:1.28 
llvm/include/llvm/ADT/SmallVector.h:1.29
--- llvm/include/llvm/ADT/SmallVector.h:1.28Wed Apr 18 21:04:09 2007
+++ llvm/include/llvm/ADT/SmallVector.h Thu May 17 13:29:01 2007
@@ -147,7 +147,7 @@
   destroy_range(Begin+N, End);
   End = Begin+N;
 } else if (N > size()) {
-  if (Begin+N > Capacity)
+  if (Capacity-Begin < N)
 grow(N);
   construct_range(End, Begin+N, T());
   End = Begin+N;
@@ -159,7 +159,7 @@
   destroy_range(Begin+N, End);
   End = Begin+N;
 } else if (N > size()) {
-  if (Begin+N > Capacity)
+  if (Capacity-Begin < N)
 grow(N);
   construct_range(End, Begin+N, NV);
   End = Begin+N;
@@ -189,7 +189,7 @@
   
   void assign(unsigned NumElts, const T &Elt) {
 clear();
-if (Begin+NumElts > Capacity)
+if (Capacity-Begin < NumElts)
   grow(NumElts);
 End = Begin+NumElts;
 construct_range(Begin, End, Elt);



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


[llvm-commits] CVS: llvm/test/CodeGen/Generic/i128-addsub.ll

2007-05-17 Thread Chris Lattner


Changes in directory llvm/test/CodeGen/Generic:

i128-addsub.ll added (r1.1)
---
Log message:

add testcase for 128-bit add/sub


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

 i128-addsub.ll |   39 +++
 1 files changed, 39 insertions(+)


Index: llvm/test/CodeGen/Generic/i128-addsub.ll
diff -c /dev/null llvm/test/CodeGen/Generic/i128-addsub.ll:1.1
*** /dev/null   Thu May 17 13:22:47 2007
--- llvm/test/CodeGen/Generic/i128-addsub.llThu May 17 13:22:37 2007
***
*** 0 
--- 1,39 
+ ; RUN: llvm-as < %s | llc
+ 
+ define void @test_add(i64 %AL, i64 %AH, i64 %BL, i64 %BH, i64* %RL, i64* %RH) 
{
+ entry:
+   %tmp1 = zext i64 %AL to i128;  [#uses=1]
+   %tmp23 = zext i64 %AH to i128   ;  [#uses=1]
+   %tmp4 = shl i128 %tmp23, 64 ;  [#uses=1]
+   %tmp5 = or i128 %tmp4, %tmp1;  [#uses=1]
+   %tmp67 = zext i64 %BL to i128   ;  [#uses=1]
+   %tmp89 = zext i64 %BH to i128   ;  [#uses=1]
+   %tmp11 = shl i128 %tmp89, 64;  [#uses=1]
+   %tmp12 = or i128 %tmp11, %tmp67 ;  [#uses=1]
+   %tmp15 = add i128 %tmp12, %tmp5 ;  [#uses=2]
+   %tmp1617 = trunc i128 %tmp15 to i64 ;  [#uses=1]
+   store i64 %tmp1617, i64* %RL
+   %tmp21 = lshr i128 %tmp15, 64   ;  [#uses=1]
+   %tmp2122 = trunc i128 %tmp21 to i64 ;  [#uses=1]
+   store i64 %tmp2122, i64* %RH
+   ret void
+ }
+ 
+ define void @test_sub(i64 %AL, i64 %AH, i64 %BL, i64 %BH, i64* %RL, i64* %RH) 
{
+ entry:
+   %tmp1 = zext i64 %AL to i128;  [#uses=1]
+   %tmp23 = zext i64 %AH to i128   ;  [#uses=1]
+   %tmp4 = shl i128 %tmp23, 64 ;  [#uses=1]
+   %tmp5 = or i128 %tmp4, %tmp1;  [#uses=1]
+   %tmp67 = zext i64 %BL to i128   ;  [#uses=1]
+   %tmp89 = zext i64 %BH to i128   ;  [#uses=1]
+   %tmp11 = shl i128 %tmp89, 64;  [#uses=1]
+   %tmp12 = or i128 %tmp11, %tmp67 ;  [#uses=1]
+   %tmp15 = sub i128 %tmp5, %tmp12 ;  [#uses=2]
+   %tmp1617 = trunc i128 %tmp15 to i64 ;  [#uses=1]
+   store i64 %tmp1617, i64* %RL
+   %tmp21 = lshr i128 %tmp15, 64   ;  [#uses=1]
+   %tmp2122 = trunc i128 %tmp21 to i64 ;  [#uses=1]
+   store i64 %tmp2122, i64* %RH
+   ret void
+ }



___
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/TargetLowering.cpp

2007-05-17 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

TargetLowering.cpp updated: 1.114 -> 1.115
---
Log message:

disable MaskedValueIsZero, ComputeMaskedBits, and SimplifyDemandedBits for
i128 integers.  The 64-bit masks are not wide enough to represent the results.
These should be converted to APInt someday.


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

 TargetLowering.cpp |   13 +
 1 files changed, 13 insertions(+)


Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.114 
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.115
--- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.114  Wed May 16 
18:45:53 2007
+++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cppThu May 17 13:19:23 2007
@@ -365,6 +365,11 @@
   TargetLoweringOpt &TLO,
   unsigned Depth) const {
   KnownZero = KnownOne = 0;   // Don't know anything.
+
+  // The masks are not wide enough to represent this type!  Should use APInt.
+  if (Op.getValueType() == MVT::i128)
+return false;
+  
   // Other users may use these bits.
   if (!Op.Val->hasOneUse()) { 
 if (Depth != 0) {
@@ -874,6 +879,10 @@
 /// for bits that V cannot have.
 bool TargetLowering::MaskedValueIsZero(SDOperand Op, uint64_t Mask, 
unsigned Depth) const {
+  // The masks are not wide enough to represent this type!  Should use APInt.
+  if (Op.getValueType() == MVT::i128)
+return false;
+  
   uint64_t KnownZero, KnownOne;
   ComputeMaskedBits(Op, Mask, KnownZero, KnownOne, Depth);
   assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); 
@@ -891,6 +900,10 @@
   if (Depth == 6 || Mask == 0)
 return;  // Limit search depth.
   
+  // The masks are not wide enough to represent this type!  Should use APInt.
+  if (Op.getValueType() == MVT::i128)
+return;
+  
   uint64_t KnownZero2, KnownOne2;
 
   switch (Op.getOpcode()) {



___
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/LegalizeDAG.cpp

2007-05-17 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.492 -> 1.493
---
Log message:

add expand support for ADDC/SUBC/ADDE/SUBE so we can codegen 128-bit add/sub on 
32-bit (or less) targets


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

 LegalizeDAG.cpp |   42 ++
 1 files changed, 42 insertions(+)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.492 
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.493
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.492 Sat May  5 14:39:05 2007
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp   Thu May 17 13:15:41 2007
@@ -5222,6 +5222,48 @@
 }
 break;
   }
+
+  case ISD::ADDC:
+  case ISD::SUBC: {
+// Expand the subcomponents.
+SDOperand LHSL, LHSH, RHSL, RHSH;
+ExpandOp(Node->getOperand(0), LHSL, LHSH);
+ExpandOp(Node->getOperand(1), RHSL, RHSH);
+SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag);
+SDOperand LoOps[2] = { LHSL, RHSL };
+SDOperand HiOps[3] = { LHSH, RHSH };
+
+if (Node->getOpcode() == ISD::ADDC) {
+  Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2);
+  HiOps[2] = Lo.getValue(1);
+  Hi = DAG.getNode(ISD::ADDE, VTList, HiOps, 3);
+} else {
+  Lo = DAG.getNode(ISD::SUBC, VTList, LoOps, 2);
+  HiOps[2] = Lo.getValue(1);
+  Hi = DAG.getNode(ISD::SUBE, VTList, HiOps, 3);
+}
+// Remember that we legalized the flag.
+AddLegalizedOperand(Op.getValue(1), LegalizeOp(Hi.getValue(1)));
+break;
+  }
+  case ISD::ADDE:
+  case ISD::SUBE: {
+// Expand the subcomponents.
+SDOperand LHSL, LHSH, RHSL, RHSH;
+ExpandOp(Node->getOperand(0), LHSL, LHSH);
+ExpandOp(Node->getOperand(1), RHSL, RHSH);
+SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag);
+SDOperand LoOps[3] = { LHSL, RHSL, Node->getOperand(2) };
+SDOperand HiOps[3] = { LHSH, RHSH };
+
+Lo = DAG.getNode(Node->getOpcode(), VTList, LoOps, 3);
+HiOps[2] = Lo.getValue(1);
+Hi = DAG.getNode(Node->getOpcode(), VTList, HiOps, 3);
+
+// Remember that we legalized the flag.
+AddLegalizedOperand(Op.getValue(1), LegalizeOp(Hi.getValue(1)));
+break;
+  }
   case ISD::MUL: {
 // If the target wants to custom expand this, let them.
 if (TLI.getOperationAction(ISD::MUL, VT) == TargetLowering::Custom) {



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


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

2007-05-17 Thread Reid Spencer


Changes in directory llvm:

configure updated: 1.275.2.1 -> 1.275.2.2
---
Log message:

Merge from mainline to require Perl for build system.


---
Diffs of the changes:  (+27 -24)

 configure |   51 +++
 1 files changed, 27 insertions(+), 24 deletions(-)


Index: llvm/configure
diff -u llvm/configure:1.275.2.1 llvm/configure:1.275.2.2
--- llvm/configure:1.275.2.1Mon May  7 23:45:26 2007
+++ llvm/configure  Thu May 17 13:12:30 2007
@@ -7374,6 +7374,9 @@
 if test x"$PERL" = xnone; then
HAVE_PERL=0
 
+   { { echo "$as_me:$LINENO: error: perl is required but was not found, please 
install it" >&5
+echo "$as_me: error: perl is required but was not found, please install it" 
>&2;}
+   { (exit 1); exit 1; }; }
 else
HAVE_PERL=1
 
@@ -10340,7 +10343,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext < conftest.$ac_ext
+  echo '#line 12490 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -14202,11 +14205,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14205: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14208: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
-   echo "$as_me:14209: \$? = $ac_status" >&5
+   echo "$as_me:14212: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
  # The compiler can only warn and ignore the option if not recognized
  # So say no if there are warnings other than the usual output.
@@ -14470,11 +14473,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14473: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14476: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
-   echo "$as_me:14477: \$? = $ac_status" >&5
+   echo "$as_me:14480: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
  # The compiler can only warn and ignore the option if not recognized
  # So say no if there are warnings other than the usual output.
@@ -14574,11 +14577,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14577: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14580: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
-   echo "$as_me:14581: \$? = $ac_status" >&5
+   echo "$as_me:14584: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
  # The compiler can only warn and ignore the option if not recognized
@@ -17026,7 +17029,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext < conftest.$ac_ext <&5)
+   (eval echo "\"\$as_me:19500: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
-   echo "$as_me:19501: \$? = $ac_status" >&5
+   echo "$as_me:19504: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
  # The compiler can only warn and ignore the option if not recognized
  # So say no if there are warnings other than the usual output.
@@ -19598,11 +19601,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:19601: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:19604: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
-   echo "$as_me:19605: \$? = $ac_status" >&5
+   echo "$as_me:19608: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
  # The compiler can only warn and ignore the option if not recognized
@@ -21168,11 +21171,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:21171: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:21174: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
-   echo "$as_me:21175: \$? = $ac_status" >&5
+   echo "$as_me:21178: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
  # The compiler can only warn and ignore the option if not recognized
  # So say no if there are warnings other than the usual output.
@@ -21272,11 +21275,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_fla

[llvm-commits] CVS: llvm/configure

2007-05-17 Thread Reid Spencer


Changes in directory llvm:

configure updated: 1.276 -> 1.277
---
Log message:

Regenerate.


---
Diffs of the changes:  (+27 -24)

 configure |   51 +++
 1 files changed, 27 insertions(+), 24 deletions(-)


Index: llvm/configure
diff -u llvm/configure:1.276 llvm/configure:1.277
--- llvm/configure:1.276Mon May  7 23:32:07 2007
+++ llvm/configure  Thu May 17 13:11:03 2007
@@ -7374,6 +7374,9 @@
 if test x"$PERL" = xnone; then
HAVE_PERL=0
 
+   { { echo "$as_me:$LINENO: error: perl is required but was not found, please 
install it" >&5
+echo "$as_me: error: perl is required but was not found, please install it" 
>&2;}
+   { (exit 1); exit 1; }; }
 else
HAVE_PERL=1
 
@@ -10340,7 +10343,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext < conftest.$ac_ext
+  echo '#line 12490 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -14202,11 +14205,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14205: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14208: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
-   echo "$as_me:14209: \$? = $ac_status" >&5
+   echo "$as_me:14212: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
  # The compiler can only warn and ignore the option if not recognized
  # So say no if there are warnings other than the usual output.
@@ -14470,11 +14473,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14473: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14476: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
-   echo "$as_me:14477: \$? = $ac_status" >&5
+   echo "$as_me:14480: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
  # The compiler can only warn and ignore the option if not recognized
  # So say no if there are warnings other than the usual output.
@@ -14574,11 +14577,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14577: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14580: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
-   echo "$as_me:14581: \$? = $ac_status" >&5
+   echo "$as_me:14584: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
  # The compiler can only warn and ignore the option if not recognized
@@ -17026,7 +17029,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext < conftest.$ac_ext <&5)
+   (eval echo "\"\$as_me:19500: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
-   echo "$as_me:19501: \$? = $ac_status" >&5
+   echo "$as_me:19504: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
  # The compiler can only warn and ignore the option if not recognized
  # So say no if there are warnings other than the usual output.
@@ -19598,11 +19601,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:19601: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:19604: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
-   echo "$as_me:19605: \$? = $ac_status" >&5
+   echo "$as_me:19608: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
  # The compiler can only warn and ignore the option if not recognized
@@ -21168,11 +21171,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:21171: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:21174: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
-   echo "$as_me:21175: \$? = $ac_status" >&5
+   echo "$as_me:21178: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
  # The compiler can only warn and ignore the option if not recognized
  # So say no if there are warnings other than the usual output.
@@ -21272,11 +21275,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:21275: $lt_compile\"" >&5)

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

2007-05-17 Thread Reid Spencer


Changes in directory llvm/autoconf:

configure.ac updated: 1.269.2.1 -> 1.269.2.2
---
Log message:

Make Perl required - merge from mainline.


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

 configure.ac |1 +
 1 files changed, 1 insertion(+)


Index: llvm/autoconf/configure.ac
diff -u llvm/autoconf/configure.ac:1.269.2.1 
llvm/autoconf/configure.ac:1.269.2.2
--- llvm/autoconf/configure.ac:1.269.2.1Mon May  7 23:45:12 2007
+++ llvm/autoconf/configure.ac  Thu May 17 13:07:24 2007
@@ -495,6 +495,7 @@
 AC_SUBST(PERL)
 if test x"$PERL" = xnone; then
AC_SUBST(HAVE_PERL,0)
+   AC_MSG_ERROR([perl is required but was not found, please install it])
 else
AC_SUBST(HAVE_PERL,1)
 fi



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


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

2007-05-17 Thread Reid Spencer


Changes in directory llvm/autoconf:

configure.ac updated: 1.270 -> 1.271
---
Log message:

Make Perl a required dependency and cause configure script to fail if it
is not found.


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

 configure.ac |1 +
 1 files changed, 1 insertion(+)


Index: llvm/autoconf/configure.ac
diff -u llvm/autoconf/configure.ac:1.270 llvm/autoconf/configure.ac:1.271
--- llvm/autoconf/configure.ac:1.270Mon May  7 23:22:59 2007
+++ llvm/autoconf/configure.ac  Thu May 17 13:06:19 2007
@@ -495,6 +495,7 @@
 AC_SUBST(PERL)
 if test x"$PERL" = xnone; then
AC_SUBST(HAVE_PERL,0)
+   AC_MSG_ERROR([perl is required but was not found, please install it])
 else
AC_SUBST(HAVE_PERL,1)
 fi



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


[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/bits.h

2007-05-17 Thread Zhou Sheng


Changes in directory llvm-test/SingleSource/UnitTests/Integer:

bits.h updated: 1.9 -> 1.10
---
Log message:

Add some new int types.


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

 bits.h |   11 ++-
 1 files changed, 10 insertions(+), 1 deletion(-)


Index: llvm-test/SingleSource/UnitTests/Integer/bits.h
diff -u llvm-test/SingleSource/UnitTests/Integer/bits.h:1.9 
llvm-test/SingleSource/UnitTests/Integer/bits.h:1.10
--- llvm-test/SingleSource/UnitTests/Integer/bits.h:1.9 Wed May 16 23:34:32 2007
+++ llvm-test/SingleSource/UnitTests/Integer/bits.h Thu May 17 13:02:42 2007
@@ -44,8 +44,12 @@
 typedef unsigned int __attribute__((bitwidth(250))) uint250;
 typedef unsigned int __attribute__((bitwidth(256))) uint256;
 typedef unsigned int __attribute__((bitwidth(500))) uint500;
+typedef unsigned int __attribute__((bitwidth(512))) uint512;
+typedef unsigned int __attribute__((bitwidth(768))) uint768;
+typedef unsigned int __attribute__((bitwidth(1000))) uint1000;
 typedef unsigned int __attribute__((bitwidth(1024))) uint1024;
 
+typedef int __attribute__((bitwidth(3))) int3;
 typedef int __attribute__((bitwidth(9)))  int9;
 typedef int __attribute__((bitwidth(10))) int10;
 typedef int __attribute__((bitwidth(21))) int21;
@@ -56,10 +60,15 @@
 typedef int __attribute__((bitwidth(63))) int63;
 typedef int __attribute__((bitwidth(68))) int68;
 typedef int __attribute__((bitwidth(69))) int69;
+typedef int __attribute__((bitwidth(128))) int128;
 typedef int __attribute__((bitwidth(169))) int169;
 typedef int __attribute__((bitwidth(250))) int250;
 typedef int __attribute__((bitwidth(256))) int256;
-typedef int __attribute__((bitwidth(256))) int500;
+typedef int __attribute__((bitwidth(500))) int500;
+typedef int __attribute__((bitwidth(512))) int512;
+typedef int __attribute__((bitwidth(768))) int768;
+typedef int __attribute__((bitwidth(1000))) int1000;
+typedef int __attribute__((bitwidth(1024))) int1024;
 
 #define bitwidthof(TORV) (__bitwidthof__(typeof(TORV)))
 



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


[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/constval.cpp constval.reference_output

2007-05-17 Thread Reid Spencer


Changes in directory llvm-test/SingleSource/UnitTests/Integer:

constval.cpp updated: 1.2 -> 1.3
constval.reference_output updated: 1.2 -> 1.3
---
Log message:

Update to include a test case with a signed value to ensure sign 
extension is working correctly.


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

 constval.cpp  |6 ++
 constval.reference_output |1 +
 2 files changed, 7 insertions(+)


Index: llvm-test/SingleSource/UnitTests/Integer/constval.cpp
diff -u llvm-test/SingleSource/UnitTests/Integer/constval.cpp:1.2 
llvm-test/SingleSource/UnitTests/Integer/constval.cpp:1.3
--- llvm-test/SingleSource/UnitTests/Integer/constval.cpp:1.2   Wed May 16 
14:34:37 2007
+++ llvm-test/SingleSource/UnitTests/Integer/constval.cpp   Thu May 17 
12:29:58 2007
@@ -29,9 +29,15 @@
   int69 a = bitsFromOctalString("01234567012345670123456", 69);
   printf( "\na = " );
   printBits(a);
+
   int68 b = 
bitsFromBinaryString("10101010101010101010101010101010101010101010101010101010101010101010",
 68);
   printf( "\nb = " );
   printBits(b);
+
+  int169 c = bitsFromString("-1234567890123456789012345678901234567890", 169);
+  printf( "\nc = " );
+  printBits(c);
+
   printf("\n");
 }
 


Index: llvm-test/SingleSource/UnitTests/Integer/constval.reference_output
diff -u llvm-test/SingleSource/UnitTests/Integer/constval.reference_output:1.2 
llvm-test/SingleSource/UnitTests/Integer/constval.reference_output:1.3
--- llvm-test/SingleSource/UnitTests/Integer/constval.reference_output:1.2  
Wed May 16 14:34:37 2007
+++ llvm-test/SingleSource/UnitTests/Integer/constval.reference_output  Thu May 
17 12:29:58 2007
@@ -3,4 +3,5 @@
 z = 

 a = 010100111001011101110101001110010111011101010011100101110
 b = 10101010101010101010101010101010101010101010101010101010101010101010
+c = 
11100010100110110110110001010001100100100110001000111010100110111101001101001001100011100010100101110
 exit 0



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


Re: [llvm-commits] PCH fix

2007-05-17 Thread Devang Patel

On May 17, 2007, at 11:08 AM, Tanya M. Lattner wrote:

>
>> This patch is good. I installed this patch in mainline sources. I  
>> agree, this should also go in 2.0 release branch.
>
> Devang - Can you please apply this patch to the release-2.0 branch?

Done.

> Also, it would be great if we could push this to the mirror ASAP, so  
> I can begin making new tarballs tonight. I think Bill might be able  
> to do that if you ask.

I'll ask Bill.


> Thanks!!

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


Re: [llvm-commits] PCH fix

2007-05-17 Thread Tanya M. Lattner

> This patch is good. I installed this patch in mainline sources. I agree, this 
> should also go in 2.0 release branch.

Devang - Can you please apply this patch to the release-2.0 branch? Also, 
it would be great if we could push this to the mirror ASAP, so I can begin 
making new tarballs tonight. I think Bill might be able to do that if you 
ask.

Thanks!!

-Tanya

>
> Thanks Anton for taking care of this bug.
> -
> Devang
>
> On May 17, 2007, at 2:53 AM, Anton Korobeynikov wrote:
>
>>  Hello, Everyone.
>> 
>>  Attached patch fixes PCHs for both TOT and 2.0 release.
>> 
>>  There were 2 problems:
>> 
>>  1. flush() method of oFILEstream doesn't actually flush the file. This
>>  can lead to incorrect offsets calculations in the PCH handling code and
>>  junk output. This problem seems to be highly platform-dependent: it
>>  fails for linux & mingw32, but passes for darwin.
>> 
>>  There are two possible solutions: either use stdio_sync_buf for
>>  oFILEstream or flush the asm_out_file by hands. I preferred second.
>> 
>>  2. This problem is not platform specific. We have the following sequence
>>  of calls during PCH's read:
>> 
>>   1) llvm_start_asm_file()
>>   2) llvm_read_pch()
>>   3) llvm_end_asm_file()
>> 
>>  In llvm_start_asm_file() routine 2 FunctionPassManagers
>>  (PerFunctionPasses and CodeGenPasses) are created having TheModule used
>>  during construction, later in the llvm_read_pch() TheModule is freed and
>>  recreated, but ... PassManagers still holds pointer to old module. This
>>  causes uninitialised memory reads (and segfaults later) during
>>  doFinalization() calls in the llvm_end_asm_file().
>> 
>>  The solutions was: factor out passmanagers' creation code to separate
>>  routine and call it in llvm_read_pch() in order to recreate passes.
>> 
>>  I think, this patch should be propagated to 2.0 release branch, or,
>>  otherwise PCHs should be marked as "broken in 2.0".
>> 
>>  Patch tested with Qt compilation on x86/linux.
>>  
>
>
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp

2007-05-17 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.402 -> 1.403
---
Log message:

This is the correct fix for PR1427: http://llvm.org/PR1427 .  This fixes 
mmx-shuffle.ll and doesn't
cause other regressions.


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

 X86ISelLowering.cpp |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.402 
llvm/lib/Target/X86/X86ISelLowering.cpp:1.403
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.402   Thu May 17 02:50:14 2007
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Thu May 17 12:13:13 2007
@@ -2675,7 +2675,8 @@
   return Op;
 }
 
-if (X86::isSHUFPMask(PermMask.Val))
+if (X86::isSHUFPMask(PermMask.Val) &&
+MVT::getSizeInBits(VT) != 64)// Don't do this for MMX.
   return Op;
 
 // Handle v8i16 shuffle high / low shuffle node pair.
@@ -2712,7 +2713,9 @@
 }
   }
 
-  if (NumElems == 4) {
+  if (NumElems == 4 && 
+  // Don't do this for MMX.
+  MVT::getSizeInBits(VT) != 64) {
 MVT::ValueType MaskVT = PermMask.getValueType();
 MVT::ValueType MaskEVT = MVT::getVectorBaseType(MaskVT);
 SmallVector, 8> Locs;



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


[llvm-commits] [127364] Fix PCH.

2007-05-17 Thread dpatel
Revision: 127364
Author:   dpatel
Date: 2007-05-17 07:35:46 -0700 (Thu, 17 May 2007)

Log Message:
---
Fix PCH. Patch by Anton Korobeynikov.

Modified Paths:
--
apple-local/branches/llvm/gcc/llvm-backend.cpp

Modified: apple-local/branches/llvm/gcc/llvm-backend.cpp
===
--- apple-local/branches/llvm/gcc/llvm-backend.cpp  2007-05-17 09:01:27 UTC 
(rev 127363)
+++ apple-local/branches/llvm/gcc/llvm-backend.cpp  2007-05-17 14:35:46 UTC 
(rev 127364)
@@ -88,6 +88,8 @@
 static PassManager *PerModulePasses = 0;
 static FunctionPassManager *CodeGenPasses = 0;
 
+static void createOptimizationPasses();
+
 void llvm_initialize_backend(void) {
   // Initialize LLVM options.
   std::vector Args;
@@ -209,13 +211,21 @@
   std::string ErrMsg;
   TheModule = ParseBitcodeFile(MB, &ErrMsg);
   delete MB;
-  
+
   if (!TheModule) {
 cerr << "Error reading bytecodes from PCH file\n";
 cerr << ErrMsg << "\n";
 exit(1);
   }
 
+  if (PerFunctionPasses || PerModulePasses || CodeGenPasses) {
+delete PerFunctionPasses;
+delete PerModulePasses;
+delete CodeGenPasses;
+
+createOptimizationPasses();
+  }
+
   // Read LLVM Types string table
   readLLVMTypesStringTable();
   readLLVMValues();
@@ -225,7 +235,6 @@
 
 // Initialize PCH writing. 
 void llvm_pch_write_init(void) {
-
   timevar_push(TV_LLVM_INIT);
   AsmOutStream = new oFILEstream(asm_out_file);
   AsmOutFile = new OStream(*AsmOutStream);
@@ -246,14 +255,7 @@
   timevar_pop(TV_LLVM_INIT);
 }
 
-// llvm_asm_file_start - Start the .s file.
-void llvm_asm_file_start(void) {
-  timevar_push(TV_LLVM_INIT);
-  AsmOutStream = new oFILEstream(asm_out_file);
-  AsmOutFile = new OStream(*AsmOutStream);
-  
-  flag_llvm_pch_read = 0;
-
+static void createOptimizationPasses() {
   // Create and set up the per-function pass manager.
   // FIXME: Move the code generator to be function-at-a-time.
   PerFunctionPasses =
@@ -411,7 +413,19 @@
 delete PerModulePasses;
 PerModulePasses = 0;
   }
+}
+
+
+// llvm_asm_file_start - Start the .s file.
+void llvm_asm_file_start(void) {
+  timevar_push(TV_LLVM_INIT);
+  AsmOutStream = new oFILEstream(asm_out_file);
+  AsmOutFile = new OStream(*AsmOutStream);
   
+  flag_llvm_pch_read = 0;
+
+  createOptimizationPasses();
+  
   timevar_pop(TV_LLVM_INIT);
 }
 
@@ -480,8 +494,9 @@
 CodeGenPasses->run(*I);
 CodeGenPasses->doFinalization();
   }
-  
+
   AsmOutStream->flush();
+  fflush(asm_out_file);
   delete AsmOutStream;
   AsmOutStream = 0;
   delete AsmOutFile;


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


Re: [llvm-commits] PCH fix

2007-05-17 Thread Devang Patel
Anton,

This patch is good. I installed this patch in mainline sources. I  
agree, this should also go in 2.0 release branch.

Thanks Anton for taking care of this bug.
-
Devang

On May 17, 2007, at 2:53 AM, Anton Korobeynikov wrote:

> Hello, Everyone.
>
> Attached patch fixes PCHs for both TOT and 2.0 release.
>
> There were 2 problems:
>
> 1. flush() method of oFILEstream doesn't actually flush the file. This
> can lead to incorrect offsets calculations in the PCH handling code  
> and
> junk output. This problem seems to be highly platform-dependent: it
> fails for linux & mingw32, but passes for darwin.
>
> There are two possible solutions: either use stdio_sync_buf for
> oFILEstream or flush the asm_out_file by hands. I preferred second.
>
> 2. This problem is not platform specific. We have the following  
> sequence
> of calls during PCH's read:
>
>  1) llvm_start_asm_file()
>  2) llvm_read_pch()
>  3) llvm_end_asm_file()
>
> In llvm_start_asm_file() routine 2 FunctionPassManagers
> (PerFunctionPasses and CodeGenPasses) are created having TheModule  
> used
> during construction, later in the llvm_read_pch() TheModule is  
> freed and
> recreated, but ... PassManagers still holds pointer to old module.  
> This
> causes uninitialised memory reads (and segfaults later) during
> doFinalization() calls in the llvm_end_asm_file().
>
> The solutions was: factor out passmanagers' creation code to separate
> routine and call it in llvm_read_pch() in order to recreate passes.
>
> I think, this patch should be propagated to 2.0 release branch, or,
> otherwise PCHs should be marked as "broken in 2.0".
>
> Patch tested with Qt compilation on x86/linux.
> 

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


[llvm-commits] PCH fix

2007-05-17 Thread Anton Korobeynikov
Hello, Everyone.

Attached patch fixes PCHs for both TOT and 2.0 release.

There were 2 problems:

1. flush() method of oFILEstream doesn't actually flush the file. This
can lead to incorrect offsets calculations in the PCH handling code and
junk output. This problem seems to be highly platform-dependent: it
fails for linux & mingw32, but passes for darwin.

There are two possible solutions: either use stdio_sync_buf for
oFILEstream or flush the asm_out_file by hands. I preferred second.

2. This problem is not platform specific. We have the following sequence
of calls during PCH's read:

 1) llvm_start_asm_file()
 2) llvm_read_pch()
 3) llvm_end_asm_file()

In llvm_start_asm_file() routine 2 FunctionPassManagers
(PerFunctionPasses and CodeGenPasses) are created having TheModule used
during construction, later in the llvm_read_pch() TheModule is freed and
recreated, but ... PassManagers still holds pointer to old module. This
causes uninitialised memory reads (and segfaults later) during
doFinalization() calls in the llvm_end_asm_file().

The solutions was: factor out passmanagers' creation code to separate
routine and call it in llvm_read_pch() in order to recreate passes.

I think, this patch should be propagated to 2.0 release branch, or,
otherwise PCHs should be marked as "broken in 2.0".

Patch tested with Qt compilation on x86/linux.
diff -r 56afa4cf33f4 gcc/llvm-backend.cpp
--- a/gcc/llvm-backend.cpp	Thu May 10 09:02:52 2007 +
+++ b/gcc/llvm-backend.cpp	Thu May 17 11:42:29 2007 +0400
@@ -88,6 +88,8 @@ static PassManager *PerModulePasses = 0;
 static PassManager *PerModulePasses = 0;
 static FunctionPassManager *CodeGenPasses = 0;
 
+static void createOptimizationPasses();
+
 void llvm_initialize_backend(void) {
   // Initialize LLVM options.
   std::vector Args;
@@ -209,13 +212,21 @@ void llvm_pch_read(const unsigned char *
   std::string ErrMsg;
   TheModule = ParseBitcodeFile(MB, &ErrMsg);
   delete MB;
-  
+
   if (!TheModule) {
 cerr << "Error reading bytecodes from PCH file\n";
 cerr << ErrMsg << "\n";
 exit(1);
   }
 
+  if (PerFunctionPasses || PerModulePasses || CodeGenPasses) {
+delete PerFunctionPasses;
+delete PerModulePasses;
+delete CodeGenPasses;
+
+createOptimizationPasses();
+  }
+
   // Read LLVM Types string table
   readLLVMTypesStringTable();
   readLLVMValues();
@@ -225,7 +236,6 @@ void llvm_pch_read(const unsigned char *
 
 // Initialize PCH writing. 
 void llvm_pch_write_init(void) {
-
   timevar_push(TV_LLVM_INIT);
   AsmOutStream = new oFILEstream(asm_out_file);
   AsmOutFile = new OStream(*AsmOutStream);
@@ -246,14 +256,7 @@ void llvm_pch_write_init(void) {
   timevar_pop(TV_LLVM_INIT);
 }
 
-// llvm_asm_file_start - Start the .s file.
-void llvm_asm_file_start(void) {
-  timevar_push(TV_LLVM_INIT);
-  AsmOutStream = new oFILEstream(asm_out_file);
-  AsmOutFile = new OStream(*AsmOutStream);
-  
-  flag_llvm_pch_read = 0;
-
+static void createOptimizationPasses() {
   // Create and set up the per-function pass manager.
   // FIXME: Move the code generator to be function-at-a-time.
   PerFunctionPasses =
@@ -411,6 +414,18 @@ void llvm_asm_file_start(void) {
 delete PerModulePasses;
 PerModulePasses = 0;
   }
+}
+
+
+// llvm_asm_file_start - Start the .s file.
+void llvm_asm_file_start(void) {
+  timevar_push(TV_LLVM_INIT);
+  AsmOutStream = new oFILEstream(asm_out_file);
+  AsmOutFile = new OStream(*AsmOutStream);
+  
+  flag_llvm_pch_read = 0;
+
+  createOptimizationPasses();
   
   timevar_pop(TV_LLVM_INIT);
 }
@@ -480,8 +495,9 @@ void llvm_asm_file_end(void) {
 CodeGenPasses->run(*I);
 CodeGenPasses->doFinalization();
   }
-  
+
   AsmOutStream->flush();
+  fflush(asm_out_file);
   delete AsmOutStream;
   AsmOutStream = 0;
   delete AsmOutFile;
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp

2007-05-17 Thread Anton Korobeynikov


Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.401 -> 1.402
---
Log message:

Revert patch for PR1427: http://llvm.org/PR1427 . It breaks almost all vector 
tests.


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

 X86ISelLowering.cpp |   11 +--
 1 files changed, 1 insertion(+), 10 deletions(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.401 
llvm/lib/Target/X86/X86ISelLowering.cpp:1.402
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.401   Wed May 16 22:29:42 2007
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Thu May 17 02:50:14 2007
@@ -1614,13 +1614,6 @@
 static bool isSHUFPMask(const SDOperand *Elems, unsigned NumElems) {
   if (NumElems != 2 && NumElems != 4) return false;
 
-  // Ensure this is not an mmx shuffle.
-  if (NumElems == 4 && Elems[0].getValueType() == MVT::i16)
-return false;
-  if (NumElems == 2 && Elems[0].getValueType() == MVT::i32)
-return false;
-  
-  
   unsigned Half = NumElems / 2;
   for (unsigned i = 0; i < Half; ++i)
 if (!isUndefOrInRange(Elems[i], 0, NumElems))
@@ -2719,9 +2712,7 @@
 }
   }
 
-  if (NumElems == 4 && 
-  // Don't do this for MMX.
-  MVT::getSizeInBits(VT) != 64) {
+  if (NumElems == 4) {
 MVT::ValueType MaskVT = PermMask.getValueType();
 MVT::ValueType MaskEVT = MVT::getVectorBaseType(MaskVT);
 SmallVector, 8> Locs;



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