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

2006-03-02 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

ScheduleDAGList.cpp updated: 1.6 -> 1.7
---
Log message:

- Fixed some priority calculation bugs that were causing bug 478: 
http://llvm.cs.uiuc.edu/PR478 . Among them:
  a predecessor appearing more than once in the operand list was counted as
  multiple predecessor; priority1 should be updated during scheduling;
  CycleBound was updated after the node is inserted into priority queue; one
  of the tie breaking condition was flipped.
- Take into consideration of two address opcodes. If a predecessor is a def&use
  operand, it should have a higher priority.
- Scheduler should also favor floaters, i.e. nodes that do not have real
  predecessors such as MOV32ri.
- The scheduling fixes / tweaks fixed bug 478: http://llvm.cs.uiuc.edu/PR478 :
.text
.align  4
.globl  _f
_f:
movl 4(%esp), %eax
movl 8(%esp), %ecx
movl %eax, %edx
imull %ecx, %edx
imull %eax, %eax
imull %ecx, %ecx
addl %eax, %ecx
leal (%ecx,%edx,2), %eax
ret

  It is also a slight performance win (1% - 3%) for most tests.


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

 ScheduleDAGList.cpp |  162 +++-
 1 files changed, 98 insertions(+), 64 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.6 
llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.7
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.6   Wed Feb  1 
18:38:08 2006
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp   Thu Mar  2 15:38:29 2006
@@ -21,8 +21,9 @@
 #include "llvm/Support/Debug.h"
 #include 
 #include 
-#include 
 #include 
+#include 
+#include 
 using namespace llvm;
 
 namespace {
@@ -32,14 +33,17 @@
 struct SUnit {
   SDNode *Node;   // Representative node.
   std::vector FlaggedNodes;  // All nodes flagged to Node.
-  std::vector Preds; // All real predecessors.
-  std::vector ChainPreds;// All chain predecessors.
-  std::vector Succs; // All real successors.
-  std::vector ChainSuccs;// All chain successors.
+  std::set Preds; // All real predecessors.
+  std::set ChainPreds;// All chain predecessors.
+  std::set Succs; // All real successors.
+  std::set ChainSuccs;// All chain successors.
   int NumPredsLeft;   // # of preds not scheduled.
   int NumSuccsLeft;   // # of succs not scheduled.
+  int NumChainPredsLeft;  // # of chain preds not scheduled.
+  int NumChainSuccsLeft;  // # of chain succs not scheduled.
   int Priority1;  // Scheduling priority 1.
   int Priority2;  // Scheduling priority 2.
+  bool isDefNUseOperand;  // Is a def&use operand.
   unsigned Latency;   // Node latency.
   unsigned CycleBound;// Upper/lower cycle to be scheduled at.
   unsigned Slot;  // Cycle node is scheduled at.
@@ -47,8 +51,9 @@
 
   SUnit(SDNode *node)
 : Node(node), NumPredsLeft(0), NumSuccsLeft(0),
-  Priority1(INT_MIN), Priority2(INT_MIN), Latency(0),
-  CycleBound(0), Slot(0), Next(NULL) {}
+  NumChainPredsLeft(0), NumChainSuccsLeft(0),
+  Priority1(INT_MIN), Priority2(INT_MIN), isDefNUseOperand(false),
+  Latency(0), CycleBound(0), Slot(0), Next(NULL) {}
 
   void dump(const SelectionDAG *G, bool All=true) const;
 };
@@ -66,37 +71,43 @@
   }
 
   if (All) {
-std::cerr << "# preds left  : " << NumPredsLeft << "\n";
-std::cerr << "# succs left  : " << NumSuccsLeft << "\n";
-std::cerr << "Latency   : " << Latency << "\n";
-std::cerr << "Priority  : " << Priority1 << " , " << Priority2 << "\n";
+std::cerr << "# preds left   : " << NumPredsLeft << "\n";
+std::cerr << "# succs left   : " << NumSuccsLeft << "\n";
+std::cerr << "# chain preds left : " << NumChainPredsLeft << "\n";
+std::cerr << "# chain succs left : " << NumChainSuccsLeft << "\n";
+std::cerr << "Latency: " << Latency << "\n";
+std::cerr << "Priority   : " << Priority1 << " , " << Priority2 << 
"\n";
 
 if (Preds.size() != 0) {
   std::cerr << "Predecessors  :\n";
-  for (unsigned i = 0, e = Preds.size(); i != e; i++) {
+  for (std::set::iterator I = Preds.begin(),
+ E = Preds.end(); I != E; ++I) {
 std::cerr << "";
-Preds[i]->dump(G, false);
+(*I)->dump(G, false);
   }
 }
 if (ChainPreds.size() != 0) {
   std::cerr << "Chained Preds :\n";
-  for (unsigned i = 0, e = ChainPreds.size(); i != e; i++) {
+  for (std::set::iterator I = ChainPreds.begin(),
+ E = ChainPreds.end(); I != E; ++I) {
 std::cerr << "";
-ChainPreds[i]->dump(G, false);
+(*I)->dump(G, false);
   }
 }
 if 

[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-03-01-InstrSchedBug.ll

2006-03-02 Thread Evan Cheng


Changes in directory llvm/test/Regression/CodeGen/X86:

2006-03-01-InstrSchedBug.ll added (r1.1)
---
Log message:

Add a regression test for bug 478: http://llvm.cs.uiuc.edu/PR478 .

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

 2006-03-01-InstrSchedBug.ll |   11 +++
 1 files changed, 11 insertions(+)


Index: llvm/test/Regression/CodeGen/X86/2006-03-01-InstrSchedBug.ll
diff -c /dev/null 
llvm/test/Regression/CodeGen/X86/2006-03-01-InstrSchedBug.ll:1.1
*** /dev/null   Thu Mar  2 15:48:44 2006
--- llvm/test/Regression/CodeGen/X86/2006-03-01-InstrSchedBug.llThu Mar 
 2 15:48:34 2006
***
*** 0 
--- 1,11 
+ ; RUN: llvm-as < %s | llc -march=x86 | not grep 'subl.*%esp'
+ 
+ int %f(int %a, int %b) {
+   %tmp.2 = mul int %a, %a
+   %tmp.5 = shl int %a, ubyte 1
+   %tmp.6 = mul int %tmp.5, %b
+   %tmp.10 = mul int %b, %b
+   %tmp.7 = add int %tmp.10, %tmp.2
+   %tmp.11 = add int %tmp.7, %tmp.6
+   ret int %tmp.11
+ }



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


[llvm-commits] CVS: llvm/lib/Target/README.txt

2006-03-02 Thread Chris Lattner


Changes in directory llvm/lib/Target:

README.txt updated: 1.8 -> 1.9
---
Log message:

add a note


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

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


Index: llvm/lib/Target/README.txt
diff -u llvm/lib/Target/README.txt:1.8 llvm/lib/Target/README.txt:1.9
--- llvm/lib/Target/README.txt:1.8  Tue Feb 21 12:29:44 2006
+++ llvm/lib/Target/README.txt  Thu Mar  2 16:34:38 2006
@@ -79,3 +79,10 @@
 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25600
 http://gcc.gnu.org/ml/gcc-patches/2006-02/msg01492.html
 
+//===-===//
+
+We should reassociate:
+int f(int a, int b){ return a * a + 2 * a * b + b * b; }
+into:
+int f(int a, int b) { return a * (a + 2 * b) + b * b; }
+to eliminate a multiply.



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


[llvm-commits] CVS: llvm/include/llvm/IntrinsicInst.h Intrinsics.h

2006-03-02 Thread Chris Lattner


Changes in directory llvm/include/llvm:

IntrinsicInst.h updated: 1.9 -> 1.10
Intrinsics.h updated: 1.36 -> 1.37
---
Log message:

Split memcpy/memset/memmove intrinsics into i32/i64 versions, resolving
PR709: http://llvm.cs.uiuc.edu/PR709 , and paving the way for future progress.



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

 IntrinsicInst.h |   20 +---
 Intrinsics.h|   17 ++---
 2 files changed, 23 insertions(+), 14 deletions(-)


Index: llvm/include/llvm/IntrinsicInst.h
diff -u llvm/include/llvm/IntrinsicInst.h:1.9 
llvm/include/llvm/IntrinsicInst.h:1.10
--- llvm/include/llvm/IntrinsicInst.h:1.9   Fri Jan 13 14:00:51 2006
+++ llvm/include/llvm/IntrinsicInst.h   Thu Mar  2 17:57:16 2006
@@ -148,9 +148,12 @@
 static inline bool classof(const MemIntrinsic *) { return true; }
 static inline bool classof(const IntrinsicInst *I) {
   switch (I->getIntrinsicID()) {
-  case Intrinsic::memcpy:
-  case Intrinsic::memmove:
-  case Intrinsic::memset:
+  case Intrinsic::memcpy_i32:
+  case Intrinsic::memcpy_i64:
+  case Intrinsic::memmove_i32:
+  case Intrinsic::memmove_i64:
+  case Intrinsic::memset_i32:
+  case Intrinsic::memset_i64:
 return true;
   default: return false;
   }
@@ -183,7 +186,8 @@
 // Methods for support type inquiry through isa, cast, and dyn_cast:
 static inline bool classof(const MemCpyInst *) { return true; }
 static inline bool classof(const IntrinsicInst *I) {
-  return I->getIntrinsicID() == Intrinsic::memcpy;
+  return I->getIntrinsicID() == Intrinsic::memcpy_i32 ||
+ I->getIntrinsicID() == Intrinsic::memcpy_i64;
 }
 static inline bool classof(const Value *V) {
   return isa(V) && classof(cast(V));
@@ -211,14 +215,15 @@
 // Methods for support type inquiry through isa, cast, and dyn_cast:
 static inline bool classof(const MemMoveInst *) { return true; }
 static inline bool classof(const IntrinsicInst *I) {
-  return I->getIntrinsicID() == Intrinsic::memmove;
+  return I->getIntrinsicID() == Intrinsic::memmove_i32 ||
+ I->getIntrinsicID() == Intrinsic::memmove_i64;
 }
 static inline bool classof(const Value *V) {
   return isa(V) && classof(cast(V));
 }
   };
 
-  /// MemSetInst - This class wraps the llvm.memcpy intrinsic.
+  /// MemSetInst - This class wraps the llvm.memset intrinsic.
   ///
   struct MemSetInst : public MemIntrinsic {
 /// get* - Return the arguments to the instruction.
@@ -234,7 +239,8 @@
 // Methods for support type inquiry through isa, cast, and dyn_cast:
 static inline bool classof(const MemSetInst *) { return true; }
 static inline bool classof(const IntrinsicInst *I) {
-  return I->getIntrinsicID() == Intrinsic::memset;
+  return I->getIntrinsicID() == Intrinsic::memset_i32 ||
+ I->getIntrinsicID() == Intrinsic::memset_i64;
 }
 static inline bool classof(const Value *V) {
   return isa(V) && classof(cast(V));


Index: llvm/include/llvm/Intrinsics.h
diff -u llvm/include/llvm/Intrinsics.h:1.36 llvm/include/llvm/Intrinsics.h:1.37
--- llvm/include/llvm/Intrinsics.h:1.36 Mon Jan 16 15:12:35 2006
+++ llvm/include/llvm/Intrinsics.h  Thu Mar  2 17:57:16 2006
@@ -59,13 +59,16 @@
 dbg_declare,  // Declare a local object
 
 // Standard C library intrinsics.
-memcpy, // Copy non-overlapping memory blocks
-memmove,// Copy potentially overlapping memory blocks
-memset, // Fill memory with a byte value
-isunordered_f32,// Return true if either float argument is a NaN
-isunordered_f64,// Return true if either double argument is a NaN
-sqrt_f32,   // Square root of float
-sqrt_f64,   // Square root of double
+memcpy_i32,  // Copy non-overlapping memory blocks.  i32 size.
+memcpy_i64,  // Copy non-overlapping memory blocks.  i64 size.
+memmove_i32, // Copy potentially overlapping memory blocks.  i32 size.
+memmove_i64, // Copy potentially overlapping memory blocks.  i64 size.
+memset_i32,  // Fill memory with a byte value.  i32 size.
+memset_i64,  // Fill memory with a byte value.  i64 size.
+isunordered_f32, // Return true if either float argument is a NaN
+isunordered_f64, // Return true if either double argument is a NaN
+sqrt_f32,// Square root of float
+sqrt_f64,// Square root of double
 
 // Bit manipulation instrinsics.
 bswap_i16,  // Byteswap 16 bits



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


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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/lib/VMCore:

AutoUpgrade.cpp updated: 1.8 -> 1.9
Function.cpp updated: 1.100 -> 1.101
Verifier.cpp updated: 1.146 -> 1.147
---
Log message:

Split memcpy/memset/memmove intrinsics into i32/i64 versions, resolving
PR709: http://llvm.cs.uiuc.edu/PR709 , and paving the way for future progress.

Significantly refactor autoupgrading code, to handle the more complex case
(where we upgrade one argument in a function), and fix some bugs in it.

Testcase here: llvm/test/Regression/Bytecode/memcpy.ll


---
Diffs of the changes:  (+128 -139)

 AutoUpgrade.cpp |  249 ++--
 Function.cpp|9 +-
 Verifier.cpp|9 +-
 3 files changed, 128 insertions(+), 139 deletions(-)


Index: llvm/lib/VMCore/AutoUpgrade.cpp
diff -u llvm/lib/VMCore/AutoUpgrade.cpp:1.8 llvm/lib/VMCore/AutoUpgrade.cpp:1.9
--- llvm/lib/VMCore/AutoUpgrade.cpp:1.8 Fri Jan 27 05:49:27 2006
+++ llvm/lib/VMCore/AutoUpgrade.cpp Thu Mar  2 17:58:40 2006
@@ -23,54 +23,86 @@
 using namespace llvm;
 
 // Utility function for getting the correct suffix given a type
-static inline const char* get_suffix(const Type* Ty) {
+static inline const char *getTypeSuffix(const Type* Ty) {
   switch (Ty->getTypeID()) {
-case Type::UIntTyID:return ".i32";
-case Type::UShortTyID:  return ".i16";
-case Type::UByteTyID:   return ".i8";
-case Type::ULongTyID:   return ".i64";
-case Type::FloatTyID:   return ".f32";
-case Type::DoubleTyID:  return ".f64";
-default:break;
+  case Type::ULongTyID:   return ".i64";
+  case Type::UIntTyID:return ".i32";
+  case Type::UShortTyID:  return ".i16";
+  case Type::UByteTyID:   return ".i8";
+  case Type::FloatTyID:   return ".f32";
+  case Type::DoubleTyID:  return ".f64";
+  default:break;
   }
   return 0;
 }
 
-static inline const Type* getTypeFromFunctionName(Function* F) {
+static Function *getUpgradedUnaryFn(Function *F) {
+  std::string Name = F->getName()+getTypeSuffix(F->getReturnType());
+  Module *M = F->getParent();
+  switch (F->getReturnType()->getTypeID()) {
+  default: return 0;
+  case Type::UByteTyID:
+  case Type::SByteTyID:
+return M->getOrInsertFunction(Name, 
+  Type::UByteTy, Type::UByteTy, NULL);
+  case Type::UShortTyID:
+  case Type::ShortTyID:
+return M->getOrInsertFunction(Name, 
+  Type::UShortTy, Type::UShortTy, NULL);
+  case Type::UIntTyID:
+  case Type::IntTyID:
+return M->getOrInsertFunction(Name, 
+  Type::UIntTy, Type::UIntTy, NULL);
+  case Type::ULongTyID:
+  case Type::LongTyID:
+return M->getOrInsertFunction(Name, 
+  Type::ULongTy, Type::ULongTy, NULL);
+}
+}
+
+static Function *getUpgradedIntrinsic(Function *F) {
   // If there's no function, we can't get the argument type.
-  if (!F)
-return 0;
+  if (!F) return 0;
 
   // Get the Function's name.
   const std::string& Name = F->getName();
 
   // Quickly eliminate it, if it's not a candidate.
-  if (Name.length() <= 8 || Name[0] != 'l' || Name[1] != 'l' || Name[2] !=
-'v' || Name[3] != 'm' || Name[4] != '.')
+  if (Name.length() <= 8 || Name[0] != 'l' || Name[1] != 'l' || 
+  Name[2] != 'v' || Name[3] != 'm' || Name[4] != '.')
 return 0;
 
+  Module *M = F->getParent();
   switch (Name[5]) {
-case 'b':
-  if (Name == "llvm.bswap")
-return F->getReturnType();
-  break;
-case 'c':
-  if (Name == "llvm.ctpop" || Name == "llvm.ctlz" || Name == "llvm.cttz")
-return F->getReturnType();
-  break;
-case 'i':
-  if (Name == "llvm.isunordered") {
-Function::const_arg_iterator ArgIt = F->arg_begin();
-if (ArgIt != F->arg_end()) 
-  return ArgIt->getType();
-  }
-  break;
-case 's':
-  if (Name == "llvm.sqrt")
-return F->getReturnType();
-  break;
-default:
-  break;
+  default: break;
+  case 'b':
+if (Name == "llvm.bswap") return getUpgradedUnaryFn(F);
+break;
+  case 'c':
+if (Name == "llvm.ctpop" || Name == "llvm.ctlz" || Name == "llvm.cttz")
+  return getUpgradedUnaryFn(F);
+break;
+  case 'i':
+if (Name == "llvm.isunordered" && F->arg_begin() != F->arg_end()) {
+  if (F->arg_begin()->getType() == Type::FloatTy)
+return M->getOrInsertFunction(Name+".f32", F->getFunctionType());
+  if (F->arg_begin()->getType() == Type::DoubleTy)
+return M->getOrInsertFunction(Name+".f64", F->getFunctionType());
+}
+break;
+  case 'm':
+if (Name == "llvm.memcpy" || Name == "llvm.memset" || 
+Name == "llvm.memmove") {
+  if (F->getFunctionType()->getParamType(2) == Type::UIntTy)
+return M->getOrInsertFunction(Name+".i32", F->getFunctionType());
+  if (F->getFunctionType()->getParamType(2) == Type::ULongTy)
+return M

[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp

2006-03-02 Thread Chris Lattner


Changes in directory llvm/lib/Bytecode/Reader:

Reader.cpp updated: 1.188 -> 1.189
---
Log message:

Simplify the autoupgrade interface


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

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


Index: llvm/lib/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.188 
llvm/lib/Bytecode/Reader/Reader.cpp:1.189
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.188   Fri Jan 27 05:49:27 2006
+++ llvm/lib/Bytecode/Reader/Reader.cpp Thu Mar  2 17:59:12 2006
@@ -1865,11 +1865,8 @@
 if (CallInst* CI = dyn_cast(II)) {
   std::map::iterator FI = 
 upgradedFunctions.find(CI->getCalledFunction());
-  if (FI != upgradedFunctions.end()) {
-Instruction* newI = UpgradeIntrinsicCall(CI,FI->second);
-CI->replaceAllUsesWith(newI);
-CI->eraseFromParent();
-  }
+  if (FI != upgradedFunctions.end())
+UpgradeIntrinsicCall(CI, FI->second);
 }
   }
 
@@ -2444,7 +2441,7 @@
 for (Module::iterator FI = TheModule->begin(), FE = TheModule->end();
  FI != FE; ++FI)
   if (Function* newF = UpgradeIntrinsicFunction(FI)) {
-upgradedFunctions.insert(std::make_pair(FI,newF));
+upgradedFunctions.insert(std::make_pair(FI, newF));
 FI->setName("");
   }
 



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


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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/lib/Analysis/DataStructure:

Local.cpp updated: 1.139 -> 1.140
---
Log message:

Split memcpy/memset/memmove intrinsics into i32/i64 versions, resolving
PR709: http://llvm.cs.uiuc.edu/PR709 , and paving the way for future progress.



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

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


Index: llvm/lib/Analysis/DataStructure/Local.cpp
diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.139 
llvm/lib/Analysis/DataStructure/Local.cpp:1.140
--- llvm/lib/Analysis/DataStructure/Local.cpp:1.139 Sun Jan 22 16:52:03 2006
+++ llvm/lib/Analysis/DataStructure/Local.cpp   Thu Mar  2 18:00:25 2006
@@ -545,8 +545,10 @@
 return;
   case Intrinsic::vaend:
 return;  // noop
-  case Intrinsic::memmove:
-  case Intrinsic::memcpy: {
+  case Intrinsic::memmove_i32:
+  case Intrinsic::memcpy_i32: 
+  case Intrinsic::memmove_i64:
+  case Intrinsic::memcpy_i64: {
 // Merge the first & second arguments, and mark the memory read and
 // modified.
 DSNodeHandle RetNH = getValueDest(**CS.arg_begin());
@@ -555,7 +557,8 @@
   N->setModifiedMarker()->setReadMarker();
 return;
   }
-  case Intrinsic::memset:
+  case Intrinsic::memset_i32:
+  case Intrinsic::memset_i64:
 // Mark the memory modified.
 if (DSNode *N = getValueDest(**CS.arg_begin()).getNode())
   N->setModifiedMarker();



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


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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen:

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

Split memcpy/memset/memmove intrinsics into i32/i64 versions, resolving
PR709: http://llvm.cs.uiuc.edu/PR709 , and paving the way for future progress.



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

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


Index: llvm/lib/CodeGen/IntrinsicLowering.cpp
diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.39 
llvm/lib/CodeGen/IntrinsicLowering.cpp:1.40
--- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.39 Mon Jan 16 15:12:35 2006
+++ llvm/lib/CodeGen/IntrinsicLowering.cpp  Thu Mar  2 18:00:25 2006
@@ -99,15 +99,18 @@
 EnsureFunctionExists(M, "abort", I->arg_end(), I->arg_end(),
  Type::VoidTy);
 break;
-  case Intrinsic::memcpy:
+  case Intrinsic::memcpy_i32:
+  case Intrinsic::memcpy_i64:
 EnsureFunctionExists(M, "memcpy", I->arg_begin(), --I->arg_end(),
  I->arg_begin()->getType());
 break;
-  case Intrinsic::memmove:
+  case Intrinsic::memmove_i32:
+  case Intrinsic::memmove_i64:
 EnsureFunctionExists(M, "memmove", I->arg_begin(), --I->arg_end(),
  I->arg_begin()->getType());
 break;
-  case Intrinsic::memset:
+  case Intrinsic::memset_i32:
+  case Intrinsic::memset_i64:
 M.getOrInsertFunction("memset", PointerType::get(Type::SByteTy),
   PointerType::get(Type::SByteTy),
   Type::IntTy, (--(--I->arg_end()))->getType(),
@@ -405,7 +408,8 @@
   CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
 break;// Simply strip out debugging intrinsics
 
-  case Intrinsic::memcpy: {
+  case Intrinsic::memcpy_i32:
+  case Intrinsic::memcpy_i64: {
 // The memcpy intrinsic take an extra alignment argument that the memcpy
 // libc function does not.
 static Function *MemcpyFCache = 0;
@@ -413,7 +417,8 @@
 (*(CI->op_begin()+1))->getType(), MemcpyFCache);
 break;
   }
-  case Intrinsic::memmove: {
+  case Intrinsic::memmove_i32: 
+  case Intrinsic::memmove_i64: {
 // The memmove intrinsic take an extra alignment argument that the memmove
 // libc function does not.
 static Function *MemmoveFCache = 0;
@@ -421,7 +426,8 @@
 (*(CI->op_begin()+1))->getType(), MemmoveFCache);
 break;
   }
-  case Intrinsic::memset: {
+  case Intrinsic::memset_i32:
+  case Intrinsic::memset_i64: {
 // The memset intrinsic take an extra alignment argument that the memset
 // libc function does not.
 static Function *MemsetFCache = 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/Assembly/AutoUpgrade.h

2006-03-02 Thread Chris Lattner


Changes in directory llvm/include/llvm/Assembly:

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

Split memcpy/memset/memmove intrinsics into i32/i64 versions, resolving
PR709: http://llvm.cs.uiuc.edu/PR709 , and paving the way for future progress.



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

 AutoUpgrade.h |   14 ++
 1 files changed, 2 insertions(+), 12 deletions(-)


Index: llvm/include/llvm/Assembly/AutoUpgrade.h
diff -u llvm/include/llvm/Assembly/AutoUpgrade.h:1.4 
llvm/include/llvm/Assembly/AutoUpgrade.h:1.5
--- llvm/include/llvm/Assembly/AutoUpgrade.h:1.4Fri Jan 27 05:49:27 2006
+++ llvm/include/llvm/Assembly/AutoUpgrade.hThu Mar  2 17:57:16 2006
@@ -24,12 +24,6 @@
   class Value;
   class BasicBlock;
 
-  /// This function determines if the \p Name provides is a name for which the
-  /// auto-upgrade to a non-overloaded name applies.
-  /// @returns True if the function name is upgradeable, false otherwise.
-  /// @brief Determine if a name is an upgradeable intrinsic name.
-  bool IsUpgradeableIntrinsicName(const std::string& Name);
-
   /// This function inspects the Function \p F to see if it is an old 
overloaded
   /// intrinsic. If it is, the Function's name is changed to add a suffix that
   /// indicates the kind of arguments or result that it accepts. In LLVM 
release
@@ -56,14 +50,10 @@
   /// non-overloaded names. This function inspects the CallInst \p CI to see 
   /// if it is a call to an old overloaded intrinsic. If it is, a new CallInst 
   /// is created that uses the correct Function and possibly casts the 
-  /// argument and result to an unsigned type.  The caller can use the 
-  /// returned Instruction to replace the existing one. Note that the
-  /// Instruction* returned could be a CallInst or a CastInst depending on
-  /// whether casting was necessary.
+  /// argument and result to an unsigned type.
   /// @param CI The CallInst to potentially auto-upgrade.
-  /// @returns An instrution to replace \p CI with.
   /// @brief Get replacement instruction for overloaded intrinsic function 
call.
-  Instruction* UpgradeIntrinsicCall(CallInst* CI, Function* newF = 0);
+  void UpgradeIntrinsicCall(CallInst* CI, Function* newF = 0);
 
   /// Upgrade both the function and all the calls made to it, if that function
   /// needs to be upgraded. This is like a combination of the above two



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


[llvm-commits] CVS: llvm/test/Regression/Bytecode/memcpy.ll memcpy.ll.bc-16

2006-03-02 Thread Chris Lattner


Changes in directory llvm/test/Regression/Bytecode:

memcpy.ll added (r1.1)
memcpy.ll.bc-16 added (r1.1)
---
Log message:

new testcases


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

 memcpy.ll   |   21 +
 memcpy.ll.bc-16 |0 
 2 files changed, 21 insertions(+)


Index: llvm/test/Regression/Bytecode/memcpy.ll
diff -c /dev/null llvm/test/Regression/Bytecode/memcpy.ll:1.1
*** /dev/null   Thu Mar  2 17:56:33 2006
--- llvm/test/Regression/Bytecode/memcpy.ll Thu Mar  2 17:56:23 2006
***
*** 0 
--- 1,21 
+ ; RUN: llvm-dis %s.bc-16 -o /dev/null -f &&
+ ; RUN: llc %s.bc-16 -o /dev/null -f -march=c &&
+ ; RUN: llvm-as < %s
+ 
+ void %test(int* %P, int* %Q) {
+ entry:
+   %tmp.1 = cast int* %P to sbyte* ;  [#uses=2]
+   %tmp.3 = cast int* %Q to sbyte* ;  [#uses=3]
+   tail call void %llvm.memcpy( sbyte* %tmp.1, sbyte* %tmp.3, uint 10, 
uint 1 )
+   tail call void %llvm.memcpy( sbyte* %tmp.1, sbyte* %tmp.3, ulong 
10, uint 1 )
+   tail call void %llvm.memset( sbyte* %tmp.3, ubyte 14, uint 1, uint 
0 )
+   tail call void %llvm.memmove( sbyte* %tmp.1, sbyte* %tmp.3, uint 
123124, uint 1 )
+   ret void
+ }
+ 
+ declare void %llvm.memcpy(sbyte*, sbyte*, uint, uint)
+ declare void %llvm.memcpy(sbyte*, sbyte*, ulong, uint)
+ 
+ declare void %llvm.memset(sbyte*, ubyte, uint, uint)
+ 
+ declare void %llvm.memmove(sbyte*, sbyte*, uint, uint)


Index: llvm/test/Regression/Bytecode/memcpy.ll.bc-16



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


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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/docs:

LangRef.html updated: 1.135 -> 1.136
---
Log message:

Update the llvm.memset/memcpy/memmove intrinsics to reflect the recent split
into types.


---
Diffs of the changes:  (+33 -26)

 LangRef.html |   59 +--
 1 files changed, 33 insertions(+), 26 deletions(-)


Index: llvm/docs/LangRef.html
diff -u llvm/docs/LangRef.html:1.135 llvm/docs/LangRef.html:1.136
--- llvm/docs/LangRef.html:1.135Fri Feb 17 15:18:08 2006
+++ llvm/docs/LangRef.html  Thu Mar  2 18:07:20 2006
@@ -152,9 +152,9 @@
 
   Standard C Library Intrinsics
 
-  'llvm.memcpy' Intrinsic
-  'llvm.memmove' Intrinsic
-  'llvm.memset' Intrinsic
+  'llvm.memcpy.*' Intrinsic
+  'llvm.memmove.*' Intrinsic
+  'llvm.memset.*' Intrinsic
   'llvm.isunordered.*' 
Intrinsic
   'llvm.sqrt.*' Intrinsic
 
@@ -3483,27 +3483,29 @@
 
 Syntax:
 
-  declare void %llvm.memcpy(sbyte* , sbyte* ,
-uint , uint )
+  declare void %llvm.memcpy.i32(sbyte* , sbyte* ,
+uint , uint )
+  declare void %llvm.memcpy.i64(sbyte* , sbyte* ,
+ulong , uint )
 
 
 Overview:
 
 
-The 'llvm.memcpy' intrinsic copies a block of memory from the source
+The 'llvm.memcpy.*' intrinsics copy a block of memory from the source
 location to the destination location.
 
 
 
-Note that, unlike the standard libc function, the llvm.memcpy 
intrinsic
-does not return a value, and takes an extra alignment argument.
+Note that, unlike the standard libc function, the llvm.memcpy.* 
+intrinsics do not return a value, and takes an extra alignment argument.
 
 
 Arguments:
 
 
 The first argument is a pointer to the destination, the second is a pointer to
-the source.  The third argument is an (arbitrarily sized) integer argument
+the source.  The third argument is an integer argument
 specifying the number of bytes to copy, and the fourth argument is the 
alignment
 of the source and destination locations.
 
@@ -3517,7 +3519,7 @@
 Semantics:
 
 
-The 'llvm.memcpy' intrinsic copies a block of memory from the source
+The 'llvm.memcpy.*' intrinsics copy a block of memory from the source
 location to the destination location, which are not allowed to overlap.  It
 copies "len" bytes of memory over.  If the argument is known to be aligned to
 some boundary, this can be specified as the fourth argument, otherwise it 
should
@@ -3535,28 +3537,30 @@
 
 Syntax:
 
-  declare void %llvm.memmove(sbyte* , sbyte* ,
- uint , uint )
+  declare void %llvm.memmove.i32(sbyte* , sbyte* ,
+ uint , uint )
+  declare void %llvm.memmove.i64(sbyte* , sbyte* ,
+ ulong , uint )
 
 
 Overview:
 
 
-The 'llvm.memmove' intrinsic moves a block of memory from the source
-location to the destination location. It is similar to the 
'llvm.memcpy' 
-intrinsic but allows the two memory locations to overlap.
+The 'llvm.memmove.*' intrinsics move a block of memory from the source
+location to the destination location. It is similar to the
+'llvm.memcmp' intrinsic but allows the two memory locations to 
overlap.
 
 
 
-Note that, unlike the standard libc function, the llvm.memmove 
intrinsic
-does not return a value, and takes an extra alignment argument.
+Note that, unlike the standard libc function, the llvm.memmove.* 
+intrinsics do not return a value, and takes an extra alignment argument.
 
 
 Arguments:
 
 
 The first argument is a pointer to the destination, the second is a pointer to
-the source.  The third argument is an (arbitrarily sized) integer argument
+the source.  The third argument is an integer argument
 specifying the number of bytes to copy, and the fourth argument is the 
alignment
 of the source and destination locations.
 
@@ -3570,7 +3574,7 @@
 Semantics:
 
 
-The 'llvm.memmove' intrinsic copies a block of memory from the source
+The 'llvm.memmove.*' intrinsics copy a block of memory from the source
 location to the destination location, which may overlap.  It
 copies "len" bytes of memory over.  If the argument is known to be aligned to
 some boundary, this can be specified as the fourth argument, otherwise it 
should
@@ -3581,21 +3585,23 @@
 
 
 
-  'llvm.memset' Intrinsic
+  'llvm.memset.*' Intrinsics
 
 
 
 
 Syntax:
 
-  declare void %llvm.memset(sbyte* , ubyte ,
-uint , uint )
+  declare void %llvm.memset.i32(sbyte* , ubyte ,
+uint , uint )
+  declare void %llvm.memset.i64(sbyte* , ubyte ,
+ulong , uint )
 
 
 Overview:
 
 
-The 'llvm.memset' intrinsic fills a blo

[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/io.llx ioport.llx

2006-03-02 Thread Chris Lattner


Changes in directory llvm/test/Regression/CodeGen/X86:

io.llx (r1.1) removed
ioport.llx (r1.2) removed
---
Log message:

Remove these testcases.  These intrinsics are going away



---
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] CVS: llvm/include/llvm/Intrinsics.h

2006-03-02 Thread Chris Lattner


Changes in directory llvm/include/llvm:

Intrinsics.h updated: 1.37 -> 1.38
---
Log message:

remove the read/write port/io intrinsics.


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

 Intrinsics.h |7 ---
 1 files changed, 7 deletions(-)


Index: llvm/include/llvm/Intrinsics.h
diff -u llvm/include/llvm/Intrinsics.h:1.37 llvm/include/llvm/Intrinsics.h:1.38
--- llvm/include/llvm/Intrinsics.h:1.37 Thu Mar  2 17:57:16 2006
+++ llvm/include/llvm/Intrinsics.h  Thu Mar  2 18:18:00 2006
@@ -86,13 +86,6 @@
 cttz_i16,   // Count trailing zeros of short
 cttz_i32,   // Count trailing zeros of int
 cttz_i64,   // Count trailing zeros of long
-
-// Input/Output intrinsics.
-readport,
-writeport,
-readio,
-writeio
-
   };
 
 } // End Intrinsic namespace



___
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-03-02 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.175 -> 1.176
---
Log message:

Split memcpy/memset/memmove intrinsics into i32/i64 versions, resolving
PR709: http://llvm.cs.uiuc.edu/PR709 , and paving the way for future progress.



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

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


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.175 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.176
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.175Tue Feb 28 
19:09:54 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Thu Mar  2 18:00:25 2006
@@ -955,9 +955,18 @@
   case Intrinsic::longjmp:
 return "_longjmp"+!TLI.usesUnderscoreSetJmpLongJmp();
 break;
-  case Intrinsic::memcpy:  visitMemIntrinsic(I, ISD::MEMCPY); return 0;
-  case Intrinsic::memset:  visitMemIntrinsic(I, ISD::MEMSET); return 0;
-  case Intrinsic::memmove: visitMemIntrinsic(I, ISD::MEMMOVE); return 0;
+  case Intrinsic::memcpy_i32:
+  case Intrinsic::memcpy_i64:
+visitMemIntrinsic(I, ISD::MEMCPY);
+return 0;
+  case Intrinsic::memset_i32:
+  case Intrinsic::memset_i64:
+visitMemIntrinsic(I, ISD::MEMSET);
+return 0;
+  case Intrinsic::memmove_i32:
+  case Intrinsic::memmove_i64:
+visitMemIntrinsic(I, ISD::MEMMOVE);
+return 0;
 
   case Intrinsic::readport:
   case Intrinsic::readio: {



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


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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.308 -> 1.309
SelectionDAG.cpp updated: 1.262 -> 1.263
SelectionDAGISel.cpp updated: 1.176 -> 1.177
---
Log message:

remove the read/write port/io intrinsics.


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

 LegalizeDAG.cpp  |   62 ---
 SelectionDAG.cpp |6 
 SelectionDAGISel.cpp |   23 --
 3 files changed, 91 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.308 
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.309
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.308 Tue Feb 28 19:09:54 2006
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp   Thu Mar  2 18:19:44 2006
@@ -1691,68 +1691,6 @@
 break;
   }
 
-  case ISD::READPORT:
-Tmp1 = LegalizeOp(Node->getOperand(0));
-Tmp2 = LegalizeOp(Node->getOperand(1));
-Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2);
-
-// Since these produce two values, make sure to remember that we legalized
-// both of them.
-AddLegalizedOperand(SDOperand(Node, 0), Result.getValue(0));
-AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
-return Result;
-  case ISD::WRITEPORT:
-Tmp1 = LegalizeOp(Node->getOperand(0));
-Tmp2 = LegalizeOp(Node->getOperand(1));
-Tmp3 = LegalizeOp(Node->getOperand(2));
-Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3);
-break;
-
-  case ISD::READIO:
-Tmp1 = LegalizeOp(Node->getOperand(0));
-Tmp2 = LegalizeOp(Node->getOperand(1));
-
-switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
-case TargetLowering::Custom:
-default: assert(0 && "This action not implemented for this operation!");
-case TargetLowering::Legal:
-  Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2);
-  break;
-case TargetLowering::Expand:
-  // Replace this with a load from memory.
-  Result = DAG.getLoad(Node->getValueType(0), Node->getOperand(0),
-   Node->getOperand(1), DAG.getSrcValue(NULL));
-  Result = LegalizeOp(Result);
-  break;
-}
-
-// Since these produce two values, make sure to remember that we legalized
-// both of them.
-AddLegalizedOperand(SDOperand(Node, 0), Result.getValue(0));
-AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
-return Result.getValue(Op.ResNo);
-
-  case ISD::WRITEIO:
-Tmp1 = LegalizeOp(Node->getOperand(0));
-Tmp2 = LegalizeOp(Node->getOperand(1));
-Tmp3 = LegalizeOp(Node->getOperand(2));
-
-switch (TLI.getOperationAction(Node->getOpcode(),
-   Node->getOperand(1).getValueType())) {
-case TargetLowering::Custom:
-default: assert(0 && "This action not implemented for this operation!");
-case TargetLowering::Legal:
-  Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3);
-  break;
-case TargetLowering::Expand:
-  // Replace this with a store to memory.
-  Result = DAG.getNode(ISD::STORE, MVT::Other, Node->getOperand(0),
-   Node->getOperand(1), Node->getOperand(2),
-   DAG.getSrcValue(NULL));
-  break;
-}
-break;
-
   case ISD::SHL_PARTS:
   case ISD::SRA_PARTS:
   case ISD::SRL_PARTS: {


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.262 
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.263
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.262Tue Feb 28 
18:51:13 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp  Thu Mar  2 18:19:44 2006
@@ -2691,12 +2691,6 @@
   case ISD::CTTZ:return "cttz";
   case ISD::CTLZ:return "ctlz";
 
-  // IO Intrinsics
-  case ISD::READPORT: return "readport";
-  case ISD::WRITEPORT: return "writeport";
-  case ISD::READIO: return "readio";
-  case ISD::WRITEIO: return "writeio";
-
   // Debug info
   case ISD::LOCATION: return "location";
   case ISD::DEBUG_LOC: return "debug_loc";


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.176 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.177
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.176Thu Mar  2 
18:00:25 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Thu Mar  2 18:19:44 2006
@@ -968,29 +968,6 @@
 visitMemIntrinsic(I, ISD::MEMMOVE);
 return 0;
 
-  case Intrinsic::readport:
-  case Intrinsic::readio: {
-std::vector VTs;
-VTs.push_back(TLI.getValueType(I.getType()));
-VTs.push_back(MVT::Other);
-std::vector Ops;
-Ops.push_back(getRoot());
-Ops.push_back(getValue(I.getOperand(1)));
-SDOperand Tmp = DAG.getNode(Intrinsic == Intrinsic::readport ?
-ISD::READPORT : ISD::READIO, VTs, Ops);
-
-setValue(&I, Tmp);
-DAG.set

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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/docs:

LangRef.html updated: 1.136 -> 1.137
---
Log message:

remove the read/write port/io intrinsics.


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

 LangRef.html |  202 ---
 1 files changed, 1 insertion(+), 201 deletions(-)


Index: llvm/docs/LangRef.html
diff -u llvm/docs/LangRef.html:1.136 llvm/docs/LangRef.html:1.137
--- llvm/docs/LangRef.html:1.136Thu Mar  2 18:07:20 2006
+++ llvm/docs/LangRef.html  Thu Mar  2 18:19:58 2006
@@ -143,13 +143,6 @@
   llvm.readcyclecounter' 
Intrinsic
 
   
-  Operating System Intrinsics
-
-  'llvm.readport' Intrinsic
-  'llvm.writeport' 
Intrinsic
-  'llvm.readio'   Intrinsic
-  'llvm.writeio'   Intrinsic
-
   Standard C Library Intrinsics
 
   'llvm.memcpy.*' Intrinsic
@@ -3266,199 +3259,6 @@
 
 
 
-
-
-
-  Operating System Intrinsics
-
-
-
-
-These intrinsics are provided by LLVM to support the implementation of
-operating system level code.
-
-
-
-
-
-
-  'llvm.readport' Intrinsic
-
-
-
-
-Syntax:
-
-  declare  %llvm.readport ( 
) - - -Overview: - - -The 'llvm.readport' intrinsic reads data from the specified hardware -I/O port. - - -Arguments: - - -The argument to this intrinsic indicates the hardware I/O address from which -to read the data. The address is in the hardware I/O address namespace (as -opposed to being a memory location for memory mapped I/O). - - -Semantics: - - -The 'llvm.readport' intrinsic reads data from the hardware I/O port -specified by address and returns the value. The address and return -value must be integers, but the size is dependent upon the platform upon which -the program is code generated. For example, on x86, the address must be an -unsigned 16-bit value, and the return value must be 8, 16, or 32 bits. - - - - - - - 'llvm.writeport' Intrinsic - - - - -Syntax: - - call void (, )* -%llvm.writeport ( , -
) - - -Overview: - - -The 'llvm.writeport' intrinsic writes data to the specified hardware -I/O port. - - -Arguments: - - -The first argument is the value to write to the I/O port. - - - -The second argument indicates the hardware I/O address to which data should be -written. The address is in the hardware I/O address namespace (as opposed to -being a memory location for memory mapped I/O). - - -Semantics: - - -The 'llvm.writeport' intrinsic writes value to the I/O port -specified by address. The address and value must be integers, but the -size is dependent upon the platform upon which the program is code generated. -For example, on x86, the address must be an unsigned 16-bit value, and the -value written must be 8, 16, or 32 bits in length. - - - - - - - 'llvm.readio' Intrinsic - - - - -Syntax: - - declare %llvm.readio ( * ) - - -Overview: - - -The 'llvm.readio' intrinsic reads data from a memory mapped I/O -address. - - -Arguments: - - -The argument to this intrinsic is a pointer indicating the memory address from -which to read the data. The data must be a -first class type. - - -Semantics: - - -The 'llvm.readio' intrinsic reads data from a memory mapped I/O -location specified by pointer and returns the value. The argument must -be a pointer, and the return value must be a -first class type. However, certain architectures -may not support I/O on all first class types. For example, 32-bit processors -may only support I/O on data types that are 32 bits or less. - - - -This intrinsic enforces an in-order memory model for llvm.readio and -llvm.writeio calls on machines that use dynamic scheduling. Dynamically -scheduled processors may execute loads and stores out of order, re-ordering at -run time accesses to memory mapped I/O registers. Using these intrinsics -ensures that accesses to memory mapped I/O registers occur in program order. - - - - - - - 'llvm.writeio' Intrinsic - - - - -Syntax: - - declare void %llvm.writeio ( , * ) - - -Overview: - - -The 'llvm.writeio' intrinsic writes data to the specified memory -mapped I/O address. - - -Arguments: - - -The first argument is the value to write to the memory mapped I/O location. -The second argument is a pointer indicating the memory address to which the -data should be written. - - -Semantics: - - -The 'llvm.writeio' intrinsic writes value to the memory mapped -I/O address specified by pointer. The value must be a -first class type. However, certain architectures -may not support I/O on all first class types. For example, 32-bit processors -may only support I/O on data types that are 32 bits or less. - - - -This intrinsic enforces an in-order memory model for llvm.readio and -llvm.writeio calls on machines that use dynamic scheduling. Dynamically -scheduled processors may execute loads and

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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.98 -> 1.99
X86InstrInfo.td updated: 1.250 -> 1.251
---
Log message:

remove the read/write port/io intrinsics.


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

 X86ISelLowering.cpp |9 -
 X86InstrInfo.td |   24 
 2 files changed, 12 insertions(+), 21 deletions(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.98 
llvm/lib/Target/X86/X86ISelLowering.cpp:1.99
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.98Tue Feb 28 19:11:20 2006
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Thu Mar  2 18:19:44 2006
@@ -137,15 +137,6 @@
   setOperationAction(ISD::READCYCLECOUNTER , MVT::i64  , Custom);
   setOperationAction(ISD::BSWAP, MVT::i16  , Expand);
 
-  setOperationAction(ISD::READIO   , MVT::i1   , Expand);
-  setOperationAction(ISD::READIO   , MVT::i8   , Expand);
-  setOperationAction(ISD::READIO   , MVT::i16  , Expand);
-  setOperationAction(ISD::READIO   , MVT::i32  , Expand);
-  setOperationAction(ISD::WRITEIO  , MVT::i1   , Expand);
-  setOperationAction(ISD::WRITEIO  , MVT::i8   , Expand);
-  setOperationAction(ISD::WRITEIO  , MVT::i16  , Expand);
-  setOperationAction(ISD::WRITEIO  , MVT::i32  , Expand);
-
   // These should be promoted to a larger select which is supported.
   setOperationAction(ISD::SELECT   , MVT::i1   , Promote);
   setOperationAction(ISD::SELECT   , MVT::i8   , Promote);


Index: llvm/lib/Target/X86/X86InstrInfo.td
diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.250 
llvm/lib/Target/X86/X86InstrInfo.td:1.251
--- llvm/lib/Target/X86/X86InstrInfo.td:1.250   Sat Feb 25 04:02:21 2006
+++ llvm/lib/Target/X86/X86InstrInfo.td Thu Mar  2 18:19:44 2006
@@ -581,48 +581,48 @@
 //
 def IN8rr  : I<0xEC, RawFrm, (ops),
"in{b} {%dx, %al|%AL, %DX}",
-   [(set AL, (readport DX))]>,  Imp<[DX], [AL]>;
+   []>,  Imp<[DX], [AL]>;
 def IN16rr : I<0xED, RawFrm, (ops),
"in{w} {%dx, %ax|%AX, %DX}",
-   [(set AX, (readport DX))]>,  Imp<[DX], [AX]>, OpSize;
+   []>,  Imp<[DX], [AX]>, OpSize;
 def IN32rr : I<0xED, RawFrm, (ops),
"in{l} {%dx, %eax|%EAX, %DX}",
-   [(set EAX, (readport DX))]>, Imp<[DX],[EAX]>;
+   []>, Imp<[DX],[EAX]>;
 
 def IN8ri  : Ii8<0xE4, RawFrm, (ops i16i8imm:$port),
   "in{b} {$port, %al|%AL, $port}",
- [(set AL, (readport i16immZExt8:$port))]>,
+ []>,
  Imp<[], [AL]>;
 def IN16ri : Ii8<0xE5, RawFrm, (ops i16i8imm:$port),
   "in{w} {$port, %ax|%AX, $port}",
- [(set AX, (readport i16immZExt8:$port))]>,
+ []>,
  Imp<[], [AX]>, OpSize;
 def IN32ri : Ii8<0xE5, RawFrm, (ops i16i8imm:$port),
   "in{l} {$port, %eax|%EAX, $port}",
- [(set EAX, (readport i16immZExt8:$port))]>,
+ []>,
  Imp<[],[EAX]>;
 
 def OUT8rr  : I<0xEE, RawFrm, (ops),
 "out{b} {%al, %dx|%DX, %AL}",
-[(writeport AL, DX)]>,  Imp<[DX,  AL], []>;
+[]>,  Imp<[DX,  AL], []>;
 def OUT16rr : I<0xEF, RawFrm, (ops),
 "out{w} {%ax, %dx|%DX, %AX}",
-[(writeport AX, DX)]>,  Imp<[DX,  AX], []>, OpSize;
+[]>,  Imp<[DX,  AX], []>, OpSize;
 def OUT32rr : I<0xEF, RawFrm, (ops),
 "out{l} {%eax, %dx|%DX, %EAX}",
-[(writeport EAX, DX)]>, Imp<[DX, EAX], []>;
+[]>, Imp<[DX, EAX], []>;
 
 def OUT8ir  : Ii8<0xE6, RawFrm, (ops i16i8imm:$port),
"out{b} {%al, $port|$port, %AL}",
-   [(writeport AL, i16immZExt8:$port)]>,
+   []>,
   Imp<[AL], []>;
 def OUT16ir : Ii8<0xE7, RawFrm, (ops i16i8imm:$port),
"out{w} {%ax, $port|$port, %AX}",
-   [(writeport AX, i16immZExt8:$port)]>,
+   []>,
   Imp<[AX], []>, OpSize;
 def OUT32ir : Ii8<0xE7, RawFrm, (ops i16i8imm:$port),
"out{l} {%eax, $port|$port, %EAX}",
-   [(writeport EAX, i16immZExt8:$port)]>,
+   []>,
   Imp<[EAX], []>;
 
 
//===--===//



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


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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/include/llvm/CodeGen:

SelectionDAGNodes.h updated: 1.105 -> 1.106
---
Log message:

remove the read/write port/io intrinsics.


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

 SelectionDAGNodes.h |6 --
 1 files changed, 6 deletions(-)


Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.105 
llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.106
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.105 Tue Feb 28 18:51:13 2006
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h   Thu Mar  2 18:18:00 2006
@@ -379,12 +379,6 @@
 // register (or other high accuracy low latency clock source)
 READCYCLECOUNTER,
 
-// READPORT, WRITEPORT, READIO, WRITEIO - These correspond to the LLVM
-// intrinsics of the same name.  The first operand is a token chain, the
-// other operands match the intrinsic.  These produce a token chain in
-// addition to a value (if any).
-READPORT, WRITEPORT, READIO, WRITEIO,
-
 // HANDLENODE node - Used as a handle for various purposes.
 HANDLENODE,
 



___
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 Verifier.cpp

2006-03-02 Thread Chris Lattner


Changes in directory llvm/lib/VMCore:

Function.cpp updated: 1.101 -> 1.102
Verifier.cpp updated: 1.147 -> 1.148
---
Log message:

remove the read/write port/io intrinsics.


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

 Function.cpp |6 --
 Verifier.cpp |   45 -
 2 files changed, 51 deletions(-)


Index: llvm/lib/VMCore/Function.cpp
diff -u llvm/lib/VMCore/Function.cpp:1.101 llvm/lib/VMCore/Function.cpp:1.102
--- llvm/lib/VMCore/Function.cpp:1.101  Thu Mar  2 17:58:40 2006
+++ llvm/lib/VMCore/Function.cppThu Mar  2 18:19:44 2006
@@ -265,8 +265,6 @@
 break;
   case 'r':
 if (Name == "llvm.returnaddress")return Intrinsic::returnaddress;
-if (Name == "llvm.readport") return Intrinsic::readport;
-if (Name == "llvm.readio")   return Intrinsic::readio;
 if (Name == "llvm.readcyclecounter") return Intrinsic::readcyclecounter;
 break;
   case 's':
@@ -283,10 +281,6 @@
 if (Name == "llvm.va_end")   return Intrinsic::vaend;
 if (Name == "llvm.va_start") return Intrinsic::vastart;
 break;
-  case 'w':
-if (Name == "llvm.writeport") return Intrinsic::writeport;
-if (Name == "llvm.writeio")   return Intrinsic::writeio;
-break;
   }
   // The "llvm." namespace is reserved!
   assert(!"Unknown LLVM intrinsic function!");


Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.147 llvm/lib/VMCore/Verifier.cpp:1.148
--- llvm/lib/VMCore/Verifier.cpp:1.147  Thu Mar  2 17:58:40 2006
+++ llvm/lib/VMCore/Verifier.cppThu Mar  2 18:19:44 2006
@@ -702,51 +702,6 @@
 NumArgs = 1;
 break;
 
-  // Verify that read and write port have integral parameters of the correct
-  // signed-ness.
-  case Intrinsic::writeport:
-Assert1(FT->getNumParams() == 2,
-"Illegal # arguments for intrinsic function!", IF);
-Assert1(FT->getParamType(0)->isIntegral(),
-"First argument not unsigned int!", IF);
-Assert1(FT->getParamType(1)->isUnsigned(),
-"First argument not unsigned int!", IF);
-NumArgs = 2;
-break;
-
-  case Intrinsic::writeio:
-Assert1(FT->getNumParams() == 2,
-"Illegal # arguments for intrinsic function!", IF);
-Assert1(FT->getParamType(0)->isFirstClassType(),
-"First argument not a first class type!", IF);
-Assert1(isa(FT->getParamType(1)),
-"Second argument not a pointer!", IF);
-NumArgs = 2;
-break;
-
-  case Intrinsic::readport:
-Assert1(FT->getNumParams() == 1,
-"Illegal # arguments for intrinsic function!", IF);
-Assert1(FT->getReturnType()->isFirstClassType(),
-"Return type is not a first class type!", IF);
-Assert1(FT->getParamType(0)->isUnsigned(),
-"First argument not unsigned int!", IF);
-NumArgs = 1;
-break;
-
-  case Intrinsic::readio: {
-const PointerType *ParamType = dyn_cast(FT->getParamType(0));
-const Type *ReturnType = FT->getReturnType();
-
-Assert1(FT->getNumParams() == 1,
-"Illegal # arguments for intrinsic function!", IF);
-Assert1(ParamType, "First argument not a pointer!", IF);
-Assert1(ParamType->getElementType() == ReturnType,
-"Pointer type doesn't match return type!", IF);
-NumArgs = 1;
-break;
-  }
-
   case Intrinsic::isunordered_f32:
 Assert1(FT->getNumParams() == 2,
 "Illegal # arguments for intrinsic function!", IF);



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


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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/lib/Target:

TargetSelectionDAG.td updated: 1.48 -> 1.49
---
Log message:

remove the read/write port/io intrinsics.


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

 TargetSelectionDAG.td |   11 ---
 1 files changed, 11 deletions(-)


Index: llvm/lib/Target/TargetSelectionDAG.td
diff -u llvm/lib/Target/TargetSelectionDAG.td:1.48 
llvm/lib/Target/TargetSelectionDAG.td:1.49
--- llvm/lib/Target/TargetSelectionDAG.td:1.48  Thu Feb 16 23:43:56 2006
+++ llvm/lib/Target/TargetSelectionDAG.td   Thu Mar  2 18:19:44 2006
@@ -138,14 +138,6 @@
 
 def SDTRet : SDTypeProfile<0, 0, []>; // ret
 
-def SDTReadPort : SDTypeProfile<1, 1, [ // readport
-  SDTCisInt<0>, SDTCisInt<1>
-]>;
-
-def SDTWritePort : SDTypeProfile<0, 2, [ // writeport
-  SDTCisInt<0>, SDTCisInt<1>
-]>;
-
 def SDTLoad : SDTypeProfile<1, 1, [ // load
   SDTCisPtrTy<1>  
 ]>;
@@ -284,9 +276,6 @@
 def br : SDNode<"ISD::BR" , SDTBr, [SDNPHasChain]>;
 def ret: SDNode<"ISD::RET", SDTRet,[SDNPHasChain]>;
 
-def readport   : SDNode<"ISD::READPORT"   , SDTReadPort,  [SDNPHasChain]>;
-def writeport  : SDNode<"ISD::WRITEPORT"  , SDTWritePort, [SDNPHasChain]>;
-
 def load   : SDNode<"ISD::LOAD"   , SDTLoad,  [SDNPHasChain]>;
 def store  : SDNode<"ISD::STORE"  , SDTStore, [SDNPHasChain]>;
 



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


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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/docs:

ReleaseNotes.html updated: 1.346 -> 1.347
---
Log message:

mention some major changes


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

 ReleaseNotes.html |   31 ---
 1 files changed, 24 insertions(+), 7 deletions(-)


Index: llvm/docs/ReleaseNotes.html
diff -u llvm/docs/ReleaseNotes.html:1.346 llvm/docs/ReleaseNotes.html:1.347
--- llvm/docs/ReleaseNotes.html:1.346   Sun Feb  5 00:39:36 2006
+++ llvm/docs/ReleaseNotes.html Thu Mar  2 18:34:26 2006
@@ -76,10 +76,26 @@
 
 
 
+New C front-end.
 New SPARC backend.
+Inline assembly support.
 
 
 
+
+
+Significant changes in LLVM 1.7cvs
+
+
+
+
+Removed the llvm.readport/llvm.writeport/llvm.readio/llvm.writeio
+intrinsics.
+Separated the other intrinsics based on type.
+
+
+
+
 
 
   Portability and Supported Platforms
@@ -184,6 +200,10 @@
 Bugs
 
 
+
+These bugs are known for the old front-end.  The new GCC-4-based C front-end
+suffers from none of these.
+
 
 C99 Variable sized arrays do not release stack memory when they go out of 
 scope.  Thus, the following program may run out of stack space:
@@ -209,8 +229,6 @@
 
 
 
-Inline assembly is not yet supported.
-
 "long double" is transformed by the front-end into "double".  There is no
 support for floating point data types of any size other than 32 and 64
 bits.
@@ -436,8 +454,7 @@
 
 
 
-http://llvm.org/PR566";>Memory Mapped I/O Intrinsics do not fence 
-memory
+None yet
 
 
 
@@ -517,13 +534,13 @@
 
 
 
-  Known problems with the SPARC back-end
+  Known problems with the SPARC back-end
 
 
 
 
 
-This backend lacks a JIT compiler.
+None yet.
 
 
 
@@ -560,7 +577,7 @@
   src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!" />
 
   http://llvm.org/";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2006/02/05 06:39:36 $
+  Last modified: $Date: 2006/03/03 00:34:26 $
 
 
 



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


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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/lib/Analysis/IPA:

Andersens.cpp updated: 1.26 -> 1.27
---
Log message:

updates for recent changes


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

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


Index: llvm/lib/Analysis/IPA/Andersens.cpp
diff -u llvm/lib/Analysis/IPA/Andersens.cpp:1.26 
llvm/lib/Analysis/IPA/Andersens.cpp:1.27
--- llvm/lib/Analysis/IPA/Andersens.cpp:1.26Sun Jan 22 17:19:18 2006
+++ llvm/lib/Analysis/IPA/Andersens.cpp Thu Mar  2 19:21:36 2006
@@ -607,7 +607,8 @@
   F->getName() == "atol" || F->getName() == "atoll" ||
   F->getName() == "remove" || F->getName() == "unlink" ||
   F->getName() == "rename" || F->getName() == "memcmp" ||
-  F->getName() == "llvm.memset" ||
+  F->getName() == "llvm.memset.i32" ||
+  F->getName() == "llvm.memset.i64" ||
   F->getName() == "strcmp" || F->getName() == "strncmp" ||
   F->getName() == "execl" || F->getName() == "execlp" ||
   F->getName() == "execle" || F->getName() == "execv" ||
@@ -645,7 +646,8 @@
 
 
   // These functions do induce points-to edges.
-  if (F->getName() == "llvm.memcpy" || F->getName() == "llvm.memmove" ||
+  if (F->getName() == "llvm.memcpy.i32" || F->getName() == "llvm.memcpy.i64" 
|| 
+  F->getName() == "llvm.memmove.i32" ||F->getName() == "llvm.memmove.i64" 
||
   F->getName() == "memmove") {
 // Note: this is a poor approximation, this says Dest = Src, instead of
 // *Dest = *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/IPO/SimplifyLibCalls.cpp

2006-03-02 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/IPO:

SimplifyLibCalls.cpp updated: 1.62 -> 1.63
---
Log message:

Make this work with renamed intrinsics.


---
Diffs of the changes:  (+25 -26)

 SimplifyLibCalls.cpp |   51 +--
 1 files changed, 25 insertions(+), 26 deletions(-)


Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.62 
llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.63
--- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.62   Wed Feb 15 15:13:37 2006
+++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cppThu Mar  2 19:30:23 2006
@@ -283,8 +283,11 @@
   Function* get_memcpy() {
 if (!memcpy_func) {
   const Type *SBP = PointerType::get(Type::SByteTy);
-  memcpy_func = M->getOrInsertFunction("llvm.memcpy", Type::VoidTy,SBP, 
SBP,
-   TD->getIntPtrType(), Type::UIntTy, 
NULL);
+  const char *N = TD->getIntPtrType() == Type::UIntTy ?
+"llvm.memcpy.i32" : "llvm.memcpy.i64";
+  memcpy_func = M->getOrInsertFunction(N, Type::VoidTy, SBP, SBP,
+   TD->getIntPtrType(), Type::UIntTy,
+   NULL);
 }
 return memcpy_func;
   }
@@ -1018,16 +1021,9 @@
 /// bytes depending on the length of the string and the alignment. Additional
 /// optimizations are possible in code generation (sequence of immediate store)
 /// @brief Simplify the memcpy library function.
-struct LLVMMemCpyOptimization : public LibCallOptimization {
-  /// @brief Default Constructor
-  LLVMMemCpyOptimization() : LibCallOptimization("llvm.memcpy",
-  "Number of 'llvm.memcpy' calls simplified") {}
-
-protected:
-  /// @brief Subclass Constructor
-  LLVMMemCpyOptimization(const char* fname, const char* desc)
-: LibCallOptimization(fname, desc) {}
-public:
+struct LLVMMemCpyMoveOptzn : public LibCallOptimization {
+  LLVMMemCpyMoveOptzn(const char* fname, const char* desc)
+  : LibCallOptimization(fname, desc) {}
 
   /// @brief Make sure that the "memcpy" function has the right prototype
   virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& TD) 
{
@@ -1086,27 +1082,26 @@
 ci->eraseFromParent();
 return true;
   }
-} LLVMMemCpyOptimizer;
-
-/// This LibCallOptimization will simplify a call to the memmove library
-/// function. It is identical to MemCopyOptimization except for the name of
-/// the intrinsic.
-/// @brief Simplify the memmove library function.
-struct LLVMMemMoveOptimization : public LLVMMemCpyOptimization {
-  /// @brief Default Constructor
-  LLVMMemMoveOptimization() : LLVMMemCpyOptimization("llvm.memmove",
-  "Number of 'llvm.memmove' calls simplified") {}
+};
 
-} LLVMMemMoveOptimizer;
+/// This LibCallOptimization will simplify a call to the memcpy/memmove library
+/// functions.
+LLVMMemCpyMoveOptzn LLVMMemCpyOptimizer32("llvm.memcpy.i32",
+"Number of 'llvm.memcpy' calls 
simplified");
+LLVMMemCpyMoveOptzn LLVMMemCpyOptimizer64("llvm.memcpy.i64",
+   "Number of 'llvm.memcpy' calls simplified");
+LLVMMemCpyMoveOptzn LLVMMemMoveOptimizer32("llvm.memmove.i32",
+   "Number of 'llvm.memmove' calls 
simplified");
+LLVMMemCpyMoveOptzn LLVMMemMoveOptimizer64("llvm.memmove.i64",
+   "Number of 'llvm.memmove' calls 
simplified");
 
 /// This LibCallOptimization will simplify a call to the memset library
 /// function by expanding it out to a single store of size 0, 1, 2, 4, or 8
 /// bytes depending on the length argument.
 struct LLVMMemSetOptimization : public LibCallOptimization {
   /// @brief Default Constructor
-  LLVMMemSetOptimization() : LibCallOptimization("llvm.memset",
+  LLVMMemSetOptimization(const char *Name) : LibCallOptimization(Name,
   "Number of 'llvm.memset' calls simplified") {}
-public:
 
   /// @brief Make sure that the "memset" function has the right prototype
   virtual bool ValidateCalledFunction(const Function *F, SimplifyLibCalls &TD) 
{
@@ -1196,7 +1191,11 @@
 ci->eraseFromParent();
 return true;
   }
-} LLVMMemSetOptimizer;
+};
+
+LLVMMemSetOptimization MemSet32Optimizer("llvm.memset.i32");
+LLVMMemSetOptimization MemSet64Optimizer("llvm.memset.i64");
+
 
 /// This LibCallOptimization will simplify calls to the "pow" library
 /// function. It looks for cases where the result of pow is well known and



___
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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.446 -> 1.447
---
Log message:

Change this to work with renamed intrinsics.


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

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


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.446 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.447
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.446   Thu Mar  2 
00:50:58 2006
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Mar  2 19:34:17 2006
@@ -5286,7 +5286,13 @@
   if (GlobalVariable *GVSrc = dyn_cast(MMI->getSource()))
 if (GVSrc->isConstant()) {
   Module *M = CI.getParent()->getParent()->getParent();
-  Function *MemCpy = M->getOrInsertFunction("llvm.memcpy",
+  const char *Name;
+  if (CI.getCalledFunction()->getFunctionType()->getParamType(3) == 
+  Type::UIntTy)
+Name = "llvm.memcpy.i32";
+  else
+Name = "llvm.memcpy.i64";
+  Function *MemCpy = M->getOrInsertFunction(Name,
  
CI.getCalledFunction()->getFunctionType());
   CI.setOperand(0, MemCpy);
   Changed = true;



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


[llvm-commits] CVS: llvm/examples/BFtoLLVM/BFtoLLVM.cpp

2006-03-02 Thread Chris Lattner


Changes in directory llvm/examples/BFtoLLVM:

BFtoLLVM.cpp updated: 1.3 -> 1.4
---
Log message:

Upgrade this to use the new intrinsic names


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

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


Index: llvm/examples/BFtoLLVM/BFtoLLVM.cpp
diff -u llvm/examples/BFtoLLVM/BFtoLLVM.cpp:1.3 
llvm/examples/BFtoLLVM/BFtoLLVM.cpp:1.4
--- llvm/examples/BFtoLLVM/BFtoLLVM.cpp:1.3 Thu Apr 21 22:18:57 2005
+++ llvm/examples/BFtoLLVM/BFtoLLVM.cpp Thu Mar  2 19:31:12 2006
@@ -29,7 +29,7 @@
<< "\n; Declarations\n"
<< "\ndeclare int %getchar()\n"
<< "declare int %putchar(int)\n"
-   << "declare void %llvm.memset(sbyte*, ubyte, uint, uint)\n"
+   << "declare void %llvm.memset.i32(sbyte*, ubyte, uint, uint)\n"
<< "\n";
 }
 
@@ -38,7 +38,8 @@
<< "int %main(int %argc, sbyte** %argv) {\n"
<< "\nentry:\n"
<< "%arr = alloca sbyte, uint 3\n"
-   << "call void (sbyte*, ubyte, uint, uint)* %llvm.memset(sbyte* %arr, 
ubyte 0, uint 3, uint 1)\n"
+   << "call void (sbyte*, ubyte, uint, uint)* %llvm.memset.i32"
+   << "(sbyte* %arr, ubyte 0, uint 3, uint 1)\n"
<< "%ptrbox = alloca sbyte*\n"
<< "store sbyte* %arr, sbyte **%ptrbox\n"
<< "\n";



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


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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/utils/TableGen:

FileLexer.l updated: 1.26 -> 1.27
TableGen.cpp updated: 1.42 -> 1.43
---
Log message:

add support for multiple include directories


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

 FileLexer.l  |   18 +++---
 TableGen.cpp |   10 +-
 2 files changed, 16 insertions(+), 12 deletions(-)


Index: llvm/utils/TableGen/FileLexer.l
diff -u llvm/utils/TableGen/FileLexer.l:1.26 
llvm/utils/TableGen/FileLexer.l:1.27
--- llvm/utils/TableGen/FileLexer.l:1.26Mon Feb 13 23:13:13 2006
+++ llvm/utils/TableGen/FileLexer.l Thu Mar  2 19:47:14 2006
@@ -36,7 +36,7 @@
 namespace llvm {
 
 // Global variable recording the location of the include directory
-std::string IncludeDirectory;
+std::vector IncludeDirectories;
 
 /// ParseInt - This has to handle the special case of binary numbers 0b0101
 ///
@@ -74,7 +74,8 @@
 
 /// ParseFile - this function begins the parsing of the specified tablegen 
file.
 ///
-void ParseFile(const std::string &Filename, const std::string & IncludeDir) {
+void ParseFile(const std::string &Filename, 
+   const std::vector &IncludeDirs) {
   FILE *F = stdin;
   if (Filename != "-") {
 F = fopen(Filename.c_str(), "r");
@@ -90,7 +91,7 @@
 
   // Record the location of the include directory so that the lexer can find
   // it later.
-  IncludeDirectory = IncludeDir;
+  IncludeDirectories = IncludeDirs;
  
   Filein = F;
   Filelineno = 1;
@@ -124,10 +125,13 @@
 // If we couldn't find the file in the current directory, look for it in
 // the include directories.
 //
-// NOTE: Right now, there is only one directory.  We need to eventually add
-// support for more.
-std::string NextFilename = IncludeDirectory + "/" + Filename;
-yyin = fopen(NextFilename.c_str(), "r");
+std::string NextFilename;
+for (unsigned i = 0, e = IncludeDirectories.size(); i != e; ++i) {
+  NextFilename = IncludeDirectories[i] + "/" + Filename;
+  if (yyin = fopen(NextFilename.c_str(), "r"))
+break;
+}
+
 if (yyin == 0) {
   err() << "Could not find include file '" << Filename << "'!\n";
   exit(1);


Index: llvm/utils/TableGen/TableGen.cpp
diff -u llvm/utils/TableGen/TableGen.cpp:1.42 
llvm/utils/TableGen/TableGen.cpp:1.43
--- llvm/utils/TableGen/TableGen.cpp:1.42   Sun Dec 25 23:08:55 2005
+++ llvm/utils/TableGen/TableGen.cppThu Mar  2 19:47:14 2006
@@ -82,14 +82,14 @@
   cl::opt
   InputFilename(cl::Positional, cl::desc(""), cl::init("-"));
 
-  cl::opt
-  IncludeDir("I", cl::desc("Directory of include files"),
-  cl::value_desc("directory"), cl::init(""));
+  cl::list
+  IncludeDirs("I", cl::desc("Directory of include files"),
+  cl::value_desc("directory"));
 }
 
 namespace llvm {
   void ParseFile(const std::string &Filename,
- const std::string &IncludeDir);
+ const std::vector &IncludeDirs);
 }
 
 RecordKeeper llvm::Records;
@@ -420,7 +420,7 @@
 
 int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv);
-  ParseFile(InputFilename, IncludeDir);
+  ParseFile(InputFilename, IncludeDirs);
 
   std::ostream *Out = &std::cout;
   if (OutputFilename != "-") {



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


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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/utils/TableGen:

TableGen.cpp updated: 1.43 -> 1.44
---
Log message:

Add support for "-Ifoo" in addition to "-I foo"


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

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


Index: llvm/utils/TableGen/TableGen.cpp
diff -u llvm/utils/TableGen/TableGen.cpp:1.43 
llvm/utils/TableGen/TableGen.cpp:1.44
--- llvm/utils/TableGen/TableGen.cpp:1.43   Thu Mar  2 19:47:14 2006
+++ llvm/utils/TableGen/TableGen.cppThu Mar  2 19:53:40 2006
@@ -84,7 +84,7 @@
 
   cl::list
   IncludeDirs("I", cl::desc("Directory of include files"),
-  cl::value_desc("directory"));
+  cl::value_desc("directory"), cl::Prefix);
 }
 
 namespace llvm {



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


[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.td

2006-03-02 Thread Chris Lattner


Changes in directory llvm/include/llvm/CodeGen:

ValueTypes.td added (r1.1)
---
Log message:

Split this out of Target.td


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

 ValueTypes.td |   45 +
 1 files changed, 45 insertions(+)


Index: llvm/include/llvm/CodeGen/ValueTypes.td
diff -c /dev/null llvm/include/llvm/CodeGen/ValueTypes.td:1.1
*** /dev/null   Thu Mar  2 19:54:21 2006
--- llvm/include/llvm/CodeGen/ValueTypes.td Thu Mar  2 19:54:11 2006
***
*** 0 
--- 1,45 
+ //===- ValueTypes.td - ValueType definitions ---*- tablegen 
-*-===//
+ // 
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by Chris Lattner and is distributed under
+ // the University of Illinois Open Source License. See LICENSE.TXT for 
details.
+ // 
+ 
//===--===//
+ //
+ // Value types - These values correspond to the register types defined in the
+ // ValueTypes.h file.  If you update anything here, you must update it there 
as
+ // well!
+ //
+ 
//===--===//
+ 
+ class ValueType {
+   string Namespace = "MVT";
+   int Size = size;
+   int Value = value;
+ }
+ 
+ def OtherVT: ValueType<0  ,  0>;   // "Other" value
+ def i1 : ValueType<1  ,  1>;   // One bit boolean value
+ def i8 : ValueType<8  ,  2>;   // 8-bit integer value
+ def i16: ValueType<16 ,  3>;   // 16-bit integer value
+ def i32: ValueType<32 ,  4>;   // 32-bit integer value
+ def i64: ValueType<64 ,  5>;   // 64-bit integer value
+ def i128   : ValueType<128,  6>;   // 128-bit integer value
+ def f32: ValueType<32 ,  7>;   // 32-bit floating point value
+ def f64: ValueType<64 ,  8>;   // 64-bit floating point value
+ def f80: ValueType<80 ,  9>;   // 80-bit floating point value
+ def f128   : ValueType<128, 10>;   // 128-bit floating point value
+ def FlagVT : ValueType<0  , 11>;   // Condition code or machine flag
+ def isVoid : ValueType<0  , 12>;   // Produces no value
+ def Vector : ValueType<0  , 13>;   // Abstract vector value
+ def v8i8   : ValueType<64 , 14>;   //  8 x i8  vector value
+ def v4i16  : ValueType<64 , 15>;   //  4 x i16 vector value
+ def v2i32  : ValueType<64 , 16>;   //  2 x i32 vector value
+ def v16i8  : ValueType<128, 17>;   // 16 x i8  vector value
+ def v8i16  : ValueType<128, 18>;   //  8 x i16 vector value
+ def v4i32  : ValueType<128, 19>;   //  4 x i32 vector value
+ def v2i64  : ValueType<128, 20>;   //  2 x i64 vector value
+ def v2f32  : ValueType<64,  21>;   //  2 x f32 vector value
+ def v4f32  : ValueType<128, 22>;   //  4 x f32 vector value
+ def v2f64  : ValueType<128, 23>;   //  2 x f64 vector value



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


[llvm-commits] CVS: llvm/utils/TableGen/FileLexer.cpp.cvs FileLexer.l.cvs

2006-03-02 Thread Chris Lattner


Changes in directory llvm/utils/TableGen:

FileLexer.cpp.cvs updated: 1.2 -> 1.3
FileLexer.l.cvs updated: 1.1 -> 1.2
---
Log message:

Regenerate


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

 FileLexer.cpp.cvs |   98 --
 FileLexer.l.cvs   |   18 ++---
 2 files changed, 62 insertions(+), 54 deletions(-)


Index: llvm/utils/TableGen/FileLexer.cpp.cvs
diff -u llvm/utils/TableGen/FileLexer.cpp.cvs:1.2 
llvm/utils/TableGen/FileLexer.cpp.cvs:1.3
--- llvm/utils/TableGen/FileLexer.cpp.cvs:1.2   Wed Feb 15 01:24:01 2006
+++ llvm/utils/TableGen/FileLexer.cpp.cvs   Thu Mar  2 19:47:37 2006
@@ -21,7 +21,7 @@
 /* A lexical scanner generated by flex */
 
 /* Scanner skeleton version:
- * $Header: /var/cvs/llvm/llvm/utils/TableGen/FileLexer.cpp.cvs,v 1.2 
2006/02/15 07:24:01 lattner Exp $
+ * $Header: /var/cvs/llvm/llvm/utils/TableGen/FileLexer.cpp.cvs,v 1.3 
2006/03/03 01:47:37 lattner Exp $
  */
 
 #define FLEX_SCANNER
@@ -489,7 +489,7 @@
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
 char *yytext;
-#line 1 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
+#line 1 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
 #define INITIAL 0
 /*===-- FileLexer.l - Scanner for TableGen Files *- C++ 
-*-===//
 // 
@@ -507,7 +507,7 @@
 #define YY_NEVER_INTERACTIVE 1
 #define comment 1
 
-#line 30 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
+#line 30 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
 #include "Record.h"
 typedef std::pair*> SubClassRefTy;
 #include "FileParser.h"
@@ -517,7 +517,7 @@
 namespace llvm {
 
 // Global variable recording the location of the include directory
-std::string IncludeDirectory;
+std::vector IncludeDirectories;
 
 /// ParseInt - This has to handle the special case of binary numbers 0b0101
 ///
@@ -555,7 +555,8 @@
 
 /// ParseFile - this function begins the parsing of the specified tablegen 
file.
 ///
-void ParseFile(const std::string &Filename, const std::string & IncludeDir) {
+void ParseFile(const std::string &Filename, 
+   const std::vector &IncludeDirs) {
   FILE *F = stdin;
   if (Filename != "-") {
 F = fopen(Filename.c_str(), "r");
@@ -571,7 +572,7 @@
 
   // Record the location of the include directory so that the lexer can find
   // it later.
-  IncludeDirectory = IncludeDir;
+  IncludeDirectories = IncludeDirs;
  
   Filein = F;
   Filelineno = 1;
@@ -605,10 +606,13 @@
 // If we couldn't find the file in the current directory, look for it in
 // the include directories.
 //
-// NOTE: Right now, there is only one directory.  We need to eventually add
-// support for more.
-std::string NextFilename = IncludeDirectory + "/" + Filename;
-yyin = fopen(NextFilename.c_str(), "r");
+std::string NextFilename;
+for (unsigned i = 0, e = IncludeDirectories.size(); i != e; ++i) {
+  NextFilename = IncludeDirectories[i] + "/" + Filename;
+  if (yyin = fopen(NextFilename.c_str(), "r"))
+break;
+}
+
 if (yyin == 0) {
   err() << "Could not find include file '" << Filename << "'!\n";
   exit(1);
@@ -644,7 +648,7 @@
 
 using namespace llvm;
 
-#line 648 "Lexer.cpp"
+#line 652 "Lexer.cpp"
 
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
@@ -795,10 +799,10 @@
register char *yy_cp, *yy_bp;
register int yy_act;
 
-#line 176 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
+#line 180 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
 
 
-#line 802 "Lexer.cpp"
+#line 806 "Lexer.cpp"
 
if ( yy_init )
{
@@ -891,168 +895,168 @@
{ /* beginning of action switch */
 case 1:
 YY_RULE_SETUP
-#line 178 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
+#line 182 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
 { /* Ignore comments */ }
YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 180 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
+#line 184 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
 { HandleInclude(yytext); }
YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 181 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
+#line 185 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
 { Filelval.StrVal = new std::string(yytext+2, yytext+yyleng-2);
  return CODEFRAGMENT; }
YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 184 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
+#line 188 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
 { return INT; }
YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 185 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
+#line 189 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
 { return BIT; }
YY_BREAK
 case 6:
 YY_RULE_SETUP
-#line 186 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
+#line 190 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
 { return BITS; }
YY_BREAK
 case 7:
 YY_RULE

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

2006-03-02 Thread Chris Lattner


Changes in directory llvm:

Makefile.rules updated: 1.348 -> 1.349
---
Log message:

pass -Illvm/include to tblgen


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

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


Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.348 llvm/Makefile.rules:1.349
--- llvm/Makefile.rules:1.348   Tue Feb 28 13:12:58 2006
+++ llvm/Makefile.rules Thu Mar  2 19:54:54 2006
@@ -378,7 +378,7 @@
 ProgInstall   = $(INSTALL) $(Install.StripFlag) -m 0755 
 DataInstall   = $(INSTALL) -m 0644
 Burg  = $(BURG) -I $(PROJ_SRC_DIR)
-TableGen  = $(TBLGEN) -I $(PROJ_SRC_DIR)
+TableGen  = $(TBLGEN) -I $(PROJ_SRC_DIR) -I$(PROJ_SRC_ROOT)/include
 Archive   = $(AR) $(AR.Flags)
 LArchive  = $(LLVMToolDir)/llvm-ar rcsf
 ifdef RANLIB
@@ -1120,7 +1120,8 @@
 
 TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
$(LLVM_SRC_ROOT)/lib/Target/Target.td \
-   $(LLVM_SRC_ROOT)/lib/Target/TargetSelectionDAG.td)
+   $(LLVM_SRC_ROOT)/lib/Target/TargetSelectionDAG.td \
+   $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td)
 INCFiles := $(filter %.inc,$(BUILT_SOURCES))
 INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
 .PRECIOUS: $(INCTMPFiles) $(INCFiles)



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


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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/lib/Target:

Target.td updated: 1.72 -> 1.73
---
Log message:

Split the valuetypes out of Target.td into ValueTypes.td


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

 Target.td |   38 +-
 1 files changed, 1 insertion(+), 37 deletions(-)


Index: llvm/lib/Target/Target.td
diff -u llvm/lib/Target/Target.td:1.72 llvm/lib/Target/Target.td:1.73
--- llvm/lib/Target/Target.td:1.72  Tue Feb 28 19:06:22 2006
+++ llvm/lib/Target/Target.td   Thu Mar  2 19:55:26 2006
@@ -12,43 +12,7 @@
 //
 
//===--===//
 
-
-//===--===//
-//
-// Value types - These values correspond to the register types defined in the
-// ValueTypes.h file.  If you update anything here, you must update it there as
-// well!
-//
-class ValueType {
-  string Namespace = "MVT";
-  int Size = size;
-  int Value = value;
-}
-
-def OtherVT: ValueType<0  ,  0>;   // "Other" value
-def i1 : ValueType<1  ,  1>;   // One bit boolean value
-def i8 : ValueType<8  ,  2>;   // 8-bit integer value
-def i16: ValueType<16 ,  3>;   // 16-bit integer value
-def i32: ValueType<32 ,  4>;   // 32-bit integer value
-def i64: ValueType<64 ,  5>;   // 64-bit integer value
-def i128   : ValueType<128,  6>;   // 128-bit integer value
-def f32: ValueType<32 ,  7>;   // 32-bit floating point value
-def f64: ValueType<64 ,  8>;   // 64-bit floating point value
-def f80: ValueType<80 ,  9>;   // 80-bit floating point value
-def f128   : ValueType<128, 10>;   // 128-bit floating point value
-def FlagVT : ValueType<0  , 11>;   // Condition code or machine flag
-def isVoid : ValueType<0  , 12>;   // Produces no value
-def Vector : ValueType<0  , 13>;   // Abstract vector value
-def v8i8   : ValueType<64 , 14>;   //  8 x i8  vector value
-def v4i16  : ValueType<64 , 15>;   //  4 x i16 vector value
-def v2i32  : ValueType<64 , 16>;   //  2 x i32 vector value
-def v16i8  : ValueType<128, 17>;   // 16 x i8  vector value
-def v8i16  : ValueType<128, 18>;   //  8 x i16 vector value
-def v4i32  : ValueType<128, 19>;   //  4 x i32 vector value
-def v2i64  : ValueType<128, 20>;   //  2 x i64 vector value
-def v2f32  : ValueType<64,  21>;   //  2 x f32 vector value
-def v4f32  : ValueType<128, 22>;   //  4 x f32 vector value
-def v2f64  : ValueType<128, 23>;   //  2 x f64 vector value
+include "llvm/CodeGen/ValueTypes.td"
 
 
//===--===//
 // Register file description - These classes are used to fill in the target



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


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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/include/llvm/CodeGen:

ValueTypes.h updated: 1.20 -> 1.21
---
Log message:

update comment


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

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


Index: llvm/include/llvm/CodeGen/ValueTypes.h
diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.20 
llvm/include/llvm/CodeGen/ValueTypes.h:1.21
--- llvm/include/llvm/CodeGen/ValueTypes.h:1.20 Tue Feb 28 18:55:26 2006
+++ llvm/include/llvm/CodeGen/ValueTypes.h  Thu Mar  2 19:55:49 2006
@@ -27,7 +27,7 @@
 ///
 namespace MVT {  // MVT = Machine Value Types
   enum ValueType {
-// If you change this numbering, you must change the values in Target.td as
+// If you change this numbering, you must change the values in 
ValueTypes.td
 // well!
 Other  =   0,   // This is a non-standard value
 i1 =   1,   // This is a 1 bit integer value



___
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

2006-03-02 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen:

AsmPrinter.cpp updated: 1.56 -> 1.57
---
Log message:

Move #include "llvm/CodeGen/AsmPrinter.h" to top since it's the interface.


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

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


Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.56 
llvm/lib/CodeGen/AsmPrinter.cpp:1.57
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.56Wed Mar  1 16:18:09 2006
+++ llvm/lib/CodeGen/AsmPrinter.cpp Thu Mar  2 20:04:29 2006
@@ -11,9 +11,9 @@
 //
 
//===--===//
 
+#include "llvm/CodeGen/AsmPrinter.h"
 #include "llvm/Assembly/Writer.h"
 #include "llvm/DerivedTypes.h"
-#include "llvm/CodeGen/AsmPrinter.h"
 #include "llvm/Constants.h"
 #include "llvm/Module.h"
 #include "llvm/CodeGen/MachineConstantPool.h"



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


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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/utils/TableGen:

SubtargetEmitter.cpp updated: 1.17 -> 1.18
---
Log message:

remove out of date comment


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

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


Index: llvm/utils/TableGen/SubtargetEmitter.cpp
diff -u llvm/utils/TableGen/SubtargetEmitter.cpp:1.17 
llvm/utils/TableGen/SubtargetEmitter.cpp:1.18
--- llvm/utils/TableGen/SubtargetEmitter.cpp:1.17   Fri Jan 27 02:09:42 2006
+++ llvm/utils/TableGen/SubtargetEmitter.cppThu Mar  2 20:04:07 2006
@@ -7,8 +7,7 @@
 //
 
//===--===//
 //
-// This tablegen backend emits subtarget enumerations.  The format is in a 
state
-// flux and will be tightened up when integration to scheduling is complete.
+// This tablegen backend emits subtarget enumerations.
 //
 
//===--===//
 



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


[llvm-commits] CVS: llvm/tools/analyze/analyze.cpp

2006-03-02 Thread Robert L. Bocchino Jr.


Changes in directory llvm/tools/analyze:

analyze.cpp updated: 1.65 -> 1.66
---
Log message:

Implemented -quiet feature for analyze


---
Diffs of the changes:  (+35 -30)

 analyze.cpp |   65 
 1 files changed, 35 insertions(+), 30 deletions(-)


Index: llvm/tools/analyze/analyze.cpp
diff -u llvm/tools/analyze/analyze.cpp:1.65 llvm/tools/analyze/analyze.cpp:1.66
--- llvm/tools/analyze/analyze.cpp:1.65 Sun Oct 23 20:00:13 2005
+++ llvm/tools/analyze/analyze.cpp  Thu Mar  2 20:12:04 2006
@@ -31,13 +31,36 @@
 
 using namespace llvm;
 
+namespace {
+  cl::opt
+  InputFilename(cl::Positional, cl::desc(""), cl::init("-"),
+cl::value_desc("filename"));
+
+  cl::opt Quiet("q", cl::desc("Don't print analysis pass names"));
+  cl::aliasQuietA("quiet", cl::desc("Alias for -q"),
+  cl::aliasopt(Quiet));
+
+  cl::opt NoVerify("disable-verify", cl::Hidden,
+ cl::desc("Do not verify input module"));
+
+  // The AnalysesList is automatically populated with registered Passes by the
+  // PassNameParser.
+  //
+  cl::list >
+  AnalysesList(cl::desc("Analyses available:"));
+
+  Timer BytecodeLoadTimer("Bytecode Loader");
+}
+
 struct ModulePassPrinter : public ModulePass {
   const PassInfo *PassToPrint;
   ModulePassPrinter(const PassInfo *PI) : PassToPrint(PI) {}
 
   virtual bool runOnModule(Module &M) {
-std::cout << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
-getAnalysisID(PassToPrint).print(std::cout, &M);
+if (!Quiet) {
+  std::cout << "Printing analysis '" << PassToPrint->getPassName() << 
"':\n";
+  getAnalysisID(PassToPrint).print(std::cout, &M);
+}
 
 // Get and print pass...
 return false;
@@ -56,11 +79,12 @@
   FunctionPassPrinter(const PassInfo *PI) : PassToPrint(PI) {}
 
   virtual bool runOnFunction(Function &F) {
-std::cout << "Printing analysis '" << PassToPrint->getPassName()
-  << "' for function '" << F.getName() << "':\n";
-getAnalysisID(PassToPrint).print(std::cout, F.getParent());
-
+if (!Quiet) {
+  std::cout << "Printing analysis '" << PassToPrint->getPassName()
+   << "' for function '" << F.getName() << "':\n";
+}
 // Get and print pass...
+getAnalysisID(PassToPrint).print(std::cout, F.getParent());
 return false;
   }
 
@@ -77,11 +101,13 @@
   BasicBlockPassPrinter(const PassInfo *PI) : PassToPrint(PI) {}
 
   virtual bool runOnBasicBlock(BasicBlock &BB) {
-std::cout << "Printing Analysis info for BasicBlock '" << BB.getName()
-  << "': Pass " << PassToPrint->getPassName() << ":\n";
-getAnalysisID(PassToPrint).print(std::cout, 
BB.getParent()->getParent());
+if (!Quiet) {
+  std::cout << "Printing Analysis info for BasicBlock '" << BB.getName()
+   << "': Pass " << PassToPrint->getPassName() << ":\n";
+}
 
 // Get and print pass...
+getAnalysisID(PassToPrint).print(std::cout, 
BB.getParent()->getParent());
 return false;
   }
 
@@ -95,27 +121,6 @@
 
 
 
-namespace {
-  cl::opt
-  InputFilename(cl::Positional, cl::desc(""), cl::init("-"),
-cl::value_desc("filename"));
-
-  cl::opt Quiet("q", cl::desc("Don't print analysis pass names"));
-  cl::aliasQuietA("quiet", cl::desc("Alias for -q"),
-  cl::aliasopt(Quiet));
-
-  cl::opt NoVerify("disable-verify", cl::Hidden,
- cl::desc("Do not verify input module"));
-
-  // The AnalysesList is automatically populated with registered Passes by the
-  // PassNameParser.
-  //
-  cl::list >
-  AnalysesList(cl::desc("Analyses available:"));
-
-  Timer BytecodeLoadTimer("Bytecode Loader");
-}
-
 int main(int argc, char **argv) {
   try {
 cl::ParseCommandLineOptions(argc, argv, " llvm analysis printer tool\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/Intrinsics.td

2006-03-02 Thread Chris Lattner


Changes in directory llvm/include/llvm:

Intrinsics.td added (r1.1)
---
Log message:

initial checkin of the intrinsic description file


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

 Intrinsics.td |  188 ++
 1 files changed, 188 insertions(+)


Index: llvm/include/llvm/Intrinsics.td
diff -c /dev/null llvm/include/llvm/Intrinsics.td:1.1
*** /dev/null   Thu Mar  2 20:33:25 2006
--- llvm/include/llvm/Intrinsics.td Thu Mar  2 20:33:15 2006
***
*** 0 
--- 1,188 
+ //===- Intrinsics.td - Defines all LLVM intrinsics -*- tablegen 
-*-===//
+ // 
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by Chris Lattner and is distributed under the
+ // University of Illinois Open Source License. See LICENSE.TXT for details.
+ // 
+ 
//===--===//
+ //
+ // This file defines properties of all LLVM intrinsics.
+ //
+ 
//===--===//
+ 
+ 
//===--===//
+ //  Properties we keep track of for intrinsics.
+ 
//===--===//
+ 
+ class IntrinsicProperty;
+ 
+ // Intr*Mem - Memory properties.  An intrinsic is allowed to have exactly one 
of
+ // these properties set.  They are listed from the most aggressive (best to 
use
+ // if correct) to the least aggressive.  If no property is set, the worst 
case 
+ // is assumed (IntrWriteMem).
+ 
+ // InstrNoMem - The intrinsic does not access memory or have any other side
+ // effects.  It may be CSE'd deleted if dead, etc.
+ def InstrNoMem : IntrinsicProperty;
+ 
+ // InstrReadArgMem - This intrinsic reads only from memory that one of its
+ // arguments points to, but may read an unspecified amount.
+ def InstrReadArgMem : IntrinsicProperty;
+ 
+ // IntrReadMem - This intrinsic reads from unspecified memory, so it cannot be
+ // moved across stores.  However, it can be reordered otherwise and can be
+ // deleted if dead.
+ def IntrReadMem : IntrinsicProperty;
+ 
+ // InstrWriteArgMem - This intrinsic reads and writes only from memory that 
one
+ // of its arguments points to, but may access an unspecified amount.  It has 
no
+ // other side effects.  This may only be used if the intrinsic doesn't 
"capture"
+ // the argument pointer (e.g. storing it someplace).
+ def InstrWriteArgMem : IntrinsicProperty;
+ 
+ // IntrWriteMem - This intrinsic may read or modify unspecified memory or has 
+ // other side effects.  It cannot be modified by the optimizer.  This is the
+ // default if the intrinsic has no other Intr*Mem property.
+ def IntrWriteMem : IntrinsicProperty;
+ 
+ 
//===--===//
+ // Types used by intrinsics.
+ 
//===--===//
+ 
+ class LLVMType {
+   string TypeVal = typeval;
+ }
+ 
+ def llvm_void_ty   : LLVMType<"Type::VoidTyID">;
+ def llvm_bool_ty   : LLVMType<"Type::BoolTyID">;
+ def llvm_sbyte_ty  : LLVMType<"Type::SByteTyID">;
+ def llvm_short_ty  : LLVMType<"Type::ShortTyID">;
+ def llvm_int_ty: LLVMType<"Type::IntTyID">;
+ def llvm_long_ty   : LLVMType<"Type::LongTyID">;
+ def llvm_ubyte_ty  : LLVMType<"Type::UByteTyID">;
+ def llvm_ushort_ty : LLVMType<"Type::UShortTyID">;
+ def llvm_uint_ty   : LLVMType<"Type::UIntTyID">;
+ def llvm_ulong_ty  : LLVMType<"Type::ULongTyID">;
+ def llvm_float_ty  : LLVMType<"Type::FloatTyID">;
+ def llvm_double_ty : LLVMType<"Type::DoubleTyID">;
+ def llvm_ptr_ty: LLVMType<"Type::PointerTyID">; // sbyte*
+ def llvm_ptrptr_ty : LLVMType<"Type::PointerTyID">; // sbyte**
+ def llvm_anchor_ty : LLVMType<"Type::PointerTyID">; // {}*
+ def llvm_descriptor_ty : LLVMType<"Type::PointerTyID">; // global*
+ 
+ 
//===--===//
+ // Intrinsic Definitions.
+ 
//===--===//
+ 
+ // Intrinsic class - This is used to define one LLVM intrinsic.  The name of 
the
+ // intrinsic definition should start with "int_", then match the LLVM 
intrinsic
+ // name with the "llvm." prefix removed, and all "."s turned into "_"s.  For
+ // example, llvm.bswap.i16 -> int_bswap_i16.
+ //
+ //  * Types is a list containing the return type and the argument types
+ //expected for the intrinsic.
+ //  * Properties can be set to describe the behavior of the intrinsic.
+ //
+ class Intrinsic types,
+ list properties = [],
+ string name = ""> {
+   string LLVMName = name;
+   list Types = types;
+   list Properties = properties;
+ }
+ 
+ 
+ //===--- Variable Argument Handling Intrinsics 

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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/utils/TableGen:

TableGen.cpp updated: 1.45 -> 1.46
---
Log message:

remove a bunch of long-dead testing code


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

 TableGen.cpp |  332 ---
 1 files changed, 1 insertion(+), 331 deletions(-)


Index: llvm/utils/TableGen/TableGen.cpp
diff -u llvm/utils/TableGen/TableGen.cpp:1.45 
llvm/utils/TableGen/TableGen.cpp:1.46
--- llvm/utils/TableGen/TableGen.cpp:1.45   Thu Mar  2 20:32:46 2006
+++ llvm/utils/TableGen/TableGen.cppThu Mar  2 20:34:28 2006
@@ -40,8 +40,7 @@
   GenDAGISel,
   GenSubtarget,
   GenIntrinsic,
-  PrintEnums,
-  Parse
+  PrintEnums
 };
 
 namespace {
@@ -71,8 +70,6 @@
"Generate intrinsic information"),
 clEnumValN(PrintEnums, "print-enums",
"Print enum values for a class"),
-clEnumValN(Parse, "parse",
-   "Interpret machine code (testing only)"),
 clEnumValEnd));
 
   cl::opt
@@ -98,330 +95,6 @@
 
 RecordKeeper llvm::Records;
 
-static Init *getBit(Record *R, unsigned BitNo) {
-  const std::vector &V = R->getValues();
-  for (unsigned i = 0, e = V.size(); i != e; ++i)
-if (V[i].getPrefix()) {
-  assert(dynamic_cast(V[i].getValue()) &&
- "Can only handle fields of bits<> type!");
-  BitsInit *I = (BitsInit*)V[i].getValue();
-  if (BitNo < I->getNumBits())
-return I->getBit(BitNo);
-  BitNo -= I->getNumBits();
-}
-
-  std::cerr << "Cannot find requested bit!\n";
-  exit(1);
-  return 0;
-}
-
-static unsigned getNumBits(Record *R) {
-  const std::vector &V = R->getValues();
-  unsigned Num = 0;
-  for (unsigned i = 0, e = V.size(); i != e; ++i)
-if (V[i].getPrefix()) {
-  assert(dynamic_cast(V[i].getValue()) &&
- "Can only handle fields of bits<> type!");
-  Num += ((BitsInit*)V[i].getValue())->getNumBits();
-}
-  return Num;
-}
-
-static bool BitsAreFixed(Record *I1, Record *I2, unsigned BitNo) {
-  return dynamic_cast(getBit(I1, BitNo)) &&
- dynamic_cast(getBit(I2, BitNo));
-}
-
-static bool BitsAreEqual(Record *I1, Record *I2, unsigned BitNo) {
-  BitInit *Bit1 = dynamic_cast(getBit(I1, BitNo));
-  BitInit *Bit2 = dynamic_cast(getBit(I2, BitNo));
-
-  return Bit1 && Bit2 && Bit1->getValue() == Bit2->getValue();
-}
-
-static bool BitRangesEqual(Record *I1, Record *I2,
-   unsigned Start, unsigned End) {
-  for (unsigned i = Start; i != End; ++i)
-if (!BitsAreEqual(I1, I2, i))
-  return false;
-  return true;
-}
-
-static unsigned getFirstFixedBit(Record *R, unsigned FirstFixedBit) {
-  // Look for the first bit of the pair that are required to be 0 or 1.
-  while (!dynamic_cast(getBit(R, FirstFixedBit)))
-++FirstFixedBit;
-  return FirstFixedBit;
-}
-
-static void FindInstDifferences(Record *I1, Record *I2,
-unsigned FirstFixedBit, unsigned MaxBits,
-unsigned &FirstVaryingBitOverall,
-unsigned &LastFixedBitOverall) {
-  // Compare the first instruction to the rest of the instructions, looking for
-  // fields that differ.
-  //
-  unsigned FirstVaryingBit = FirstFixedBit;
-  while (FirstVaryingBit < MaxBits && BitsAreEqual(I1, I2, FirstVaryingBit))
-++FirstVaryingBit;
-
-  unsigned LastFixedBit = FirstVaryingBit;
-  while (LastFixedBit < MaxBits && BitsAreFixed(I1, I2, LastFixedBit))
-++LastFixedBit;
-
-  if (FirstVaryingBit < FirstVaryingBitOverall)
-FirstVaryingBitOverall = FirstVaryingBit;
-  if (LastFixedBit < LastFixedBitOverall)
-LastFixedBitOverall = LastFixedBit;
-}
-
-static bool getBitValue(Record *R, unsigned BitNo) {
-  Init *I = getBit(R, BitNo);
-  assert(dynamic_cast(I) && "Bit should be fixed!");
-  return ((BitInit*)I)->getValue();
-}
-
-struct BitComparator {
-  unsigned BitBegin, BitEnd;
-  BitComparator(unsigned B, unsigned E) : BitBegin(B), BitEnd(E) {}
-
-  bool operator()(Record *R1, Record *R2) { // Return true if R1 is less than 
R2
-for (unsigned i = BitBegin; i != BitEnd; ++i) {
-  bool V1 = getBitValue(R1, i), V2 = getBitValue(R2, i);
-  if (V1 < V2)
-return true;
-  else if (V2 < V1)
-return false;
-}
-return false;
-  }
-};
-
-static void PrintRange(std::vector::iterator I,
-   std::vector::iterator E) {
-  while (I != E) std::cerr << **I++;
-}
-
-static bool getMemoryBit(unsigned char *M, unsigned i) {
-  return (M[i/8] & (1 << (i&7))) != 0;
-}
-
-static unsigned getFirstFixedBitInSequence(std::vector::iterator IB,
-   std::vector::iterator IE,
-   unsigned StartBit) {
-  unsigned FirstFixedBit = 0;
-  for (std::vector::iterator I = IB; I != IE; ++I)
-FirstFixedBit = std::max(FirstFixedBit, getFirstFixedBit(*I, StartBit));

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

2006-03-02 Thread Chris Lattner


Changes in directory llvm/utils/TableGen:

CodeGenIntrinsics.h added (r1.1)
IntrinsicEmitter.cpp added (r1.1)
IntrinsicEmitter.h added (r1.1)
TableGen.cpp updated: 1.44 -> 1.45
---
Log message:

initial implementation of intrinsic parsing


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

 CodeGenIntrinsics.h  |   42 ++
 IntrinsicEmitter.cpp |   70 +++
 IntrinsicEmitter.h   |   38 +++
 TableGen.cpp |7 +
 4 files changed, 157 insertions(+)


Index: llvm/utils/TableGen/CodeGenIntrinsics.h
diff -c /dev/null llvm/utils/TableGen/CodeGenIntrinsics.h:1.1
*** /dev/null   Thu Mar  2 20:32:56 2006
--- llvm/utils/TableGen/CodeGenIntrinsics.h Thu Mar  2 20:32:46 2006
***
*** 0 
--- 1,42 
+ //===- CodeGenIntrinsic.h - Intrinsic Class Wrapper *- C++ 
-*--===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by the LLVM research group and is distributed under
+ // the University of Illinois Open Source License. See LICENSE.TXT for 
details.
+ //
+ 
//===--===//
+ //
+ // This file defines a wrapper class for the 'Intrinsic' TableGen class.
+ //
+ 
//===--===//
+ 
+ #ifndef CODEGEN_INTRINSIC_H
+ #define CODEGEN_INTRINSIC_H
+ 
+ #include 
+ #include 
+ 
+ namespace llvm {
+   class Record;
+   class RecordKeeper;
+ 
+   struct CodeGenIntrinsic {
+ Record *TheDef;// The actual record defining this instruction.
+ std::string Name;  // The name of the LLVM function 
"llvm.bswap.i32"
+ std::string EnumName;  // The name of the enum "bswap_i32"
+ 
+ // Memory mod/ref behavior of this intrinsic.
+ enum {
+   NoMem, ReadArgMem, ReadMem, WriteArgMem, WriteMem
+ } ModRef;
+ 
+ CodeGenIntrinsic(Record *R);
+   };
+ 
+   /// LoadIntrinsics - Read all of the intrinsics defined in the specified
+   /// .td file.
+   std::vector LoadIntrinsics(const RecordKeeper &RC);
+ }
+ 
+ #endif


Index: llvm/utils/TableGen/IntrinsicEmitter.cpp
diff -c /dev/null llvm/utils/TableGen/IntrinsicEmitter.cpp:1.1
*** /dev/null   Thu Mar  2 20:32:58 2006
--- llvm/utils/TableGen/IntrinsicEmitter.cppThu Mar  2 20:32:46 2006
***
*** 0 
--- 1,70 
+ //===- IntrinsicEmitter.cpp - Generate intrinsic information 
--===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by Chris Lattner and is distributed under
+ // the University of Illinois Open Source License. See LICENSE.TXT for 
details.
+ //
+ 
//===--===//
+ //
+ // This tablegen backend emits information about intrinsic functions.
+ //
+ 
//===--===//
+ 
+ #include "IntrinsicEmitter.h"
+ #include "Record.h"
+ using namespace llvm;
+ 
+ 
//===--===//
+ // CodeGenIntrinsic Implementation
+ 
//===--===//
+ 
+ std::vector llvm::LoadIntrinsics(const RecordKeeper &RC) {
+   std::vector I = RC.getAllDerivedDefinitions("Intrinsic");
+   return std::vector(I.begin(), I.end());
+ }
+ 
+ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
+   std::string DefName = R->getName();
+   
+   if (DefName.size() <= 4 || 
+   std::string(DefName.begin(), DefName.begin()+4) != "int_")
+ throw "Intrinsic '" + DefName + "' does not start with 'int_'!";
+   EnumName = std::string(DefName.begin()+4, DefName.end());
+   
+   Name = R->getValueAsString("LLVMName");
+   if (Name == "") {
+ // If an explicit name isn't specified, derive one from the DefName.
+ Name = "llvm.";
+ for (unsigned i = 0, e = EnumName.size(); i != e; ++i)
+   if (EnumName[i] == '_')
+ Name += '.';
+   else
+ Name += EnumName[i];
+   }
+ }
+ 
+ 
//===--===//
+ // IntrinsicEmitter Implementation
+ 
//===--===//
+ 
+ void IntrinsicEmitter::run(std::ostream &OS) {
+   EmitSourceFileHeader("Intrinsic Function Source Fragment", OS);
+   
+   std::vector Ints = LoadIntrinsics(Records);
+ 
+   // Emit the enum information.
+   EmitEnumInfo(Ints, OS);
+ }
+ 
+ void IntrinsicEmitter::EmitEnumInfo(const std::vector &Ints,
+ std::ostream &OS) {
+   OS << "#ifdef GET_INTRINSIC_ENUM_VALUES\n";
+   for (unsigned i = 0, e = Ints.size(); i != e; ++i) {
+ OS << "" << Ints[i].EnumName;
+ OS << ((i != e-1) ? ", " : "  ");
+ OS << std::string(40-Ints[i].EnumName.size(), ' ') 
+   << "// " << Ints[i].Name << "\n";
+   }
+   OS

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

2006-03-02 Thread Jeff Cohen


Changes in directory llvm/lib/CodeGen/SelectionDAG:

ScheduleDAGList.cpp updated: 1.7 -> 1.8
---
Log message:

Fix VC++ compilation errors.

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

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


Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.7 
llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.8
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.7   Thu Mar  2 
15:38:29 2006
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp   Thu Mar  2 21:25:07 2006
@@ -80,7 +80,7 @@
 
 if (Preds.size() != 0) {
   std::cerr << "Predecessors  :\n";
-  for (std::set::iterator I = Preds.begin(),
+  for (std::set::const_iterator I = Preds.begin(),
  E = Preds.end(); I != E; ++I) {
 std::cerr << "";
 (*I)->dump(G, false);
@@ -88,7 +88,7 @@
 }
 if (ChainPreds.size() != 0) {
   std::cerr << "Chained Preds :\n";
-  for (std::set::iterator I = ChainPreds.begin(),
+  for (std::set::const_iterator I = ChainPreds.begin(),
  E = ChainPreds.end(); I != E; ++I) {
 std::cerr << "";
 (*I)->dump(G, false);
@@ -96,7 +96,7 @@
 }
 if (Succs.size() != 0) {
   std::cerr << "Successors:\n";
-  for (std::set::iterator I = Succs.begin(),
+  for (std::set::const_iterator I = Succs.begin(),
  E = Succs.end(); I != E; ++I) {
 std::cerr << "";
 (*I)->dump(G, false);
@@ -104,7 +104,7 @@
 }
 if (ChainSuccs.size() != 0) {
   std::cerr << "Chained succs :\n";
-  for (std::set::iterator I = ChainSuccs.begin(),
+  for (std::set::const_iterator I = ChainSuccs.begin(),
  E = ChainSuccs.end(); I != E; ++I) {
 std::cerr << "";
 (*I)->dump(G, false);



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


[llvm-commits] CVS: llvm/utils/TableGen/CodeGenIntrinsics.h

2006-03-02 Thread Chris Lattner


Changes in directory llvm/utils/TableGen:

CodeGenIntrinsics.h updated: 1.1 -> 1.2
---
Log message:

Fix pasteo


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

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


Index: llvm/utils/TableGen/CodeGenIntrinsics.h
diff -u llvm/utils/TableGen/CodeGenIntrinsics.h:1.1 
llvm/utils/TableGen/CodeGenIntrinsics.h:1.2
--- llvm/utils/TableGen/CodeGenIntrinsics.h:1.1 Thu Mar  2 20:32:46 2006
+++ llvm/utils/TableGen/CodeGenIntrinsics.h Fri Mar  3 00:13:41 2006
@@ -2,7 +2,7 @@
 //
 // The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
+// This file was developed by Chris Lattner and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
 //
 
//===--===//



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

2006-03-02 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

ScheduleDAGList.cpp updated: 1.8 -> 1.9
---
Log message:

A bit more tweaking

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

 ScheduleDAGList.cpp |   30 --
 1 files changed, 24 insertions(+), 6 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.8 
llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.9
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.8   Thu Mar  2 
21:25:07 2006
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp   Fri Mar  3 00:23:43 2006
@@ -43,6 +43,7 @@
   int NumChainSuccsLeft;  // # of chain succs not scheduled.
   int Priority1;  // Scheduling priority 1.
   int Priority2;  // Scheduling priority 2.
+  bool isTwoAddress;  // Is a two-address instruction.
   bool isDefNUseOperand;  // Is a def&use operand.
   unsigned Latency;   // Node latency.
   unsigned CycleBound;// Upper/lower cycle to be scheduled at.
@@ -52,7 +53,8 @@
   SUnit(SDNode *node)
 : Node(node), NumPredsLeft(0), NumSuccsLeft(0),
   NumChainPredsLeft(0), NumChainSuccsLeft(0),
-  Priority1(INT_MIN), Priority2(INT_MIN), isDefNUseOperand(false),
+  Priority1(INT_MIN), Priority2(INT_MIN),
+  isTwoAddress(false), isDefNUseOperand(false),
   Latency(0), CycleBound(0), Slot(0), Next(NULL) {}
 
   void dump(const SelectionDAG *G, bool All=true) const;
@@ -120,6 +122,20 @@
 bool RFloater = (right->Preds.size() == 0);
 int LBonus = (int)left ->isDefNUseOperand;
 int RBonus = (int)right->isDefNUseOperand;
+
+// Special tie breaker: if two nodes share a operand, the one that
+// use it as a def&use operand is preferred.
+if (left->isTwoAddress && !right->isTwoAddress) {
+  SDNode *DUNode = left->Node->getOperand(0).Val;
+  if (DUNode->isOperand(right->Node))
+LBonus++;
+}
+if (!left->isTwoAddress && right->isTwoAddress) {
+  SDNode *DUNode = right->Node->getOperand(0).Val;
+  if (DUNode->isOperand(left->Node))
+RBonus++;
+}
+
 int LPriority1 = left ->Priority1 - LBonus;
 int RPriority1 = right->Priority1 - RBonus;
 int LPriority2 = left ->Priority2 + LBonus;
@@ -138,8 +154,6 @@
 else if (LPriority1 == RPriority1)
   if (left->CycleBound > right->CycleBound) 
 return true;
-  else
-return left->Node->getNodeDepth() < right->Node->getNodeDepth();
 
 return false;
   }
@@ -238,6 +252,9 @@
 /// its predecessors. If a predecessor pending count is zero, add it to the
 /// Available queue.
 void ScheduleDAGList::ScheduleNode(SUnit *SU) {
+  DEBUG(std::cerr << "*** Scheduling: ");
+  DEBUG(SU->dump(&DAG, false));
+
   Sequence.push_back(SU);
   SU->Slot = CurrCycle;
 
@@ -283,8 +300,6 @@
 for (unsigned i = 0, e = NotReady.size(); i != e; ++i)
   Available.push(NotReady[i]);
 
-DEBUG(std::cerr << "*** Scheduling: ");
-DEBUG(CurrNode->dump(&DAG, false));
 ScheduleNode(CurrNode);
   }
 
@@ -402,6 +417,9 @@
   for (SUnit *SU = HeadSUnit; SU != NULL; SU = SU->Next) {
 SDNode   *N  = SU->Node;
 NodeInfo *NI = getNI(N);
+
+if (N->isTargetOpcode() && TII->isTwoAddrInstr(N->getTargetOpcode()))
+  SU->isTwoAddress = true;
 
 if (NI->isInGroup()) {
   // Find all predecessors (of the group).
@@ -446,7 +464,7 @@
   SU->NumPredsLeft++;
 if (OpSU->Succs.insert(SU).second)
   OpSU->NumSuccsLeft++;
-if (j == 0 && TII->isTwoAddrInstr(N->getTargetOpcode()))
+if (j == 0 && SU->isTwoAddress) 
   OpSU->isDefNUseOperand = true;
   }
 }



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

2006-03-02 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAG.cpp updated: 1.263 -> 1.264
---
Log message:

Added isOperand(N): true if this is an operand of N

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

 SelectionDAG.cpp |7 +++
 1 files changed, 7 insertions(+)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.263 
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.264
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.263Thu Mar  2 
18:19:44 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp  Fri Mar  3 00:24:54 2006
@@ -2533,6 +2533,13 @@
   return Seen;
 }
 
+// isOperand - Return true if this node is an operand of N.
+bool SDNode::isOperand(SDNode *N) const {
+  for (unsigned i = 0, e = N->NumOperands; i != e; ++i)
+if (this == N->OperandList[i].Val)
+  return true;
+  return false;
+}
 
 const char *SDNode::getOperationName(const SelectionDAG *G) const {
   switch (getOpcode()) {



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


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

2006-03-02 Thread Evan Cheng


Changes in directory llvm/include/llvm/CodeGen:

SelectionDAGNodes.h updated: 1.106 -> 1.107
---
Log message:

Added isOperand(N): true if this is an operand of N

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

 SelectionDAGNodes.h |7 +++
 1 files changed, 7 insertions(+)


Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.106 
llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.107
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.106 Thu Mar  2 18:18:00 2006
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h   Fri Mar  3 00:24:54 2006
@@ -542,6 +542,7 @@
   inline const SDOperand &getOperand(unsigned i) const;
   inline bool isTargetOpcode() const;
   inline unsigned getTargetOpcode() const;
+  inline const bool isOperand(SDNode *N) const;
 
   /// hasOneUse - Return true if there is exactly one operation using this
   /// result value of the defining operator.
@@ -631,6 +632,9 @@
   // isOnlyUse - Return true if this node is the only use of N.
   bool isOnlyUse(SDNode *N) const;
 
+  // isOperand - Return true if this node is an operand of N.
+  bool isOperand(SDNode *N) const;
+
   /// getNumOperands - Return the number of values used by this operation.
   ///
   unsigned getNumOperands() const { return NumOperands; }
@@ -937,6 +941,9 @@
 inline unsigned SDOperand::getTargetOpcode() const {
   return Val->getTargetOpcode();
 }
+inline const bool SDOperand::isOperand(SDNode *N) const {
+  return Val->isOperand(N);
+}
 inline bool SDOperand::hasOneUse() const {
   return Val->hasNUsesOfValue(1, ResNo);
 }



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

2006-03-02 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAG.cpp updated: 1.264 -> 1.265
---
Log message:

SDOperand::isOperand should not be a forwarding. It must check *this against 
N's operands.

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

 SelectionDAG.cpp |7 +++
 1 files changed, 7 insertions(+)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.264 
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.265
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.264Fri Mar  3 
00:24:54 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp  Fri Mar  3 00:42:32 2006
@@ -2534,6 +2534,13 @@
 }
 
 // isOperand - Return true if this node is an operand of N.
+bool SDOperand::isOperand(SDNode *N) const {
+  for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
+if (*this == N->getOperand(i))
+  return true;
+  return false;
+}
+
 bool SDNode::isOperand(SDNode *N) const {
   for (unsigned i = 0, e = N->NumOperands; i != e; ++i)
 if (this == N->OperandList[i].Val)



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


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

2006-03-02 Thread Evan Cheng


Changes in directory llvm/include/llvm/CodeGen:

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

SDOperand::isOperand should not be a forwarding. It must check *this against 
N's operands.

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

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


Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.107 
llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.108
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.107 Fri Mar  3 00:24:54 2006
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h   Fri Mar  3 00:42:32 2006
@@ -531,6 +531,9 @@
 return SDOperand(Val, R);
   }
 
+  // isOperand - Return true if this node is an operand of N.
+  bool isOperand(SDNode *N) const;
+
   /// getValueType - Return the ValueType of the referenced return value.
   ///
   inline MVT::ValueType getValueType() const;
@@ -542,7 +545,6 @@
   inline const SDOperand &getOperand(unsigned i) const;
   inline bool isTargetOpcode() const;
   inline unsigned getTargetOpcode() const;
-  inline const bool isOperand(SDNode *N) const;
 
   /// hasOneUse - Return true if there is exactly one operation using this
   /// result value of the defining operator.
@@ -941,9 +943,6 @@
 inline unsigned SDOperand::getTargetOpcode() const {
   return Val->getTargetOpcode();
 }
-inline const bool SDOperand::isOperand(SDNode *N) const {
-  return Val->isOperand(N);
-}
 inline bool SDOperand::hasOneUse() const {
   return Val->hasNUsesOfValue(1, ResNo);
 }



___
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-03-02 Thread Evan Cheng


Changes in directory llvm/lib/Target:

TargetLowering.cpp updated: 1.42 -> 1.43
---
Log message:

Number of NodeTypes now exceeds 128.


---
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.42 
llvm/lib/Target/TargetLowering.cpp:1.43
--- llvm/lib/Target/TargetLowering.cpp:1.42 Tue Feb 28 22:52:55 2006
+++ llvm/lib/Target/TargetLowering.cpp  Fri Mar  3 00:58:59 2006
@@ -21,7 +21,7 @@
 
 TargetLowering::TargetLowering(TargetMachine &tm)
   : TM(tm), TD(TM.getTargetData()) {
-  assert(ISD::BUILTIN_OP_END <= 128 &&
+  assert(ISD::BUILTIN_OP_END <= 156 &&
  "Fixed size array in TargetLowering is not large enough!");
   // All operations default to being supported.
   memset(OpActions, 0, sizeof(OpActions));



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


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

2006-03-02 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.309 -> 1.310
SelectionDAGISel.cpp updated: 1.177 -> 1.178
---
Log message:

Add more vector NodeTypes: VSDIV, VUDIV, VAND, VOR, and VXOR.


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

 LegalizeDAG.cpp  |   18 ++
 SelectionDAGISel.cpp |   10 ++
 2 files changed, 20 insertions(+), 8 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.309 
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.310
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.309 Thu Mar  2 18:19:44 2006
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp   Fri Mar  3 01:01:07 2006
@@ -152,9 +152,14 @@
 static unsigned getScalarizedOpcode(unsigned VecOp, MVT::ValueType VT) {
   switch (VecOp) {
   default: assert(0 && "Don't know how to scalarize this opcode!");
-  case ISD::VADD: return MVT::isInteger(VT) ? ISD::ADD : ISD::FADD;
-  case ISD::VSUB: return MVT::isInteger(VT) ? ISD::SUB : ISD::FSUB;
-  case ISD::VMUL: return MVT::isInteger(VT) ? ISD::MUL : ISD::FMUL;
+  case ISD::VADD:  return MVT::isInteger(VT) ? ISD::ADD : ISD::FADD;
+  case ISD::VSUB:  return MVT::isInteger(VT) ? ISD::SUB : ISD::FSUB;
+  case ISD::VMUL:  return MVT::isInteger(VT) ? ISD::MUL : ISD::FMUL;
+  case ISD::VSDIV: return MVT::isInteger(VT) ? ISD::SDIV: ISD::FDIV;
+  case ISD::VUDIV: return MVT::isInteger(VT) ? ISD::UDIV: ISD::FDIV;
+  case ISD::VAND:  return MVT::isInteger(VT) ? ISD::AND : 0;
+  case ISD::VOR:   return MVT::isInteger(VT) ? ISD::OR  : 0;
+  case ISD::VXOR:  return MVT::isInteger(VT) ? ISD::XOR : 0;
   }
 }
 
@@ -3646,7 +3651,12 @@
   }
   case ISD::VADD:
   case ISD::VSUB:
-  case ISD::VMUL: {
+  case ISD::VMUL:
+  case ISD::VSDIV:
+  case ISD::VUDIV:
+  case ISD::VAND:
+  case ISD::VOR:
+  case ISD::VXOR: {
 unsigned NumElements 
=cast(Node->getOperand(0))->getValue();
 MVT::ValueType EVT = cast(Node->getOperand(1))->getVT();
 MVT::ValueType TVT = (NumElements/2 > 1)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.177 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.178
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.177Thu Mar  2 
18:19:44 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Fri Mar  3 01:01:07 2006
@@ -496,15 +496,17 @@
   }
   void visitDiv(User &I) {
 const Type *Ty = I.getType();
-visitBinary(I, Ty->isSigned() ? ISD::SDIV : ISD::UDIV, ISD::FDIV, 0);
+visitBinary(I,
+Ty->isSigned() ? ISD::SDIV : ISD::UDIV, ISD::FDIV,
+Ty->isSigned() ? ISD::VSDIV : ISD::VUDIV);
   }
   void visitRem(User &I) {
 const Type *Ty = I.getType();
 visitBinary(I, Ty->isSigned() ? ISD::SREM : ISD::UREM, ISD::FREM, 0);
   }
-  void visitAnd(User &I) { visitBinary(I, ISD::AND, 0, 0); }
-  void visitOr (User &I) { visitBinary(I, ISD::OR,  0, 0); }
-  void visitXor(User &I) { visitBinary(I, ISD::XOR, 0, 0); }
+  void visitAnd(User &I) { visitBinary(I, ISD::AND, 0, ISD::VAND); }
+  void visitOr (User &I) { visitBinary(I, ISD::OR,  0, ISD::VOR); }
+  void visitXor(User &I) { visitBinary(I, ISD::XOR, 0, ISD::VXOR); }
   void visitShl(User &I) { visitShift(I, ISD::SHL); }
   void visitShr(User &I) { 
 visitShift(I, I.getType()->isUnsigned() ? ISD::SRL : ISD::SRA);



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


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

2006-03-02 Thread Evan Cheng


Changes in directory llvm/include/llvm/CodeGen:

SelectionDAGNodes.h updated: 1.108 -> 1.109
---
Log message:

Add more vector NodeTypes: VSDIV, VUDIV, VAND, VOR, and VXOR.


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

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


Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.108 
llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.109
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.108 Fri Mar  3 00:42:32 2006
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h   Fri Mar  3 01:01:07 2006
@@ -147,7 +147,8 @@
 // the elements.  The order is count, type, op0, op1.  All vector opcodes,
 // including VLOAD and VConstant must currently have count and type as
 // their 1st and 2nd arguments.
-VADD, VSUB, VMUL,
+VADD, VSUB, VMUL, VSDIV, VUDIV,
+VAND, VOR, VXOR,
 
 // MULHU/MULHS - Multiply high - Multiply two integers of type iN, 
producing
 // an unsigned/signed value of type i[2*n], then return the top part.



___
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-03-02 Thread Evan Cheng


Changes in directory llvm/include/llvm/Target:

TargetLowering.h updated: 1.57 -> 1.58
---
Log message:

Number of NodeTypes now exceeds 128.


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

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


Index: llvm/include/llvm/Target/TargetLowering.h
diff -u llvm/include/llvm/Target/TargetLowering.h:1.57 
llvm/include/llvm/Target/TargetLowering.h:1.58
--- llvm/include/llvm/Target/TargetLowering.h:1.57  Tue Feb 28 22:52:29 2006
+++ llvm/include/llvm/Target/TargetLowering.h   Fri Mar  3 00:58:59 2006
@@ -642,7 +642,7 @@
   /// Most operations are Legal (aka, supported natively by the target), but
   /// operations that are not should be described.  Note that operations on
   /// non-legal value types are not described here.
-  uint64_t OpActions[128];
+  uint64_t OpActions[156];
   
   ValueTypeActionImpl ValueTypeActions;
 
@@ -654,7 +654,7 @@
   /// TargetDAGCombineArray - Targets can specify ISD nodes that they would
   /// like PerformDAGCombine callbacks for by calling setTargetDAGCombine(),
   /// which sets a bit in this array.
-  unsigned char TargetDAGCombineArray[128/(sizeof(unsigned char)*8)];
+  unsigned char TargetDAGCombineArray[156/(sizeof(unsigned char)*8)];
   
 protected:
   /// When lowering %llvm.memset this field specifies the maximum number of



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