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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86Subtarget.cpp updated: 1.21 -> 1.22
---
Log message:

Enable SSE (for the right subtargets)

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

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


Index: llvm/lib/Target/X86/X86Subtarget.cpp
diff -u llvm/lib/Target/X86/X86Subtarget.cpp:1.21 
llvm/lib/Target/X86/X86Subtarget.cpp:1.22
--- llvm/lib/Target/X86/X86Subtarget.cpp:1.21   Sat Jan 28 14:30:18 2006
+++ llvm/lib/Target/X86/X86Subtarget.cppTue Feb 14 02:07:58 2006
@@ -16,11 +16,10 @@
 #include "X86GenSubtarget.inc"
 using namespace llvm;
 
-// FIXME: temporary.
 #include "llvm/Support/CommandLine.h"
 namespace {
-  cl::opt EnableSSE("enable-x86-sse", cl::Hidden,
-  cl::desc("Enable sse on X86"));
+  cl::opt DisableSSE("disable-x86-sse", cl::Hidden,
+  cl::desc("Disable sse on X86"));
 }
 
 /// GetCpuIDAndInfo - Execute the specified cpuid and return the 4 values in 
the
@@ -167,9 +166,7 @@
   // Default to ELF unless otherwise specified.
   TargetType = isELF;
   
-  // FIXME: Force these off until they work.  An llc-beta option should turn
-  // them back on.
-  if (!EnableSSE) {
+  if (DisableSSE) {
 X86SSELevel = NoMMXSSE;
 X863DNowLevel = NoThreeDNow;
   }



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


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

2006-02-14 Thread Evan Cheng


Changes in directory llvm-test:

Makefile.programs updated: 1.191 -> 1.192
---
Log message:

Set -enable-x86-fastcc as X86 llc-beta option

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

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


Index: llvm-test/Makefile.programs
diff -u llvm-test/Makefile.programs:1.191 llvm-test/Makefile.programs:1.192
--- llvm-test/Makefile.programs:1.191   Thu Feb  9 14:01:19 2006
+++ llvm-test/Makefile.programs Tue Feb 14 02:09:05 2006
@@ -197,7 +197,7 @@
 LLCBETAOPTION := -sched=simple 
 endif
 ifeq ($(ARCH),x86)
-LLCBETAOPTION := -enable-x86-sse
+LLCBETAOPTION := -enable-x86-fastcc
 endif
 ifeq ($(ARCH),Sparc)
 LLCBETAOPTION := -enable-sparc-v9-insts



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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.153 -> 1.154
---
Log message:

Expand memset dst, c, size to a series of stores if size falls below the
target specific theshold, e.g. 16 for x86.


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

 SelectionDAGISel.cpp |  131 +--
 1 files changed, 127 insertions(+), 4 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.153 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.154
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.153Mon Feb 13 
23:39:35 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Tue Feb 14 02:22:34 2006
@@ -1523,13 +1523,136 @@
   DAG.setRoot(Result.second);
 }
 
+/// getMemSetValue - Vectorized representation of the memset value
+/// operand.
+static SDOperand getMemsetValue(SDOperand Value, MVT::ValueType VT,
+SelectionDAG &DAG) {
+  if (VT == MVT::i8)
+return Value;
+
+  MVT::ValueType CurVT = VT;
+  if (ConstantSDNode *C = dyn_cast(Value)) {
+uint64_t Val   = C->getValue() & 255;
+unsigned Shift = 8;
+while (CurVT != MVT::i8) {
+  Val = (Val << Shift) | Val;
+  Shift <<= 1;
+  CurVT = (MVT::ValueType)((unsigned)CurVT - 1);
+  assert(MVT::isInteger(CurVT));
+}
+return DAG.getConstant(Val, VT);
+  } else {
+Value = DAG.getNode(ISD::ZERO_EXTEND, VT, Value);
+unsigned Shift = 8;
+while (CurVT != MVT::i8) {
+  Value =
+DAG.getNode(ISD::OR, VT,
+DAG.getNode(ISD::SHL, VT, Value,
+DAG.getConstant(Shift, MVT::i8)), Value);
+  Shift <<= 1;
+  CurVT = (MVT::ValueType)((unsigned)CurVT - 1);
+  assert(MVT::isInteger(CurVT));
+}
+
+return Value;
+  }
+}
+
+/// getMemBasePlusOffset - Returns base and offset node for the 
+static SDOperand getMemBasePlusOffset(SDOperand Base, unsigned Offset,
+  SelectionDAG &DAG, TargetLowering &TLI) {
+  MVT::ValueType VT = Base.getValueType();
+  return DAG.getNode(ISD::ADD, VT, Base, DAG.getConstant(Offset, VT));
+}
+
+/// getMemOpTypes - Determines the types of the sequence of 
+/// memory ops to perform memset / memcpy.
+static void getMemOpTypes(std::vector &MemOps,
+  uint64_t Size, unsigned Align, TargetLowering &TLI) {
+  MVT::ValueType VT;
+
+  if (TLI.allowsUnalignedMemoryAccesses()) {
+VT = MVT::i64;
+  } else {
+switch (Align & 7) {
+case 0:
+  VT = MVT::i64;
+  break;
+case 4:
+  VT = MVT::i32;
+  break;
+case 2:
+  VT = MVT::i16;
+  break;
+default:
+  VT = MVT::i8;
+  break;
+}
+  }
+
+  while (!TLI.isTypeLegal(VT)) {
+VT = (MVT::ValueType)((unsigned)VT - 1);
+assert(MVT::isInteger(VT));
+  }
+
+  while (Size != 0) {
+unsigned VTSize = getSizeInBits(VT) / 8;
+while (VTSize > Size) {
+  VT = (MVT::ValueType)((unsigned)VT - 1);
+  assert(MVT::isInteger(VT));
+  VTSize >>= 1;
+}
+MemOps.push_back(VT);
+Size -= VTSize;
+  }
+}
+
 void SelectionDAGLowering::visitMemIntrinsic(CallInst &I, unsigned Op) {
+  SDOperand Op1 = getValue(I.getOperand(1));
+  SDOperand Op2 = getValue(I.getOperand(2));
+  SDOperand Op3 = getValue(I.getOperand(3));
+  SDOperand Op4 = getValue(I.getOperand(4));
+  unsigned Align = (unsigned)cast(Op4)->getValue();
+  if (Align == 0) Align = 1;
+
+  if (ConstantSDNode *Size = dyn_cast(Op3)) {
+std::vector MemOps;
+getMemOpTypes(MemOps, Size->getValue(), Align, TLI);
+unsigned NumMemOps = MemOps.size();
+
+// Expand memset / memcpy to a series of load / store ops
+// if the size operand falls below a certain threshold.
+std::vector OutChains;
+switch (Op) {
+default: ;  // Do nothing for now.
+case ISD::MEMSET: {
+  if (NumMemOps <= TLI.getMaxStoresPerMemSet()) {
+unsigned Offset = 0;
+for (unsigned i = 0; i < NumMemOps; i++) {
+  MVT::ValueType VT = MemOps[i];
+  unsigned VTSize = getSizeInBits(VT) / 8;
+  SDOperand Value = getMemsetValue(Op2, VT, DAG);
+  OutChains.
+push_back(DAG.getNode(ISD::STORE, MVT::Other, getRoot(),
+  Value,
+  getMemBasePlusOffset(Op1, Offset, DAG, TLI),
+  DAG.getSrcValue(NULL)));
+  Offset += VTSize;
+}
+
+DAG.setRoot(DAG.getNode(ISD::TokenFactor, MVT::Other, OutChains));
+return;
+  }
+}
+}
+  }
+
   std::vector Ops;
   Ops.push_back(getRoot());
-  Ops.push_back(getValue(I.getOperand(1)));
-  Ops.push_back(getValue(I.getOperand(2)));
-  Ops.push_back(getValue(I.getOperand(3)));
-  Ops.push_back(getValue(I.getOperand(4)));
+  Ops.push_back(Op1);
+  Ops.push_back(Op2);
+  Ops.push_back(Op3);
+  Ops.push_back(Op4);
   DAG.

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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.80 -> 1.81
---
Log message:

Set maxStoresPerMemSet to 16. Ditto for maxStoresPerMemCpy and
maxStoresPerMemMove. Although the last one is not used.


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

 X86ISelLowering.cpp |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.80 
llvm/lib/Target/X86/X86ISelLowering.cpp:1.81
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.80Mon Feb 13 03:00:43 2006
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Tue Feb 14 02:25:08 2006
@@ -251,9 +251,11 @@
   }
   computeRegisterProperties();
 
-  maxStoresPerMemSet = 8; // For %llvm.memset -> sequence of stores
-  maxStoresPerMemCpy = 8; // For %llvm.memcpy -> sequence of stores
-  maxStoresPerMemMove = 8; // For %llvm.memmove -> sequence of stores
+  // FIXME: These should be based on subtarget info. Plus, the values should
+  // be smaller when we are in optimizing for size mode.
+  maxStoresPerMemSet = 16; // For %llvm.memset -> sequence of stores
+  maxStoresPerMemCpy = 16; // For %llvm.memcpy -> sequence of stores
+  maxStoresPerMemMove = 16; // For %llvm.memmove -> sequence of stores
   allowUnalignedMemoryAccesses = true; // x86 supports it!
 }
 



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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

README.txt updated: 1.51 -> 1.52
---
Log message:

Add a entry.


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

 README.txt |   17 +
 1 files changed, 17 insertions(+)


Index: llvm/lib/Target/X86/README.txt
diff -u llvm/lib/Target/X86/README.txt:1.51 llvm/lib/Target/X86/README.txt:1.52
--- llvm/lib/Target/X86/README.txt:1.51 Thu Feb  9 23:48:15 2006
+++ llvm/lib/Target/X86/README.txt  Tue Feb 14 02:25:32 2006
@@ -426,3 +426,20 @@
 //===-===//
 
 Use fisttp to do FP to integer conversion whenever it is available.
+
+//===-===//
+
+Instead of the following for memset char*, 1, 10:
+
+   movl $16843009, 4(%edx)
+   movl $16843009, (%edx)
+   movw $257, 8(%edx)
+
+It might be better to generate
+
+   movl $16843009, %eax
+   movl %eax, 4(%edx)
+   movl %eax, (%edx)
+   movw al, 8(%edx)
+   
+when we can spare a register. It reduces code size.



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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.154 -> 1.155
---
Log message:

Rename maxStoresPerMemSet to maxStoresPerMemset, etc.


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

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


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.154 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.155
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.154Tue Feb 14 
02:22:34 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Tue Feb 14 02:38:30 2006
@@ -1626,7 +1626,7 @@
 switch (Op) {
 default: ;  // Do nothing for now.
 case ISD::MEMSET: {
-  if (NumMemOps <= TLI.getMaxStoresPerMemSet()) {
+  if (NumMemOps <= TLI.getMaxStoresPerMemset()) {
 unsigned Offset = 0;
 for (unsigned i = 0; i < NumMemOps; i++) {
   MVT::ValueType VT = MemOps[i];



___
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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/include/llvm/Target:

TargetLowering.h updated: 1.48 -> 1.49
---
Log message:

Rename maxStoresPerMemSet to maxStoresPerMemset, etc.


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

 TargetLowering.h |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)


Index: llvm/include/llvm/Target/TargetLowering.h
diff -u llvm/include/llvm/Target/TargetLowering.h:1.48 
llvm/include/llvm/Target/TargetLowering.h:1.49
--- llvm/include/llvm/Target/TargetLowering.h:1.48  Tue Feb  7 14:13:44 2006
+++ llvm/include/llvm/Target/TargetLowering.h   Tue Feb 14 02:38:30 2006
@@ -243,19 +243,19 @@
   /// to replace a call to llvm.memset. The value is set by the target at the
   /// performance threshold for such a replacement.
   /// @brief Get maximum # of store operations permitted for llvm.memset
-  unsigned getMaxStoresPerMemSet() const { return maxStoresPerMemSet; }
+  unsigned getMaxStoresPerMemset() const { return maxStoresPerMemset; }
 
   /// This function returns the maximum number of store operations permitted
   /// to replace a call to llvm.memcpy. The value is set by the target at the
   /// performance threshold for such a replacement.
   /// @brief Get maximum # of store operations permitted for llvm.memcpy
-  unsigned getMaxStoresPerMemCpy() const { return maxStoresPerMemCpy; }
+  unsigned getMaxStoresPerMemcpy() const { return maxStoresPerMemcpy; }
 
   /// This function returns the maximum number of store operations permitted
   /// to replace a call to llvm.memmove. The value is set by the target at the
   /// performance threshold for such a replacement.
   /// @brief Get maximum # of store operations permitted for llvm.memmove
-  unsigned getMaxStoresPerMemMove() const { return maxStoresPerMemMove; }
+  unsigned getMaxStoresPerMemmove() const { return maxStoresPerMemmove; }
 
   /// This function returns true if the target allows unaligned memory 
accesses.
   /// This is used, for example, in situations where an array copy/move/set is 
@@ -567,7 +567,7 @@
   /// with 16-bit alignment would result in four 2-byte stores and one 1-byte
   /// store.  This only applies to setting a constant array of a constant size.
   /// @brief Specify maximum number of store instructions per memset call.
-  unsigned maxStoresPerMemSet;
+  unsigned maxStoresPerMemset;
 
   /// When lowering %llvm.memcpy this field specifies the maximum number of
   /// store operations that may be substituted for a call to memcpy. Targets
@@ -579,7 +579,7 @@
   /// and one 1-byte store. This only applies to copying a constant array of
   /// constant size.
   /// @brief Specify maximum bytes of store instructions per memcpy call.
-  unsigned maxStoresPerMemCpy;
+  unsigned maxStoresPerMemcpy;
 
   /// When lowering %llvm.memmove this field specifies the maximum number of
   /// store instructions that may be substituted for a call to memmove. Targets
@@ -590,7 +590,7 @@
   /// with 8-bit alignment would result in nine 1-byte stores.  This only
   /// applies to copying a constant array of constant size.
   /// @brief Specify maximum bytes of store instructions per memmove call.
-  unsigned maxStoresPerMemMove;
+  unsigned maxStoresPerMemmove;
 
   /// This field specifies whether the target machine permits unaligned memory
   /// accesses.  This is used, for example, to determine the size of store 



___
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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.81 -> 1.82
---
Log message:

Rename maxStoresPerMemSet to maxStoresPerMemset, etc.


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

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


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.81 
llvm/lib/Target/X86/X86ISelLowering.cpp:1.82
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.81Tue Feb 14 02:25:08 2006
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Tue Feb 14 02:38:30 2006
@@ -253,9 +253,9 @@
 
   // FIXME: These should be based on subtarget info. Plus, the values should
   // be smaller when we are in optimizing for size mode.
-  maxStoresPerMemSet = 16; // For %llvm.memset -> sequence of stores
-  maxStoresPerMemCpy = 16; // For %llvm.memcpy -> sequence of stores
-  maxStoresPerMemMove = 16; // For %llvm.memmove -> sequence of stores
+  maxStoresPerMemset = 16; // For %llvm.memset -> sequence of stores
+  maxStoresPerMemcpy = 16; // For %llvm.memcpy -> sequence of stores
+  maxStoresPerMemmove = 16; // For %llvm.memmove -> sequence of stores
   allowUnalignedMemoryAccesses = true; // x86 supports it!
 }
 



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


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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/Target:

TargetLowering.cpp updated: 1.29 -> 1.30
---
Log message:

Rename maxStoresPerMemSet to maxStoresPerMemset, etc.


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

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


Index: llvm/lib/Target/TargetLowering.cpp
diff -u llvm/lib/Target/TargetLowering.cpp:1.29 
llvm/lib/Target/TargetLowering.cpp:1.30
--- llvm/lib/Target/TargetLowering.cpp:1.29 Fri Feb  3 20:13:02 2006
+++ llvm/lib/Target/TargetLowering.cpp  Tue Feb 14 02:38:30 2006
@@ -30,7 +30,7 @@
   ShiftAmountTy = SetCCResultTy = PointerTy = getValueType(TD.getIntPtrType());
   ShiftAmtHandling = Undefined;
   memset(RegClassForVT, 0,MVT::LAST_VALUETYPE*sizeof(TargetRegisterClass*));
-  maxStoresPerMemSet = maxStoresPerMemCpy = maxStoresPerMemMove = 8;
+  maxStoresPerMemset = maxStoresPerMemcpy = maxStoresPerMemmove = 8;
   allowUnalignedMemoryAccesses = false;
   UseUnderscoreSetJmpLongJmp = false;
   IntDivIsCheap = false;



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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.155 -> 1.156
---
Log message:

Fixed a build breakage.


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

 SelectionDAGISel.cpp |   37 +++--
 1 files changed, 23 insertions(+), 14 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.155 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.156
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.155Tue Feb 14 
02:38:30 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Tue Feb 14 03:11:59 2006
@@ -1538,7 +1538,6 @@
   Val = (Val << Shift) | Val;
   Shift <<= 1;
   CurVT = (MVT::ValueType)((unsigned)CurVT - 1);
-  assert(MVT::isInteger(CurVT));
 }
 return DAG.getConstant(Val, VT);
   } else {
@@ -1551,7 +1550,6 @@
 DAG.getConstant(Shift, MVT::i8)), Value);
   Shift <<= 1;
   CurVT = (MVT::ValueType)((unsigned)CurVT - 1);
-  assert(MVT::isInteger(CurVT));
 }
 
 return Value;
@@ -1565,10 +1563,12 @@
   return DAG.getNode(ISD::ADD, VT, Base, DAG.getConstant(Offset, VT));
 }
 
-/// getMemOpTypes - Determines the types of the sequence of 
-/// memory ops to perform memset / memcpy.
-static void getMemOpTypes(std::vector &MemOps,
-  uint64_t Size, unsigned Align, TargetLowering &TLI) {
+/// MeetMaxMemopRequirement - Determines if the number of memory ops required
+/// to replace the memset / memcpy is below the threshold. It also returns the
+/// types of the sequence of  memory ops to perform memset / memcpy.
+static bool MeetMaxMemopRequirement(std::vector &MemOps,
+unsigned Limit,
+uint64_t Size, unsigned Align, 
TargetLowering &TLI) {
   MVT::ValueType VT;
 
   if (TLI.allowsUnalignedMemoryAccesses()) {
@@ -1590,21 +1590,30 @@
 }
   }
 
-  while (!TLI.isTypeLegal(VT)) {
-VT = (MVT::ValueType)((unsigned)VT - 1);
-assert(MVT::isInteger(VT));
-  }
+  MVT::ValueType LVT = MVT::i64;
+  while (!TLI.isTypeLegal(LVT))
+LVT = (MVT::ValueType)((unsigned)LVT - 1);
+  assert(MVT::isInteger(LVT));
 
+  if (VT > LVT)
+VT = LVT;
+
+  unsigned NumMemOps;
   while (Size != 0) {
 unsigned VTSize = getSizeInBits(VT) / 8;
 while (VTSize > Size) {
   VT = (MVT::ValueType)((unsigned)VT - 1);
-  assert(MVT::isInteger(VT));
   VTSize >>= 1;
 }
+assert(MVT::isInteger(VT));
+
+if (++NumMemOps > Limit)
+  return false;
 MemOps.push_back(VT);
 Size -= VTSize;
   }
+
+  return true;
 }
 
 void SelectionDAGLowering::visitMemIntrinsic(CallInst &I, unsigned Op) {
@@ -1617,8 +1626,6 @@
 
   if (ConstantSDNode *Size = dyn_cast(Op3)) {
 std::vector MemOps;
-getMemOpTypes(MemOps, Size->getValue(), Align, TLI);
-unsigned NumMemOps = MemOps.size();
 
 // Expand memset / memcpy to a series of load / store ops
 // if the size operand falls below a certain threshold.
@@ -1626,7 +1633,9 @@
 switch (Op) {
 default: ;  // Do nothing for now.
 case ISD::MEMSET: {
-  if (NumMemOps <= TLI.getMaxStoresPerMemset()) {
+  if (MeetMaxMemopRequirement(MemOps, TLI.getMaxStoresPerMemset(),
+  Size->getValue(), Align, TLI)) {
+unsigned NumMemOps = MemOps.size();
 unsigned Offset = 0;
 for (unsigned i = 0; i < NumMemOps; i++) {
   MVT::ValueType VT = MemOps[i];



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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.156 -> 1.157
---
Log message:

Missed a break so memcpy cases fell through to memset. Doh.

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

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


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.156 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.157
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.156Tue Feb 14 
03:11:59 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Tue Feb 14 13:45:56 2006
@@ -1631,7 +1631,7 @@
 // if the size operand falls below a certain threshold.
 std::vector OutChains;
 switch (Op) {
-default: ;  // Do nothing for now.
+default: break;  // Do nothing for now.
 case ISD::MEMSET: {
   if (MeetMaxMemopRequirement(MemOps, TLI.getMaxStoresPerMemset(),
   Size->getValue(), Align, TLI)) {



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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.157 -> 1.158
---
Log message:

Keep to < 80 cols

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

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


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.157 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.158
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.157Tue Feb 14 
13:45:56 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Tue Feb 14 14:12:38 2006
@@ -1563,12 +1563,12 @@
   return DAG.getNode(ISD::ADD, VT, Base, DAG.getConstant(Offset, VT));
 }
 
-/// MeetMaxMemopRequirement - Determines if the number of memory ops required
+/// MeetsMaxMemopRequirement - Determines if the number of memory ops required
 /// to replace the memset / memcpy is below the threshold. It also returns the
 /// types of the sequence of  memory ops to perform memset / memcpy.
-static bool MeetMaxMemopRequirement(std::vector &MemOps,
-unsigned Limit,
-uint64_t Size, unsigned Align, 
TargetLowering &TLI) {
+static bool MeetsMaxMemopRequirement(std::vector &MemOps,
+ unsigned Limit, uint64_t Size,
+ unsigned Align, TargetLowering &TLI) {
   MVT::ValueType VT;
 
   if (TLI.allowsUnalignedMemoryAccesses()) {
@@ -1633,8 +1633,8 @@
 switch (Op) {
 default: break;  // Do nothing for now.
 case ISD::MEMSET: {
-  if (MeetMaxMemopRequirement(MemOps, TLI.getMaxStoresPerMemset(),
-  Size->getValue(), Align, TLI)) {
+  if (MeetsMaxMemopRequirement(MemOps, TLI.getMaxStoresPerMemset(),
+   Size->getValue(), Align, TLI)) {
 unsigned NumMemOps = MemOps.size();
 unsigned Offset = 0;
 for (unsigned i = 0; i < NumMemOps; i++) {



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


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

2006-02-14 Thread Chris Lattner


Changes in directory llvm/lib/Analysis:

LoopInfo.cpp updated: 1.67 -> 1.68
---
Log message:

add an assert


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

 LoopInfo.cpp |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/lib/Analysis/LoopInfo.cpp
diff -u llvm/lib/Analysis/LoopInfo.cpp:1.67 llvm/lib/Analysis/LoopInfo.cpp:1.68
--- llvm/lib/Analysis/LoopInfo.cpp:1.67 Sat Jan 14 14:55:08 2006
+++ llvm/lib/Analysis/LoopInfo.cpp  Tue Feb 14 14:14:17 2006
@@ -367,7 +367,8 @@
   Out = *PI;
 }
 
-  // Make sure there is only one exit out of the preheader...
+  // Make sure there is only one exit out of the preheader.
+  assert(Out && "Header of loop has no predecessors from outside loop?");
   succ_iterator SI = succ_begin(Out);
   ++SI;
   if (SI != succ_end(Out))



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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86Subtarget.cpp updated: 1.22 -> 1.23
---
Log message:

Remove -disable-x86-sse

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

 X86Subtarget.cpp |   12 ++--
 1 files changed, 2 insertions(+), 10 deletions(-)


Index: llvm/lib/Target/X86/X86Subtarget.cpp
diff -u llvm/lib/Target/X86/X86Subtarget.cpp:1.22 
llvm/lib/Target/X86/X86Subtarget.cpp:1.23
--- llvm/lib/Target/X86/X86Subtarget.cpp:1.22   Tue Feb 14 02:07:58 2006
+++ llvm/lib/Target/X86/X86Subtarget.cppTue Feb 14 14:30:14 2006
@@ -16,12 +16,6 @@
 #include "X86GenSubtarget.inc"
 using namespace llvm;
 
-#include "llvm/Support/CommandLine.h"
-namespace {
-  cl::opt DisableSSE("disable-x86-sse", cl::Hidden,
-  cl::desc("Disable sse on X86"));
-}
-
 /// GetCpuIDAndInfo - Execute the specified cpuid and return the 4 values in 
the
 /// specified arguments.  If we can't run cpuid on the host, return true.
 static bool GetCpuIDAndInfo(unsigned value, unsigned *rEAX, unsigned *rEBX,
@@ -166,10 +160,8 @@
   // Default to ELF unless otherwise specified.
   TargetType = isELF;
   
-  if (DisableSSE) {
-X86SSELevel = NoMMXSSE;
-X863DNowLevel = NoThreeDNow;
-  }
+  X86SSELevel = NoMMXSSE;
+  X863DNowLevel = NoThreeDNow;
   
   // Set the boolean corresponding to the current target triple, or the default
   // if one cannot be determined, to true.



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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86Subtarget.cpp updated: 1.23 -> 1.24
---
Log message:

Duh

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

 X86Subtarget.cpp |3 ---
 1 files changed, 3 deletions(-)


Index: llvm/lib/Target/X86/X86Subtarget.cpp
diff -u llvm/lib/Target/X86/X86Subtarget.cpp:1.23 
llvm/lib/Target/X86/X86Subtarget.cpp:1.24
--- llvm/lib/Target/X86/X86Subtarget.cpp:1.23   Tue Feb 14 14:30:14 2006
+++ llvm/lib/Target/X86/X86Subtarget.cppTue Feb 14 14:37:37 2006
@@ -160,9 +160,6 @@
   // Default to ELF unless otherwise specified.
   TargetType = isELF;
   
-  X86SSELevel = NoMMXSSE;
-  X863DNowLevel = NoThreeDNow;
-  
   // Set the boolean corresponding to the current target triple, or the default
   // if one cannot be determined, to true.
   const std::string& TT = M.getTargetTriple();



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

2006-02-14 Thread Chris Lattner


Changes in directory llvm/lib/Target/PowerPC:

PPCAsmPrinter.cpp updated: 1.149 -> 1.150
---
Log message:

Make sure that weak functions are aligned properly


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

 PPCAsmPrinter.cpp |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.149 
llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.150
--- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.149 Wed Feb  8 17:42:22 2006
+++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp   Tue Feb 14 14:42:33 2006
@@ -464,11 +464,9 @@
   default: assert(0 && "Unknown linkage type!");
   case Function::InternalLinkage:  // Symbols default to internal.
 SwitchSection(".text", F);
-EmitAlignment(4, F);
 break;
   case Function::ExternalLinkage:
 SwitchSection(".text", F);
-EmitAlignment(4, F);
 O << "\t.globl\t" << CurrentFnName << "\n";
 break;
   case Function::WeakLinkage:
@@ -479,6 +477,7 @@
 O << "\t.weak_definition\t" << CurrentFnName << "\n";
 break;
   }
+  EmitAlignment(4, F);
   O << CurrentFnName << ":\n";
 
   // Print out code for the function.



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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86CodeEmitter.cpp updated: 1.87 -> 1.88
---
Log message:

Bug fix: XS, XD prefixes were being emitted twice.
XMM registers were not being handled.


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

 X86CodeEmitter.cpp |   18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)


Index: llvm/lib/Target/X86/X86CodeEmitter.cpp
diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.87 
llvm/lib/Target/X86/X86CodeEmitter.cpp:1.88
--- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.87 Wed Feb  1 00:13:50 2006
+++ llvm/lib/Target/X86/X86CodeEmitter.cpp  Tue Feb 14 15:45:24 2006
@@ -186,6 +186,11 @@
   case X86::ST0: case X86::ST1: case X86::ST2: case X86::ST3:
   case X86::ST4: case X86::ST5: case X86::ST6: case X86::ST7:
 return RegNo-X86::ST0;
+
+  case X86::XMM0: case X86::XMM1: case X86::XMM2: case X86::XMM3:
+  case X86::XMM4: case X86::XMM5: case X86::XMM6: case X86::XMM7:
+return RegNo-X86::XMM0;
+
   default:
 assert(MRegisterInfo::isVirtualRegister(RegNo) &&
"Unknown physical register!");
@@ -371,21 +376,16 @@
   case X86II::TB:
 MCE.emitByte(0x0F);   // Two-byte opcode prefix
 break;
-  case X86II::REP: break; // already handled.
-  case X86II::XS:   // F3 0F
-MCE.emitByte(0xF3);
-MCE.emitByte(0x0F);
-break;
-  case X86II::XD:   // F2 0F
-MCE.emitByte(0xF2);
-MCE.emitByte(0x0F);
-break;
   case X86II::D8: case X86II::D9: case X86II::DA: case X86II::DB:
   case X86II::DC: case X86II::DD: case X86II::DE: case X86II::DF:
 MCE.emitByte(0xD8+
  (((Desc.TSFlags & X86II::Op0Mask)-X86II::D8)
>> X86II::Op0Shift));
 break; // Two-byte opcode prefix
+  case X86II::REP:
+  case X86II::XS:
+  case X86II::XD:
+break; // already handled.
   default: assert(0 && "Invalid prefix!");
   case 0: break;  // No prefix!
   }



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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86CodeEmitter.cpp updated: 1.88 -> 1.89
---
Log message:

Don't special case XS, XD prefixes.


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

 X86CodeEmitter.cpp |   23 +--
 1 files changed, 9 insertions(+), 14 deletions(-)


Index: llvm/lib/Target/X86/X86CodeEmitter.cpp
diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.88 
llvm/lib/Target/X86/X86CodeEmitter.cpp:1.89
--- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.88 Tue Feb 14 15:45:24 2006
+++ llvm/lib/Target/X86/X86CodeEmitter.cpp  Tue Feb 14 15:52:51 2006
@@ -362,30 +362,25 @@
   // Emit the operand size opcode prefix as needed.
   if (Desc.TSFlags & X86II::OpSize) MCE.emitByte(0x66);
 
-  // Emit the double precision sse fp opcode prefix as needed.
-  if ((Desc.TSFlags & X86II::Op0Mask) == X86II::XD) {
-MCE.emitByte(0xF2); MCE.emitByte(0x0F);
-  }
-
-  // Emit the double precision sse fp opcode prefix as needed.
-  if ((Desc.TSFlags & X86II::Op0Mask) == X86II::XS) {
-MCE.emitByte(0xF3); MCE.emitByte(0x0F);
-  }
-
   switch (Desc.TSFlags & X86II::Op0Mask) {
   case X86II::TB:
 MCE.emitByte(0x0F);   // Two-byte opcode prefix
 break;
+  case X86II::REP: break; // already handled.
+  case X86II::XS:   // F3 0F
+MCE.emitByte(0xF3);
+MCE.emitByte(0x0F);
+break;
+  case X86II::XD:   // F2 0F
+MCE.emitByte(0xF2);
+MCE.emitByte(0x0F);
+break;
   case X86II::D8: case X86II::D9: case X86II::DA: case X86II::DB:
   case X86II::DC: case X86II::DD: case X86II::DE: case X86II::DF:
 MCE.emitByte(0xD8+
  (((Desc.TSFlags & X86II::Op0Mask)-X86II::D8)
>> X86II::Op0Shift));
 break; // Two-byte opcode prefix
-  case X86II::REP:
-  case X86II::XS:
-  case X86II::XD:
-break; // already handled.
   default: assert(0 && "Invalid prefix!");
   case 0: break;  // No prefix!
   }



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


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

2006-02-14 Thread Jim Laskey


Changes in directory llvm/lib/CodeGen:

DwarfWriter.cpp updated: 1.25 -> 1.26
---
Log message:

Using wrong DW_FORM.


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

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


Index: llvm/lib/CodeGen/DwarfWriter.cpp
diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.25 
llvm/lib/CodeGen/DwarfWriter.cpp:1.26
--- llvm/lib/CodeGen/DwarfWriter.cpp:1.25   Mon Feb  6 09:33:21 2006
+++ llvm/lib/CodeGen/DwarfWriter.cppTue Feb 14 16:01:57 2006
@@ -941,7 +941,7 @@
 // construct the type DIE.
 TypeDie = new DIE(DW_TAG_base_type, DW_CHILDREN_no);
 TypeDie->AddString(DW_AT_name,  DW_FORM_string, Name);
-TypeDie->AddUInt  (DW_AT_byte_size, DW_FORM_data1,  Size);
+TypeDie->AddUInt  (DW_AT_byte_size, 0,  Size);
 TypeDie->AddUInt  (DW_AT_encoding,  DW_FORM_data1,  Encoding);
 TypeDie->Complete(DW);
 



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

2006-02-14 Thread Chris Lattner


Changes in directory llvm/lib/Target/PowerPC:

PPCAsmPrinter.cpp updated: 1.150 -> 1.151
---
Log message:

If we have zero initialized data with external linkage, use .zerofill to
emit it (instead of .space), saving a bit of space in the .o file.

For example:
int foo[100];
int bar[100] = {};

when compiled with C++ or -fno-common results in shrinkage from 1160 to 360
bytes of space.  The X86 backend can also do this on darwin.



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

 PPCAsmPrinter.cpp |   15 +++
 1 files changed, 11 insertions(+), 4 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.150 
llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.151
--- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.150 Tue Feb 14 14:42:33 2006
+++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp   Tue Feb 14 16:18:23 2006
@@ -539,13 +539,20 @@
 
 if (C->isNullValue() && /* FIXME: Verify correct */
 (I->hasInternalLinkage() || I->hasWeakLinkage() ||
- I->hasLinkOnceLinkage())) {
-  SwitchSection(".data", I);
+ I->hasLinkOnceLinkage() ||
+ (I->hasExternalLinkage() && !I->hasSection( {
   if (Size == 0) Size = 1;   // .comm Foo, 0 is undefined, avoid it.
-  if (I->hasInternalLinkage())
+  if (I->hasExternalLinkage()) {
+O << "\t.globl " << name << '\n';
+O << "\t.zerofill __DATA, __common, " << name << ", "
+  << Size << ", " << Align;
+  } else if (I->hasInternalLinkage()) {
+SwitchSection(".data", I);
 O << LCOMMDirective << name << "," << Size << "," << Align;
-  else
+  } else {
+SwitchSection(".data", I);
 O << ".comm " << name << "," << Size;
+  }
   O << "\t\t; '" << I->getName() << "'\n";
 } else {
   switch (I->getLinkage()) {



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

2006-02-14 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

README.txt updated: 1.52 -> 1.53
---
Log message:

new note


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

 README.txt |5 +
 1 files changed, 5 insertions(+)


Index: llvm/lib/Target/X86/README.txt
diff -u llvm/lib/Target/X86/README.txt:1.52 llvm/lib/Target/X86/README.txt:1.53
--- llvm/lib/Target/X86/README.txt:1.52 Tue Feb 14 02:25:32 2006
+++ llvm/lib/Target/X86/README.txt  Tue Feb 14 16:19:54 2006
@@ -443,3 +443,8 @@
movw al, 8(%edx)

 when we can spare a register. It reduces code size.
+
+//===-===//
+
+Use .zerofill on x86/darwin when appropriate.
+



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


[llvm-commits] CVS: llvm/lib/Transforms/Utils/LoopSimplify.cpp

2006-02-14 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Utils:

LoopSimplify.cpp updated: 1.67 -> 1.68
---
Log message:

When splitting exit edges to canonicalize loops, make sure to put the new
block in the appropriate loop nest.

Third time is the charm, right?


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

 LoopSimplify.cpp |   38 --
 1 files changed, 20 insertions(+), 18 deletions(-)


Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp
diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.67 
llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.68
--- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.67 Sat Feb 11 19:59:10 2006
+++ llvm/lib/Transforms/Utils/LoopSimplify.cpp  Tue Feb 14 16:34:08 2006
@@ -57,6 +57,7 @@
 // AA - If we have an alias analysis object to update, this is it, 
otherwise
 // this is null.
 AliasAnalysis *AA;
+LoopInfo *LI;
 
 virtual bool runOnFunction(Function &F);
 
@@ -100,10 +101,10 @@
 ///
 bool LoopSimplify::runOnFunction(Function &F) {
   bool Changed = false;
-  LoopInfo &LI = getAnalysis();
+  LI = &getAnalysis();
   AA = getAnalysisToUpdate();
 
-  for (LoopInfo::iterator I = LI.begin(), E = LI.end(); I != E; ++I)
+  for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I)
 Changed |= ProcessLoop(*I);
 
   return Changed;
@@ -159,9 +160,8 @@
   // predecessors from outside of the loop, split the edge now.
   std::vector ExitBlocks;
   L->getExitBlocks(ExitBlocks);
-
+
   SetVector ExitBlockSet(ExitBlocks.begin(), ExitBlocks.end());
-  LoopInfo &LI = getAnalysis();
   for (SetVector::iterator I = ExitBlockSet.begin(),
  E = ExitBlockSet.end(); I != E; ++I) {
 BasicBlock *ExitBlock = *I;
@@ -326,7 +326,7 @@
 
   // We know that we have loop information to update... update it now.
   if (Loop *Parent = L->getParentLoop())
-Parent->addBasicBlockToLoop(NewBB, getAnalysis());
+Parent->addBasicBlockToLoop(NewBB, *LI);
 
   DominatorSet &DS = getAnalysis();  // Update dominator info
   DominatorTree &DT = getAnalysis();
@@ -414,8 +414,6 @@
 /// blocks.  This method is used to split exit blocks that have predecessors
 /// outside of the loop.
 BasicBlock *LoopSimplify::RewriteLoopExitBlock(Loop *L, BasicBlock *Exit) {
-  DominatorSet &DS = getAnalysis();
-
   std::vector LoopBlocks;
   for (pred_iterator I = pred_begin(Exit), E = pred_end(Exit); I != E; ++I)
 if (L->contains(*I))
@@ -424,10 +422,16 @@
   assert(!LoopBlocks.empty() && "No edges coming in from outside the loop?");
   BasicBlock *NewBB = SplitBlockPredecessors(Exit, ".loopexit", LoopBlocks);
 
-  // Update Loop Information - we know that the new block will be in the parent
-  // loop of L.
-  if (Loop *Parent = L->getParentLoop())
-Parent->addBasicBlockToLoop(NewBB, getAnalysis());
+  // Update Loop Information - we know that the new block will be in whichever
+  // loop the Exit block is in.  Note that it may not be in that immediate 
loop,
+  // if the successor is some other loop header.  In that case, we continue 
+  // walking up the loop tree to find a loop that contains both the successor
+  // block and the predecessor block.
+  Loop *SuccLoop = LI->getLoopFor(Exit);
+  while (SuccLoop && !SuccLoop->contains(L->getHeader()))
+SuccLoop = SuccLoop->getParentLoop();
+  if (SuccLoop)
+SuccLoop->addBasicBlockToLoop(NewBB, *LI);
 
   // Update dominator information (set, immdom, domtree, and domfrontier)
   UpdateDomInfoForRevectoredPreds(NewBB, LoopBlocks);
@@ -511,17 +515,15 @@
   // Create the new outer loop.
   Loop *NewOuter = new Loop();
 
-  LoopInfo &LI = getAnalysis();
-
   // Change the parent loop to use the outer loop as its child now.
   if (Loop *Parent = L->getParentLoop())
 Parent->replaceChildLoopWith(L, NewOuter);
   else
-LI.changeTopLevelLoop(L, NewOuter);
+LI->changeTopLevelLoop(L, NewOuter);
 
   // This block is going to be our new header block: add it to this loop and 
all
   // parent loops.
-  NewOuter->addBasicBlockToLoop(NewBB, getAnalysis());
+  NewOuter->addBasicBlockToLoop(NewBB, *LI);
 
   // L is now a subloop of our outer loop.
   NewOuter->addChildLoop(L);
@@ -553,8 +555,8 @@
 if (!BlocksInL.count(BB)) {
   // Move this block to the parent, updating the exit blocks sets
   L->removeBlockFromLoop(BB);
-  if (LI[BB] == L)
-LI.changeLoopFor(BB, NewOuter);
+  if ((*LI)[BB] == L)
+LI->changeLoopFor(BB, NewOuter);
   --i;
 }
   }
@@ -656,7 +658,7 @@
 
   // Update Loop Information - we know that this block is now in the current
   // loop and all parent loops.
-  L->addBasicBlockToLoop(BEBlock, getAnalysis());
+  L->addBasicBlockToLoop(BEBlock, *LI);
 
   // Update dominator information (set, immdom, domtree, and domfrontier)
   UpdateDomInfoForRevectoredPreds(BEBlock, BackedgeBlocks);



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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.158 -> 1.159
---
Log message:

Doh again!


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

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


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.158 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.159
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.158Tue Feb 14 
14:12:38 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Tue Feb 14 17:05:54 2006
@@ -1598,7 +1598,7 @@
   if (VT > LVT)
 VT = LVT;
 
-  unsigned NumMemOps;
+  unsigned NumMemOps = 0;
   while (Size != 0) {
 unsigned VTSize = getSizeInBits(VT) / 8;
 while (VTSize > Size) {



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


[llvm-commits] CVS: llvm/lib/Transforms/Utils/LoopSimplify.cpp

2006-02-14 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Utils:

LoopSimplify.cpp updated: 1.68 -> 1.69
---
Log message:

Canonicalize inner loops before outer loops.  Inner loop canonicalization
can provide work for the outer loop to canonicalize.

This fixes a case that breaks unswitching.



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

 LoopSimplify.cpp |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)


Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp
diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.68 
llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.69
--- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.68 Tue Feb 14 16:34:08 2006
+++ llvm/lib/Transforms/Utils/LoopSimplify.cpp  Tue Feb 14 17:06:02 2006
@@ -115,7 +115,11 @@
 ///
 bool LoopSimplify::ProcessLoop(Loop *L) {
   bool Changed = false;
-
+  // Canonicalize inner loops before outer loops.  Inner loop canonicalization
+  // can provide work for the outer loop to canonicalize.
+  for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
+Changed |= ProcessLoop(*I);
+  
   // Check to see that no blocks (other than the header) in the loop have
   // predecessors that are not in the loop.  This is not valid for natural
   // loops, but can occur if the blocks are unreachable.  Since they are
@@ -205,9 +209,6 @@
 PN->eraseFromParent();
   }
 
-  for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
-Changed |= ProcessLoop(*I);
-
   return Changed;
 }
 



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

2006-02-14 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

LoopUnswitch.cpp updated: 1.18 -> 1.19
---
Log message:

pull some code out into a function


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

 LoopUnswitch.cpp |   46 --
 1 files changed, 28 insertions(+), 18 deletions(-)


Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.18 
llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.19
--- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.18Mon Feb 13 19:01:41 2006
+++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Tue Feb 14 18:07:43 2006
@@ -432,6 +432,28 @@
   return New;
 }
 
+/// EmitPreheaderBranchOnCondition - Emit a conditional branch on two values
+/// if LIC == Val, branch to TrueDst, otherwise branch to FalseDest.  Insert 
the
+/// code immediately before InsertPt.
+static void EmitPreheaderBranchOnCondition(Value *LIC, Constant *Val,
+   BasicBlock *TrueDest,
+   BasicBlock *FalseDest,
+   Instruction *InsertPt) {
+  // Insert a conditional branch on LIC to the two preheaders.  The original
+  // code is the true version and the new code is the false version.
+  Value *BranchVal = LIC;
+  if (!isa(BranchVal)) {
+BranchVal = BinaryOperator::createSetEQ(LIC, Val, "tmp", InsertPt);
+  } else if (Val != ConstantBool::True) {
+// We want to enter the new loop when the condition is true.
+std::swap(TrueDest, FalseDest);
+  }
+
+  // Insert the new branch.
+  new BranchInst(TrueDest, FalseDest, BranchVal, InsertPt);
+}
+
+
 /// UnswitchTrivialCondition - Given a loop that has a trivial unswitchable
 /// condition in it (a cond branch from its header block to its latch block,
 /// where the path through the loop that doesn't execute its body has no 
@@ -505,6 +527,7 @@
   std::sort(ExitBlocks.begin(), ExitBlocks.end());
   ExitBlocks.erase(std::unique(ExitBlocks.begin(), ExitBlocks.end()),
ExitBlocks.end());
+  
   // Split all of the edges from inside the loop to their exit blocks.  This
   // unswitching trivial: no phi nodes to update.
   unsigned NumBlocks = L->getBlocks().size();
@@ -583,26 +606,13 @@
   RemapInstruction(I, ValueMap);
   
   // Rewrite the original preheader to select between versions of the loop.
-  assert(isa(OrigPreheader->getTerminator()) &&
- cast(OrigPreheader->getTerminator())->isUnconditional() &&
- OrigPreheader->getTerminator()->getSuccessor(0) == LoopBlocks[0] &&
+  BranchInst *OldBR = cast(OrigPreheader->getTerminator());
+  assert(OldBR->isUnconditional() && OldBR->getSuccessor(0) == LoopBlocks[0] &&
  "Preheader splitting did not work correctly!");
 
-  // Insert a conditional branch on LIC to the two preheaders.  The original
-  // code is the true version and the new code is the false version.
-  Value *BranchVal = LIC;
-  if (!isa(BranchVal)) {
-BranchVal = BinaryOperator::createSetEQ(LIC, Val, "tmp",
-OrigPreheader->getTerminator());
-  } else if (Val != ConstantBool::True) {
-// We want to enter the new loop when the condition is true.
-BranchVal = BinaryOperator::createNot(BranchVal, "tmp",
-  OrigPreheader->getTerminator());
-  }
-  
-  // Remove the unconditional branch to LoopBlocks[0] and insert the new 
branch.
-  OrigPreheader->getInstList().pop_back();
-  new BranchInst(NewBlocks[0], LoopBlocks[0], BranchVal, OrigPreheader);
+  // Emit the new branch that selects between the two versions of this loop.
+  EmitPreheaderBranchOnCondition(LIC, Val, NewBlocks[0], LoopBlocks[0], OldBR);
+  OldBR->eraseFromParent();
 
   // Now we rewrite the original code to know that the condition is true and 
the
   // new code to know that the condition is false.



___
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.td

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86InstrInfo.td updated: 1.231 -> 1.232
---
Log message:

movaps, movapd encoding bug.


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

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


Index: llvm/lib/Target/X86/X86InstrInfo.td
diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.231 
llvm/lib/Target/X86/X86InstrInfo.td:1.232
--- llvm/lib/Target/X86/X86InstrInfo.td:1.231   Mon Feb  6 17:41:19 2006
+++ llvm/lib/Target/X86/X86InstrInfo.td Tue Feb 14 18:11:37 2006
@@ -3015,34 +3015,34 @@
 
 def MOVAPSrr : I<0x28, MRMSrcMem, (ops V4F4:$dst, V4F4:$src),
 "movaps {$src, $dst|$dst, $src}", []>,
-   Requires<[HasSSE1]>, XS;
+   Requires<[HasSSE1]>, TB;
 def MOVAPDrr : I<0x28, MRMSrcMem, (ops V2F8:$dst, V2F8:$src),
 "movapd {$src, $dst|$dst, $src}", []>,
-   Requires<[HasSSE2]>, XD;
+   Requires<[HasSSE2]>, TB, OpSize;
 
 def MOVAPSrm : I<0x28, MRMSrcMem, (ops V4F4:$dst, f128mem:$src),
 "movaps {$src, $dst|$dst, $src}", []>,
-   Requires<[HasSSE1]>, XS;
+   Requires<[HasSSE1]>, TB;
 def MOVAPSmr : I<0x29, MRMDestMem, (ops f128mem:$dst, V4F4:$src),
 "movaps {$src, $dst|$dst, $src}",[]>,
-   Requires<[HasSSE1]>, XD;
+   Requires<[HasSSE1]>, TB;
 def MOVAPDrm : I<0x28, MRMSrcMem, (ops V2F8:$dst, f128mem:$src),
 "movapd {$src, $dst|$dst, $src}", []>,
-   Requires<[HasSSE1]>, XD;
+   Requires<[HasSSE1]>, TB, OpSize;
 def MOVAPDmr : I<0x29, MRMDestMem, (ops f128mem:$dst, V2F8:$src),
 "movapd {$src, $dst|$dst, $src}",[]>,
-   Requires<[HasSSE2]>, XD;
+   Requires<[HasSSE2]>, TB, OpSize;
 
 // Pseudo-instructions to load FR32 / FR64 from f128mem using movaps / movapd.
 // Upper bits are disregarded.
 def MOVSAPSrm : I<0x28, MRMSrcMem, (ops FR32:$dst, f128mem:$src),
   "movaps {$src, $dst|$dst, $src}",
   [(set FR32:$dst, (X86loadpf32 addr:$src))]>,
-Requires<[HasSSE1]>, XS;
+Requires<[HasSSE1]>, TB;
 def MOVSAPDrm : I<0x28, MRMSrcMem, (ops FR64:$dst, f128mem:$src),
   "movapd {$src, $dst|$dst, $src}",
   [(set FR64:$dst, (X86loadpf64 addr:$src))]>,
-Requires<[HasSSE1]>, XD;
+Requires<[HasSSE2]>, TB, OpSize;
 
 
 
//===--===//



___
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.td

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86InstrInfo.td updated: 1.232 -> 1.233
---
Log message:

cvtsd2ss / cvtss2sd encoding bug.


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

 X86InstrInfo.td |8 
 1 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm/lib/Target/X86/X86InstrInfo.td
diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.232 
llvm/lib/Target/X86/X86InstrInfo.td:1.233
--- llvm/lib/Target/X86/X86InstrInfo.td:1.232   Tue Feb 14 18:11:37 2006
+++ llvm/lib/Target/X86/X86InstrInfo.td Tue Feb 14 18:31:03 2006
@@ -2423,19 +2423,19 @@
 def CVTSS2SDrr: I<0x5A, MRMSrcReg, (ops FR64:$dst, FR32:$src),
   "cvtss2sd {$src, $dst|$dst, $src}",
   [(set FR64:$dst, (fextend FR32:$src))]>,
-Requires<[HasSSE2]>, XD;
+Requires<[HasSSE2]>, XS;
 def CVTSS2SDrm: I<0x5A, MRMSrcMem, (ops FR64:$dst, f32mem:$src),
   "cvtss2sd {$src, $dst|$dst, $src}",
   [(set FR64:$dst, (fextend (loadf32 addr:$src)))]>,
-Requires<[HasSSE2]>, XD;
+Requires<[HasSSE2]>, XS;
 def CVTSD2SSrr: I<0x5A, MRMSrcReg, (ops FR32:$dst, FR64:$src),
   "cvtsd2ss {$src, $dst|$dst, $src}",
   [(set FR32:$dst, (fround FR64:$src))]>,
-Requires<[HasSSE2]>, XS;
+Requires<[HasSSE2]>, XD;
 def CVTSD2SSrm: I<0x5A, MRMSrcMem, (ops FR32:$dst, f64mem:$src), 
   "cvtsd2ss {$src, $dst|$dst, $src}",
   [(set FR32:$dst, (fround (loadf64 addr:$src)))]>,
-Requires<[HasSSE2]>, XS;
+Requires<[HasSSE2]>, XD;
 def CVTSI2SSrr: I<0x2A, MRMSrcReg, (ops FR32:$dst, R32:$src),
   "cvtsi2ss {$src, $dst|$dst, $src}",
   [(set FR32:$dst, (sint_to_fp R32:$src))]>,



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

2006-02-14 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

LoopUnswitch.cpp updated: 1.19 -> 1.20
---
Log message:

more refactoring, no functionality change.


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

 LoopUnswitch.cpp |   23 +++
 1 files changed, 11 insertions(+), 12 deletions(-)


Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.19 
llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.20
--- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.19Tue Feb 14 18:07:43 2006
+++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Tue Feb 14 19:44:42 2006
@@ -77,7 +77,7 @@
 BasicBlock *SplitEdge(BasicBlock *From, BasicBlock *To);
 void RewriteLoopBodyWithConditionConstant(Loop *L, Value *LIC,Constant 
*Val,
   bool isEqual);
-void UnswitchTrivialCondition(Loop *L, Value *Cond, bool EntersLoopOnCond,
+void UnswitchTrivialCondition(Loop *L, Value *Cond, Constant *Val,
   BasicBlock *ExitBlock);
   };
   RegisterOpt X("loop-unswitch", "Unswitch loops");
@@ -154,7 +154,7 @@
 /// runs when the condition is true, False if the loop body executes when the
 /// condition is false.  Otherwise, return null to indicate a complex 
condition.
 static bool IsTrivialUnswitchCondition(Loop *L, Value *Cond,
-   bool *CondEntersLoop = 0,
+   Constant **Val = 0,
BasicBlock **LoopExit = 0) {
   BasicBlock *Header = L->getHeader();
   BranchInst *HeaderTerm = dyn_cast(Header->getTerminator());
@@ -170,9 +170,9 @@
   // the loop.
   BasicBlock *Latch = L->getLoopLatch();
   if (HeaderTerm->getSuccessor(1) == Latch) {
-if (CondEntersLoop) *CondEntersLoop = true;
+if (Val) *Val = ConstantBool::True;
   } else if (HeaderTerm->getSuccessor(0) == Latch)
-if (CondEntersLoop) *CondEntersLoop = false;
+if (Val) *Val = ConstantBool::False;
   else
 return false;  // Doesn't branch to latch block.
   
@@ -333,10 +333,10 @@
  
   // If this is a trivial condition to unswitch (which results in no code
   // duplication), do it now.
-  bool EntersLoopOnCond;
+  Constant *CondVal;
   BasicBlock *ExitBlock;
-  if (IsTrivialUnswitchCondition(L, LoopCond, &EntersLoopOnCond, &ExitBlock)){
-UnswitchTrivialCondition(L, LoopCond, EntersLoopOnCond, ExitBlock);
+  if (IsTrivialUnswitchCondition(L, LoopCond, &CondVal, &ExitBlock)){
+UnswitchTrivialCondition(L, LoopCond, CondVal, ExitBlock);
 NewLoop1 = L;
   } else {
 VersionLoop(LoopCond, Val, L, NewLoop1, NewLoop2);
@@ -460,7 +460,7 @@
 /// side-effects), unswitch it.  This doesn't involve any code duplication, 
just
 /// moving the conditional branch outside of the loop and updating loop info.
 void LoopUnswitch::UnswitchTrivialCondition(Loop *L, Value *Cond, 
-bool EnterOnCond,
+Constant *Val,
 BasicBlock *ExitBlock) {
   DEBUG(std::cerr << "loop-unswitch: Trivial-Unswitch loop %"
 << L->getHeader()->getName() << " [" << L->getBlocks().size()
@@ -484,15 +484,14 @@
 
   // Okay, now we have a position to branch from and a position to branch to, 
   // insert the new conditional branch.
-  new BranchInst(EnterOnCond ? NewPH : NewExit, EnterOnCond ? NewExit : NewPH,
- Cond, OrigPH->getTerminator());
+  EmitPreheaderBranchOnCondition(Cond, Val, NewPH, NewExit, 
+ OrigPH->getTerminator());
   OrigPH->getTerminator()->eraseFromParent();
 
   // Now that we know that the loop is never entered when this condition is a
   // particular value, rewrite the loop with this info.  We know that this will
   // at least eliminate the old branch.
-  RewriteLoopBodyWithConditionConstant(L, Cond, ConstantBool::get(EnterOnCond),
-   true);
+  RewriteLoopBodyWithConditionConstant(L, Cond, Val, true);
   ++NumTrivial;
 }
 



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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.159 -> 1.160
---
Log message:

Lower memcpy with small constant size operand into a series of load / store
ops.


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

 SelectionDAGISel.cpp |   42 ++
 1 files changed, 34 insertions(+), 8 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.159 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.160
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.159Tue Feb 14 
17:05:54 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Tue Feb 14 19:54:51 2006
@@ -1641,18 +1641,44 @@
   MVT::ValueType VT = MemOps[i];
   unsigned VTSize = getSizeInBits(VT) / 8;
   SDOperand Value = getMemsetValue(Op2, VT, DAG);
-  OutChains.
-push_back(DAG.getNode(ISD::STORE, MVT::Other, getRoot(),
-  Value,
-  getMemBasePlusOffset(Op1, Offset, DAG, TLI),
-  DAG.getSrcValue(NULL)));
+  SDOperand Store = DAG.getNode(ISD::STORE, MVT::Other, getRoot(),
+Value,
+getMemBasePlusOffset(Op1, Offset, DAG, 
TLI),
+DAG.getSrcValue(I.getOperand(1), 
Offset));
+  OutChains.push_back(Store);
   Offset += VTSize;
 }
-
-DAG.setRoot(DAG.getNode(ISD::TokenFactor, MVT::Other, OutChains));
-return;
   }
+  break;
 }
+case ISD::MEMCPY: {
+  if (MeetsMaxMemopRequirement(MemOps, TLI.getMaxStoresPerMemcpy(),
+   Size->getValue(), Align, TLI)) {
+unsigned NumMemOps = MemOps.size();
+unsigned Offset = 0;
+for (unsigned i = 0; i < NumMemOps; i++) {
+  MVT::ValueType VT = MemOps[i];
+  unsigned VTSize = getSizeInBits(VT) / 8;
+  SDOperand Value =
+DAG.getLoad(VT, getRoot(),
+getMemBasePlusOffset(Op2, Offset, DAG, TLI),
+DAG.getSrcValue(I.getOperand(2), Offset));
+  SDOperand Store =
+DAG.getNode(ISD::STORE, MVT::Other, Value.getValue(1),
+Value,
+getMemBasePlusOffset(Op1, Offset, DAG, TLI),
+DAG.getSrcValue(I.getOperand(1), Offset));
+  OutChains.push_back(Store);
+  Offset += VTSize;
+}
+  }
+  break;
+}
+}
+
+if (!OutChains.empty()) {
+  DAG.setRoot(DAG.getNode(ISD::TokenFactor, MVT::Other, OutChains));
+  return;
 }
   }
 



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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86AsmPrinter.cpp updated: 1.164 -> 1.165
---
Log message:

Use .zerofill on x86/darwin.


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

 X86AsmPrinter.cpp |   37 ++---
 1 files changed, 22 insertions(+), 15 deletions(-)


Index: llvm/lib/Target/X86/X86AsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.164 
llvm/lib/Target/X86/X86AsmPrinter.cpp:1.165
--- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.164 Wed Feb  8 17:42:22 2006
+++ llvm/lib/Target/X86/X86AsmPrinter.cpp   Tue Feb 14 19:56:23 2006
@@ -96,24 +96,31 @@
 
 if (C->isNullValue() && /* FIXME: Verify correct */
 (I->hasInternalLinkage() || I->hasWeakLinkage() ||
- I->hasLinkOnceLinkage())) {
+ I->hasLinkOnceLinkage() ||
+ (forDarwin && I->hasExternalLinkage() && !I->hasSection( {
   if (Size == 0) Size = 1;   // .comm Foo, 0 is undefined, avoid it.
-  SwitchSection(".data", I);
-  if (LCOMMDirective != NULL) {
-if (I->hasInternalLinkage()) {
-  O << LCOMMDirective << name << "," << Size;
-  if (forDarwin)
-O << "," << (AlignmentIsInBytes ? (1 << Align) : Align);
-} else
-  O << COMMDirective  << name << "," << Size;
+  if (I->hasExternalLinkage()) {
+  O << "\t.global\t" << name << "\n";
+  O << "\t.zerofill __DATA__, __common, " << name << ", "
+<< Size << ", " << Align;
   } else {
-if (I->hasInternalLinkage())
-  O <<"\t.local\t" << name << "\n";
-O << COMMDirective  << name << "," << Size;
-if (COMMDirectiveTakesAlignment)
-  O << "," << (AlignmentIsInBytes ? (1 << Align) : Align);
+SwitchSection(".data", I);
+if (LCOMMDirective != NULL) {
+  if (I->hasInternalLinkage()) {
+O << LCOMMDirective << name << "," << Size;
+if (forDarwin)
+  O << "," << (AlignmentIsInBytes ? (1 << Align) : Align);
+  } else
+O << COMMDirective  << name << "," << Size;
+} else {
+  if (I->hasInternalLinkage())
+O << "\t.local\t" << name << "\n";
+  O << COMMDirective  << name << "," << Size;
+  if (COMMDirectiveTakesAlignment)
+O << "," << (AlignmentIsInBytes ? (1 << Align) : Align);
+}
+O << "\t\t" << CommentString << " " << I->getName() << "\n";
   }
-  O << "\t\t" << CommentString << " " << I->getName() << "\n";
 } else {
   switch (I->getLinkage()) {
   case GlobalValue::LinkOnceLinkage:



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

2006-02-14 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

README.txt updated: 1.53 -> 1.54
---
Log message:

Remove an entry.

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

 README.txt |5 -
 1 files changed, 5 deletions(-)


Index: llvm/lib/Target/X86/README.txt
diff -u llvm/lib/Target/X86/README.txt:1.53 llvm/lib/Target/X86/README.txt:1.54
--- llvm/lib/Target/X86/README.txt:1.53 Tue Feb 14 16:19:54 2006
+++ llvm/lib/Target/X86/README.txt  Tue Feb 14 19:56:48 2006
@@ -443,8 +443,3 @@
movw al, 8(%edx)

 when we can spare a register. It reduces code size.
-
-//===-===//
-
-Use .zerofill on x86/darwin when appropriate.
-



___
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

2006-02-14 Thread Duraid Madina


Changes in directory llvm/autoconf:

configure.ac updated: 1.207 -> 1.208
---
Log message:

previously, configure would die if GCC or ICC was not found. Now it'll
go through, but we do want to know if we're using GCC/ICC since they
share certain funky command line options (for dependency generation
stuff)



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

 configure.ac |   11 ---
 1 files changed, 11 deletions(-)


Index: llvm/autoconf/configure.ac
diff -u llvm/autoconf/configure.ac:1.207 llvm/autoconf/configure.ac:1.208
--- llvm/autoconf/configure.ac:1.207Sat Feb  4 23:56:51 2006
+++ llvm/autoconf/configure.ac  Tue Feb 14 21:15:55 2006
@@ -412,17 +412,6 @@
 ;;
 esac
 
-if test "$GCC" != "yes" && test "$ICC" != "yes"
-then
-  AC_MSG_ERROR([gcc|icc required but not found])
-fi
-
-dnl Ensure that compilation tools are GCC; we use GCC specific extensions
-if test "$GXX" != "yes" && test "$IXX" != "yes"
-then
-  AC_MSG_ERROR([g++|icc required but not found])
-fi
-
 dnl Verify that GCC is version 3.0 or higher
 if test "$GCC" = "yes"
 then



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


[llvm-commits] CVS: llvm/configure

2006-02-14 Thread Duraid Madina


Changes in directory llvm:

configure updated: 1.209 -> 1.210
---
Log message:

zap



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

 configure |   14 --
 1 files changed, 14 deletions(-)


Index: llvm/configure
diff -u llvm/configure:1.209 llvm/configure:1.210
--- llvm/configure:1.209Sun Feb  5 00:26:43 2006
+++ llvm/configure  Tue Feb 14 21:16:52 2006
@@ -24870,20 +24870,6 @@
 ;;
 esac
 
-if test "$GCC" != "yes" && test "$ICC" != "yes"
-then
-  { { echo "$as_me:$LINENO: error: gcc|icc required but not found" >&5
-echo "$as_me: error: gcc|icc required but not found" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-if test "$GXX" != "yes" && test "$IXX" != "yes"
-then
-  { { echo "$as_me:$LINENO: error: g++|icc required but not found" >&5
-echo "$as_me: error: g++|icc required but not found" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
 if test "$GCC" = "yes"
 then
   gccmajor=`$CC --version | head -n 1 | sed 's/[^0-9]*\([0-9.]\).*/\1/'`



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


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

2006-02-14 Thread Duraid Madina


Changes in directory llvm:

Makefile.rules updated: 1.342 -> 1.343
---
Log message:

oops, I meant this



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

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


Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.342 llvm/Makefile.rules:1.343
--- llvm/Makefile.rules:1.342   Mon Feb 13 23:12:00 2006
+++ llvm/Makefile.rules Tue Feb 14 21:20:16 2006
@@ -347,7 +347,7 @@
 CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused
 
 ifeq ($(OS),HP-UX)
-  CompileCommonOpts += -D_REENTRANT -D_HPUX_SOURCE
+  CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE
 endif
 
 LD.Flags  += -L$(LibDir) -L$(LLVMLibDir) 



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


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

2006-02-14 Thread Duraid Madina


Changes in directory llvm:

Makefile.rules updated: 1.343 -> 1.344
---
Log message:

HP aCC (and a bunch of other compilers, no doubt) don't share
GCC's syntax for auto-dependency generation stuff. This should
be changed to be disabling dependency stuff unless GCC/ICC is
found.



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

 Makefile.rules |5 +
 1 files changed, 5 insertions(+)


Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.343 llvm/Makefile.rules:1.344
--- llvm/Makefile.rules:1.343   Tue Feb 14 21:20:16 2006
+++ llvm/Makefile.rules Tue Feb 14 21:23:26 2006
@@ -951,6 +951,11 @@
 # Object Build Rules: Build object files based on sources 
 ###
 
+# FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
+ifeq ($(OS),HP-UX)
+  DISABLE_AUTO_DEPENDENCIES=1
+endif
+
 # Provide rule sets for when dependency generation is enabled
 ifndef DISABLE_AUTO_DEPENDENCIES
 



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


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

2006-02-14 Thread Chris Lattner

On Tue, 14 Feb 2006, Reid Spencer wrote:

Rather than just kill this checking, I would prefer it if the aCC
compiler was added to the check for supported compilers. This
configuration check (that you've deleted) can prevent really bad things
happening downstream.


FWIW, I agree with reid.

-Chris


On Tue, 2006-02-14 at 21:16 -0600, Duraid Madina wrote:


Changes in directory llvm/autoconf:

configure.ac updated: 1.207 -> 1.208
---
Log message:

previously, configure would die if GCC or ICC was not found. Now it'll
go through, but we do want to know if we're using GCC/ICC since they
share certain funky command line options (for dependency generation
stuff)



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

 configure.ac |   11 ---
 1 files changed, 11 deletions(-)


Index: llvm/autoconf/configure.ac
diff -u llvm/autoconf/configure.ac:1.207 llvm/autoconf/configure.ac:1.208
--- llvm/autoconf/configure.ac:1.207Sat Feb  4 23:56:51 2006
+++ llvm/autoconf/configure.ac  Tue Feb 14 21:15:55 2006
@@ -412,17 +412,6 @@
 ;;
 esac

-if test "$GCC" != "yes" && test "$ICC" != "yes"
-then
-  AC_MSG_ERROR([gcc|icc required but not found])
-fi
-
-dnl Ensure that compilation tools are GCC; we use GCC specific extensions
-if test "$GXX" != "yes" && test "$IXX" != "yes"
-then
-  AC_MSG_ERROR([g++|icc required but not found])
-fi
-
 dnl Verify that GCC is version 3.0 or higher
 if test "$GCC" = "yes"
 then



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




-Chris

--
http://nondot.org/sabre/
http://llvm.org/

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


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

2006-02-14 Thread Reid Spencer
Rather than just kill this checking, I would prefer it if the aCC
compiler was added to the check for supported compilers. This
configuration check (that you've deleted) can prevent really bad things
happening downstream.

REid.

On Tue, 2006-02-14 at 21:16 -0600, Duraid Madina wrote:
> 
> Changes in directory llvm/autoconf:
> 
> configure.ac updated: 1.207 -> 1.208
> ---
> Log message:
> 
> previously, configure would die if GCC or ICC was not found. Now it'll
> go through, but we do want to know if we're using GCC/ICC since they
> share certain funky command line options (for dependency generation
> stuff)
> 
> 
> 
> ---
> Diffs of the changes:  (+0 -11)
> 
>  configure.ac |   11 ---
>  1 files changed, 11 deletions(-)
> 
> 
> Index: llvm/autoconf/configure.ac
> diff -u llvm/autoconf/configure.ac:1.207 llvm/autoconf/configure.ac:1.208
> --- llvm/autoconf/configure.ac:1.207  Sat Feb  4 23:56:51 2006
> +++ llvm/autoconf/configure.acTue Feb 14 21:15:55 2006
> @@ -412,17 +412,6 @@
>  ;;
>  esac
>  
> -if test "$GCC" != "yes" && test "$ICC" != "yes"
> -then
> -  AC_MSG_ERROR([gcc|icc required but not found])
> -fi
> -
> -dnl Ensure that compilation tools are GCC; we use GCC specific extensions
> -if test "$GXX" != "yes" && test "$IXX" != "yes"
> -then
> -  AC_MSG_ERROR([g++|icc required but not found])
> -fi
> -
>  dnl Verify that GCC is version 3.0 or higher
>  if test "$GCC" = "yes"
>  then
> 
> 
> 
> ___
> llvm-commits mailing list
> llvm-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


signature.asc
Description: This is a digitally signed message part
___
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/SparcISelDAGToDAG.cpp

2006-02-14 Thread Chris Lattner


Changes in directory llvm/lib/Target/Sparc:

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

Fix SingleSource/Regression/C/2004-08-12-InlinerAndAllocas.c on Sparc.

The ABI specifies that there is a register save area at the bottom of the
stack, which means the actual used pointer needs to be an offset from 
the subtracted value.


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

 SparcISelDAGToDAG.cpp |   23 ++-
 1 files changed, 22 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp
diff -u llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.84 
llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.85
--- llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.84Mon Feb 13 03:00:43 2006
+++ llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Wed Feb 15 00:41:34 2006
@@ -211,7 +211,7 @@
   setOperationAction(ISD::VAEND , MVT::Other, Expand);
   setOperationAction(ISD::STACKSAVE , MVT::Other, Expand); 
   setOperationAction(ISD::STACKRESTORE  , MVT::Other, Expand);
-  setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32  , Expand);
+  setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32  , Custom);
 
   setOperationAction(ISD::ConstantFP, MVT::f64, Expand);
   setOperationAction(ISD::ConstantFP, MVT::f32, Expand);
@@ -807,6 +807,27 @@
   return DAG.getNode(ISD::MERGE_VALUES, Tys, Ops);
 }
   }
+  case ISD::DYNAMIC_STACKALLOC: {
+SDOperand Chain = Op.getOperand(0);  // Legalize the chain.
+SDOperand Size  = Op.getOperand(1);  // Legalize the size.
+
+unsigned SPReg = SP::O6;
+SDOperand SP = DAG.getCopyFromReg(Chain, SPReg, MVT::i32);
+SDOperand NewSP = DAG.getNode(ISD::SUB, MVT::i32, SP, Size);// Value
+Chain = DAG.getCopyToReg(SP.getValue(1), SPReg, NewSP);  // Output 
chain
+
+// The resultant pointer is actually 16 words from the bottom of the stack,
+// to provide a register spill area.
+SDOperand NewVal = DAG.getNode(ISD::ADD, MVT::i32, NewSP,
+   DAG.getConstant(96, MVT::i32));
+std::vector Tys;
+Tys.push_back(MVT::i32);
+Tys.push_back(MVT::Other);
+std::vector Ops;
+Ops.push_back(NewVal);
+Ops.push_back(Chain);
+return DAG.getNode(ISD::MERGE_VALUES, Tys, Ops);
+  }
   case ISD::RET: {
 SDOperand Copy;
 



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


[llvm-commits] CVS: llvm/lib/AsmParser/Lexer.cpp.cvs Lexer.l Lexer.l.cvs

2006-02-14 Thread Chris Lattner


Changes in directory llvm/lib/AsmParser:

Lexer.cpp.cvs updated: 1.1 -> 1.2
Lexer.l updated: 1.71 -> 1.72
Lexer.l.cvs updated: 1.1 -> 1.2
---
Log message:

random lexer change to test the makefile updating stuff


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

 Lexer.cpp.cvs |3 ++-
 Lexer.l   |1 +
 Lexer.l.cvs   |1 +
 3 files changed, 4 insertions(+), 1 deletion(-)


Index: llvm/lib/AsmParser/Lexer.cpp.cvs
diff -u llvm/lib/AsmParser/Lexer.cpp.cvs:1.1 
llvm/lib/AsmParser/Lexer.cpp.cvs:1.2
--- llvm/lib/AsmParser/Lexer.cpp.cvs:1.1Mon Feb 13 23:14:46 2006
+++ llvm/lib/AsmParser/Lexer.cpp.cvsWed Feb 15 01:02:59 2006
@@ -20,7 +20,7 @@
 /* A lexical scanner generated by flex */
 
 /* Scanner skeleton version:
- * $Header: /home/vadve/shared/PublicCVS/llvm/lib/AsmParser/Lexer.cpp.cvs,v 
1.1 2006/02/14 05:14:46 lattner Exp $
+ * $Header: /home/vadve/shared/PublicCVS/llvm/lib/AsmParser/Lexer.cpp.cvs,v 
1.2 2006/02/15 07:02:59 lattner Exp $
  */
 
 #define FLEX_SCANNER
@@ -2623,3 +2623,4 @@
 #endif
 #line 355 "/Users/sabre/cvs/llvm/lib/AsmParser/Lexer.l"
 
+


Index: llvm/lib/AsmParser/Lexer.l
diff -u llvm/lib/AsmParser/Lexer.l:1.71 llvm/lib/AsmParser/Lexer.l:1.72
--- llvm/lib/AsmParser/Lexer.l:1.71 Wed Jan 25 16:26:43 2006
+++ llvm/lib/AsmParser/Lexer.l  Wed Feb 15 01:02:59 2006
@@ -353,3 +353,4 @@
 .   { return yytext[0]; }
 
 %%
+


Index: llvm/lib/AsmParser/Lexer.l.cvs
diff -u llvm/lib/AsmParser/Lexer.l.cvs:1.1 llvm/lib/AsmParser/Lexer.l.cvs:1.2
--- llvm/lib/AsmParser/Lexer.l.cvs:1.1  Mon Feb 13 23:14:46 2006
+++ llvm/lib/AsmParser/Lexer.l.cvs  Wed Feb 15 01:02:59 2006
@@ -353,3 +353,4 @@
 .   { return yytext[0]; }
 
 %%
+



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

2006-02-14 Thread Chris Lattner


Changes in directory llvm/lib/Target/Sparc:

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

Sparc actually *DOES* have a directive for emitting zeros.  In fact, it requires
it, because this:

.bss
X:
.byte 0

results in the assembler warning: "initialization in bss segment".  Annoying.



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

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


Index: llvm/lib/Target/Sparc/SparcAsmPrinter.cpp
diff -u llvm/lib/Target/Sparc/SparcAsmPrinter.cpp:1.54 
llvm/lib/Target/Sparc/SparcAsmPrinter.cpp:1.55
--- llvm/lib/Target/Sparc/SparcAsmPrinter.cpp:1.54  Fri Feb 10 01:35:42 2006
+++ llvm/lib/Target/Sparc/SparcAsmPrinter.cpp   Wed Feb 15 01:07:14 2006
@@ -40,7 +40,7 @@
   Data16bitsDirective = "\t.half\t";
   Data32bitsDirective = "\t.word\t";
   Data64bitsDirective = 0;  // .xword is only supported by V9.
-  ZeroDirective = 0;  // no .zero or .space!
+  ZeroDirective = "\t.skip\t";
   CommentString = "!";
   ConstantPoolSection = "\t.section \".rodata\",#alloc\n";
 }



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


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

2006-02-14 Thread Chris Lattner


Changes in directory llvm:

Makefile.rules updated: 1.344 -> 1.345
---
Log message:

Convert the bison-output-checked-into-cvs makefile handling stuff to work
like the flex stuff, which actually works when people do cvs updates and
get conflicts in the updated checked in file.


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

 Makefile.rules |   19 ---
 1 files changed, 16 insertions(+), 3 deletions(-)


Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.344 llvm/Makefile.rules:1.345
--- llvm/Makefile.rules:1.344   Tue Feb 14 21:23:26 2006
+++ llvm/Makefile.rules Wed Feb 15 01:16:57 2006
@@ -1252,6 +1252,8 @@
 
 .PRECIOUS: $(YaccOutput)
 
+all:: $(YaccFiles:%.l=$(PROJ_SRC_DIR)/%.cpp.cvs)
+
 # Cancel built-in rules for yacc
 %.c: %.y 
 %.cpp: %.y
@@ -1265,10 +1267,21 @@
$(Verb) $(MV) -f $*.tab.h $(PROJ_SRC_DIR)/$*.h
$(Echo) "*** DON'T FORGET TO CHECK IN $*.cpp and $*.h (generated files)"
 
-YaccObjs   := $(patsubst %.y,$(ObjDir)/%.o,$(YaccFiles))
-$(YaccObjs): $(ObjDir)/%.o : $(PROJ_SRC_DIR)/%.cpp
+# IFF the .y file has changed since it was last checked into CVS, copy the .y
+# file to .y.cvs and the generated .cpp/.h file to .cpp.cvs/.h.cvs.  We use 
this
+# mechanism so that people without flex can build LLVM by copying the .cvs 
files
+# to the source location and building them.
+$(YaccFiles:%.y=$(PROJ_SRC_DIR)/%.cpp.cvs): \
+$(PROJ_SRC_DIR)/%.cpp.cvs: $(PROJ_SRC_DIR)/%.cpp
+   $(Verb) $(CMP) -s $@ $< || \
+  ($(CP) $< $@; \
+   $(CP) $(PROJ_SRC_DIR)/$*.l $(PROJ_SRC_DIR)/$*.l.cvs; \
+   $(CP) $(PROJ_SRC_DIR)/$*.h $(PROJ_SRC_DIR)/$*.h.cvs)
+
+
+$(YaccFiles:%.y=$(ObjDir)/%.o): $(ObjDir)/%.o : $(PROJ_SRC_DIR)/%.cpp
 
-YaccOutput := $(addprefix $(patsubst %.y,%,$(YaccFiles)),.output)
+YaccOutput := $(YaccFiles:%.y=%.output)
 
 clean-local::
-$(Verb) $(RM) -f $(YaccOutput)



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


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

2006-02-14 Thread Chris Lattner


Changes in directory llvm:

Makefile.rules updated: 1.345 -> 1.346
---
Log message:

bugfixes


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

 Makefile.rules |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)


Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.345 llvm/Makefile.rules:1.346
--- llvm/Makefile.rules:1.345   Wed Feb 15 01:16:57 2006
+++ llvm/Makefile.rules Wed Feb 15 01:23:05 2006
@@ -1252,7 +1252,7 @@
 
 .PRECIOUS: $(YaccOutput)
 
-all:: $(YaccFiles:%.l=$(PROJ_SRC_DIR)/%.cpp.cvs)
+all:: $(YaccFiles:%.y=$(PROJ_SRC_DIR)/%.cpp.cvs)
 
 # Cancel built-in rules for yacc
 %.c: %.y 
@@ -1265,7 +1265,6 @@
$(Verb) $(BISON) -v -d -p $(http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-test/MultiSource/Applications/JM/lencod/q_matrix.c q_offsets.c

2006-02-14 Thread Chris Lattner


Changes in directory llvm-test/MultiSource/Applications/JM/lencod:

q_matrix.c updated: 1.1 -> 1.2
q_offsets.c updated: 1.1 -> 1.2
---
Log message:

Fix prototypes to match the definition


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

 q_matrix.c  |4 ++--
 q_offsets.c |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm-test/MultiSource/Applications/JM/lencod/q_matrix.c
diff -u llvm-test/MultiSource/Applications/JM/lencod/q_matrix.c:1.1 
llvm-test/MultiSource/Applications/JM/lencod/q_matrix.c:1.2
--- llvm-test/MultiSource/Applications/JM/lencod/q_matrix.c:1.1 Sat Feb 11 
04:33:22 2006
+++ llvm-test/MultiSource/Applications/JM/lencod/q_matrix.c Wed Feb 15 
01:38:36 2006
@@ -14,7 +14,7 @@
 #include "global.h"
 #include "memalloc.h"
 
-extern char *GetConfigFileContent (char *Filename, int error_type);
+extern char *GetConfigFileContent (char *Filename);
 
 #define MAX_ITEMS_TO_PARSE  1000
 
@@ -402,7 +402,7 @@
   if(input->ScalingMatrixPresentFlag)
   {
 printf ("Parsing QMatrix file %s ", input->QmatrixFile);
-content = GetConfigFileContent(input->QmatrixFile, 0);
+content = GetConfigFileContent(input->QmatrixFile);
 if(content!='\0')
   ParseMatrix(content, strlen (content));
 else


Index: llvm-test/MultiSource/Applications/JM/lencod/q_offsets.c
diff -u llvm-test/MultiSource/Applications/JM/lencod/q_offsets.c:1.1 
llvm-test/MultiSource/Applications/JM/lencod/q_offsets.c:1.2
--- llvm-test/MultiSource/Applications/JM/lencod/q_offsets.c:1.1Sat Feb 
11 04:33:22 2006
+++ llvm-test/MultiSource/Applications/JM/lencod/q_offsets.cWed Feb 15 
01:38:36 2006
@@ -14,7 +14,7 @@
 #include "global.h"
 #include "memalloc.h"
 
-extern char *GetConfigFileContent (char *Filename, int error_type);
+extern char *GetConfigFileContent (char *Filename);
 
 #define MAX_ITEMS_TO_PARSE  1000
 
@@ -339,7 +339,7 @@
   {
 printf ("Parsing Quantization Offset Matrix file %s ",
   input->QOffsetMatrixFile);
-content = GetConfigFileContent (input->QOffsetMatrixFile, 0);
+content = GetConfigFileContent (input->QOffsetMatrixFile);
 if (content != '\0')
   ParseQOffsetMatrix (content, strlen (content));
 else



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


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

2006-02-14 Thread duraid
> On Tue, 14 Feb 2006, Reid Spencer wrote:
>> Rather than just kill this checking, I would prefer it if the aCC
>> compiler was added to the check for supported compilers. This
>> configuration check (that you've deleted) can prevent really bad things
>> happening downstream.

Not trying to be picky, but what kind of really bad things are we talking
about? The worst thing I can imagine is that a build fails because there's
some issue between the source/makefiles and the user's toolchain.

> FWIW, I agree with reid.

I did ask..! :) For now, I'll just revert it and add aCC-specific stuff
later (the get-rid-of-hash-tables patch is still to come) but the
intention was that with a little bit of work LLVM could be made and kept
standard-compliant and so "any good compiler" should work, in theory.
Should we insist on known-good compilers, abort on known-bad compilers,
spit out scary warning messages, or something else again?

Anyway, for now I'll just revert this. Sorry guys! :)

   Duraid


> -Chris
>
>> On Tue, 2006-02-14 at 21:16 -0600, Duraid Madina wrote:
>>>
>>> Changes in directory llvm/autoconf:
>>>
>>> configure.ac updated: 1.207 -> 1.208
>>> ---
>>> Log message:
>>>
>>> previously, configure would die if GCC or ICC was not found. Now it'll
>>> go through, but we do want to know if we're using GCC/ICC since they
>>> share certain funky command line options (for dependency generation
>>> stuff)
>>>
>>>
>>>
>>> ---
>>> Diffs of the changes:  (+0 -11)
>>>
>>>  configure.ac |   11 ---
>>>  1 files changed, 11 deletions(-)
>>>
>>>
>>> Index: llvm/autoconf/configure.ac
>>> diff -u llvm/autoconf/configure.ac:1.207
>>> llvm/autoconf/configure.ac:1.208
>>> --- llvm/autoconf/configure.ac:1.207Sat Feb  4 23:56:51 2006
>>> +++ llvm/autoconf/configure.ac  Tue Feb 14 21:15:55 2006
>>> @@ -412,17 +412,6 @@
>>>  ;;
>>>  esac
>>>
>>> -if test "$GCC" != "yes" && test "$ICC" != "yes"
>>> -then
>>> -  AC_MSG_ERROR([gcc|icc required but not found])
>>> -fi
>>> -
>>> -dnl Ensure that compilation tools are GCC; we use GCC specific
>>> extensions
>>> -if test "$GXX" != "yes" && test "$IXX" != "yes"
>>> -then
>>> -  AC_MSG_ERROR([g++|icc required but not found])
>>> -fi
>>> -
>>>  dnl Verify that GCC is version 3.0 or higher
>>>  if test "$GCC" = "yes"
>>>  then
>>>
>>>
>>>
>>> ___
>>> llvm-commits mailing list
>>> llvm-commits@cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
> -Chris
>
> --
> http://nondot.org/sabre/
> http://llvm.org/
>


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


[llvm-commits] CVS: llvm/configure

2006-02-14 Thread Duraid Madina


Changes in directory llvm:

configure updated: 1.210 -> 1.211
---
Log message:

reverting previous change, will add support for other compilers later




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

 configure |   14 ++
 1 files changed, 14 insertions(+)


Index: llvm/configure
diff -u llvm/configure:1.210 llvm/configure:1.211
--- llvm/configure:1.210Tue Feb 14 21:16:52 2006
+++ llvm/configure  Wed Feb 15 01:56:38 2006
@@ -24870,6 +24870,20 @@
 ;;
 esac
 
+if test "$GCC" != "yes" && test "$ICC" != "yes"
+then
+  { { echo "$as_me:$LINENO: error: gcc|icc required but not found" >&5
+echo "$as_me: error: gcc|icc required but not found" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+if test "$GXX" != "yes" && test "$IXX" != "yes"
+then
+  { { echo "$as_me:$LINENO: error: g++|icc required but not found" >&5
+echo "$as_me: error: g++|icc required but not found" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
 if test "$GCC" = "yes"
 then
   gccmajor=`$CC --version | head -n 1 | sed 's/[^0-9]*\([0-9.]\).*/\1/'`



___
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

2006-02-14 Thread Duraid Madina


Changes in directory llvm/autoconf:

configure.ac updated: 1.208 -> 1.209
---
Log message:

reverting previous change, will add support for other compilers later




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

 configure.ac |   11 +++
 1 files changed, 11 insertions(+)


Index: llvm/autoconf/configure.ac
diff -u llvm/autoconf/configure.ac:1.208 llvm/autoconf/configure.ac:1.209
--- llvm/autoconf/configure.ac:1.208Tue Feb 14 21:15:55 2006
+++ llvm/autoconf/configure.ac  Wed Feb 15 01:57:42 2006
@@ -412,6 +412,17 @@
 ;;
 esac
 
+if test "$GCC" != "yes" && test "$ICC" != "yes"
+then
+  AC_MSG_ERROR([gcc|icc required but not found])
+fi
+
+dnl Ensure that compilation tools are GCC; we use GCC specific extensions
+if test "$GXX" != "yes" && test "$IXX" != "yes"
+then
+  AC_MSG_ERROR([g++|icc required but not found])
+fi
+
 dnl Verify that GCC is version 3.0 or higher
 if test "$GCC" = "yes"
 then



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