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

2007-02-15 Thread Evan Cheng


Changes in directory llvm/include/llvm/ADT:

BitVector.h updated: 1.1 - 1.2
---
Log message:

Bug fixes: assignment operator forgot to copy over size; copy ctor forgot to 
clear unused top bits.

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

 BitVector.h |   11 ++-
 1 files changed, 6 insertions(+), 5 deletions(-)


Index: llvm/include/llvm/ADT/BitVector.h
diff -u llvm/include/llvm/ADT/BitVector.h:1.1 
llvm/include/llvm/ADT/BitVector.h:1.2
--- llvm/include/llvm/ADT/BitVector.h:1.1   Wed Feb 14 23:56:11 2007
+++ llvm/include/llvm/ADT/BitVector.h   Thu Feb 15 02:15:58 2007
@@ -86,6 +86,7 @@
 Capacity = NumBitWords(s);
 Bits = new BitWord[Capacity];
 init_words(Bits, Capacity, t);
+clear_unused_bits();
   }
 
   /// BitVector copy ctor.
@@ -175,6 +176,7 @@
   init_words(Bits[OldCapacity], (Capacity-OldCapacity), t);
 }
 Size = N;
+clear_unused_bits();
   }
 
   void reserve(unsigned N) {
@@ -274,17 +276,16 @@
   const BitVector operator=(const BitVector RHS) {
 if (this == RHS) return *this;
 
-unsigned RHSWords = NumBitWords(RHS.size());
-unsigned NewSize = RHS.size();
-if (NewSize = Capacity * BITS_PER_WORD) {
+Size = RHS.size();
+unsigned RHSWords = NumBitWords(Size);
+if (Size  Capacity * BITS_PER_WORD) {
   std::copy(RHS.Bits, RHS.Bits[RHSWords], Bits);
-  Size = NewSize;
   clear_unused_bits();
   return *this;
 }
   
 // Grow the bitvector to have enough elements.
-Capacity = NumBitWords(NewSize);
+Capacity = NumBitWords(Size);
 BitWord *NewBits = new BitWord[Capacity];
 std::copy(RHS.Bits, RHS.Bits[RHSWords], NewBits);
 



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


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

2007-02-15 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

ScheduleDAG.cpp updated: 1.119 - 1.120
---
Log message:

Apply B Scott Michel's patch for PR1184: http://llvm.org/PR1184 , which 
improves diagnostics in an
abort case.


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

 ScheduleDAG.cpp |   18 --
 1 files changed, 16 insertions(+), 2 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.119 
llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.120
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.119 Wed Feb 14 21:39:18 2007
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp   Thu Feb 15 12:17:56 2007
@@ -302,8 +302,22 @@
   const TargetRegisterClass *RC =
   getInstrOperandRegClass(MRI, TII, II, IIOpNum);
   assert(RC  Don't have operand info for this instruction!);
-  assert(RegMap-getRegClass(VReg) == RC 
- Register class of operand and regclass of use don't agree!);
+  const TargetRegisterClass *VRC = RegMap-getRegClass(VReg);
+  if (VRC != RC) {
+cerr  Register class of operand and regclass of use don't agree!\n;
+#ifndef NDEBUG
+cerr  Operand =   IIOpNum  \n;
+cerr  Op-Val = ; Op.Val-dump(0); cerr  \n;
+cerr  MI = ; MI-print(cerr);
+cerr  VReg =   VReg  \n;
+cerr  VReg RegClass size =   VRC-getSize()
+   , align =   VRC-getAlignment()  \n;
+cerr  Expected RegClass size =   RC-getSize()
+   , align =   RC-getAlignment()  \n;
+#endif
+cerr  Fatal error, aborting.\n;
+abort();
+  }
 }
   } else if (ConstantSDNode *C =
  dyn_castConstantSDNode(Op)) {



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


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

2007-02-15 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

ScheduleDAG.cpp updated: 1.120 - 1.121
---
Log message:

fix indentation


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

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


Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.120 
llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.121
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.120 Thu Feb 15 12:17:56 2007
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp   Thu Feb 15 12:19:15 2007
@@ -311,9 +311,9 @@
 cerr  MI = ; MI-print(cerr);
 cerr  VReg =   VReg  \n;
 cerr  VReg RegClass size =   VRC-getSize()
-   , align =   VRC-getAlignment()  \n;
+  , align =   VRC-getAlignment()  \n;
 cerr  Expected RegClass size =   RC-getSize()
-   , align =   RC-getAlignment()  \n;
+  , align =   RC-getAlignment()  \n;
 #endif
 cerr  Fatal error, aborting.\n;
 abort();



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


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

2007-02-15 Thread Chris Lattner


Changes in directory llvm/include/llvm:

Value.h updated: 1.97 - 1.98
---
Log message:

Add a new Value::getNameStr method, which is preferred over getName.


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

 Value.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/Value.h
diff -u llvm/include/llvm/Value.h:1.97 llvm/include/llvm/Value.h:1.98
--- llvm/include/llvm/Value.h:1.97  Wed Feb 14 21:39:17 2007
+++ llvm/include/llvm/Value.h   Thu Feb 15 12:53:54 2007
@@ -87,7 +87,8 @@
 
   // All values can potentially be named...
   inline bool hasName() const { return Name != 0; }
-  std::string getName() const;
+  std::string getName() const { return getNameStr(); }
+  std::string getNameStr() const;
   ValueName *getValueName() const { return Name; }
 
   void setName(const std::string name);



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


[llvm-commits] CVS: llvm/lib/VMCore/Value.cpp

2007-02-15 Thread Chris Lattner


Changes in directory llvm/lib/VMCore:

Value.cpp updated: 1.68 - 1.69
---
Log message:

Add a new Value::getNameStr method, which is preferred over getName.


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

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


Index: llvm/lib/VMCore/Value.cpp
diff -u llvm/lib/VMCore/Value.cpp:1.68 llvm/lib/VMCore/Value.cpp:1.69
--- llvm/lib/VMCore/Value.cpp:1.68  Tue Feb 13 01:53:34 2007
+++ llvm/lib/VMCore/Value.cpp   Thu Feb 15 12:53:54 2007
@@ -112,7 +112,7 @@
   return false;
 }
 
-std::string Value::getName() const {
+std::string Value::getNameStr() const {
   if (Name == 0) return ;
   return std::string(Name-getKeyData(),
  Name-getKeyData()+Name-getKeyLength());



___
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/BitVector.h

2007-02-15 Thread Evan Cheng


Changes in directory llvm/include/llvm/ADT:

BitVector.h updated: 1.3 - 1.4
---
Log message:

Eliminate new[0], just set Bits to NULL.

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

 BitVector.h |   31 ---
 1 files changed, 20 insertions(+), 11 deletions(-)


Index: llvm/include/llvm/ADT/BitVector.h
diff -u llvm/include/llvm/ADT/BitVector.h:1.3 
llvm/include/llvm/ADT/BitVector.h:1.4
--- llvm/include/llvm/ADT/BitVector.h:1.3   Thu Feb 15 12:48:41 2007
+++ llvm/include/llvm/ADT/BitVector.h   Thu Feb 15 12:59:15 2007
@@ -69,7 +69,7 @@
 
   /// BitVector default ctor - Creates an empty bitvector.
   BitVector() : Size(0), Capacity(0) {
-Bits = new BitWord[0];
+Bits = NULL;
   }
 
   /// BitVector ctor - Creates a bitvector of specified number of bits. All
@@ -154,9 +154,11 @@
 
   /// clear - Clear all bits.
   void clear() {
-delete[] Bits;
-Bits = new BitWord[0];
-Size = Capacity = 0;
+if (Capacity  0) {
+  delete[] Bits;
+  Bits = NULL;
+  Size = Capacity = 0;
+}
   }
 
   /// resize - Grow or shrink the bitvector.
@@ -186,8 +188,10 @@
 
   // Set, reset, flip
   BitVector set() {
-init_words(Bits, Capacity, true);
-clear_unused_bits();
+if (Bits) {
+  init_words(Bits, Capacity, true);
+  clear_unused_bits();
+}
 return *this;
   }
 
@@ -197,7 +201,8 @@
   }
 
   BitVector reset() {
-init_words(Bits, Capacity, false);
+if (Bits)
+  init_words(Bits, Capacity, false);
 return *this;
   }
 
@@ -303,8 +308,10 @@
 
   // Clear the unused top bits in the high word.
   void clear_unused_bits() {
-unsigned ExtraBits = Size % BITS_PER_WORD;
-Bits[Size / BITS_PER_WORD] = ~(~0  ExtraBits);
+if (Size) {
+  unsigned ExtraBits = Size % BITS_PER_WORD;
+  Bits[Size / BITS_PER_WORD] = ~(~0  ExtraBits);
+}
   }
 
   void grow(unsigned NewSize) {
@@ -317,12 +324,14 @@
   std::copy(Bits, Bits[OldCapacity], NewBits);
 
 // Destroy the old bits.
-delete[] Bits;
+if (Bits)
+  delete[] Bits;
 Bits = NewBits;
   }
 
   void init_words(BitWord *B, unsigned NumWords, bool t) {
-memset(B, 0 - (int)t, NumWords*sizeof(BitWord));
+if (B)
+  memset(B, 0 - (int)t, NumWords*sizeof(BitWord));
   } 
 };
 



___
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/BitVector.h

2007-02-15 Thread Evan Cheng


Changes in directory llvm/include/llvm/ADT:

BitVector.h updated: 1.4 - 1.5
---
Log message:

1 - 1L since BitWord has type unsigned long.

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

 BitVector.h |   18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)


Index: llvm/include/llvm/ADT/BitVector.h
diff -u llvm/include/llvm/ADT/BitVector.h:1.4 
llvm/include/llvm/ADT/BitVector.h:1.5
--- llvm/include/llvm/ADT/BitVector.h:1.4   Thu Feb 15 12:59:15 2007
+++ llvm/include/llvm/ADT/BitVector.h   Thu Feb 15 13:03:23 2007
@@ -47,22 +47,22 @@
 
 reference operator=(bool t) {
   if (t)
-*WordRef |= 1  BitPos;
+*WordRef |= 1L  BitPos;
   else
-*WordRef = ~(1  BitPos);
+*WordRef = ~(1L  BitPos);
   return *this;
 }
 
 reference operator=(const reference rhs) {
   if (*rhs.WordRef  (1  rhs.BitPos))
-*WordRef |= 1  BitPos;
+*WordRef |= 1L  BitPos;
   else
-*WordRef = ~(1  BitPos);
+*WordRef = ~(1L  BitPos);
   return *this;
 }
 
 operator bool() const {
-  return (*WordRef)  (1  BitPos);
+  return (*WordRef)  (1L  BitPos);
 }
   };
 
@@ -196,7 +196,7 @@
   }
 
   BitVector set(unsigned Idx) {
-Bits[Idx / BITS_PER_WORD] |= 1  (Idx % BITS_PER_WORD);
+Bits[Idx / BITS_PER_WORD] |= 1L  (Idx % BITS_PER_WORD);
 return *this;
   }
 
@@ -207,7 +207,7 @@
   }
 
   BitVector reset(unsigned Idx) {
-Bits[Idx / BITS_PER_WORD] = ~(1  (Idx % BITS_PER_WORD));
+Bits[Idx / BITS_PER_WORD] = ~(1L  (Idx % BITS_PER_WORD));
 return *this;
   }
 
@@ -219,7 +219,7 @@
   }
 
   BitVector flip(unsigned Idx) {
-Bits[Idx / BITS_PER_WORD] ^= 1  (Idx % BITS_PER_WORD);
+Bits[Idx / BITS_PER_WORD] ^= 1L  (Idx % BITS_PER_WORD);
 return *this;
   }
 
@@ -234,7 +234,7 @@
   }
 
   bool operator[](unsigned Idx) const {
-BitWord Mask = 1  (Idx % BITS_PER_WORD);
+BitWord Mask = 1L  (Idx % BITS_PER_WORD);
 return (Bits[Idx / BITS_PER_WORD]  Mask) != 0;
   }
 



___
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/BitVector.h

2007-02-15 Thread Evan Cheng


Changes in directory llvm/include/llvm/ADT:

BitVector.h updated: 1.5 - 1.6
---
Log message:

Eliminate a redundent ctor; eliminate one more potential new [0].

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

 BitVector.h |   18 --
 1 files changed, 8 insertions(+), 10 deletions(-)


Index: llvm/include/llvm/ADT/BitVector.h
diff -u llvm/include/llvm/ADT/BitVector.h:1.5 
llvm/include/llvm/ADT/BitVector.h:1.6
--- llvm/include/llvm/ADT/BitVector.h:1.5   Thu Feb 15 13:03:23 2007
+++ llvm/include/llvm/ADT/BitVector.h   Thu Feb 15 13:05:25 2007
@@ -73,24 +73,22 @@
   }
 
   /// BitVector ctor - Creates a bitvector of specified number of bits. All
-  /// bits are initialized to false;
-  BitVector(unsigned s) : Size(s) {
-Capacity = NumBitWords(s);
-Bits = new BitWord[Capacity];
-init_words(Bits, Capacity, false);
-  }
-
-  /// BitVector ctor - Creates a bitvector of specified number of bits. All
   /// bits are initialized to the specified value.
-  BitVector(unsigned s, bool t) : Size(s) {
+  explicit BitVector(unsigned s, bool t = false) : Size(s) {
 Capacity = NumBitWords(s);
 Bits = new BitWord[Capacity];
 init_words(Bits, Capacity, t);
-clear_unused_bits();
+if (t)
+  clear_unused_bits();
   }
 
   /// BitVector copy ctor.
   BitVector(const BitVector RHS) : Size(RHS.size()) {
+if (Size == 0) {
+  Bits = NULL;
+  return;
+}
+
 Capacity = NumBitWords(RHS.size());
 Bits = new BitWord[Capacity];
 std::copy(RHS.Bits, RHS.Bits[Capacity], Bits);



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


[llvm-commits] Bug 1202 fix

2007-02-15 Thread Scott Michel
Attached patch fixes bug 1202.
Index: lib/Target/TargetData.cpp
===
--- lib/Target/TargetData.cpp	(.../trunk)	(revision 877)
+++ lib/Target/TargetData.cpp	(.../branches/llvm-spu)	(revision 877)
@@ -245,7 +245,8 @@
   std::pairalign_iterator, align_iterator ins_result =
 std::equal_range(Alignments.begin(), Alignments.end(), elt);
   align_iterator I = ins_result.first;
-  if (I-AlignType == align_type  I-TypeBitWidth == bit_width) {
+  align_iterator E = ins_result.second;
+  if (I != E  I-AlignType == align_type  I-TypeBitWidth == bit_width) {
 // Update the abi, preferred alignments.
 I-ABIAlign = abi_align;
 I-PrefAlign = pref_align;
@@ -254,7 +255,6 @@
 
 #if 0
   // Keep around for debugging and testing...
-  align_iterator E = ins_result.second;
 
   cerr  setAlignment(  elt  )\n;
   cerr  I =   (I - Alignments.begin())
___
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/BitVector.h

2007-02-15 Thread Evan Cheng


Changes in directory llvm/include/llvm/ADT:

BitVector.h updated: 1.6 - 1.7
---
Log message:

BitVector::count() bugs.

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

 BitVector.h |7 ++-
 1 files changed, 6 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/ADT/BitVector.h
diff -u llvm/include/llvm/ADT/BitVector.h:1.6 
llvm/include/llvm/ADT/BitVector.h:1.7
--- llvm/include/llvm/ADT/BitVector.h:1.6   Thu Feb 15 13:05:25 2007
+++ llvm/include/llvm/ADT/BitVector.h   Thu Feb 15 13:09:36 2007
@@ -101,7 +101,12 @@
   unsigned count() const {
 unsigned NumBits = 0;
 for (unsigned i = 0; i  NumBitWords(size()); ++i)
-  NumBits = CountPopulation_32(Bits[i]);
+  if (sizeof(BitWord) == 4)
+NumBits += CountPopulation_32(Bits[i]);
+  else if (sizeof(BitWord) == 8)
+NumBits += CountPopulation_64(Bits[i]);
+  else
+assert(0  Unsupported!)
 return NumBits;
   }
 



___
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/BitVector.h

2007-02-15 Thread Evan Cheng


Changes in directory llvm/include/llvm/ADT:

BitVector.h updated: 1.7 - 1.8
---
Log message:

Clear no longer deleting the bits to avoid mallocs.

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

 BitVector.h |6 +-
 1 files changed, 1 insertion(+), 5 deletions(-)


Index: llvm/include/llvm/ADT/BitVector.h
diff -u llvm/include/llvm/ADT/BitVector.h:1.7 
llvm/include/llvm/ADT/BitVector.h:1.8
--- llvm/include/llvm/ADT/BitVector.h:1.7   Thu Feb 15 13:09:36 2007
+++ llvm/include/llvm/ADT/BitVector.h   Thu Feb 15 13:10:34 2007
@@ -157,11 +157,7 @@
 
   /// clear - Clear all bits.
   void clear() {
-if (Capacity  0) {
-  delete[] Bits;
-  Bits = NULL;
-  Size = Capacity = 0;
-}
+Size = 0;
   }
 
   /// resize - Grow or shrink the bitvector.



___
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/BitVector.h

2007-02-15 Thread Evan Cheng


Changes in directory llvm/include/llvm/ADT:

BitVector.h updated: 1.8 - 1.9
---
Log message:

Merges two resize() variants.

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

 BitVector.h |   14 +++---
 1 files changed, 3 insertions(+), 11 deletions(-)


Index: llvm/include/llvm/ADT/BitVector.h
diff -u llvm/include/llvm/ADT/BitVector.h:1.8 
llvm/include/llvm/ADT/BitVector.h:1.9
--- llvm/include/llvm/ADT/BitVector.h:1.8   Thu Feb 15 13:10:34 2007
+++ llvm/include/llvm/ADT/BitVector.h   Thu Feb 15 13:12:39 2007
@@ -161,23 +161,15 @@
   }
 
   /// resize - Grow or shrink the bitvector.
-  void resize(unsigned N) {
-if (N  Capacity * BITS_PER_WORD) {
-  unsigned OldCapacity = Capacity;
-  grow(N);
-  init_words(Bits[OldCapacity], (Capacity-OldCapacity), false);
-}
-Size = N;
-  }
-
-  void resize(unsigned N, bool t) {
+  void resize(unsigned N, bool t = false) {
 if (N  Capacity * BITS_PER_WORD) {
   unsigned OldCapacity = Capacity;
   grow(N);
   init_words(Bits[OldCapacity], (Capacity-OldCapacity), t);
 }
 Size = N;
-clear_unused_bits();
+if (t)
+  clear_unused_bits();
   }
 
   void reserve(unsigned N) {



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


[llvm-commits] CVS: llvm/lib/VMCore/Function.cpp

2007-02-15 Thread Chris Lattner


Changes in directory llvm/lib/VMCore:

Function.cpp updated: 1.113 - 1.114
---
Log message:

Implement Function::getIntrinsicID without it needing to call Value::getName,
which allocates a string.  This speeds up instcombine on 447.dealII by 5%.


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

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


Index: llvm/lib/VMCore/Function.cpp
diff -u llvm/lib/VMCore/Function.cpp:1.113 llvm/lib/VMCore/Function.cpp:1.114
--- llvm/lib/VMCore/Function.cpp:1.113  Sun Feb 11 23:18:08 2007
+++ llvm/lib/VMCore/Function.cppThu Feb 15 13:17:16 2007
@@ -160,12 +160,15 @@
 /// llvm/Intrinsics.h.
 ///
 unsigned Function::getIntrinsicID() const {
-  const std::string Name = this-getName();
-  if (Name.size()  5 || Name[4] != '.' || Name[0] != 'l' || Name[1] != 'l'
+  const ValueName *ValName = this-getValueName();
+  unsigned Len = ValName-getKeyLength();
+  const char *Name = ValName-getKeyData();
+  
+  if (Len  5 || Name[4] != '.' || Name[0] != 'l' || Name[1] != 'l'
   || Name[2] != 'v' || Name[3] != 'm')
 return 0;  // All intrinsics start with 'llvm.'
 
-  assert(Name.size() != 5  'llvm.' is an invalid intrinsic name!);
+  assert(Len != 5  'llvm.' is an invalid intrinsic name!);
 
 #define GET_FUNCTION_RECOGNIZER
 #include llvm/Intrinsics.gen



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


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

2007-02-15 Thread Chris Lattner


Changes in directory llvm/utils/TableGen:

IntrinsicEmitter.cpp updated: 1.27 - 1.28
---
Log message:

Implement Function::getIntrinsicID without it needing to call Value::getName,
which allocates a string.  This speeds up instcombine on 447.dealII by 5%.


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

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


Index: llvm/utils/TableGen/IntrinsicEmitter.cpp
diff -u llvm/utils/TableGen/IntrinsicEmitter.cpp:1.27 
llvm/utils/TableGen/IntrinsicEmitter.cpp:1.28
--- llvm/utils/TableGen/IntrinsicEmitter.cpp:1.27   Wed Feb 14 21:39:18 2007
+++ llvm/utils/TableGen/IntrinsicEmitter.cppThu Feb 15 13:17:16 2007
@@ -81,17 +81,19 @@
   OS  // Function name - enum value recognizer code.\n;
   OS  #ifdef GET_FUNCTION_RECOGNIZER\n;
   OSswitch (Name[5]) {\n;
-  OSdefault: break;\n;
+  OSdefault:\n;
   // Emit the intrinsics in sorted order.
   char LastChar = 0;
   for (std::mapstd::string, std::string::iterator I = IntMapping.begin(),
E = IntMapping.end(); I != E; ++I) {
 if (I-first[5] != LastChar) {
   LastChar = I-first[5];
+  OS  break;\n;
   OScase '  LastChar  ':\n;
 }
 
-OS  if (Name == \  I-first  \) return Intrinsic::
+OS  if (Len ==   I-first.size()
+  !strcmp(Name, \  I-first  \)) return Intrinsic::
 I-second  ;\n;
   }
   OS}\n;



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


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

2007-02-15 Thread Evan Cheng


Changes in directory llvm/include/llvm/ADT:

BitVector.h updated: 1.10 - 1.11
---
Log message:

Remove unnecessary checks.

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

 BitVector.h |   15 +--
 1 files changed, 5 insertions(+), 10 deletions(-)


Index: llvm/include/llvm/ADT/BitVector.h
diff -u llvm/include/llvm/ADT/BitVector.h:1.10 
llvm/include/llvm/ADT/BitVector.h:1.11
--- llvm/include/llvm/ADT/BitVector.h:1.10  Thu Feb 15 13:16:21 2007
+++ llvm/include/llvm/ADT/BitVector.h   Thu Feb 15 13:18:12 2007
@@ -179,10 +179,8 @@
 
   // Set, reset, flip
   BitVector set() {
-if (Bits) {
-  init_words(Bits, Capacity, true);
-  clear_unused_bits();
-}
+init_words(Bits, Capacity, true);
+clear_unused_bits();
 return *this;
   }
 
@@ -192,8 +190,7 @@
   }
 
   BitVector reset() {
-if (Bits)
-  init_words(Bits, Capacity, false);
+init_words(Bits, Capacity, false);
 return *this;
   }
 
@@ -317,14 +314,12 @@
   std::copy(Bits, Bits[OldCapacity], NewBits);
 
 // Destroy the old bits.
-if (Bits)
-  delete[] Bits;
+delete[] Bits;
 Bits = NewBits;
   }
 
   void init_words(BitWord *B, unsigned NumWords, bool t) {
-if (B)
-  memset(B, 0 - (int)t, NumWords*sizeof(BitWord));
+memset(B, 0 - (int)t, NumWords*sizeof(BitWord));
   } 
 };
 



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


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

2007-02-15 Thread Chris Lattner


Changes in directory llvm/utils/TableGen:

IntrinsicEmitter.cpp updated: 1.28 - 1.29
---
Log message:

the lengths of the strings are known, just use memcmp


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

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


Index: llvm/utils/TableGen/IntrinsicEmitter.cpp
diff -u llvm/utils/TableGen/IntrinsicEmitter.cpp:1.28 
llvm/utils/TableGen/IntrinsicEmitter.cpp:1.29
--- llvm/utils/TableGen/IntrinsicEmitter.cpp:1.28   Thu Feb 15 13:17:16 2007
+++ llvm/utils/TableGen/IntrinsicEmitter.cppThu Feb 15 13:26:16 2007
@@ -93,7 +93,7 @@
 }
 
 OS  if (Len ==   I-first.size()
-  !strcmp(Name, \  I-first  \)) return Intrinsic::
+  !memcmp(Name, \  I-first  \, Len)) return Intrinsic::
 I-second  ;\n;
   }
   OS}\n;



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


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

2007-02-15 Thread Evan Cheng


Changes in directory llvm/include/llvm/ADT:

BitVector.h updated: 1.11 - 1.12
---
Log message:

BitVector::reference operator=(const reference rhs) is unnecessary thanks to 
autoconvert to bool.

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

 BitVector.h |8 
 1 files changed, 8 deletions(-)


Index: llvm/include/llvm/ADT/BitVector.h
diff -u llvm/include/llvm/ADT/BitVector.h:1.11 
llvm/include/llvm/ADT/BitVector.h:1.12
--- llvm/include/llvm/ADT/BitVector.h:1.11  Thu Feb 15 13:18:12 2007
+++ llvm/include/llvm/ADT/BitVector.h   Thu Feb 15 13:21:44 2007
@@ -53,14 +53,6 @@
   return *this;
 }
 
-reference operator=(const reference rhs) {
-  if (*rhs.WordRef  (1  rhs.BitPos))
-*WordRef |= 1L  BitPos;
-  else
-*WordRef = ~(1L  BitPos);
-  return *this;
-}
-
 operator bool() const {
   return (*WordRef)  (1L  BitPos);
 }



___
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/BitVector.h

2007-02-15 Thread Evan Cheng


Changes in directory llvm/include/llvm/ADT:

BitVector.h updated: 1.12 - 1.13
---
Log message:

Missing a ;

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

 BitVector.h |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/ADT/BitVector.h
diff -u llvm/include/llvm/ADT/BitVector.h:1.12 
llvm/include/llvm/ADT/BitVector.h:1.13
--- llvm/include/llvm/ADT/BitVector.h:1.12  Thu Feb 15 13:21:44 2007
+++ llvm/include/llvm/ADT/BitVector.h   Thu Feb 15 13:29:05 2007
@@ -98,7 +98,7 @@
   else if (sizeof(BitWord) == 8)
 NumBits += CountPopulation_64(Bits[i]);
   else
-assert(0  Unsupported!)
+assert(0  Unsupported!);
 return NumBits;
   }
 
@@ -160,8 +160,7 @@
   init_words(Bits[OldCapacity], (Capacity-OldCapacity), t);
 }
 Size = N;
-if (t)
-  clear_unused_bits();
+clear_unused_bits();
   }
 
   void reserve(unsigned N) {



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

2007-02-15 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.633 - 1.634
---
Log message:

switch an std::set to a SmallPtr set, this speeds up instcombine by 9.5%
on 447.dealII


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

 InstructionCombining.cpp |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.633 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.634
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.633   Wed Feb 14 
20:26:10 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Feb 15 13:41:52 2007
@@ -51,6 +51,7 @@
 #include llvm/Support/PatternMatch.h
 #include llvm/Support/Compiler.h
 #include llvm/ADT/SmallVector.h
+#include llvm/ADT/SmallPtrSet.h
 #include llvm/ADT/Statistic.h
 #include llvm/ADT/STLExtras.h
 #include algorithm
@@ -9088,11 +9089,11 @@
 /// whose condition is a known constant, we only visit the reachable 
successors.
 ///
 static void AddReachableCodeToWorklist(BasicBlock *BB, 
-   std::setBasicBlock* Visited,
+   SmallPtrSetBasicBlock*, 64 Visited,
std::vectorInstruction* WorkList,
const TargetData *TD) {
   // We have now visited this block!  If we've already been here, bail out.
-  if (!Visited.insert(BB).second) return;
+  if (!Visited.insert(BB)) return;
 
   for (BasicBlock::iterator BBI = BB-begin(), E = BB-end(); BBI != E; ) {
 Instruction *Inst = BBI++;
@@ -9154,7 +9155,7 @@
 // Do a depth-first traversal of the function, populate the worklist with
 // the reachable instructions.  Ignore blocks that are not reachable.  Keep
 // track of which blocks we visit.
-std::setBasicBlock* Visited;
+SmallPtrSetBasicBlock*, 64 Visited;
 AddReachableCodeToWorklist(F.begin(), Visited, WorkList, TD);
 
 // Do a quick scan over the function.  If we find any blocks that are



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


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

2007-02-15 Thread Reid Spencer
Evan,

BitVector is still very broken. Please run the llvm/test suite. Numerous
tests are failing, all in BitVector. This is preventing me from testing
today.

Reid.

On Thu, 2007-02-15 at 13:29 -0600, Evan Cheng wrote:
 
 Changes in directory llvm/include/llvm/ADT:
 
 BitVector.h updated: 1.12 - 1.13
 ---
 Log message:
 
 Missing a ;
 
 ---
 Diffs of the changes:  (+2 -3)
 
  BitVector.h |5 ++---
  1 files changed, 2 insertions(+), 3 deletions(-)
 
 
 Index: llvm/include/llvm/ADT/BitVector.h
 diff -u llvm/include/llvm/ADT/BitVector.h:1.12 
 llvm/include/llvm/ADT/BitVector.h:1.13
 --- llvm/include/llvm/ADT/BitVector.h:1.12Thu Feb 15 13:21:44 2007
 +++ llvm/include/llvm/ADT/BitVector.h Thu Feb 15 13:29:05 2007
 @@ -98,7 +98,7 @@
else if (sizeof(BitWord) == 8)
  NumBits += CountPopulation_64(Bits[i]);
else
 -assert(0  Unsupported!)
 +assert(0  Unsupported!);
  return NumBits;
}
  
 @@ -160,8 +160,7 @@
init_words(Bits[OldCapacity], (Capacity-OldCapacity), t);
  }
  Size = N;
 -if (t)
 -  clear_unused_bits();
 +clear_unused_bits();
}
  
void reserve(unsigned N) {
 
 
 
 ___
 llvm-commits mailing list
 llvm-commits@cs.uiuc.edu
 http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

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


[llvm-commits] CVS: llvm/lib/VMCore/Value.cpp

2007-02-15 Thread Chris Lattner


Changes in directory llvm/lib/VMCore:

Value.cpp updated: 1.69 - 1.70
---
Log message:

rewrite Value::takeName to take advantage of the new symtab stuff.  This
causes it to require no allocations and no symtab lookups in the common
case.  This speeds up instcombine 9.2% on 447.dealII.


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

 Value.cpp |   61 +++--
 1 files changed, 55 insertions(+), 6 deletions(-)


Index: llvm/lib/VMCore/Value.cpp
diff -u llvm/lib/VMCore/Value.cpp:1.69 llvm/lib/VMCore/Value.cpp:1.70
--- llvm/lib/VMCore/Value.cpp:1.69  Thu Feb 15 12:53:54 2007
+++ llvm/lib/VMCore/Value.cpp   Thu Feb 15 14:01:43 2007
@@ -185,15 +185,64 @@
 /// takeName - transfer the name from V to this value, setting V's name to
 /// empty.  It is an error to call V-takeName(V). 
 void Value::takeName(Value *V) {
-  if (!V-hasName()) {
-if (hasName())
-  setName();
+  ValueSymbolTable *ST = 0;
+  // If this value has a name, drop it.
+  if (hasName()) {
+// Get the symtab this is in.
+if (getSymTab(this, ST)) {
+  // We can't set a name on this value, but we need to clear V's name if
+  // it has one.
+  if (V-hasName()) V-setName(0, 0);
+  return;  // Cannot set a name on this value (e.g. constant).
+}
+
+// Remove old name.
+if (ST)
+  ST-removeValueName(Name);
+Name-Destroy();
+Name = 0;
+  } 
+  
+  // Now we know that this has no name.
+  
+  // If V has no name either, we're done.
+  if (!V-hasName()) return;
+   
+  // Get this's symtab if we didn't before.
+  if (!ST) {
+if (getSymTab(this, ST)) {
+  // Clear V's name.
+  V-setName(0, 0);
+  return;  // Cannot set a name on this value (e.g. constant).
+}
+  }
+  
+  // Get V's ST, this should always succed, because V has a name.
+  ValueSymbolTable *VST;
+  bool Failure = getSymTab(V, VST);
+  assert(!Failure  V has a name, so it should have a ST!);
+  
+  // If these values are both in the same symtab, we can do this very fast.
+  // This works even if both values have no symtab yet.
+  if (ST == VST) {
+// Take the name!
+Name = V-Name;
+V-Name = 0;
+Name-setValue(this);
 return;
   }
   
-  std::string Name = V-getName();
-  V-setName();
-  setName(Name);
+  // Otherwise, things are slightly more complex.  Remove V's name from VST and
+  // then reinsert it into ST.
+  
+  if (VST)
+VST-removeValueName(V-Name);
+  Name = V-Name;
+  V-Name = 0;
+  Name-setValue(this);
+  
+  if (ST)
+ST-reinsertValue(this);
 }
 
 



___
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/BitVector.h

2007-02-15 Thread Reid Spencer


Changes in directory llvm/include/llvm/ADT:

BitVector.h updated: 1.13 - 1.14
---
Log message:

Make sure Capacity gets initialized too.


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

 BitVector.h |1 +
 1 files changed, 1 insertion(+)


Index: llvm/include/llvm/ADT/BitVector.h
diff -u llvm/include/llvm/ADT/BitVector.h:1.13 
llvm/include/llvm/ADT/BitVector.h:1.14
--- llvm/include/llvm/ADT/BitVector.h:1.13  Thu Feb 15 13:29:05 2007
+++ llvm/include/llvm/ADT/BitVector.h   Thu Feb 15 14:14:06 2007
@@ -78,6 +78,7 @@
   BitVector(const BitVector RHS) : Size(RHS.size()) {
 if (Size == 0) {
   Bits = NULL;
+  Capacity = 0;
   return;
 }
 



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


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

2007-02-15 Thread Reid Spencer
This patch fixed the bulk of the BitVector failures. However, there is
still a memory corruption that I'm working on.

Reid.

On Thu, 2007-02-15 at 14:14 -0600, Reid Spencer wrote:
 
 Changes in directory llvm/include/llvm/ADT:
 
 BitVector.h updated: 1.13 - 1.14
 ---
 Log message:
 
 Make sure Capacity gets initialized too.
 
 
 ---
 Diffs of the changes:  (+1 -0)
 
  BitVector.h |1 +
  1 files changed, 1 insertion(+)
 
 
 Index: llvm/include/llvm/ADT/BitVector.h
 diff -u llvm/include/llvm/ADT/BitVector.h:1.13 
 llvm/include/llvm/ADT/BitVector.h:1.14
 --- llvm/include/llvm/ADT/BitVector.h:1.13Thu Feb 15 13:29:05 2007
 +++ llvm/include/llvm/ADT/BitVector.h Thu Feb 15 14:14:06 2007
 @@ -78,6 +78,7 @@
BitVector(const BitVector RHS) : Size(RHS.size()) {
  if (Size == 0) {
Bits = NULL;
 +  Capacity = 0;
return;
  }
  
 
 
 
 ___
 llvm-commits mailing list
 llvm-commits@cs.uiuc.edu
 http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
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/BitVector.h

2007-02-15 Thread Reid Spencer


Changes in directory llvm/include/llvm/ADT:

BitVector.h updated: 1.14 - 1.15
---
Log message:

Fix an off-by-one bug in computing the index of the word to clear.


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

 BitVector.h |5 -
 1 files changed, 4 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/ADT/BitVector.h
diff -u llvm/include/llvm/ADT/BitVector.h:1.14 
llvm/include/llvm/ADT/BitVector.h:1.15
--- llvm/include/llvm/ADT/BitVector.h:1.14  Thu Feb 15 14:14:06 2007
+++ llvm/include/llvm/ADT/BitVector.h   Thu Feb 15 14:49:10 2007
@@ -292,7 +292,10 @@
   void clear_unused_bits() {
 if (Size) {
   unsigned ExtraBits = Size % BITS_PER_WORD;
-  Bits[Size / BITS_PER_WORD] = ~(~0  ExtraBits);
+  unsigned index = Size / BITS_PER_WORD;
+  if (Size % BITS_PER_WORD == 0)
+index--;
+  Bits[index] = ~(~0  ExtraBits);
 }
   }
 



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


[llvm-commits] CVS: llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll

2007-02-15 Thread Reid Spencer


Changes in directory llvm/test/CodeGen/CBackend:

2007-01-08-ParamAttr-ICmp.ll updated: 1.2 - 1.3
---
Log message:

Update this test to compile properly and check against the correct 
string generated by the CBE. This is no longer an XFAIL.


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

 2007-01-08-ParamAttr-ICmp.ll |   19 +--
 1 files changed, 9 insertions(+), 10 deletions(-)


Index: llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll
diff -u llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll:1.2 
llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll:1.3
--- llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll:1.2 Fri Jan 26 
02:25:06 2007
+++ llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll Thu Feb 15 
15:01:58 2007
@@ -1,7 +1,6 @@
-; RUN: llvm-as  %s | llc -march=c | \
-; RUN:   grep 'return ltmp_2_2 == (signed int)ltmp_1_2)) ?  (1) : (0)))'
 ; For PR1099
-; XFAIL: *
+; RUN: llvm-as  %s | llc -march=c | \
+; RUN:   grep 'return ltmp_2_2 == ltmp_1_2)) ? (1) : (0)))'
 
 target datalayout = e-p:32:32
 target triple = i686-apple-darwin8
@@ -9,21 +8,21 @@
 
 implementation   ; Functions:
 
-define bool @prune_match_entry_2E_ce(%struct.Connector* %a, i16 %b.0.0.val) {
+define i1 @prune_match_entry_2E_ce(%struct.Connector* %a, i16 %b.0.0.val) {
 newFuncRoot:
 br label %entry.ce
 
 cond_next.exitStub: ; preds = %entry.ce
-ret bool true
+ret i1 true
 
 entry.return_crit_edge.exitStub:; preds = %entry.ce
-ret bool false
+ret i1 false
 
 entry.ce:   ; preds = %newFuncRoot
-%tmp = getelementptr %struct.Connector* %a, i32 0, i32 0   
 ; i16* [#uses=1]
-%tmp = load i16* %tmp   ; i16 [#uses=1]
-%tmp = icmp eq i16 %tmp, %b.0.0.val ; bool [#uses=1]
-br bool %tmp, label %cond_next.exitStub, label 
%entry.return_crit_edge.exitStub
+%tmp1 = getelementptr %struct.Connector* %a, i32 0, i32 0  
  ; i16* [#uses=1]
+%tmp2 = load i16* %tmp1   ; i16 [#uses=1]
+%tmp3 = icmp eq i16 %tmp2, %b.0.0.val ; i1 [#uses=1]
+br i1 %tmp3, label %cond_next.exitStub, label 
%entry.return_crit_edge.exitStub
 }
 
 



___
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/BitVector.h

2007-02-15 Thread Evan Cheng


Changes in directory llvm/include/llvm/ADT:

BitVector.h updated: 1.15 - 1.16
---
Log message:

Proper fix for the off-by-one bug in clear_unused_bits().

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

 BitVector.h |8 +++-
 1 files changed, 3 insertions(+), 5 deletions(-)


Index: llvm/include/llvm/ADT/BitVector.h
diff -u llvm/include/llvm/ADT/BitVector.h:1.15 
llvm/include/llvm/ADT/BitVector.h:1.16
--- llvm/include/llvm/ADT/BitVector.h:1.15  Thu Feb 15 14:49:10 2007
+++ llvm/include/llvm/ADT/BitVector.h   Thu Feb 15 15:38:15 2007
@@ -290,12 +290,10 @@
 
   // Clear the unused top bits in the high word.
   void clear_unused_bits() {
-if (Size) {
-  unsigned ExtraBits = Size % BITS_PER_WORD;
+unsigned ExtraBits = Size % BITS_PER_WORD;
+if (ExtraBits) {
   unsigned index = Size / BITS_PER_WORD;
-  if (Size % BITS_PER_WORD == 0)
-index--;
-  Bits[index] = ~(~0  ExtraBits);
+  Bits[index] = ~(~0L  ExtraBits);
 }
   }
 



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


[llvm-commits] llvm-gcc4: display the LLVM type when printing type trees

2007-02-15 Thread Duncan Sands
For example:

(gdb) call debug_tree(type)
 void_type 0xb7bd6ac8 void sizes-gimplified visited VOID
align 8 symtab 152957560 alias set -1
LLVM:  void
pointer_to_this pointer_type 0xb7bd6b40

Enjoy!

Duncan.
Index: gcc.llvm.master/gcc/print-tree.c
===
--- gcc.llvm.master.orig/gcc/print-tree.c	2007-02-15 20:31:54.0 +0100
+++ gcc.llvm.master/gcc/print-tree.c	2007-02-15 22:33:46.0 +0100
@@ -603,6 +603,16 @@
 
   lang_hooks.print_type (file, node, indent);
 
+  /* APPLE LOCAL begin LLVM */
+#ifdef ENABLE_LLVM
+  if (GET_TYPE_LLVM (node))
+	{
+	  indent_to (file, indent + 4);
+	  print_llvm_type (file, GET_TYPE_LLVM (node));
+	}
+#endif
+  /* APPLE LOCAL end LLVM */
+
   if (TYPE_POINTER_TO (node) || TREE_CHAIN (node))
 	indent_to (file, indent + 3);
 
Index: gcc.llvm.master/gcc/llvm-backend.cpp
===
--- gcc.llvm.master.orig/gcc/llvm-backend.cpp	2007-02-15 20:34:11.0 +0100
+++ gcc.llvm.master/gcc/llvm-backend.cpp	2007-02-15 20:41:41.0 +0100
@@ -892,4 +892,13 @@
   WriteAsOperand(FS, (Value*)LLVM, true, TheModule);
 }
 
+// print_llvm_type - Print the specified LLVM type symbolically, called by
+// print-tree.c for tree dumps.
+//
+void print_llvm_type(FILE *file, void *LLVM) {
+  oFILEstream FS(file);
+  FS  LLVM: ;
+  WriteTypeSymbolic(FS, (const Type*)LLVM, TheModule);
+}
+
 /* APPLE LOCAL end LLVM (ENTIRE FILE!)  */
Index: gcc.llvm.master/gcc/llvm.h
===
--- gcc.llvm.master.orig/gcc/llvm.h	2007-02-15 20:32:52.0 +0100
+++ gcc.llvm.master/gcc/llvm.h	2007-02-15 20:41:24.0 +0100
@@ -80,6 +80,11 @@
  */
 void print_llvm(FILE *file, void *LLVM);
 
+/* print_llvm_type - Print the specified LLVM type symbolically, called by
+ * print-tree.c for tree dumps.
+ */
+void print_llvm_type(FILE *file, void *LLVM);
+
 /* Init pch writing. */
 void llvm_pch_write_init(void);
 
Index: gcc.llvm.master/gcc/tree.h
===
--- gcc.llvm.master.orig/gcc/tree.h	2007-02-15 20:39:44.0 +0100
+++ gcc.llvm.master/gcc/tree.h	2007-02-15 20:40:24.0 +0100
@@ -2092,6 +2092,7 @@
  ? (void*)(NODE)-decl.llvm		\
  : (make_decl_llvm (NODE), (void*)(NODE)-decl.llvm)))
 #define SET_DECL_LLVM(NODE, LLVM) (DECL_CHECK (NODE)-decl.llvm = (long)LLVM)
+#define GET_TYPE_LLVM(NODE) (void *)(TYPE_CHECK (NODE)-type.symtab.llvm)
 #endif
 /* Returns nonzero if the DECL_LLVM for NODE has already been set.  */
 #define DECL_LLVM_SET_P(NODE) (DECL_CHECK (NODE)-decl.llvm != 0)
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/CREDITS.TXT

2007-02-15 Thread Dan Gohman


Changes in directory llvm:

CREDITS.TXT updated: 1.67 - 1.68
---
Log message:

Add myself to the credits.


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

 CREDITS.TXT |4 
 1 files changed, 4 insertions(+)


Index: llvm/CREDITS.TXT
diff -u llvm/CREDITS.TXT:1.67 llvm/CREDITS.TXT:1.68
--- llvm/CREDITS.TXT:1.67   Sun Jan  7 21:10:00 2007
+++ llvm/CREDITS.TXTThu Feb 15 16:05:14 2007
@@ -85,6 +85,10 @@
 E: [EMAIL PROTECTED]
 D: Callgraph class cleanups
 
+N: Dan Gohman
+E: [EMAIL PROTECTED]
+D: Miscellaneous bug fixes
+
 N: Paolo Invernizzi
 E: [EMAIL PROTECTED]
 D: Visual C++ compatibility fixes 



___
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/TargetData.h

2007-02-15 Thread Reid Spencer


Changes in directory llvm/include/llvm/Target:

TargetData.h updated: 1.55 - 1.56
---
Log message:

For PR1195: http://llvm.org/PR1195 :
PACKED_ALIGN - VECTOR_ALIGN


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

 TargetData.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/include/llvm/Target/TargetData.h
diff -u llvm/include/llvm/Target/TargetData.h:1.55 
llvm/include/llvm/Target/TargetData.h:1.56
--- llvm/include/llvm/Target/TargetData.h:1.55  Wed Feb 14 20:11:06 2007
+++ llvm/include/llvm/Target/TargetData.h   Thu Feb 15 16:07:05 2007
@@ -36,7 +36,7 @@
 /// Enum used to categorize the alignment types stored by TargetAlignElem
 enum AlignTypeEnum {
   INTEGER_ALIGN = 'i',   /// Integer type alignment
-  PACKED_ALIGN = 'v',/// Vector type alignment
+  VECTOR_ALIGN = 'v',/// Vector type alignment
   FLOAT_ALIGN = 'f', /// Floating point type alignment
   AGGREGATE_ALIGN = 'a'  /// Aggregate alignment
 };



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


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

2007-02-15 Thread Reid Spencer


Changes in directory llvm/lib/Target:

TargetData.cpp updated: 1.96 - 1.97
---
Log message:

For PR1195: http://llvm.org/PR1195 :
PACKED_ALIGN - VECTOR_ALIGN


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

 TargetData.cpp |8 
 1 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm/lib/Target/TargetData.cpp
diff -u llvm/lib/Target/TargetData.cpp:1.96 llvm/lib/Target/TargetData.cpp:1.97
--- llvm/lib/Target/TargetData.cpp:1.96 Thu Feb 15 12:34:36 2007
+++ llvm/lib/Target/TargetData.cpp  Thu Feb 15 16:07:05 2007
@@ -184,8 +184,8 @@
   setAlignment(INTEGER_ALIGN,   4,  8, 64);  // long
   setAlignment(FLOAT_ALIGN, 4,  4, 32);  // float
   setAlignment(FLOAT_ALIGN, 8,  8, 64);  // double
-  setAlignment(PACKED_ALIGN,8,  8, 64);  // v2i32
-  setAlignment(PACKED_ALIGN,   16, 16, 128); // v16i8, v8i16, v4i32, ...
+  setAlignment(VECTOR_ALIGN,8,  8, 64);  // v2i32
+  setAlignment(VECTOR_ALIGN,   16, 16, 128); // v16i8, v8i16, v4i32, ...
   setAlignment(AGGREGATE_ALIGN, 0,  0,  0);  // struct, union, class, ...
   
   while (!temp.empty()) {
@@ -218,7 +218,7 @@
 case 'a': {
   align_type = (*p == 'i' ? INTEGER_ALIGN :
 (*p == 'f' ? FLOAT_ALIGN :
- (*p == 'v' ? PACKED_ALIGN : AGGREGATE_ALIGN)));
+ (*p == 'v' ? VECTOR_ALIGN : AGGREGATE_ALIGN)));
   size = (short) atoi(++p);
   abi_align = atoi(getToken(token, :).c_str()) / 8;
   pref_align = atoi(getToken(token, :).c_str()) / 8;
@@ -485,7 +485,7 @@
 AlignType = FLOAT_ALIGN;
 break;
   case Type::VectorTyID:
-AlignType = PACKED_ALIGN;
+AlignType = VECTOR_ALIGN;
 break;
   default:
 assert(0  Bad type for getAlignment!!!);



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


[llvm-commits] CVS: llvm/CREDITS.TXT

2007-02-15 Thread Evan Cheng


Changes in directory llvm:

CREDITS.TXT updated: 1.68 - 1.69
---
Log message:

Update

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

 CREDITS.TXT |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/CREDITS.TXT
diff -u llvm/CREDITS.TXT:1.68 llvm/CREDITS.TXT:1.69
--- llvm/CREDITS.TXT:1.68   Thu Feb 15 16:05:14 2007
+++ llvm/CREDITS.TXTThu Feb 15 16:26:28 2007
@@ -49,7 +49,7 @@
 
 N: Evan Cheng
 E: [EMAIL PROTECTED]
-D: X86 backend developer
+D: ARM and X86 backends
 D: Instruction scheduler improvements
 D: Loop optimizer improvements
 D: Target-independent code generator improvements



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

2007-02-15 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.634 - 1.635
---
Log message:

change some vectors to smallvectors.  This speeds up instcombine on 447.dealII
by 5%.


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

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


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.634 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.635
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.634   Thu Feb 15 
13:41:52 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Feb 15 16:48:32 2007
@@ -7748,9 +7748,9 @@
   // is a getelementptr instruction, combine the indices of the two
   // getelementptr instructions into a single instruction.
   //
-  std::vectorValue* SrcGEPOperands;
+  SmallVectorValue*, 8 SrcGEPOperands;
   if (User *Src = dyn_castGetElementPtr(PtrOp))
-SrcGEPOperands.assign(Src-op_begin(), Src-op_end());
+SrcGEPOperands.append(Src-op_begin(), Src-op_end());
 
   if (!SrcGEPOperands.empty()) {
 // Note that if our source is a gep chain itself that we wait for that
@@ -7761,7 +7761,7 @@
 castInstruction(SrcGEPOperands[0])-getNumOperands() == 2)
   return 0;   // Wait until our source is folded to completion.
 
-std::vectorValue * Indices;
+SmallVectorValue*, 8 Indices;
 
 // Find out whether the last index in the source GEP is a sequential idx.
 bool EndsWithSequential = false;



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

2007-02-15 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.635 - 1.636
---
Log message:

convert more vectors to smallvectors, 2.8% speedup


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

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


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.635 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.636
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.635   Thu Feb 15 
16:48:32 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Feb 15 16:52:10 2007
@@ -3411,7 +3411,7 @@
 /// CollectBSwapParts - Look to see if the specified value defines a single 
byte
 /// in the result.  If it does, and if the specified byte hasn't been filled in
 /// yet, fill it in and return false.
-static bool CollectBSwapParts(Value *V, std::vectorValue* ByteValues) {
+static bool CollectBSwapParts(Value *V, SmallVectorValue*, 8 ByteValues) {
   Instruction *I = dyn_castInstruction(V);
   if (I == 0) return true;
 
@@ -3495,7 +3495,7 @@
   
   /// ByteValues - For each byte of the result, we keep track of which value
   /// defines each byte.
-  std::vectorValue* ByteValues;
+  SmallVectorValue*, 8 ByteValues;
   ByteValues.resize(TD-getTypeSize(I.getType()));
 
   // Try to find all the pieces corresponding to the bswap.
@@ -5791,7 +5791,7 @@
   
   // Remove any uses of AI that are dead.
   assert(!CI.use_empty()  Dead instructions should be removed earlier!);
-  std::vectorInstruction* DeadUsers;
+  
   for (Value::use_iterator UI = AI.use_begin(), E = AI.use_end(); UI != E; ) {
 Instruction *User = castInstruction(*UI++);
 if (isInstructionTriviallyDead(User)) {



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


[llvm-commits] CVS: llvm/include/llvm/Instruction.h Instructions.h

2007-02-15 Thread Chris Lattner


Changes in directory llvm/include/llvm:

Instruction.h updated: 1.80 - 1.81
Instructions.h updated: 1.60 - 1.61
---
Log message:

make mayWriteToMemory a non-virtual function


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

 Instruction.h  |2 +-
 Instructions.h |   18 +-
 2 files changed, 2 insertions(+), 18 deletions(-)


Index: llvm/include/llvm/Instruction.h
diff -u llvm/include/llvm/Instruction.h:1.80 
llvm/include/llvm/Instruction.h:1.81
--- llvm/include/llvm/Instruction.h:1.80Tue Feb 13 01:54:42 2007
+++ llvm/include/llvm/Instruction.h Thu Feb 15 17:15:00 2007
@@ -54,7 +54,7 @@
   
   /// mayWriteToMemory - Return true if this instruction may modify memory.
   ///
-  virtual bool mayWriteToMemory() const { return false; }
+  bool mayWriteToMemory() const;
 
   /// clone() - Create a copy of 'this' instruction that is identical in all
   /// ways except the following:


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.60 
llvm/include/llvm/Instructions.h:1.61
--- llvm/include/llvm/Instructions.h:1.60   Wed Feb 14 21:39:17 2007
+++ llvm/include/llvm/Instructions.hThu Feb 15 17:15:00 2007
@@ -189,8 +189,6 @@
 
   virtual FreeInst *clone() const;
 
-  virtual bool mayWriteToMemory() const { return true; }
-
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const FreeInst *) { return true; }
   static inline bool classof(const Instruction *I) {
@@ -245,8 +243,6 @@
 
   virtual LoadInst *clone() const;
 
-  virtual bool mayWriteToMemory() const { return isVolatile(); }
-
   Value *getPointerOperand() { return getOperand(0); }
   const Value *getPointerOperand() const { return getOperand(0); }
   static unsigned getPointerOperandIndex() { return 0U; }
@@ -310,8 +306,6 @@
 
   virtual StoreInst *clone() const;
 
-  virtual bool mayWriteToMemory() const { return true; }
-
   Value *getPointerOperand() { return getOperand(1); }
   const Value *getPointerOperand() const { return getOperand(1); }
   static unsigned getPointerOperandIndex() { return 1U; }
@@ -722,8 +716,7 @@
   ~CallInst();
 
   virtual CallInst *clone() const;
-  bool mayWriteToMemory() const { return true; }
-
+  
   bool isTailCall() const   { return SubclassData  1; }
   void setTailCall(bool isTailCall = true) {
 SubclassData = (SubclassData  ~1) | unsigned(isTailCall);
@@ -845,7 +838,6 @@
   }
 
   virtual VAArgInst *clone() const;
-  bool mayWriteToMemory() const { return true; }
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const VAArgInst *) { return true; }
@@ -888,8 +880,6 @@
 
   virtual ExtractElementInst *clone() const;
 
-  virtual bool mayWriteToMemory() const { return false; }
-
   /// Transparently provide more efficient getOperand methods.
   Value *getOperand(unsigned i) const {
 assert(i  2  getOperand() out of range!);
@@ -938,8 +928,6 @@
 
   virtual InsertElementInst *clone() const;
 
-  virtual bool mayWriteToMemory() const { return false; }
-
   /// getType - Overload to return most specific vector type.
   ///
   inline const VectorType *getType() const {
@@ -990,8 +978,6 @@
 
   virtual ShuffleVectorInst *clone() const;
 
-  virtual bool mayWriteToMemory() const { return false; }
-
   /// getType - Overload to return most specific vector type.
   ///
   inline const VectorType *getType() const {
@@ -1499,8 +1485,6 @@
 
   virtual InvokeInst *clone() const;
 
-  bool mayWriteToMemory() const { return true; }
-
   /// getCallingConv/setCallingConv - Get or set the calling convention of this
   /// function call.
   unsigned getCallingConv() const { return SubclassData; }



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


[llvm-commits] CVS: llvm/lib/VMCore/Instruction.cpp

2007-02-15 Thread Chris Lattner


Changes in directory llvm/lib/VMCore:

Instruction.cpp updated: 1.65 - 1.66
---
Log message:

make mayWriteToMemory a non-virtual function


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

 Instruction.cpp |   19 +++
 1 files changed, 19 insertions(+)


Index: llvm/lib/VMCore/Instruction.cpp
diff -u llvm/lib/VMCore/Instruction.cpp:1.65 
llvm/lib/VMCore/Instruction.cpp:1.66
--- llvm/lib/VMCore/Instruction.cpp:1.65Tue Feb 13 01:54:42 2007
+++ llvm/lib/VMCore/Instruction.cpp Thu Feb 15 17:15:00 2007
@@ -225,6 +225,25 @@
   return true;
 }
 
+/// mayWriteToMemory - Return true if this instruction may modify memory.
+///
+bool Instruction::mayWriteToMemory() const {
+  switch (getOpcode()) {
+  default: return false;
+  case Instruction::Free:
+  case Instruction::Store:
+  case Instruction::Invoke:
+  case Instruction::VAArg:
+return true;
+  case Instruction::Call:
+if (const IntrinsicInst *II = dyn_castIntrinsicInst(this)) {
+  // If the intrinsic doesn't write memory, it is safe.
+}
+return true;
+  case Instruction::Load:
+return castLoadInst(this)-isVolatile();
+  }
+}
 
 /// isAssociative - Return true if the instruction is associative:
 ///



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


[llvm-commits] CVS: llvm-test/MultiSource/Applications/SIBsim4/

2007-02-15 Thread LLVM


Changes in directory llvm-test/MultiSource/Applications/SIBsim4:

---
Log message:

Directory /var/cvs/llvm/llvm-test/MultiSource/Applications/SIBsim4 added to the 
repository


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

 0 files changed



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


[llvm-commits] mingw stuff backport

2007-02-15 Thread Anton Korobeynikov
Hello, Everyone.

Attached patch is just backport from gcc mailine. More correctly: its
backport of these patches:

http://gcc.gnu.org/ml/gcc-cvs/2005-10/msg00474.html
http://gcc.gnu.org/ml/gcc-cvs/2005-10/msg00718.html

The main aim of patches is better handling of dll* attributes especially
set on C++ stuff.

More patches will follow. However, this is the biggest one.

There are 3 files attached: patch against current llvm-gcc sources + 2
new files, which should be placed to gcc/config/i386 directory.

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics  Mechanics, Saint Petersburg State University.

diff -r 9a4f61828020 gcc/config.gcc
--- a/gcc/config.gcc	Tue Feb 13 11:41:51 2007 +
+++ b/gcc/config.gcc	Fri Feb 16 00:46:07 2007 +0300
@@ -1209,9 +1209,9 @@ i[34567]86-*-pe | i[34567]86-*-cygwin*)
 	xm_file=i386/xm-cygwin.h
 	tmake_file=i386/t-cygwin i386/t-cygming
 	target_gtfiles=\$(srcdir)/config/i386/winnt.c
-	extra_objs=winnt.o
+	extra_objs=winnt.o winnt-stubs.o
 	c_target_objs=cygwin2.o
-	cxx_target_objs=cygwin2.o
+	cxx_target_objs=cygwin2.o winnt-cxx.o
 	extra_gcc_objs=cygwin1.o
 	if test x$enable_threads = xyes; then
 		thread_file='posix'
@@ -1222,7 +1222,8 @@ i[34567]86-*-mingw32*)
 	xm_file=i386/xm-mingw32.h
 	tmake_file=i386/t-cygming i386/t-mingw32
 	target_gtfiles=\$(srcdir)/config/i386/winnt.c
-	extra_objs=winnt.o
+	extra_objs=winnt.o winnt-stubs.o
+	cxx_target_objs=winnt-cxx.o
 	case ${enable_threads} in
 	   | yes | win32) thread_file='win32' ;;
 	esac
diff -r 9a4f61828020 gcc/config/i386/cygming.h
--- a/gcc/config/i386/cygming.h	Tue Feb 13 11:41:51 2007 +
+++ b/gcc/config/i386/cygming.h	Thu Feb 15 22:47:25 2007 +0300
@@ -422,6 +422,9 @@ extern int i386_pe_dllimport_p (tree);
 #undef TARGET_USE_LOCAL_THUNK_ALIAS_P
 #define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) (!DECL_ONE_ONLY (DECL))
 
+#define TARGET_VALID_DLLIMPORT_ATTRIBUTE_P i386_pe_valid_dllimport_attribute_p
+#define TARGET_CXX_ADJUST_CLASS_AT_DEFINITION i386_pe_adjust_class_at_definition
+
 #undef TREE
 
 #ifndef BUFSIZ
diff -r 9a4f61828020 gcc/config/i386/i386-protos.h
--- a/gcc/config/i386/i386-protos.h	Tue Feb 13 11:41:51 2007 +
+++ b/gcc/config/i386/i386-protos.h	Thu Feb 15 23:09:35 2007 +0300
@@ -261,6 +261,13 @@ extern const char *i386_pe_strip_name_en
 extern const char *i386_pe_strip_name_encoding (const char *);
 extern const char *i386_pe_strip_name_encoding_full (const char *);
 extern void i386_pe_output_labelref (FILE *, const char *);
+extern int i386_pe_valid_dllimport_attribute_p (tree);
+
+/* In winnt-cxx.c and winnt-stubs.c  */
+extern void i386_pe_adjust_class_at_definition (tree);
+extern bool i386_pe_type_dllimport_p (tree);
+extern bool i386_pe_type_dllexport_p (tree);
+
 extern rtx maybe_get_pool_constant (rtx);
 
 extern char internal_label_prefix[16];
diff -r 9a4f61828020 gcc/config/i386/i386.c
--- a/gcc/config/i386/i386.c	Tue Feb 13 11:41:51 2007 +
+++ b/gcc/config/i386/i386.c	Thu Feb 15 19:01:42 2007 +0300
@@ -2323,7 +2323,7 @@ ix86_function_ok_for_sibcall (tree decl,
 
 #if TARGET_DLLIMPORT_DECL_ATTRIBUTES
   /* Dllimport'd functions are also called indirectly.  */
-  if (decl  lookup_attribute (dllimport, DECL_ATTRIBUTES (decl))
+  if (decl  DECL_DLLIMPORT_P (decl)
ix86_function_regparm (TREE_TYPE (decl), NULL) = 3)
 return false;
 #endif
diff -r 9a4f61828020 gcc/config/i386/t-cygming
--- a/gcc/config/i386/t-cygming	Tue Feb 13 11:41:51 2007 +
+++ b/gcc/config/i386/t-cygming	Thu Feb 15 19:05:50 2007 +0300
@@ -16,4 +16,17 @@ winnt.o: $(srcdir)/config/i386/winnt.c $
 	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
 	$(srcdir)/config/i386/winnt.c
 
+winnt-cxx.o: $(srcdir)/config/i386/winnt-cxx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+  $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \
+  $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H)
+	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+	$(srcdir)/config/i386/winnt-cxx.c
+
+
+winnt-stubs.o: $(srcdir)/config/i386/winnt-stubs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+  $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \
+  $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H)
+	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+	$(srcdir)/config/i386/winnt-stubs.c
+
 STMP_FIXINC=stmp-fixinc
diff -r 9a4f61828020 gcc/config/i386/winnt.c
--- a/gcc/config/i386/winnt.c	Tue Feb 13 11:41:51 2007 +
+++ b/gcc/config/i386/winnt.c	Thu Feb 15 23:46:59 2007 +0300
@@ -83,131 +83,64 @@ static tree
 static tree
 associated_type (tree decl)
 {
-  tree t = NULL_TREE;
-
-  /* In the C++ frontend, DECL_CONTEXT for a method doesn't actually refer
- to the containing class.  So we look at the 'this' arg.  */
-  if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE)
-{
-  /* Artificial methods are not affected by the import/export status
-	 of their class unless they are COMDAT.  Implicit copy ctor's and
-	 dtor's are not affected by class status but virtual and
-	 non-virtual thunks are.  */
-

[llvm-commits] CVS: llvm-test/MultiSource/Applications/Makefile

2007-02-15 Thread Nick Lewycky


Changes in directory llvm-test/MultiSource/Applications:

Makefile updated: 1.26 - 1.27
---
Log message:

Add SIBsim4 to the test suite.


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

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


Index: llvm-test/MultiSource/Applications/Makefile
diff -u llvm-test/MultiSource/Applications/Makefile:1.26 
llvm-test/MultiSource/Applications/Makefile:1.27
--- llvm-test/MultiSource/Applications/Makefile:1.26Thu Feb  8 12:14:36 2007
+++ llvm-test/MultiSource/Applications/Makefile Thu Feb 15 19:50:21 2007
@@ -5,7 +5,7 @@
 include $(LEVEL)/Makefile.config
 
 PARALLEL_DIRS  = Burg aha sgefa siod lambda-0.1.3 d spiff hbd treecc SPASS \
- hexxagon oggenc JM viterbi minisat
+ hexxagon oggenc JM viterbi minisat SIBsim4
 
 # Obsequi uses Linux-only features; need to fix that
 ifeq ($(OS),Linux)



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


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

2007-02-15 Thread Dale Johannesen


Changes in directory llvm/lib/CodeGen:

AsmPrinter.cpp updated: 1.150 - 1.151
---
Log message:

test commit (blank line)


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

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


Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.150 
llvm/lib/CodeGen/AsmPrinter.cpp:1.151
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.150   Wed Feb 14 20:26:09 2007
+++ llvm/lib/CodeGen/AsmPrinter.cpp Thu Feb 15 19:54:53 2007
@@ -1144,3 +1144,4 @@
 break;
   }
 }
+



___
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/README.txt

2007-02-15 Thread Andrew Lenharth


Changes in directory llvm/lib/Target/Alpha:

README.txt updated: 1.7 - 1.8
---
Log message:

This was done recently

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

 README.txt |4 +---
 1 files changed, 1 insertion(+), 3 deletions(-)


Index: llvm/lib/Target/Alpha/README.txt
diff -u llvm/lib/Target/Alpha/README.txt:1.7 
llvm/lib/Target/Alpha/README.txt:1.8
--- llvm/lib/Target/Alpha/README.txt:1.7Tue Oct 10 20:48:03 2006
+++ llvm/lib/Target/Alpha/README.txtThu Feb 15 20:11:59 2007
@@ -1,3 +1 @@
-%%
-Fix Ordered/Unordered FP stuff
-
+* EMPTY *



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


[llvm-commits] CVS: llvm/lib/VMCore/Instruction.cpp

2007-02-15 Thread Andrew Lenharth


Changes in directory llvm/lib/VMCore:

Instruction.cpp updated: 1.66 - 1.67
---
Log message:

fix build

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

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


Index: llvm/lib/VMCore/Instruction.cpp
diff -u llvm/lib/VMCore/Instruction.cpp:1.66 
llvm/lib/VMCore/Instruction.cpp:1.67
--- llvm/lib/VMCore/Instruction.cpp:1.66Thu Feb 15 17:15:00 2007
+++ llvm/lib/VMCore/Instruction.cpp Thu Feb 15 20:25:55 2007
@@ -13,6 +13,7 @@
 
 #include llvm/Type.h
 #include llvm/Instructions.h
+#include llvm/IntrinsicInst.h
 #include llvm/Function.h
 #include llvm/Support/LeakDetector.h
 using namespace llvm;



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


[llvm-commits] [llvm-gcc] BITWIDTH8.patch (please review/commit)

2007-02-15 Thread Reid Spencer
Devang,

Please find attached the latest bitwidth attribute patch. This is a
candidate for committing to llvm-gcc if it passes your review. The
differences between this patch and the one you reviewed are:

1. All six of the bit reduction builtins have been removed (not needed).
2. I've hacked on the C++ part of llvm-gcc to get it to handle the three
remaining
   builtins much like C does. This was a lot more involved than just
modifying the
   typeck.c file. semantics.c and call.c had to be modified too.

The main thing needing review are the changes to gcc/cp/*.c. The rest
you've already reviewed. If it looks good, please consider committing
it.

Thanks,

Reid.
Index: gcc/tree.h
===
--- gcc/tree.h	(revision 276)
+++ gcc/tree.h	(working copy)
@@ -1711,6 +1711,21 @@
 #define TYPE_CONTAINS_PLACEHOLDER_INTERNAL(NODE) \
   (TYPE_CHECK (NODE)-type.contains_placeholder_bits)
 
+/* APPLE LOCAL begin LLVM bit accurate integer types - ras */
+#ifdef ENABLE_LLVM
+/* 1 if the bitwidth for this type was set with the bitwidth attribute,
+   0 otherwise.  */
+#define TYPE_USER_BITWIDTH(NODE) (TYPE_CHECK (NODE)-type.user_bitwidth)
+/* Extracts the bitwidth field that holds the user's requested
+ * bitwidth from the bitwidth attribute. Depending on the usage this
+ * may or may not be honored due to limitations of how the type is
+ * used. See the handle_bitwidth_attribute function in c-common.c for
+ * details. Note that this field always contains the bitwidth requested
+ * in the attribute but that may differ from the precision used by the type.*/
+#define TYPE_BITWIDTH(NODE) (TYPE_CHECK (NODE)-type.bitwidth)
+#endif
+/* APPLE LOCAL end LLVM bit accurate integer types - ras */
+
 struct die_struct;
 
 struct tree_type GTY(())
@@ -1741,6 +1756,10 @@
   unsigned lang_flag_5 : 1;
   unsigned lang_flag_6 : 1;
   unsigned user_align : 1;
+  /* APPLE LOCAL begin LLVM bit accurate integer types - ras */
+  unsigned user_bitwidth : 1;
+  unsigned bitwidth : 23;
+  /* APPLE LOCAL end LLVM bit accurate integer types - ras */
 
   unsigned int align;
   tree pointer_to;
Index: gcc/llvm.h
===
--- gcc/llvm.h	(revision 276)
+++ gcc/llvm.h	(working copy)
@@ -92,6 +92,12 @@
 /* llvm_asm_file_end - Finish the .s file. */
 void llvm_asm_file_end(void);
 
+/* A function that can be used to see if a function is one of the LLVM
+ * pseudo_builtin functions that permits integer arguments of any size.
+ * A non-negative result indicates which pseudo-builtin it is. A 
+ * negative result indicates it is not a pseudo-builtin. */
+int llvm_get_pseudo_builtin_index(const char *);
+
 #endif /* ENABLE_LLVM */
 
 #endif
Index: gcc/cp/typeck.c
===
--- gcc/cp/typeck.c	(revision 276)
+++ gcc/cp/typeck.c	(working copy)
@@ -42,6 +42,11 @@
 #include target.h
 #include convert.h
 #include c-common.h
+/* APPLE LOCAL begin LLVM bit accurate integer types - ras */
+#ifdef ENABLE_LLVM
+#include llvm.h
+#endif
+/* APPLE LOCAL end LLVM bit accurate integer types - ras */
 
 static tree convert_for_assignment (tree, tree, const char *, tree, int);
 static tree cp_pointer_int_sum (enum tree_code, tree, tree);
@@ -2620,6 +2625,12 @@
   tree result = NULL_TREE;
   const char *called_thing = 0;
   int i = 0;
+/* APPLE LOCAL begin LLVM bit accurate integer types - ras */
+#ifdef ENABLE_LLVM
+  const char *fname = 0;
+  int is_pseudo_builtin = 0;
+#endif
+/* APPLE LOCAL end LLVM bit accurate integer types - ras */
 
   /* Argument passing is always copy-initialization.  */
   flags |= LOOKUP_ONLYCONVERTING;
@@ -2635,7 +2646,18 @@
 	called_thing = member function;
 	}
   else
+/* APPLE LOCAL begin LLVM bit accurate integer types - ras */
+#ifdef ENABLE_LLVM
+{
+  is_pseudo_builtin = 
+llvm_get_pseudo_builtin_index(IDENTIFIER_POINTER(DECL_NAME(fndecl)))
+  = 0;
+  called_thing = function;
+}
+#else
 	called_thing = function;
+#endif
+/* APPLE LOCAL end LLVM bit accurate integer types - ras */
 }
 
   for (valtail = values, typetail = typelist;
@@ -2683,6 +2705,18 @@
   if (val == error_mark_node)
 	return error_mark_node;
 
+/* APPLE LOCAL begin LLVM bit accurate integer types - ras */
+#ifdef ENABLE_LLVM
+  /* If its a pseudo-builtin function, just defeat all the type checking
+ below and tack the value on to the result. The type is checked later
+ in llvm-convert.cpp when the builtin is handled. */
+  if (is_pseudo_builtin) 
+{
+	  result = tree_cons (NULL_TREE, val, result);
+} 
+  else
+#endif
+/* APPLE LOCAL end LLVM bit accurate integer types - ras */
   if (type != 0)
 	{
 	  /* Formal parm type is specified by a function prototype.  */
Index: gcc/cp/call.c
===
--- gcc/cp/call.c	(revision 276)