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

2005-12-21 Thread Chris Lattner


Changes in directory llvm/lib/Target:

TargetSelectionDAG.td updated: 1.32 -> 1.33
---
Log message:

add some nodes, forgot to commit this last night :(


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

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


Index: llvm/lib/Target/TargetSelectionDAG.td
diff -u llvm/lib/Target/TargetSelectionDAG.td:1.32 
llvm/lib/Target/TargetSelectionDAG.td:1.33
--- llvm/lib/Target/TargetSelectionDAG.td:1.32  Tue Dec 20 01:38:38 2005
+++ llvm/lib/Target/TargetSelectionDAG.td   Wed Dec 21 10:22:46 2005
@@ -242,6 +242,8 @@
 def fabs   : SDNode<"ISD::FABS"   , SDTFPUnaryOp>;
 def fneg   : SDNode<"ISD::FNEG"   , SDTFPUnaryOp>;
 def fsqrt  : SDNode<"ISD::FSQRT"  , SDTFPUnaryOp>;
+def fsin   : SDNode<"ISD::FSIN"   , SDTFPUnaryOp>;
+def fcos   : SDNode<"ISD::FCOS"   , SDTFPUnaryOp>;
 
 def fround : SDNode<"ISD::FP_ROUND"   , SDTFPRoundOp>;
 def fextend: SDNode<"ISD::FP_EXTEND"  , SDTFPExtendOp>;



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


[llvm-commits] CVS: llvm/test/Regression/Assembler/2005-12-21-ZeroInitVector.ll

2005-12-21 Thread Chris Lattner


Changes in directory llvm/test/Regression/Assembler:

2005-12-21-ZeroInitVector.ll added (r1.1)
---
Log message:

new testcase


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

 2005-12-21-ZeroInitVector.ll |5 +
 1 files changed, 5 insertions(+)


Index: llvm/test/Regression/Assembler/2005-12-21-ZeroInitVector.ll
diff -c /dev/null 
llvm/test/Regression/Assembler/2005-12-21-ZeroInitVector.ll:1.1
*** /dev/null   Wed Dec 21 11:52:53 2005
--- llvm/test/Regression/Assembler/2005-12-21-ZeroInitVector.ll Wed Dec 21 
11:52:42 2005
***
*** 0 
--- 1,5 
+ ; RUN: llvm-as < %s > /dev/null
+ 
+ < 4 x int> %foo() {
+   ret <4 x int> zeroinitializer
+ }



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


[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y ParserInternals.h

2005-12-21 Thread Chris Lattner


Changes in directory llvm/lib/AsmParser:

llvmAsmParser.y updated: 1.239 -> 1.240
ParserInternals.h updated: 1.41 -> 1.42
---
Log message:

Implement Regression/Assembler/2005-12-21-ZeroInitVector.ll


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

 ParserInternals.h |8 +++-
 llvmAsmParser.y   |6 ++
 2 files changed, 13 insertions(+), 1 deletion(-)


Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.239 
llvm/lib/AsmParser/llvmAsmParser.y:1.240
--- llvm/lib/AsmParser/llvmAsmParser.y:1.239Sat Nov 12 12:21:21 2005
+++ llvm/lib/AsmParser/llvmAsmParser.y  Wed Dec 21 11:53:02 2005
@@ -303,6 +303,9 @@
   case ValID::ConstUndefVal:  // Is it an undef value?
 return UndefValue::get(Ty);
 
+  case ValID::ConstZeroVal:  // Is it a zero value?
+return Constant::getNullValue(Ty);
+
   case ValID::ConstantVal:   // Fully resolved constant?
 if (D.ConstantValue->getType() != Ty)
   ThrowException("Constant expression type different from required type!");
@@ -1816,6 +1819,9 @@
   | UNDEF {
 $$ = ValID::createUndef();
   }
+  | ZEROINITIALIZER { // A vector zero constant.
+$$ = ValID::createZeroInit();
+  }
   | '<' ConstVector '>' { // Nonempty unsized packed vector
 const Type *ETy = (*$2)[0]->getType();
 int NumElements = $2->size(); 


Index: llvm/lib/AsmParser/ParserInternals.h
diff -u llvm/lib/AsmParser/ParserInternals.h:1.41 
llvm/lib/AsmParser/ParserInternals.h:1.42
--- llvm/lib/AsmParser/ParserInternals.h:1.41   Thu May 19 22:25:47 2005
+++ llvm/lib/AsmParser/ParserInternals.hWed Dec 21 11:53:02 2005
@@ -82,7 +82,7 @@
 struct ValID {
   enum {
 NumberVal, NameVal, ConstSIntVal, ConstUIntVal, ConstFPVal, ConstNullVal,
-ConstUndefVal, ConstantVal,
+ConstUndefVal, ConstZeroVal, ConstantVal,
   } Type;
 
   union {
@@ -122,6 +122,10 @@
 ValID D; D.Type = ConstUndefVal; return D;
   }
 
+  static ValID createZeroInit() {
+ValID D; D.Type = ConstZeroVal; return D;
+  }
+  
   static ValID create(Constant *Val) {
 ValID D; D.Type = ConstantVal; D.ConstantValue = Val; return D;
   }
@@ -145,6 +149,7 @@
 case ConstFPVal: return ftostr(ConstPoolFP);
 case ConstNullVal  : return "null";
 case ConstUndefVal : return "undef";
+case ConstZeroVal  : return "zeroinitializer";
 case ConstUIntVal  :
 case ConstSIntVal  : return std::string("%") + itostr(ConstPool64);
 case ConstantVal:
@@ -168,6 +173,7 @@
 case ConstFPVal:return ConstPoolFP  < V.ConstPoolFP;
 case ConstNullVal:  return false;
 case ConstUndefVal: return false;
+case ConstZeroVal: return false;
 case ConstantVal:   return ConstantValue < V.ConstantValue;
 default:  assert(0 && "Unknown value type!"); return false;
 }



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


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

2005-12-21 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.236 -> 1.237
---
Log message:

fix a bug I introduced that broke recursive expansion of nodes (e.g. 
scalarizing vectors)


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

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


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.236 
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.237
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.236 Mon Dec 19 18:53:54 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp   Wed Dec 21 12:02:52 2005
@@ -3827,9 +3827,12 @@
   std::make_pair(Lo, Hi))).second;
   assert(isNew && "Value already expanded?!?");
   
-  // Make sure the resultant values have been legalized themselves.
-  Lo = LegalizeOp(Lo);
-  Hi = LegalizeOp(Hi);
+  // Make sure the resultant values have been legalized themselves, unless this
+  // is a type that requires multi-step expansion.
+  if (getTypeAction(NVT) != Expand && NVT != MVT::isVoid) {
+Lo = LegalizeOp(Lo);
+Hi = LegalizeOp(Hi);
+  }
 }
 
 



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


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

2005-12-21 Thread Chris Lattner


Changes in directory llvm/lib/VMCore:

Instructions.cpp updated: 1.28 -> 1.29
Verifier.cpp updated: 1.135 -> 1.136
---
Log message:

Get logical operations to like packed types, allow BinOp::getNot to create
the right vector of -1's as its operand.


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

 Instructions.cpp |   22 --
 Verifier.cpp |4 +++-
 2 files changed, 19 insertions(+), 7 deletions(-)


Index: llvm/lib/VMCore/Instructions.cpp
diff -u llvm/lib/VMCore/Instructions.cpp:1.28 
llvm/lib/VMCore/Instructions.cpp:1.29
--- llvm/lib/VMCore/Instructions.cpp:1.28   Sat Nov  5 15:57:54 2005
+++ llvm/lib/VMCore/Instructions.cppWed Dec 21 12:22:19 2005
@@ -811,16 +811,17 @@
   case Rem:
 assert(getType() == LHS->getType() &&
"Arithmetic operation should return same type as operands!");
-assert((getType()->isInteger() ||
-getType()->isFloatingPoint() ||
-isa(getType()) ) &&
+assert((getType()->isInteger() || getType()->isFloatingPoint() ||
+isa(getType())) &&
   "Tried to create an arithmetic operation on a non-arithmetic type!");
 break;
   case And: case Or:
   case Xor:
 assert(getType() == LHS->getType() &&
"Logical operation should return same type as operands!");
-assert(getType()->isIntegral() &&
+assert((getType()->isIntegral() ||
+(isa(getType()) && 
+ cast(getType())->getElementType()->isIntegral())) &&
"Tried to create a logical operation on a non-integral type!");
 break;
   case SetLT: case SetGT: case SetLE:
@@ -889,8 +890,17 @@
 
 BinaryOperator *BinaryOperator::createNot(Value *Op, const std::string &Name,
   BasicBlock *InsertAtEnd) {
-  return new BinaryOperator(Instruction::Xor, Op,
-ConstantIntegral::getAllOnesValue(Op->getType()),
+  Constant *AllOnes;
+  if (const PackedType *PTy = dyn_cast(Op->getType())) {
+// Create a vector of all ones values.
+Constant *Elt = ConstantIntegral::getAllOnesValue(PTy->getElementType());
+AllOnes = 
+  ConstantPacked::get(std::vector(PTy->getNumElements(), Elt));
+  } else {
+AllOnes = ConstantIntegral::getAllOnesValue(Op->getType());
+  }
+  
+  return new BinaryOperator(Instruction::Xor, Op, AllOnes,
 Op->getType(), Name, InsertAtEnd);
 }
 


Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.135 llvm/lib/VMCore/Verifier.cpp:1.136
--- llvm/lib/VMCore/Verifier.cpp:1.135  Fri Nov 11 10:46:18 2005
+++ llvm/lib/VMCore/Verifier.cppWed Dec 21 12:22:19 2005
@@ -498,7 +498,9 @@
   // Check that logical operators are only used with integral operands.
   if (B.getOpcode() == Instruction::And || B.getOpcode() == Instruction::Or ||
   B.getOpcode() == Instruction::Xor) {
-Assert1(B.getType()->isIntegral(),
+Assert1(B.getType()->isIntegral() ||
+(isa(B.getType()) && 
+ cast(B.getType())->getElementType()->isIntegral()),
 "Logical operators only work with integral types!", &B);
 Assert1(B.getType() == B.getOperand(0)->getType(),
 "Logical operators must have same type for operands and result!",



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


[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y

2005-12-21 Thread Chris Lattner


Changes in directory llvm/lib/AsmParser:

llvmAsmParser.y updated: 1.240 -> 1.241
---
Log message:

allow logical operators on packed integral types


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

 llvmAsmParser.y |   14 ++
 1 files changed, 10 insertions(+), 4 deletions(-)


Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.240 
llvm/lib/AsmParser/llvmAsmParser.y:1.241
--- llvm/lib/AsmParser/llvmAsmParser.y:1.240Wed Dec 21 11:53:02 2005
+++ llvm/lib/AsmParser/llvmAsmParser.y  Wed Dec 21 12:31:29 2005
@@ -1501,8 +1501,11 @@
   | LogicalOps '(' ConstVal ',' ConstVal ')' {
 if ($3->getType() != $5->getType())
   ThrowException("Logical operator types must match!");
-if (!$3->getType()->isIntegral())
-  ThrowException("Logical operands must have integral types!");
+if (!$3->getType()->isIntegral()) {
+  if (!isa($3->getType()) || 
+  !cast($3->getType())->getElementType()->isIntegral())
+ThrowException("Logical operator requires integral operands!");
+}
 $$ = ConstantExpr::get($1, $3, $5);
   }
   | SetCondOps '(' ConstVal ',' ConstVal ')' {
@@ -2079,8 +2082,11 @@
 delete $2;
   }
   | LogicalOps Types ValueRef ',' ValueRef {
-if (!(*$2)->isIntegral())
-  ThrowException("Logical operator requires integral operands!");
+if (!(*$2)->isIntegral()) {
+  if (!isa($2->get()) ||
+  !cast($2->get())->getElementType()->isIntegral())
+ThrowException("Logical operator requires integral operands!");
+}
 $$ = BinaryOperator::create($1, getVal(*$2, $3), getVal(*$2, $5));
 if ($$ == 0)
   ThrowException("binary operator returned null!");



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


[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp

2005-12-21 Thread Chris Lattner


Changes in directory llvm/lib/AsmParser:

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

Regenerate


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

 llvmAsmParser.cpp |  248 +++---
 1 files changed, 127 insertions(+), 121 deletions(-)


Index: llvm/lib/AsmParser/llvmAsmParser.cpp
diff -u llvm/lib/AsmParser/llvmAsmParser.cpp:1.26 
llvm/lib/AsmParser/llvmAsmParser.cpp:1.27
--- llvm/lib/AsmParser/llvmAsmParser.cpp:1.26   Wed Dec 21 11:53:23 2005
+++ llvm/lib/AsmParser/llvmAsmParser.cppWed Dec 21 12:31:50 2005
@@ -1175,18 +1175,18 @@
   1154,  1163,  1166,  1174,  1178,  1183,  1184,  1187,  1190,  1200,
   1225,  1238,  1266,  1291,  1311,  1323,  1332,  1336,  1395,  1401,
   1409,  1414,  1419,  1422,  1425,  1432,  1442,  1473,  1480,  1501,
-  1508,  1513,  1523,  1526,  1533,  1533,  1543,  1550,  1554,  1557,
-  1560,  1573,  1593,  1595,  1598,  1601,  1605,  1608,  1610,  1612,
-  1617,  1618,  1620,  1623,  1631,  1636,  1638,  1642,  1646,  1654,
-  1654,  1655,  1655,  1657,  1663,  1668,  1674,  1677,  1682,  1686,
-  1690,  1776,  1776,  1778,  1786,  1786,  1788,  1792,  1792,  1801,
-  1804,  1807,  1810,  1813,  1816,  1819,  1822,  1825,  1849,  1856,
-  1859,  1864,  1864,  1870,  1874,  1877,  1885,  1894,  1898,  1908,
-  1919,  1922,  1925,  1928,  1931,  1945,  1949,  2002,  2005,  2011,
-  2019,  2029,  2036,  2041,  2048,  2052,  2058,  2058,  2060,  2063,
-  2069,  2081,  2089,  2099,  2111,  2118,  2125,  2132,  2137,  2156,
-  2178,  2192,  2249,  2255,  2257,  2261,  2264,  2270,  2274,  2278,
-  2282,  2286,  2293,  2303,  2316
+  1511,  1516,  1526,  1529,  1536,  1536,  1546,  1553,  1557,  1560,
+  1563,  1576,  1596,  1598,  1601,  1604,  1608,  1611,  1613,  1615,
+  1620,  1621,  1623,  1626,  1634,  1639,  1641,  1645,  1649,  1657,
+  1657,  1658,  1658,  1660,  1666,  1671,  1677,  1680,  1685,  1689,
+  1693,  1779,  1779,  1781,  1789,  1789,  1791,  1795,  1795,  1804,
+  1807,  1810,  1813,  1816,  1819,  1822,  1825,  1828,  1852,  1859,
+  1862,  1867,  1867,  1873,  1877,  1880,  1888,  1897,  1901,  1911,
+  1922,  1925,  1928,  1931,  1934,  1948,  1952,  2005,  2008,  2014,
+  2022,  2032,  2039,  2044,  2051,  2055,  2061,  2061,  2063,  2066,
+  2072,  2084,  2095,  2105,  2117,  2124,  2131,  2138,  2143,  2162,
+  2184,  2198,  2255,  2261,  2263,  2267,  2270,  2276,  2280,  2284,
+  2288,  2292,  2299,  2309,  2322
 };
 #endif
 
@@ -2821,13 +2821,16 @@
 {
 if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType())
   ThrowException("Logical operator types must match!");
-if (!yyvsp[-3].ConstVal->getType()->isIntegral())
-  ThrowException("Logical operands must have integral types!");
+if (!yyvsp[-3].ConstVal->getType()->isIntegral()) {
+  if (!isa(yyvsp[-3].ConstVal->getType()) || 
+  
!cast(yyvsp[-3].ConstVal->getType())->getElementType()->isIntegral())
+ThrowException("Logical operator requires integral operands!");
+}
 yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, 
yyvsp[-3].ConstVal, yyvsp[-1].ConstVal);
   ;
 break;}
 case 111:
-#line 1508 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1511 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
 {
 if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType())
   ThrowException("setcc operand types must match!");
@@ -2835,7 +2838,7 @@
   ;
 break;}
 case 112:
-#line 1513 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1516 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
 {
 if (yyvsp[-1].ConstVal->getType() != Type::UByteTy)
   ThrowException("Shift count for shift constant must be unsigned byte!");
@@ -2845,54 +2848,54 @@
   ;
 break;}
 case 113:
-#line 1523 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1526 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
 {
 (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal);
   ;
 break;}
 case 114:
-#line 1526 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1529 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
 {
 yyval.ConstVector = new std::vector();
 yyval.ConstVector->push_back(yyvsp[0].ConstVal);
   ;
 break;}
 case 115:
-#line 1533 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1536 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
 { yyval.BoolVal = false; ;
 break;}
 case 116:
-#line 1533 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1536 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
 { yyval.BoolVal = true; ;
 break;}
 case 117:
-#line 1543 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1546 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
 {
   yyval.ModuleVal = ParserResult = yyvsp[0].Modu

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

2005-12-21 Thread Chris Lattner


Changes in directory llvm-test:

Makefile.programs updated: 1.181 -> 1.182
---
Log message:

Change beta options back


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

 Makefile.programs |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)


Index: llvm-test/Makefile.programs
diff -u llvm-test/Makefile.programs:1.181 llvm-test/Makefile.programs:1.182
--- llvm-test/Makefile.programs:1.181   Mon Dec  5 01:04:22 2005
+++ llvm-test/Makefile.programs Wed Dec 21 13:35:05 2005
@@ -187,8 +187,7 @@
 endif#DISABLE_DIFFS
 
 ifeq ($(ARCH),PowerPC)
-LLCBETAOPTION := -enable-gep-isel-opt
-#-sched=simple
+LLCBETAOPTION := -sched=simple
 endif
 ifeq ($(ARCH),Alpha)
 LLCBETAOPTION := -enable-dag-isel-for-alpha
@@ -198,8 +197,7 @@
 LLCBETAOPTION := -enable-ia64-dag-isel 
 endif
 ifeq ($(ARCH),x86)
-LLCBETAOPTION := -enable-gep-isel-opt
-#-enable-x86-fastcc
+LLCBETAOPTION := -enable-x86-fastcc
 endif
 
 # Given a version of the entire program linked together into a single unit of



___
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

2005-12-21 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.118 -> 1.119
---
Log message:

enable the gep isel opt


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

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


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.118 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.119
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.118Tue Dec 20 
20:43:26 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Wed Dec 21 13:36:36 2005
@@ -40,10 +40,6 @@
 #include 
 using namespace llvm;
 
-static cl::opt
-GEPISelTest("enable-gep-isel-opt", cl::Hidden,
-cl::desc("temporary for testing"));
-
 #ifndef NDEBUG
 static cl::opt
 ViewDAGs("view-isel-dags", cl::Hidden,
@@ -1315,8 +1311,6 @@
 /// indices into blocks that use it.
 static void OptimizeGEPExpression(GetElementPtrInst *GEPI,
   const TargetData &TD) {
-  if (!GEPISelTest) return;
-  
   // If this GEP is only used inside the block it is defined in, there is no
   // need to rewrite it.
   bool isUsedOutsideDefBB = false;



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


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

2005-12-21 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.237 -> 1.238
---
Log message:

make sure to relegalize all cases


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

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


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.237 
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.238
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.237 Wed Dec 21 12:02:52 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp   Wed Dec 21 13:40:42 2005
@@ -1036,9 +1036,9 @@
 Result = DAG.getNode(ISD::BRCOND, MVT::Other, Tmp1, Tmp2,
  Node->getOperand(4));
 Result = DAG.getNode(ISD::BR, MVT::Other, Result, Node->getOperand(5));
-Result = LegalizeOp(Result);  // Relegalize new nodes.
 break;
   }
+  Result = LegalizeOp(Result);  // Relegalize new nodes.
 }
 break;
   case ISD::LOAD:



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

2005-12-21 Thread Jim Laskey


Changes in directory llvm/include/llvm/CodeGen:

DwarfWriter.h added (r1.1)
---
Log message:

Start of Dwarf framework code.


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

 DwarfWriter.h |  424 ++
 1 files changed, 424 insertions(+)


Index: llvm/include/llvm/CodeGen/DwarfWriter.h
diff -c /dev/null llvm/include/llvm/CodeGen/DwarfWriter.h:1.1
*** /dev/null   Wed Dec 21 13:44:50 2005
--- llvm/include/llvm/CodeGen/DwarfWriter.h Wed Dec 21 13:44:40 2005
***
*** 0 
--- 1,424 
+ //===-- llvm/CodeGen/DwarfWriter.h - Dwarf Framework *- C++ 
-*-===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by James M. Laskey and is distributed under the
+ // University of Illinois Open Source License. See LICENSE.TXT for details.
+ //
+ 
//===--===//
+ //
+ // This file contains support for writing dwarf debug info into asm files.
+ //
+ 
//===--===//
+ 
+ #ifndef LLVM_CODEGEN_DWARFPRINTER_H
+ #define LLVM_CODEGEN_DWARFPRINTER_H
+ 
+ 
//===--===//
+ // Dwarf constants as gleaned from the DWARF Debugging Information Format V.3
+ // reference manual http://dwarf.freestandards.org. 
+ //
+ enum dwarf_constants {
+  // Tags
+   DW_TAG_array_type = 0x01,
+   DW_TAG_class_type = 0x02,
+   DW_TAG_entry_point = 0x03,
+   DW_TAG_enumeration_type = 0x04,
+   DW_TAG_formal_parameter = 0x05,
+   DW_TAG_imported_declaration = 0x08,
+   DW_TAG_label = 0x0a,
+   DW_TAG_lexical_block = 0x0b,
+   DW_TAG_member = 0x0d,
+   DW_TAG_pointer_type = 0x0f,
+   DW_TAG_reference_type = 0x10,
+   DW_TAG_compile_unit = 0x11,
+   DW_TAG_string_type = 0x12,
+   DW_TAG_structure_type = 0x13,
+   DW_TAG_subroutine_type = 0x15,
+   DW_TAG_typedef = 0x16,
+   DW_TAG_union_type = 0x17,
+   DW_TAG_unspecified_parameters = 0x18,
+   DW_TAG_variant = 0x19,
+   DW_TAG_common_block = 0x1a,
+   DW_TAG_common_inclusion = 0x1b,
+   DW_TAG_inheritance = 0x1c,
+   DW_TAG_inlined_subroutine = 0x1d,
+   DW_TAG_module = 0x1e,
+   DW_TAG_ptr_to_member_type = 0x1f,
+   DW_TAG_set_type = 0x20,
+   DW_TAG_subrange_type = 0x21,
+   DW_TAG_with_stmt = 0x22,
+   DW_TAG_access_declaration = 0x23,
+   DW_TAG_base_type = 0x24,
+   DW_TAG_catch_block = 0x25,
+   DW_TAG_const_type = 0x26,
+   DW_TAG_constant = 0x27,
+   DW_TAG_enumerator = 0x28,
+   DW_TAG_file_type = 0x29,
+   DW_TAG_friend = 0x2a,
+   DW_TAG_namelist = 0x2b,
+   DW_TAG_namelist_item = 0x2c,
+   DW_TAG_packed_type = 0x2d,
+   DW_TAG_subprogram = 0x2e,
+   DW_TAG_template_type_parameter = 0x2f,
+   DW_TAG_template_value_parameter = 0x30,
+   DW_TAG_thrown_type = 0x31,
+   DW_TAG_try_block = 0x32,
+   DW_TAG_variant_part = 0x33,
+   DW_TAG_variable = 0x34,
+   DW_TAG_volatile_type = 0x35,
+   DW_TAG_dwarf_procedure = 0x36,
+   DW_TAG_restrict_type = 0x37,
+   DW_TAG_interface_type = 0x38,
+   DW_TAG_namespace = 0x39,
+   DW_TAG_imported_module = 0x3a,
+   DW_TAG_unspecified_type = 0x3b,
+   DW_TAG_partial_unit = 0x3c,
+   DW_TAG_imported_unit = 0x3d,
+   DW_TAG_condition = 0x3f,
+   DW_TAG_shared_type = 0x40,
+   DW_TAG_lo_user = 0x4080,
+   DW_TAG_hi_user = 0x,
+ 
+   // Children flag
+   DW_CHILDREN_no = 0x00,
+   DW_CHILDREN_yes = 0x01,
+ 
+   // Attributes
+   DW_AT_sibling = 0x01,
+   DW_AT_location = 0x02,
+   DW_AT_name = 0x03,
+   DW_AT_ordering = 0x09,
+   DW_AT_byte_size = 0x0b,
+   DW_AT_bit_offset = 0x0c,
+   DW_AT_bit_size = 0x0d,
+   DW_AT_stmt_list = 0x10,
+   DW_AT_low_pc = 0x11,
+   DW_AT_high_pc = 0x12,
+   DW_AT_language = 0x13,
+   DW_AT_discr = 0x15,
+   DW_AT_discr_value = 0x16,
+   DW_AT_visibility = 0x17,
+   DW_AT_import = 0x18,
+   DW_AT_string_length = 0x19,
+   DW_AT_common_reference = 0x1a,
+   DW_AT_comp_dir = 0x1b,
+   DW_AT_const_value = 0x1c,
+   DW_AT_containing_type = 0x1d,
+   DW_AT_default_value = 0x1e,
+   DW_AT_inline = 0x20,
+   DW_AT_is_optional = 0x21,
+   DW_AT_lower_bound = 0x22,
+   DW_AT_producer = 0x25,
+   DW_AT_prototyped = 0x27,
+   DW_AT_return_addr = 0x2a,
+   DW_AT_start_scope = 0x2c,
+   DW_AT_bit_stride = 0x2e,
+   DW_AT_upper_bound = 0x2f,
+   DW_AT_abstract_origin = 0x31,
+   DW_AT_accessibility = 0x32,
+   DW_AT_address_class = 0x33,
+   DW_AT_artificial = 0x34,
+   DW_AT_base_types = 0x35,
+   DW_AT_calling_convention = 0x36,
+   DW_AT_count = 0x37,
+   DW_AT_data_member_location = 0x38,
+   DW_AT_decl_column = 0x39,
+   DW_AT_decl_file = 0x3a,
+   DW_AT_decl_line = 0x3b,
+   DW_AT_declaration = 0x3c,
+   DW_AT_discr_list = 0x3d,
+   DW_AT_encoding = 0x3e,
+   DW_AT_external = 0x3f,
+   DW_AT_frame_base = 0x40,
+   DW_AT_friend = 0x41,
+   DW_AT_identifier_case = 0x42,
+   DW_AT_macro_info = 0x43,
+   DW_AT_namelist_item = 0x44,
+   DW_AT_priority = 0x45,
+   DW_AT_segment = 0x46,
+   DW_AT_specification = 0x47,
+   DW_AT

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

2005-12-21 Thread Jim Laskey


Changes in directory llvm/include/llvm/CodeGen:

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

Oops llvm namespace.


---
Diffs of the changes:  (+410 -406)

 DwarfWriter.h |  816 +-
 1 files changed, 410 insertions(+), 406 deletions(-)


Index: llvm/include/llvm/CodeGen/DwarfWriter.h
diff -u llvm/include/llvm/CodeGen/DwarfWriter.h:1.1 
llvm/include/llvm/CodeGen/DwarfWriter.h:1.2
--- llvm/include/llvm/CodeGen/DwarfWriter.h:1.1 Wed Dec 21 13:44:40 2005
+++ llvm/include/llvm/CodeGen/DwarfWriter.h Wed Dec 21 13:46:32 2005
@@ -14,411 +14,415 @@
 #ifndef LLVM_CODEGEN_DWARFPRINTER_H
 #define LLVM_CODEGEN_DWARFPRINTER_H
 
-//===--===//
-// Dwarf constants as gleaned from the DWARF Debugging Information Format V.3
-// reference manual http://dwarf.freestandards.org. 
-//
-enum dwarf_constants {
- // Tags
-  DW_TAG_array_type = 0x01,
-  DW_TAG_class_type = 0x02,
-  DW_TAG_entry_point = 0x03,
-  DW_TAG_enumeration_type = 0x04,
-  DW_TAG_formal_parameter = 0x05,
-  DW_TAG_imported_declaration = 0x08,
-  DW_TAG_label = 0x0a,
-  DW_TAG_lexical_block = 0x0b,
-  DW_TAG_member = 0x0d,
-  DW_TAG_pointer_type = 0x0f,
-  DW_TAG_reference_type = 0x10,
-  DW_TAG_compile_unit = 0x11,
-  DW_TAG_string_type = 0x12,
-  DW_TAG_structure_type = 0x13,
-  DW_TAG_subroutine_type = 0x15,
-  DW_TAG_typedef = 0x16,
-  DW_TAG_union_type = 0x17,
-  DW_TAG_unspecified_parameters = 0x18,
-  DW_TAG_variant = 0x19,
-  DW_TAG_common_block = 0x1a,
-  DW_TAG_common_inclusion = 0x1b,
-  DW_TAG_inheritance = 0x1c,
-  DW_TAG_inlined_subroutine = 0x1d,
-  DW_TAG_module = 0x1e,
-  DW_TAG_ptr_to_member_type = 0x1f,
-  DW_TAG_set_type = 0x20,
-  DW_TAG_subrange_type = 0x21,
-  DW_TAG_with_stmt = 0x22,
-  DW_TAG_access_declaration = 0x23,
-  DW_TAG_base_type = 0x24,
-  DW_TAG_catch_block = 0x25,
-  DW_TAG_const_type = 0x26,
-  DW_TAG_constant = 0x27,
-  DW_TAG_enumerator = 0x28,
-  DW_TAG_file_type = 0x29,
-  DW_TAG_friend = 0x2a,
-  DW_TAG_namelist = 0x2b,
-  DW_TAG_namelist_item = 0x2c,
-  DW_TAG_packed_type = 0x2d,
-  DW_TAG_subprogram = 0x2e,
-  DW_TAG_template_type_parameter = 0x2f,
-  DW_TAG_template_value_parameter = 0x30,
-  DW_TAG_thrown_type = 0x31,
-  DW_TAG_try_block = 0x32,
-  DW_TAG_variant_part = 0x33,
-  DW_TAG_variable = 0x34,
-  DW_TAG_volatile_type = 0x35,
-  DW_TAG_dwarf_procedure = 0x36,
-  DW_TAG_restrict_type = 0x37,
-  DW_TAG_interface_type = 0x38,
-  DW_TAG_namespace = 0x39,
-  DW_TAG_imported_module = 0x3a,
-  DW_TAG_unspecified_type = 0x3b,
-  DW_TAG_partial_unit = 0x3c,
-  DW_TAG_imported_unit = 0x3d,
-  DW_TAG_condition = 0x3f,
-  DW_TAG_shared_type = 0x40,
-  DW_TAG_lo_user = 0x4080,
-  DW_TAG_hi_user = 0x,
-
-  // Children flag
-  DW_CHILDREN_no = 0x00,
-  DW_CHILDREN_yes = 0x01,
-
-  // Attributes
-  DW_AT_sibling = 0x01,
-  DW_AT_location = 0x02,
-  DW_AT_name = 0x03,
-  DW_AT_ordering = 0x09,
-  DW_AT_byte_size = 0x0b,
-  DW_AT_bit_offset = 0x0c,
-  DW_AT_bit_size = 0x0d,
-  DW_AT_stmt_list = 0x10,
-  DW_AT_low_pc = 0x11,
-  DW_AT_high_pc = 0x12,
-  DW_AT_language = 0x13,
-  DW_AT_discr = 0x15,
-  DW_AT_discr_value = 0x16,
-  DW_AT_visibility = 0x17,
-  DW_AT_import = 0x18,
-  DW_AT_string_length = 0x19,
-  DW_AT_common_reference = 0x1a,
-  DW_AT_comp_dir = 0x1b,
-  DW_AT_const_value = 0x1c,
-  DW_AT_containing_type = 0x1d,
-  DW_AT_default_value = 0x1e,
-  DW_AT_inline = 0x20,
-  DW_AT_is_optional = 0x21,
-  DW_AT_lower_bound = 0x22,
-  DW_AT_producer = 0x25,
-  DW_AT_prototyped = 0x27,
-  DW_AT_return_addr = 0x2a,
-  DW_AT_start_scope = 0x2c,
-  DW_AT_bit_stride = 0x2e,
-  DW_AT_upper_bound = 0x2f,
-  DW_AT_abstract_origin = 0x31,
-  DW_AT_accessibility = 0x32,
-  DW_AT_address_class = 0x33,
-  DW_AT_artificial = 0x34,
-  DW_AT_base_types = 0x35,
-  DW_AT_calling_convention = 0x36,
-  DW_AT_count = 0x37,
-  DW_AT_data_member_location = 0x38,
-  DW_AT_decl_column = 0x39,
-  DW_AT_decl_file = 0x3a,
-  DW_AT_decl_line = 0x3b,
-  DW_AT_declaration = 0x3c,
-  DW_AT_discr_list = 0x3d,
-  DW_AT_encoding = 0x3e,
-  DW_AT_external = 0x3f,
-  DW_AT_frame_base = 0x40,
-  DW_AT_friend = 0x41,
-  DW_AT_identifier_case = 0x42,
-  DW_AT_macro_info = 0x43,
-  DW_AT_namelist_item = 0x44,
-  DW_AT_priority = 0x45,
-  DW_AT_segment = 0x46,
-  DW_AT_specification = 0x47,
-  DW_AT_static_link = 0x48,
-  DW_AT_type = 0x49,
-  DW_AT_use_location = 0x4a,
-  DW_AT_variable_parameter = 0x4b,
-  DW_AT_virtuality = 0x4c,
-  DW_AT_vtable_elem_location = 0x4d,
-  DW_AT_allocated = 0x4e,
-  DW_AT_associated = 0x4f,
-  DW_AT_data_location = 0x50,
-  DW_AT_byte_stride = 0x51,
-  DW_AT_entry_pc = 0x52,
-  DW_AT_use_UTF8 = 0x53,
-  DW_AT_extension = 0x54,
-  DW_AT_ranges = 0x55,
-  DW_AT_trampoline = 0x56,
-  DW_AT_call_column = 0x57,
-  DW_AT_call_file = 0x58,
-  DW_AT_call_line = 0x59,
-  DW_AT_description = 0x5a,
-  DW_AT_binary_scale = 0x5b,
-  DW_AT_decimal_scale = 0x5c,
-  DW_AT_small = 0x5d,
-  DW_AT_decimal_s

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

2005-12-21 Thread Jim Laskey


Changes in directory llvm/lib/CodeGen:

DwarfWriter.cpp added (r1.1)
---
Log message:

Start of Dwarf framework.


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

 DwarfWriter.cpp |   15 +++
 1 files changed, 15 insertions(+)


Index: llvm/lib/CodeGen/DwarfWriter.cpp
diff -c /dev/null llvm/lib/CodeGen/DwarfWriter.cpp:1.1
*** /dev/null   Wed Dec 21 13:48:26 2005
--- llvm/lib/CodeGen/DwarfWriter.cppWed Dec 21 13:48:16 2005
***
*** 0 
--- 1,15 
+ //===-- llvm/CodeGen/DwarfWriter.cpp - Dwarf Framework --*- C++ 
-*-===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by James M. Laskey and is distributed under the
+ // University of Illinois Open Source License. See LICENSE.TXT for details.
+ //
+ 
//===--===//
+ //
+ // This file contains support for writing dwarf debug info into asm files.
+ //
+ 
//===--===//
+ 
+ 
+ #include "llvm/CodeGen/DwarfWriter.h"
\ No newline at end of file



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


[llvm-commits] CVS: llvm/Xcode/LLVM.xcodeproj/project.pbxproj

2005-12-21 Thread Chris Lattner


Changes in directory llvm/Xcode/LLVM.xcodeproj:

project.pbxproj updated: 1.13 -> 1.14
---
Log message:

add dwarfwriter to the xcode project


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

 project.pbxproj |4 
 1 files changed, 4 insertions(+)


Index: llvm/Xcode/LLVM.xcodeproj/project.pbxproj
diff -u llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.13 
llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.14
--- llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.13  Sat Oct 29 00:34:40 2005
+++ llvm/Xcode/LLVM.xcodeproj/project.pbxproj   Wed Dec 21 13:51:24 2005
@@ -898,6 +898,8 @@
DE8170AA08CFB44D0093BDEF /* TableGen.cpp */ = {isa = 
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; 
path = TableGen.cpp; sourceTree = ""; };
DE8170AB08CFB44D0093BDEF /* TableGenBackend.cpp */ = {isa = 
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; 
path = TableGenBackend.cpp; sourceTree = ""; };
DE8170AC08CFB44D0093BDEF /* TableGenBackend.h */ = {isa = 
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = 
TableGenBackend.h; sourceTree = ""; };
+   DEFAB19C0959E97F00E0AB42 /* DwarfWriter.cpp */ = {isa = 
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; 
name = DwarfWriter.cpp; path = ../lib/CodeGen/DwarfWriter.cpp; sourceTree = 
SOURCE_ROOT; };
+   DEFAB19D0959E9A100E0AB42 /* DwarfWriter.h */ = {isa = 
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = 
DwarfWriter.h; path = ../include/llvm/CodeGen/DwarfWriter.h; sourceTree = 
SOURCE_ROOT; };
 /* End PBXFileReference section */
 
 /* Begin PBXGroup section */
@@ -1079,6 +1081,7 @@
DE66ED8308ABEC2B00323D32 /* SelectionDAG */,
DE66ED3F08ABEC2A00323D32 /* AsmPrinter.cpp */,
DE66ED4008ABEC2A00323D32 /* BranchFolding.cpp 
*/,
+   DEFAB19C0959E97F00E0AB42 /* DwarfWriter.cpp */,
DE66ED6F08ABEC2B00323D32 /* ELFWriter.cpp */,
DE66ED7008ABEC2B00323D32 /* 
IntrinsicLowering.cpp */,
DE66ED7108ABEC2B00323D32 /* LiveInterval.cpp */,
@@ -1881,6 +1884,7 @@
isa = PBXGroup;
children = (
DE66F23608ABF03100323D32 /* AsmPrinter.h */,
+   DEFAB19D0959E9A100E0AB42 /* DwarfWriter.h */,
DE66F23708ABF03100323D32 /* ELFWriter.h */,
DE66F23808ABF03100323D32 /* InstrScheduling.h 
*/,
DE66F23908ABF03100323D32 /* IntrinsicLowering.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/DAGISelEmitter.cpp

2005-12-21 Thread Evan Cheng


Changes in directory llvm/utils/TableGen:

DAGISelEmitter.cpp updated: 1.110 -> 1.111
---
Log message:

Allows instructions which no explicit operands. e.g. X86 RET which has but
an implicit flag operand.


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

 DAGISelEmitter.cpp |   11 +--
 1 files changed, 5 insertions(+), 6 deletions(-)


Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.110 
llvm/utils/TableGen/DAGISelEmitter.cpp:1.111
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.110Tue Dec 20 23:31:05 2005
+++ llvm/utils/TableGen/DAGISelEmitter.cpp  Wed Dec 21 14:20:49 2005
@@ -1124,23 +1124,22 @@
   std::vector Operands;
   
   CodeGenInstruction &InstInfo 
=Target.getInstruction(Instrs[i]->getName());
-  
-  // Doesn't even define a result?
-  if (InstInfo.OperandList.size() == 0)
-continue;
 
+  // Note: Removed if (InstInfo.OperandList.size() == 0) continue;
+  // It's possible for some instruction, e.g. RET for X86 that only has an
+  // implicit flag operand.
   // FIXME: temporary hack...
   if (InstInfo.isReturn || InstInfo.isBranch || InstInfo.isCall ||
   InstInfo.isStore) {
 // These produce no results
-for (unsigned j = 0, e = InstInfo.OperandList.size(); j != e; ++j)
+for (unsigned j = 0, e = InstInfo.OperandList.size(); j < e; ++j)
   Operands.push_back(InstInfo.OperandList[j].Rec);
   } else {
 // Assume the first operand is the result.
 Results.push_back(InstInfo.OperandList[0].Rec);
   
 // The rest are inputs.
-for (unsigned j = 1, e = InstInfo.OperandList.size(); j != e; ++j)
+for (unsigned j = 1, e = InstInfo.OperandList.size(); j < e; ++j)
   Operands.push_back(InstInfo.OperandList[j].Rec);
   }
   



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


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

2005-12-21 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.12 -> 1.13
X86ISelLowering.h updated: 1.6 -> 1.7
X86InstrInfo.td updated: 1.179 -> 1.180
---
Log message:

* Added support for X86 RET with an additional operand to specify number of
bytes to pop off stack.
* Added support for X86 SETCC.


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

 X86ISelLowering.cpp |   27 -
 X86ISelLowering.h   |   17 +-
 X86InstrInfo.td |  142 +++-
 3 files changed, 122 insertions(+), 64 deletions(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.12 
llvm/lib/Target/X86/X86ISelLowering.cpp:1.13
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.12Tue Dec 20 20:39:21 2005
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Wed Dec 21 14:21:51 2005
@@ -119,6 +119,9 @@
   if (X86DAGIsel) {
 setOperationAction(ISD::SELECT , MVT::i16  , Custom);
 setOperationAction(ISD::SELECT , MVT::i32  , Custom);
+setOperationAction(ISD::SETCC  , MVT::i8   , Custom);
+setOperationAction(ISD::SETCC  , MVT::i16  , Custom);
+setOperationAction(ISD::SETCC  , MVT::i32  , Custom);
   }
 
   // We don't have line number support yet.
@@ -256,7 +259,10 @@
   }
   break;
   }
-  return DAG.getNode(X86ISD::RET_FLAG, MVT::Other, Copy, Copy.getValue(1));
+
+  return DAG.getNode(X86ISD::RET_FLAG, MVT::Other,
+ Copy, DAG.getConstant(getBytesToPopOnReturn(), MVT::i16),
+ Copy.getValue(1));
 }
 
 
//===--===//
@@ -999,10 +1005,20 @@
 Tys.push_back(MVT::Other);
 return DAG.getNode(ISD::MERGE_VALUES, Tys, Ops);
   }
+  case ISD::SETCC: {
+assert(Op.getValueType() == MVT::i8 && "SetCC type must be 8-bit integer");
+SDOperand CC   = Op.getOperand(2);
+SDOperand Cond = DAG.getNode(X86ISD::CMP, MVT::Flag,
+ Op.getOperand(0), Op.getOperand(1));
+return DAG.getNode(X86ISD::SETCC, MVT::i8, CC, Cond);
+  }
   case ISD::SELECT: {
 SDOperand Cond  = Op.getOperand(0);
 SDOperand CC;
-if (Cond.getOpcode() == ISD::SETCC) {
+if (Cond.getOpcode() == X86ISD::SETCC) {
+  CC = Cond.getOperand(0);
+  Cond = Cond.getOperand(1);
+} else if (Cond.getOpcode() == ISD::SETCC) {
   CC = Cond.getOperand(2);
   Cond = DAG.getNode(X86ISD::CMP, MVT::Flag,
  Cond.getOperand(0), Cond.getOperand(1));
@@ -1014,12 +1030,14 @@
Op.getOperand(1), Op.getOperand(2), CC, Cond);
   }
   case ISD::BRCOND: {
-SDOperand Chain = Op.getOperand(0);
 SDOperand Cond  = Op.getOperand(1);
 SDOperand Dest  = Op.getOperand(2);
 SDOperand CC;
 // TODO: handle Cond == OR / AND / XOR
-if (Cond.getOpcode() == ISD::SETCC) {
+if (Cond.getOpcode() == X86ISD::SETCC) {
+  CC = Cond.getOperand(0);
+  Cond = Cond.getOperand(1);
+} else if (Cond.getOpcode() == ISD::SETCC) {
   CC = Cond.getOperand(2);
   Cond = DAG.getNode(X86ISD::CMP, MVT::Flag,
  Cond.getOperand(0), Cond.getOperand(1));
@@ -1061,6 +1079,7 @@
   case X86ISD::RDTSC_DAG:  return "X86ISD::RDTSC_DAG";
   case X86ISD::CMP:return "X86ISD::CMP";
   case X86ISD::TEST:   return "X86ISD::TEST";
+  case X86ISD::SETCC:  return "X86ISD::SETCC";
   case X86ISD::CMOV:   return "X86ISD::CMOV";
   case X86ISD::BRCOND: return "X86ISD::BRCOND";
   case X86ISD::RET_FLAG:   return "X86ISD::RET_FLAG";


Index: llvm/lib/Target/X86/X86ISelLowering.h
diff -u llvm/lib/Target/X86/X86ISelLowering.h:1.6 
llvm/lib/Target/X86/X86ISelLowering.h:1.7
--- llvm/lib/Target/X86/X86ISelLowering.h:1.6   Tue Dec 20 20:39:21 2005
+++ llvm/lib/Target/X86/X86ISelLowering.h   Wed Dec 21 14:21:51 2005
@@ -81,13 +81,24 @@
   /// X86 compare and logical compare instructions.
   CMP, TEST,
 
-  /// X86 conditional moves.
+  /// X86 SetCC. Operand 1 is condition code, and operand 2 is the flag
+  /// operand produced by a CMP instruction.
+  SETCC,
+
+  /// X86 conditional moves. Operand 1 and operand 2 are the two values
+  /// to select from (operand 1 is a R/W operand). Operand 3 is the 
condition
+  /// code, and operand 4 is the flag operand produced by a CMP or TEST
+  /// instruction.
   CMOV,
 
-  /// X86 conditional branches.
+  /// X86 conditional branches. Operand 1 is the chain operand, operand 2
+  /// is the block to branch if condition is true, operand 3 is the
+  /// condition code, and operand 4 is the flag operand produced by a CMP
+  /// or TEST instruction.
   BRCOND,
 
-  // Return with a flag operand.
+  /// Return with a flag operand. Operand 1 is the number of bytes of stack
+  /// to pop, operand 2 is the chain and ope

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

2005-12-21 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.238 -> 1.239
---
Log message:

* Added support for X86 RET with an additional operand to specify number of
bytes to pop off stack.
* Added support for X86 SETCC.


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

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


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.238 
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.239
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.238 Wed Dec 21 13:40:42 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp   Wed Dec 21 14:21:51 2005
@@ -1621,6 +1621,16 @@
Node->getOperand(2));
   break;
 }
+case TargetLowering::Custom: {
+  SDOperand Tmp =
+TLI.LowerOperation(DAG.getNode(ISD::SETCC, Node->getValueType(0),
+   Tmp1, Tmp2, Node->getOperand(2)), DAG);
+  if (Tmp.Val) {
+Result = LegalizeOp(Tmp);
+break;
+  }
+  // FALLTHROUGH if the target thinks it is legal.
+}
 case TargetLowering::Legal:
   if (Tmp1 != Node->getOperand(0) || Tmp2 != Node->getOperand(1))
 Result = DAG.getNode(ISD::SETCC, Node->getValueType(0), Tmp1, Tmp2,



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


[llvm-commits] CVS: llvm/Xcode/LLVM.xcodeproj/project.pbxproj

2005-12-21 Thread Jim Laskey


Changes in directory llvm/Xcode/LLVM.xcodeproj:

project.pbxproj updated: 1.14 -> 1.15
---
Log message:

Sync up the project with my tweaks.


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

 project.pbxproj |  210 +---
 1 files changed, 199 insertions(+), 11 deletions(-)


Index: llvm/Xcode/LLVM.xcodeproj/project.pbxproj
diff -u llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.14 
llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.15
--- llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.14  Wed Dec 21 13:51:24 2005
+++ llvm/Xcode/LLVM.xcodeproj/project.pbxproj   Wed Dec 21 14:47:34 2005
@@ -78,8 +78,57 @@
 /* End PBXContainerItemProxy section */
 
 /* Begin PBXFileReference section */
+   CF26835B09178F5500C5F253 /* TargetInstrItineraries.h */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path 
= TargetInstrItineraries.h; sourceTree = ""; };
+   CF490CD50903C9260072DB1C /* PPC.h */ = {isa = PBXFileReference; 
fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPC.h; sourceTree 
= ""; };
+   CF490CD60903C9260072DB1C /* PPCAsmPrinter.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = PPCAsmPrinter.cpp; sourceTree = ""; };
+   CF490CD70903C9260072DB1C /* PPCBranchSelector.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = PPCBranchSelector.cpp; sourceTree = ""; };
+   CF490CD80903C9260072DB1C /* PPCCodeEmitter.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = PPCCodeEmitter.cpp; sourceTree = ""; };
+   CF490CD90903C9260072DB1C /* PPCFrameInfo.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
PPCFrameInfo.h; sourceTree = ""; };
+   CF490CDA0903C9260072DB1C /* PPCInstrBuilder.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
PPCInstrBuilder.h; sourceTree = ""; };
+   CF490CDB0903C9260072DB1C /* PPCInstrFormats.td */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 
PPCInstrFormats.td; sourceTree = ""; };
+   CF490CDC0903C9260072DB1C /* PPCInstrInfo.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = PPCInstrInfo.cpp; sourceTree = ""; };
+   CF490CDD0903C9260072DB1C /* PPCInstrInfo.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
PPCInstrInfo.h; sourceTree = ""; };
+   CF490CDE0903C9260072DB1C /* PPCInstrInfo.td */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 
PPCInstrInfo.td; sourceTree = ""; };
+   CF490CDF0903C9260072DB1C /* PPCISelDAGToDAG.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = PPCISelDAGToDAG.cpp; sourceTree = ""; };
+   CF490CE00903C9260072DB1C /* PPCISelLowering.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = PPCISelLowering.cpp; sourceTree = ""; };
+   CF490CE10903C9260072DB1C /* PPCISelLowering.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
PPCISelLowering.h; sourceTree = ""; };
+   CF490CE20903C9260072DB1C /* PPCISelPattern.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = PPCISelPattern.cpp; sourceTree = ""; };
+   CF490CE30903C9260072DB1C /* PPCJITInfo.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = PPCJITInfo.cpp; sourceTree = ""; };
+   CF490CE40903C9260072DB1C /* PPCJITInfo.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
PPCJITInfo.h; sourceTree = ""; };
+   CF490CE50903C9260072DB1C /* PPCRegisterInfo.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = PPCRegisterInfo.cpp; sourceTree = ""; };
+   CF490CE60903C9260072DB1C /* PPCRegisterInfo.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
PPCRegisterInfo.h; sourceTree = ""; };
+   CF490CE70903C9260072DB1C /* PPCRegisterInfo.td */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 
PPCRegisterInfo.td; sourceTree = ""; };
+   CF490CE80903C9260072DB1C /* PPCRelocations.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
PPCRelocations.h; sourceTree = ""; };
+   CF490CE90903C9260072DB1C /* PPCSubtarget.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = PPCSubtarget.cpp; sourceTree = ""; };
+  

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

2005-12-21 Thread Jim Laskey


Changes in directory llvm/lib/Target/Alpha:

AlphaISelLowering.cpp updated: 1.12 -> 1.13
---
Log message:

Disengage DEBUG_LOC from non-PPC targets.


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

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


Index: llvm/lib/Target/Alpha/AlphaISelLowering.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.12 
llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.13
--- llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.12Wed Nov 30 11:11:20 2005
+++ llvm/lib/Target/Alpha/AlphaISelLowering.cpp Wed Dec 21 14:51:36 2005
@@ -102,6 +102,7 @@
 
   // We don't have line number support yet.
   setOperationAction(ISD::LOCATION, MVT::Other, Expand);
+  setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
   
   addLegalFPImmediate(+0.0); //F31
   addLegalFPImmediate(-0.0); //-F31



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


[llvm-commits] CVS: llvm/lib/Target/IA64/IA64ISelLowering.cpp IA64ISelPattern.cpp

2005-12-21 Thread Jim Laskey


Changes in directory llvm/lib/Target/IA64:

IA64ISelLowering.cpp updated: 1.4 -> 1.5
IA64ISelPattern.cpp updated: 1.69 -> 1.70
---
Log message:

Disengage DEBUG_LOC from non-PPC targets.


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

 IA64ISelLowering.cpp |1 +
 IA64ISelPattern.cpp  |1 +
 2 files changed, 2 insertions(+)


Index: llvm/lib/Target/IA64/IA64ISelLowering.cpp
diff -u llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.4 
llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.5
--- llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.4   Tue Nov 29 00:16:21 2005
+++ llvm/lib/Target/IA64/IA64ISelLowering.cpp   Wed Dec 21 14:51:36 2005
@@ -74,6 +74,7 @@
 
   // We don't have line number support yet.
   setOperationAction(ISD::LOCATION, MVT::Other, Expand);
+  setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
 
   //IA64 has these, but they are not implemented
   setOperationAction(ISD::CTTZ , MVT::i64  , Expand);


Index: llvm/lib/Target/IA64/IA64ISelPattern.cpp
diff -u llvm/lib/Target/IA64/IA64ISelPattern.cpp:1.69 
llvm/lib/Target/IA64/IA64ISelPattern.cpp:1.70
--- llvm/lib/Target/IA64/IA64ISelPattern.cpp:1.69   Thu Dec  1 12:19:53 2005
+++ llvm/lib/Target/IA64/IA64ISelPattern.cppWed Dec 21 14:51:36 2005
@@ -102,6 +102,7 @@
 
   // We don't have line number support yet.
   setOperationAction(ISD::LOCATION, MVT::Other, Expand);
+  setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
 
   computeRegisterProperties();
 



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


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

2005-12-21 Thread Jim Laskey


Changes in directory llvm/lib/Target/X86:

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

Disengage DEBUG_LOC from non-PPC targets.


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

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


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.13 
llvm/lib/Target/X86/X86ISelLowering.cpp:1.14
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.13Wed Dec 21 14:21:51 2005
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Wed Dec 21 14:51:37 2005
@@ -126,6 +126,7 @@
 
   // We don't have line number support yet.
   setOperationAction(ISD::LOCATION, MVT::Other, Expand);
+  setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
 
   if (X86ScalarSSE) {
 // Set up the FP register classes.



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


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

2005-12-21 Thread Jim Laskey


Changes in directory llvm/lib/Target/SparcV8:

SparcV8ISelDAGToDAG.cpp updated: 1.30 -> 1.31
---
Log message:

Disengage DEBUG_LOC from non-PPC targets.


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

 SparcV8ISelDAGToDAG.cpp |5 +
 1 files changed, 5 insertions(+)


Index: llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp
diff -u llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp:1.30 
llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp:1.31
--- llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp:1.30Tue Dec 20 
23:27:51 2005
+++ llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp Wed Dec 21 14:51:37 2005
@@ -147,6 +147,11 @@
   setOperationAction(ISD::SHL_PARTS, MVT::i32, Expand);
   setOperationAction(ISD::SRA_PARTS, MVT::i32, Expand);
   setOperationAction(ISD::SRL_PARTS, MVT::i32, Expand);
+
+  // We don't have line number support yet.
+  setOperationAction(ISD::LOCATION, MVT::Other, Expand);
+  setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
+
   computeRegisterProperties();
 }
 



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

2005-12-21 Thread Jim Laskey


Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.239 -> 1.240
ScheduleDAG.cpp updated: 1.53 -> 1.54
---
Log message:

Disengage DEBUG_LOC from non-PPC targets.


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

 LegalizeDAG.cpp |   28 
 ScheduleDAG.cpp |2 +-
 2 files changed, 17 insertions(+), 13 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.239 
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.240
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.239 Wed Dec 21 14:21:51 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp   Wed Dec 21 14:51:36 2005
@@ -622,18 +622,22 @@
 case TargetLowering::Promote:
 default: assert(0 && "This action is not supported yet!");
 case TargetLowering::Expand: {
-  MachineDebugInfo &DebugInfo = DAG.getMachineFunction().getDebugInfo();
-  std::vector Ops;
-  Ops.push_back(Tmp1);  // chain
-  Ops.push_back(Node->getOperand(1));  // line #
-  Ops.push_back(Node->getOperand(2));  // col #
-  const std::string &fname =
-cast(Node->getOperand(3))->getValue();
-  const std::string &dirname = 
-cast(Node->getOperand(4))->getValue();
-  unsigned id = DebugInfo.RecordSource(fname, dirname);
-  Ops.push_back(DAG.getConstant(id, MVT::i32));  // source file id
-  Result = DAG.getNode(ISD::DEBUG_LOC, MVT::Other, Ops);
+  if (TLI.isOperationLegal(ISD::DEBUG_LOC, MVT::Other)) {
+MachineDebugInfo &DebugInfo = DAG.getMachineFunction().getDebugInfo();
+std::vector Ops;
+Ops.push_back(Tmp1);  // chain
+Ops.push_back(Node->getOperand(1));  // line #
+Ops.push_back(Node->getOperand(2));  // col #
+const std::string &fname =
+  cast(Node->getOperand(3))->getValue();
+const std::string &dirname = 
+  cast(Node->getOperand(4))->getValue();
+unsigned id = DebugInfo.RecordSource(fname, dirname);
+Ops.push_back(DAG.getConstant(id, MVT::i32));  // source file id
+Result = DAG.getNode(ISD::DEBUG_LOC, MVT::Other, Ops);
+  } else {
+Result = Tmp1;  // chain
+  }
   Result = LegalizeOp(Result);  // Relegalize new nodes.
   break;
 }


Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.53 
llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.54
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.53  Mon Dec 19 10:32:26 2005
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp   Wed Dec 21 14:51:36 2005
@@ -691,7 +691,7 @@
   } else {
 Ordering.push_back(NI);
   }
-  
+
   // Iterate through all nodes that have been added
   for (unsigned i = 0; i < Ordering.size(); i++) { // note: size() varies
 // Visit all operands



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


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

2005-12-21 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86InstrInfo.td updated: 1.180 -> 1.181
---
Log message:

Oops. Accidentally deleted RET pattern. It's still needed for return void;


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

 X86InstrInfo.td |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Target/X86/X86InstrInfo.td
diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.180 
llvm/lib/Target/X86/X86InstrInfo.td:1.181
--- llvm/lib/Target/X86/X86InstrInfo.td:1.180   Wed Dec 21 14:21:51 2005
+++ llvm/lib/Target/X86/X86InstrInfo.td Wed Dec 21 16:22:16 2005
@@ -290,7 +290,7 @@
 
 // Return instructions.
 let isTerminator = 1, isReturn = 1, isBarrier = 1, hasCtrlDep = 1 in
-  def RET : I<0xC3, RawFrm, (ops), "ret", []>;
+  def RET : I<0xC3, RawFrm, (ops), "ret", [(ret)]>;
 let isTerminator = 1, isReturn = 1, isBarrier = 1, hasCtrlDep = 1 in
   def RETI : Ii16<0xC2, RawFrm, (ops i16imm:$amt), "ret $amt", []>;
 



___
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

2005-12-21 Thread Evan Cheng


Changes in directory llvm/lib/Target:

TargetLowering.cpp updated: 1.16 -> 1.17
---
Log message:

* Fix a GlobalAddress lowering bug.
* Teach DAG combiner about X86ISD::SETCC by adding a TargetLowering hook.


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

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


Index: llvm/lib/Target/TargetLowering.cpp
diff -u llvm/lib/Target/TargetLowering.cpp:1.16 
llvm/lib/Target/TargetLowering.cpp:1.17
--- llvm/lib/Target/TargetLowering.cpp:1.16 Tue Dec 20 00:22:03 2005
+++ llvm/lib/Target/TargetLowering.cpp  Wed Dec 21 17:05:39 2005
@@ -125,3 +125,8 @@
 const char *TargetLowering::getTargetNodeName(unsigned Opcode) const {
   return NULL;
 }
+
+bool isMaskedValueZeroForTargetNode(const SDOperand &Op,
+uint64_t Mask) const {
+  return false;
+}



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


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

2005-12-21 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86ISelDAGToDAG.cpp updated: 1.18 -> 1.19
X86ISelLowering.cpp updated: 1.14 -> 1.15
X86ISelLowering.h updated: 1.7 -> 1.8
X86InstrInfo.td updated: 1.181 -> 1.182
---
Log message:

* Fix a GlobalAddress lowering bug.
* Teach DAG combiner about X86ISD::SETCC by adding a TargetLowering hook.


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

 X86ISelDAGToDAG.cpp |1 +
 X86ISelLowering.cpp |   23 ---
 X86ISelLowering.h   |6 ++
 X86InstrInfo.td |4 ++--
 4 files changed, 29 insertions(+), 5 deletions(-)


Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.18 
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.19
--- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.18Tue Dec 20 20:41:57 2005
+++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Dec 21 17:05:39 2005
@@ -172,6 +172,7 @@
 break;
 
   case ISD::GlobalAddress:
+  case ISD::TargetGlobalAddress:
 if (AM.GV == 0) {
   AM.GV = cast(N)->getGlobal();
   return false;


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.14 
llvm/lib/Target/X86/X86ISelLowering.cpp:1.15
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.14Wed Dec 21 14:51:37 2005
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Wed Dec 21 17:05:39 2005
@@ -122,6 +122,7 @@
 setOperationAction(ISD::SETCC  , MVT::i8   , Custom);
 setOperationAction(ISD::SETCC  , MVT::i16  , Custom);
 setOperationAction(ISD::SETCC  , MVT::i32  , Custom);
+setOperationAction(ISD::GlobalAddress  , MVT::i32  , Custom);
   }
 
   // We don't have line number support yet.
@@ -1051,6 +1052,7 @@
   }
   case ISD::GlobalAddress:
 GlobalValue *GV = cast(Op)->getGlobal();
+SDOperand GVOp = DAG.getTargetGlobalAddress(GV, getPointerTy());
 // For Darwin, external and weak symbols are indirect, so we want to load
 // the value at address GV, not the value of GV itself.  This means that
 // the GlobalAddress must be in the base or index register of the address,
@@ -1058,10 +1060,10 @@
 if (getTargetMachine().
 getSubtarget().getIndirectExternAndWeakGlobals() &&
 (GV->hasWeakLinkage() || GV->isExternal()))
-  return DAG.getLoad(MVT::i32, DAG.getEntryNode(), Op,
- DAG.getSrcValue(NULL));
+  return DAG.getLoad(MVT::i32, DAG.getEntryNode(),
+ GVOp, DAG.getSrcValue(NULL));
 else
-  return Op;
+  return GVOp;
 break;
   }
 }
@@ -1086,3 +1088,18 @@
   case X86ISD::RET_FLAG:   return "X86ISD::RET_FLAG";
   }
 }
+
+bool X86TargetLowering::isMaskedValueZeroForTargetNode(const SDOperand &Op,
+   uint64_t Mask) const {
+
+  unsigned Opc = Op.getOpcode();
+
+  switch (Opc) {
+  default:
+assert(Opc >= ISD::BUILTIN_OP_END && "Expected a target specific node");
+break;
+  case X86ISD::SETCC: return (Mask & 1) == 0;
+  }
+
+  return false;
+}


Index: llvm/lib/Target/X86/X86ISelLowering.h
diff -u llvm/lib/Target/X86/X86ISelLowering.h:1.7 
llvm/lib/Target/X86/X86ISelLowering.h:1.8
--- llvm/lib/Target/X86/X86ISelLowering.h:1.7   Wed Dec 21 14:21:51 2005
+++ llvm/lib/Target/X86/X86ISelLowering.h   Wed Dec 21 17:05:39 2005
@@ -155,6 +155,12 @@
 /// DAG node.
 virtual const char *getTargetNodeName(unsigned Opcode) const;
 
+/// isMaskedValueZeroForTargetNode - Return true if 'Op & Mask' is known to
+/// be zero. Op is expected to be a target specific node. Used by DAG
+/// combiner.
+virtual bool isMaskedValueZeroForTargetNode(const SDOperand &Op,
+uint64_t Mask) const;
+
 SDOperand getReturnAddressFrameIndex(SelectionDAG &DAG);
 
   private:


Index: llvm/lib/Target/X86/X86InstrInfo.td
diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.181 
llvm/lib/Target/X86/X86InstrInfo.td:1.182
--- llvm/lib/Target/X86/X86InstrInfo.td:1.181   Wed Dec 21 16:22:16 2005
+++ llvm/lib/Target/X86/X86InstrInfo.td Wed Dec 21 17:05:39 2005
@@ -98,8 +98,8 @@
 // Define X86 specific addressing mode.
 def addr: ComplexPattern;
 def leaaddr : ComplexPattern;
+ [add, frameindex, constpool,
+  globaladdr, tglobaladdr, externalsym]>;
 
 
//===--===//
 // X86 Instruction Format Definitions.



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

2005-12-21 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.69 -> 1.70
---
Log message:

* Fix a GlobalAddress lowering bug.
* Teach DAG combiner about X86ISD::SETCC by adding a TargetLowering hook.


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

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


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.69 
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.70
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.69  Thu Dec 15 13:02:38 2005
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp   Wed Dec 21 17:05:39 2005
@@ -455,7 +455,10 @@
 // Bit counting instructions can not set the high bits of the result
 // register.  The max number of bits sets depends on the input.
 return (Mask & (MVT::getSizeInBits(Op.getValueType())*2-1)) == 0;
-  default: break;
+  default:
+if (Op.getOpcode() >= ISD::BUILTIN_OP_END)
+  return TLI.isMaskedValueZeroForTargetNode(Op, Mask);
+break;
   }
   return false;
 }



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


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

2005-12-21 Thread Evan Cheng


Changes in directory llvm/lib/Target:

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

Lefted out TargetLowering::


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

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


Index: llvm/lib/Target/TargetLowering.cpp
diff -u llvm/lib/Target/TargetLowering.cpp:1.17 
llvm/lib/Target/TargetLowering.cpp:1.18
--- llvm/lib/Target/TargetLowering.cpp:1.17 Wed Dec 21 17:05:39 2005
+++ llvm/lib/Target/TargetLowering.cpp  Wed Dec 21 17:14:54 2005
@@ -126,7 +126,7 @@
   return NULL;
 }
 
-bool isMaskedValueZeroForTargetNode(const SDOperand &Op,
-uint64_t Mask) const {
+bool TargetLowering::isMaskedValueZeroForTargetNode(const SDOperand &Op,
+uint64_t Mask) const {
   return false;
 }



___
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

2005-12-21 Thread Evan Cheng


Changes in directory llvm/include/llvm/Target:

TargetLowering.h updated: 1.30 -> 1.31
---
Log message:

Added TargetLowering::isMaskedValueZeroForTargetNode() declaration.


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

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


Index: llvm/include/llvm/Target/TargetLowering.h
diff -u llvm/include/llvm/Target/TargetLowering.h:1.30 
llvm/include/llvm/Target/TargetLowering.h:1.31
--- llvm/include/llvm/Target/TargetLowering.h:1.30  Tue Dec 20 00:22:03 2005
+++ llvm/include/llvm/Target/TargetLowering.h   Wed Dec 21 17:15:41 2005
@@ -375,10 +375,16 @@
   /// implement this.  The default implementation of this aborts.
   virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
 
-  // getTargetNodeName() - This method returns the name of a target specific
-  // DAG node.
+  /// getTargetNodeName() - This method returns the name of a target specific
+  /// DAG node.
   virtual const char *getTargetNodeName(unsigned Opcode) const;
 
+  /// isMaskedValueZeroForTargetNode - Return true if 'Op & Mask' is known to
+  /// be zero. Op is expected to be a target specific node. Used by DAG
+  /// combiner.
+  virtual bool isMaskedValueZeroForTargetNode(const SDOperand &Op,
+  uint64_t Mask) const;
+
   
//======//
   // Scheduler hooks
   //



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


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

2005-12-21 Thread Reid Spencer


Changes in directory llvm:

Makefile.rules updated: 1.336 -> 1.337
---
Log message:

Some simple cleanups:
1. When srcdir == objdir have "spotless" say that it isn't supported in
   that mode rather than just let make say "no such target"
2. Minor doc cleanups
3. Fix the double rebuild problem with yacc files. A missing dependency 
   caused parallel builds to skip building the .cpp file after the .cpp 
   file was regenerated by bison.


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

 Makefile.rules |   18 --
 1 files changed, 12 insertions(+), 6 deletions(-)


Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.336 llvm/Makefile.rules:1.337
--- llvm/Makefile.rules:1.336   Tue Dec 20 21:31:52 2005
+++ llvm/Makefile.rules Wed Dec 21 17:17:06 2005
@@ -108,6 +108,9 @@
else \
  $(EchoCmd) "make spotless" can only be run from $(PROJ_OBJ_ROOT); \
fi
+else
+spotless:
+   $(EchoCmd) "spotless target not supported for objdir == srcdir"
 endif
 
 $(BUILT_SOURCES) : $(ObjMakefiles)
@@ -475,9 +478,9 @@
done
 endif
 
-#-
+#---
 # Handle the PARALLEL_DIRS options for parallel construction
-#-
+#---
 ifdef PARALLEL_DIRS
 
 SubDirs += $(PARALLEL_DIRS)
@@ -1219,7 +1222,6 @@
 
 clean-local::
-$(Verb) $(RM) -f $(LexOutput)
-   $(Verb) $(RM) -f $(LexOutput)
 
 endif
 
@@ -1230,7 +1232,6 @@
 
 YaccFiles  := $(filter %.y,$(Sources))
 ifneq ($(YaccFiles),)
-YaccOutput := $(addprefix $(patsubst %.y,%,$(YaccFiles)),.output)
 
 .PRECIOUS: $(YaccOutput)
 
@@ -1239,7 +1240,7 @@
 %.cpp: %.y
 %.h: %.y
 
-# Rule for building the bison parsers...
+# Rule for building the bison based parsers...
 $(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y
$(Echo) "Bisoning $*.y"
$(Verb) $(BISON) -v -d -p $(http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2005-12-21 Thread Reid Spencer


Changes in directory llvm/lib/CodeGen:

DwarfWriter.cpp updated: 1.1 -> 1.2
---
Log message:

Add an eol at the end to shut gcc sup.


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

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


Index: llvm/lib/CodeGen/DwarfWriter.cpp
diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.1 
llvm/lib/CodeGen/DwarfWriter.cpp:1.2
--- llvm/lib/CodeGen/DwarfWriter.cpp:1.1Wed Dec 21 13:48:16 2005
+++ llvm/lib/CodeGen/DwarfWriter.cppWed Dec 21 19:41:00 2005
@@ -12,4 +12,4 @@
 
//===--===//
 
 
-#include "llvm/CodeGen/DwarfWriter.h"
\ No newline at end of file
+#include "llvm/CodeGen/DwarfWriter.h"



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

2005-12-21 Thread Reid Spencer


Changes in directory llvm/include/llvm/CodeGen:

DwarfWriter.h updated: 1.2 -> 1.3
---
Log message:

Add an eol at the end to shut gcc up.


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

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


Index: llvm/include/llvm/CodeGen/DwarfWriter.h
diff -u llvm/include/llvm/CodeGen/DwarfWriter.h:1.2 
llvm/include/llvm/CodeGen/DwarfWriter.h:1.3
--- llvm/include/llvm/CodeGen/DwarfWriter.h:1.2 Wed Dec 21 13:46:32 2005
+++ llvm/include/llvm/CodeGen/DwarfWriter.h Wed Dec 21 19:40:06 2005
@@ -425,4 +425,4 @@
 
 } // end llvm namespace
 
-#endif
\ No newline at end of file
+#endif



___
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

2005-12-21 Thread Jeff Cohen


Changes in directory llvm/include/llvm/Target:

TargetLowering.h updated: 1.31 -> 1.32
---
Log message:

Make it compile with VC++.

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

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


Index: llvm/include/llvm/Target/TargetLowering.h
diff -u llvm/include/llvm/Target/TargetLowering.h:1.31 
llvm/include/llvm/Target/TargetLowering.h:1.32
--- llvm/include/llvm/Target/TargetLowering.h:1.31  Wed Dec 21 17:15:41 2005
+++ llvm/include/llvm/Target/TargetLowering.h   Wed Dec 21 19:44:51 2005
@@ -24,6 +24,7 @@
 
 #include "llvm/Type.h"
 #include "llvm/CodeGen/ValueTypes.h"
+#include "llvm/support/DataTypes.h"
 #include 
 
 namespace llvm {



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


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

2005-12-21 Thread Jeff Cohen


Changes in directory llvm/include/llvm/Target:

TargetLowering.h updated: 1.32 -> 1.33
---
Log message:

Oh oh...  Unix is case sensitive.

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

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


Index: llvm/include/llvm/Target/TargetLowering.h
diff -u llvm/include/llvm/Target/TargetLowering.h:1.32 
llvm/include/llvm/Target/TargetLowering.h:1.33
--- llvm/include/llvm/Target/TargetLowering.h:1.32  Wed Dec 21 19:44:51 2005
+++ llvm/include/llvm/Target/TargetLowering.h   Wed Dec 21 19:46:59 2005
@@ -24,7 +24,7 @@
 
 #include "llvm/Type.h"
 #include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/support/DataTypes.h"
+#include "llvm/Support/DataTypes.h"
 #include 
 
 namespace llvm {



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


[llvm-commits] CVS: llvm/win32/CodeGen/CodeGen.vcproj

2005-12-21 Thread Jeff Cohen


Changes in directory llvm/win32/CodeGen:

CodeGen.vcproj updated: 1.16 -> 1.17
---
Log message:

Add new files to Visual Studio.

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

 CodeGen.vcproj |6 ++
 1 files changed, 6 insertions(+)


Index: llvm/win32/CodeGen/CodeGen.vcproj
diff -u llvm/win32/CodeGen/CodeGen.vcproj:1.16 
llvm/win32/CodeGen/CodeGen.vcproj:1.17
--- llvm/win32/CodeGen/CodeGen.vcproj:1.16  Fri Dec 16 18:14:46 2005
+++ llvm/win32/CodeGen/CodeGen.vcproj   Wed Dec 21 19:50:11 2005
@@ -115,6 +115,9 @@

RelativePath="..\..\lib\CodeGen\BranchFolding.cpp">


+   
+   




+   
+   

http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2005-12-21 Thread Reid Spencer


Changes in directory llvm/tools/gccld:

GenerateCode.cpp updated: 1.55 -> 1.56
gccld.cpp updated: 1.106 -> 1.107
gccld.h updated: 1.17 -> 1.18
---
Log message:

Implement PR679: http://llvm.cs.uiuc.edu/PR679 :
* Changed the -rpath option from cl::opt to cl::list
* Changed the interface to GenerateNative to take a std::vector
  instead of just a std::string
* Changed GenerateNative to generate multiple -Wl,-rpath, options to be
  passed to gcc.


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

 GenerateCode.cpp |   13 -
 gccld.cpp|7 ++-
 gccld.h  |2 +-
 3 files changed, 15 insertions(+), 7 deletions(-)


Index: llvm/tools/gccld/GenerateCode.cpp
diff -u llvm/tools/gccld/GenerateCode.cpp:1.55 
llvm/tools/gccld/GenerateCode.cpp:1.56
--- llvm/tools/gccld/GenerateCode.cpp:1.55  Thu Nov  3 01:17:51 2005
+++ llvm/tools/gccld/GenerateCode.cpp   Wed Dec 21 19:50:56 2005
@@ -352,7 +352,7 @@
  const sys::Path &gcc, char ** const envp,
  bool Shared,
  bool ExportAllAsDynamic,
- const std::string &RPath,
+ const std::vector &RPaths,
  const std::string &SOName,
  bool Verbose) {
   // Remove these environment variables from the environment of the
@@ -394,10 +394,13 @@
 
   if (Shared) args.push_back("-shared");
   if (ExportAllAsDynamic) args.push_back("-export-dynamic");
-  if (!RPath.empty()) {
-std::string rp = "-Wl,-rpath," + RPath;
-StringsToDelete.push_back(strdup(rp.c_str()));
-args.push_back(StringsToDelete.back());
+  if (!RPaths.empty()) {
+for (std::vector::const_iterator I = RPaths.begin(),
+E = RPaths.end(); I != E; I++) {
+  std::string rp = "-Wl,-rpath," + *I;
+  StringsToDelete.push_back(strdup(rp.c_str()));
+  args.push_back(StringsToDelete.back());
+}
   }
   if (!SOName.empty()) {
 std::string so = "-Wl,-soname," + SOName;


Index: llvm/tools/gccld/gccld.cpp
diff -u llvm/tools/gccld/gccld.cpp:1.106 llvm/tools/gccld/gccld.cpp:1.107
--- llvm/tools/gccld/gccld.cpp:1.106Wed Dec 14 13:08:51 2005
+++ llvm/tools/gccld/gccld.cpp  Wed Dec 21 19:50:56 2005
@@ -88,7 +88,7 @@
   SaveTemps("save-temps",
  cl::desc("Do not delete temporary files"));
 
-  cl::opt
+  cl::list
   RPath("rpath",
 cl::desc("Set runtime shared library search path (requires -native or"
  " -native-cbe)"),
@@ -107,6 +107,11 @@
   CO5("eh-frame-hdr", cl::Hidden, cl::desc("Compatibility option: ignored"));
   cl::opt
   CO6("h", cl::Hidden, cl::desc("Compatibility option: ignored"));
+  cl::opt
+  CO7("start-group", cl::Hidden, cl::desc("Compatibility option: ignored"));
+  cl::opt
+  CO8("end-group", cl::Hidden, cl::desc("Compatibility option: ignored"));
+
   cl::alias A0("s", cl::desc("Alias for --strip-all"),
cl::aliasopt(Strip));
   cl::alias A1("S", cl::desc("Alias for --strip-debug"),


Index: llvm/tools/gccld/gccld.h
diff -u llvm/tools/gccld/gccld.h:1.17 llvm/tools/gccld/gccld.h:1.18
--- llvm/tools/gccld/gccld.h:1.17   Tue Aug  2 17:07:38 2005
+++ llvm/tools/gccld/gccld.hWed Dec 21 19:50:56 2005
@@ -46,7 +46,7 @@
 char ** const envp,
 bool Shared,
 bool ExportAllAsDynamic,
-const std::string &RPath,
+const std::vector &RPath,
 const std::string &SOName,
 bool Verbose=false);
 



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


[llvm-commits] CVS: llvm/autoconf/m4/sanity_check.m4

2005-12-21 Thread Reid Spencer


Changes in directory llvm/autoconf/m4:

sanity_check.m4 updated: 1.1 -> 1.2
---
Log message:

For PR678: http://llvm.cs.uiuc.edu/PR678 :
* Make it possible to pass a fourth argument to the CHECK_PROGRAM_SANITY
  macro that controls whether a non-sane program generates an error or
  a warning.


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

 sanity_check.m4 |   10 --
 1 files changed, 8 insertions(+), 2 deletions(-)


Index: llvm/autoconf/m4/sanity_check.m4
diff -u llvm/autoconf/m4/sanity_check.m4:1.1 
llvm/autoconf/m4/sanity_check.m4:1.2
--- llvm/autoconf/m4/sanity_check.m4:1.1Sat Jul 16 19:50:40 2005
+++ llvm/autoconf/m4/sanity_check.m4Wed Dec 21 20:08:30 2005
@@ -5,6 +5,7 @@
 dnl   $1 - Name or full path of the program to run
 dnl   $2 - Argument to pass to print out identification string
 dnl   $3 - grep RE to match identification string
+dnl   $4 - set to 1 to make errors only a warning
 AC_DEFUN([CHECK_PROGRAM_SANITY],
 [
 AC_MSG_CHECKING([sanity for program ]$1)
@@ -13,9 +14,14 @@
   sanity=`$1 $2 2>&1 | grep "$3"`
   if test -z "$sanity" ; then
 AC_MSG_RESULT([no])
-AC_MSG_ERROR([Program ]$1[ failed to pass sanity check.])
+if test "$4" -eq 1 ; then
+  AC_MSG_WARN([Program ]$1[ failed to pass sanity check.])
+else
+  AC_MSG_ERROR([Program ]$1[ failed to pass sanity check.])
+fi
+  else
+AC_MSG_RESULT([yes])
   fi
-  AC_MSG_RESULT([yes])
 else
   AC_MSG_RESULT([not found])
 fi



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


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

2005-12-21 Thread Reid Spencer


Changes in directory llvm-test:

configure updated: 1.30 -> 1.31
---
Log message:

Fix PR678: http://llvm.cs.uiuc.edu/PR678 :
Use the 4th argument to CHECK_PROGRAM_SANITY in order to turn a failed
sanity check into a warning instead of an error.


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

 configure |   12 +---
 1 files changed, 9 insertions(+), 3 deletions(-)


Index: llvm-test/configure
diff -u llvm-test/configure:1.30 llvm-test/configure:1.31
--- llvm-test/configure:1.30Tue Nov  8 15:13:45 2005
+++ llvm-test/configure Wed Dec 21 20:10:25 2005
@@ -19287,12 +19287,18 @@
   if test -z "$sanity" ; then
 echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
-{ { echo "$as_me:$LINENO: error: Program f95 failed to pass sanity check." 
>&5
+if test "1" -eq 1 ; then
+  { echo "$as_me:$LINENO: WARNING: Program f95 failed to pass sanity 
check." >&5
+echo "$as_me: WARNING: Program f95 failed to pass sanity check." >&2;}
+else
+  { { echo "$as_me:$LINENO: error: Program f95 failed to pass sanity 
check." >&5
 echo "$as_me: error: Program f95 failed to pass sanity check." >&2;}
{ (exit 1); exit 1; }; }
-  fi
-  echo "$as_me:$LINENO: result: yes" >&5
+fi
+  else
+echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6
+  fi
 else
   echo "$as_me:$LINENO: result: not found" >&5
 echo "${ECHO_T}not found" >&6



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


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

2005-12-21 Thread Reid Spencer


Changes in directory llvm-test/autoconf:

configure.ac updated: 1.29 -> 1.30
---
Log message:

Fix PR678: http://llvm.cs.uiuc.edu/PR678 :
Use the 4th argument to CHECK_PROGRAM_SANITY in order to turn a failed
sanity check into a warning instead of an error.


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

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


Index: llvm-test/autoconf/configure.ac
diff -u llvm-test/autoconf/configure.ac:1.29 
llvm-test/autoconf/configure.ac:1.30
--- llvm-test/autoconf/configure.ac:1.29Tue Nov  8 15:13:47 2005
+++ llvm-test/autoconf/configure.ac Wed Dec 21 20:10:25 2005
@@ -93,7 +93,7 @@
 FIND_STD_PROGRAM(f2c,f2c.h,libf2c.a)
 dnl Check for the NAG f95 FORTRAN -> C translator
 FIND_STD_PROGRAM(f95,,libf97.dylib,[nag fortran])
-CHECK_PROGRAM_SANITY([f95],[-V],[NAGWare Fortran 95])
+CHECK_PROGRAM_SANITY([f95],[-V],[NAGWare Fortran 95],1)
 
 dnl Checks for header files.
 dnl We don't check for ancient stuff or things that are guaranteed to be there



___
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

2005-12-21 Thread Evan Cheng


Changes in directory llvm/lib/Target:

TargetSelectionDAG.td updated: 1.33 -> 1.34
---
Log message:

Added special flag node FLAG.


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

 TargetSelectionDAG.td |1 +
 1 files changed, 1 insertion(+)


Index: llvm/lib/Target/TargetSelectionDAG.td
diff -u llvm/lib/Target/TargetSelectionDAG.td:1.33 
llvm/lib/Target/TargetSelectionDAG.td:1.34
--- llvm/lib/Target/TargetSelectionDAG.td:1.33  Wed Dec 21 10:22:46 2005
+++ llvm/lib/Target/TargetSelectionDAG.td   Wed Dec 21 20:25:14 2005
@@ -184,6 +184,7 @@
 def set;
 def node;
 def srcvalue;
+def FLAG;
 
 def imm: SDNode<"ISD::Constant"  , SDTIntLeaf , [], "ConstantSDNode">;
 def vt : SDNode<"ISD::VALUETYPE" , SDTOther   , [], "VTSDNode">;



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


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

2005-12-21 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86InstrInfo.td updated: 1.182 -> 1.183
X86RegisterInfo.td updated: 1.26 -> 1.27
---
Log message:

Bye bye HACKTROCITY.


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

 X86InstrInfo.td|5 +++--
 X86RegisterInfo.td |7 +--
 2 files changed, 4 insertions(+), 8 deletions(-)


Index: llvm/lib/Target/X86/X86InstrInfo.td
diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.182 
llvm/lib/Target/X86/X86InstrInfo.td:1.183
--- llvm/lib/Target/X86/X86InstrInfo.td:1.182   Wed Dec 21 17:05:39 2005
+++ llvm/lib/Target/X86/X86InstrInfo.td Wed Dec 21 20:25:42 2005
@@ -38,7 +38,7 @@
 def SDTX86Fld : SDTypeProfile<1, 2, [SDTCisFP<0>,
  SDTCisPtrTy<1>, SDTCisVT<2, 
OtherVT>]>;
 
-def SDTX86FpSet   : SDTypeProfile<0, 1, [SDTCisFP<0>]>;
+def SDTX86FpSet   : SDTypeProfile<1, 1, [SDTCisVT<0, FlagVT>, SDTCisFP<1>]>;
 
 def X86cmp : SDNode<"X86ISD::CMP" , SDTX86CmpTest,  []>;
 def X86test: SDNode<"X86ISD::TEST", SDTX86CmpTest,  []>;
@@ -2257,7 +2257,8 @@
 def FpGETRESULT : FpI<(ops RFP:$dst), SpecialFP, // FPR = ST(0)
   []>;  
 def FpSETRESULT : FpI<(ops RFP:$src), SpecialFP,
-  [(X86fpset RFP:$src)]>, Imp<[], [ST0]>;  // ST(0) = FPR
+  [(set FLAG, (X86fpset RFP:$src))]>,
+   Imp<[], [ST0]>;  // ST(0) = FPR
 def FpMOV   : FpI<(ops RFP:$dst, RFP:$src), SpecialFP,
   []>;   // f1 = fmov f2
 


Index: llvm/lib/Target/X86/X86RegisterInfo.td
diff -u llvm/lib/Target/X86/X86RegisterInfo.td:1.26 
llvm/lib/Target/X86/X86RegisterInfo.td:1.27
--- llvm/lib/Target/X86/X86RegisterInfo.td:1.26 Tue Dec 20 20:39:21 2005
+++ llvm/lib/Target/X86/X86RegisterInfo.td  Wed Dec 21 20:25:42 2005
@@ -142,11 +142,6 @@
   }];
 }
 
-// FIXME:
-// HACKTROCITY: define a flags reg class for things that need to take a flag.
-// this should really be handled by tablgen.
-let Namespace = "X86" in
-  def FLAG : Register<"FLAG">;
-def FLAGS_REGS : RegisterClass<"X86", [FlagVT], 32, [STATUS, FLAG]> {
+def FLAGS_REGS : RegisterClass<"X86", [FlagVT], 32, [STATUS]> {
 let Size = 32;
 }



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


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

2005-12-21 Thread Evan Cheng


Changes in directory llvm/lib/Target/PowerPC:

PPCRegisterInfo.td updated: 1.28 -> 1.29
---
Log message:

Bye bye HACKTROCITY.


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

 PPCRegisterInfo.td |8 
 1 files changed, 8 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.td
diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.28 
llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.29
--- llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.28 Mon Dec 19 18:26:01 2005
+++ llvm/lib/Target/PowerPC/PPCRegisterInfo.td  Wed Dec 21 20:26:21 2005
@@ -132,14 +132,6 @@
 // VRsave register
 def VRSAVE: SPR<256, "VRsave">;
 
-// FIXME:
-// HACKTROCITY: define a flags reg class for things that need to take a flag.
-// this should really be handled by tablgen.
-def FLAG: SPR<1023, "Flag">;
-def FLAGRC : RegisterClass<"PPC", [FlagVT], 32, [FLAG]> {
-  let Size = 32;
-}
-
 /// Register classes
 // Allocate volatiles first
 // then nonvolatiles in reverse order since stmw/lmw save from rN to r31



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


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

2005-12-21 Thread Evan Cheng


Changes in directory llvm/utils/TableGen:

DAGISelEmitter.cpp updated: 1.111 -> 1.112
DAGISelEmitter.h updated: 1.46 -> 1.47
---
Log message:

* Added support for FLAG - a special nameless flag register. Can be used as
  either an operand or a result.
* Fixed some more flag / chain bugs.


---
Diffs of the changes:  (+68 -65)

 DAGISelEmitter.cpp |  120 +
 DAGISelEmitter.h   |   13 -
 2 files changed, 68 insertions(+), 65 deletions(-)


Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.111 
llvm/utils/TableGen/DAGISelEmitter.cpp:1.112
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.111Wed Dec 21 14:20:49 2005
+++ llvm/utils/TableGen/DAGISelEmitter.cpp  Wed Dec 21 20:24:50 2005
@@ -489,6 +489,9 @@
   } else if (R->getName() == "node" || R->getName() == "srcvalue") {
 // Placeholder.
 return MVT::isUnknown;
+  } else if (R->getName() == "FLAG") {
+// Some pseudo flag operand.
+return MVT::Flag;
   }
   
   TP.error("Unknown node flavor used in pattern: " + R->getName());
@@ -952,17 +955,13 @@
 /// HandleUse - Given "Pat" a leaf in the pattern, check to see if it is an
 /// instruction input.  Return true if this is a real use.
 static bool HandleUse(TreePattern *I, TreePatternNode *Pat,
-  std::map &InstInputs,
-  std::vector &InstImpInputs) {
+  std::map &InstInputs) {
   // No name -> not interesting.
   if (Pat->getName().empty()) {
 if (Pat->isLeaf()) {
   DefInit *DI = dynamic_cast(Pat->getLeafValue());
   if (DI && DI->getDef()->isSubClassOf("RegisterClass"))
 I->error("Input " + DI->getDef()->getName() + " must be named!");
-  else if (DI && DI->getDef()->isSubClassOf("Register")) {
-InstImpInputs.push_back(DI->getDef());
-  }
 }
 return false;
   }
@@ -1009,10 +1008,9 @@
 FindPatternInputsAndOutputs(TreePattern *I, TreePatternNode *Pat,
 std::map 
&InstInputs,
 std::map &InstResults,
-std::vector &InstImpInputs,
 std::vector &InstImpResults) {
   if (Pat->isLeaf()) {
-bool isUse = HandleUse(I, Pat, InstInputs, InstImpInputs);
+bool isUse = HandleUse(I, Pat, InstInputs);
 if (!isUse && Pat->getTransformFn())
   I->error("Cannot specify a transform function for a non-input value!");
 return;
@@ -1023,14 +1021,14 @@
   if (Pat->getChild(i)->getExtType() == MVT::isVoid)
 I->error("Cannot have void nodes inside of patterns!");
   FindPatternInputsAndOutputs(I, Pat->getChild(i), InstInputs, InstResults,
-  InstImpInputs, InstImpResults);
+  InstImpResults);
 }
 
 // If this is a non-leaf node with no children, treat it basically as if
 // it were a leaf.  This handles nodes like (imm).
 bool isUse = false;
 if (Pat->getNumChildren() == 0)
-  isUse = HandleUse(I, Pat, InstInputs, InstImpInputs);
+  isUse = HandleUse(I, Pat, InstInputs);
 
 if (!isUse && Pat->getTransformFn())
   I->error("Cannot specify a transform function for a non-input value!");
@@ -1063,7 +1061,8 @@
   if (InstResults.count(Dest->getName()))
 I->error("cannot set '" + Dest->getName() +"' multiple times");
   InstResults[Dest->getName()] = Val->getDef();
-} else if (Val->getDef()->isSubClassOf("Register")) {
+} else if (Val->getDef()->isSubClassOf("Register") ||
+   Val->getDef()->getName() == "FLAG") {
   InstImpResults.push_back(Val->getDef());
 } else {
   I->error("set destination should be a register!");
@@ -1071,7 +1070,7 @@
 
 // Verify and collect info from the computation.
 FindPatternInputsAndOutputs(I, Pat->getChild(i+NumValues),
-InstInputs, InstResults, InstImpInputs, 
InstImpResults);
+InstInputs, InstResults, InstImpResults);
   }
 }
 
@@ -1147,8 +1146,7 @@
   std::vector ImpResults;
   std::vector ImpOperands;
   Instructions.insert(std::make_pair(Instrs[i], 
-  DAGInstruction(0, Results, Operands,
- ImpResults, ImpOperands)));
+  DAGInstruction(0, Results, Operands, ImpResults)));
   continue;  // no pattern.
 }
 
@@ -1169,8 +1167,6 @@
 // InstResults - Keep track of all the virtual registers that are 'set'
 // in the instruction, including what reg class they are.
 std::map InstResults;
-
-std::vector InstImpInputs;
 std::vector InstImpResults;
 
 // Verify that the top-level forms in the instruction are of void type, and
@@ -1183,7 +1179,7 @@
 
   // Find inputs and outputs, and verify the structure of the uses/defs.
   FindPatternInputsAndOutputs(I, Pat, InstInputs, InstR

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

2005-12-21 Thread Evan Cheng


Changes in directory llvm/utils/TableGen:

DAGISelEmitter.cpp updated: 1.112 -> 1.113
---
Log message:

Attempt to fix a crash on WIN32.


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

 DAGISelEmitter.cpp |   31 ---
 1 files changed, 16 insertions(+), 15 deletions(-)


Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.112 
llvm/utils/TableGen/DAGISelEmitter.cpp:1.113
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.112Wed Dec 21 20:24:50 2005
+++ llvm/utils/TableGen/DAGISelEmitter.cpp  Wed Dec 21 20:35:21 2005
@@ -1124,22 +1124,23 @@
   
   CodeGenInstruction &InstInfo 
=Target.getInstruction(Instrs[i]->getName());
 
-  // Note: Removed if (InstInfo.OperandList.size() == 0) continue;
-  // It's possible for some instruction, e.g. RET for X86 that only has an
-  // implicit flag operand.
-  // FIXME: temporary hack...
-  if (InstInfo.isReturn || InstInfo.isBranch || InstInfo.isCall ||
-  InstInfo.isStore) {
-// These produce no results
-for (unsigned j = 0, e = InstInfo.OperandList.size(); j < e; ++j)
-  Operands.push_back(InstInfo.OperandList[j].Rec);
-  } else {
-// Assume the first operand is the result.
-Results.push_back(InstInfo.OperandList[0].Rec);
+  if (InstInfo.OperandList.size() != 0) {
+// It's possible for some instruction, e.g. RET for X86 that only has 
an
+// implicit flag operand.
+// FIXME: temporary hack...
+if (InstInfo.isReturn || InstInfo.isBranch || InstInfo.isCall ||
+InstInfo.isStore) {
+  // These produce no results
+  for (unsigned j = 0, e = InstInfo.OperandList.size(); j < e; ++j)
+Operands.push_back(InstInfo.OperandList[j].Rec);
+} else {
+  // Assume the first operand is the result.
+  Results.push_back(InstInfo.OperandList[0].Rec);
   
-// The rest are inputs.
-for (unsigned j = 1, e = InstInfo.OperandList.size(); j < e; ++j)
-  Operands.push_back(InstInfo.OperandList[j].Rec);
+  // The rest are inputs.
+  for (unsigned j = 1, e = InstInfo.OperandList.size(); j < e; ++j)
+Operands.push_back(InstInfo.OperandList[j].Rec);
+}
   }
   
   // Create and insert the instruction.



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


[llvm-commits] CVS: llvm/lib/System/Alarm.cpp

2005-12-21 Thread Reid Spencer


Changes in directory llvm/lib/System:

Alarm.cpp added (r1.1)
---
Log message:

Implement a generic polled Alarm function. This merely removes the system
dependent portion of the lib/Support/SlowOperationTimer code into the
lib/System implementation where it can be ported to different platforms.


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

 Alarm.cpp |   34 ++
 1 files changed, 34 insertions(+)


Index: llvm/lib/System/Alarm.cpp
diff -c /dev/null llvm/lib/System/Alarm.cpp:1.1
*** /dev/null   Wed Dec 21 21:23:56 2005
--- llvm/lib/System/Alarm.cpp   Wed Dec 21 21:23:46 2005
***
*** 0 
--- 1,34 
+ //===- Alarm.cpp - Alarm Generation Support -*- C++ 
-*-===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by the Reid Spencer and is distributed under the 
+ // University of Illinois Open Source License. See LICENSE.TXT for details.
+ //
+ 
//===--===//
+ //
+ // This file implements the Alarm functionality 
+ //
+ 
//===--===//
+ 
+ #include "llvm/System/Alarm.h"
+ #include "llvm/Config/config.h"
+ 
+ namespace llvm {
+ using namespace sys;
+ 
+ 
//===--===//
+ //=== WARNING: Implementation here must contain only TRULY operating system
+ //===  independent code.
+ 
//===--===//
+ 
+ }
+ 
+ // Include the platform-specific parts of this class.
+ #ifdef LLVM_ON_UNIX
+ #include "Unix/Alarm.inc"
+ #endif
+ #ifdef LLVM_ON_WIN32
+ #include "Win32/Alarm.inc"
+ #endif
+ 



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


[llvm-commits] CVS: llvm/include/llvm/System/Alarm.h

2005-12-21 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

Alarm.h added (r1.1)
---
Log message:

Implement a generic polled Alarm function. This merely removes the system
dependent portion of the lib/Support/SlowOperationTimer code into the
lib/System implementation where it can be ported to different platforms.


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

 Alarm.h |   42 ++
 1 files changed, 42 insertions(+)


Index: llvm/include/llvm/System/Alarm.h
diff -c /dev/null llvm/include/llvm/System/Alarm.h:1.1
*** /dev/null   Wed Dec 21 21:23:56 2005
--- llvm/include/llvm/System/Alarm.hWed Dec 21 21:23:46 2005
***
*** 0 
--- 1,42 
+ //===- llvm/System/Alarm.h - Alarm Generation support  --*- C++ 
-*-===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by Reid Spencer and is distributed under the
+ // University of Illinois Open Source License. See LICENSE.TXT for details.
+ //
+ 
//===--===//
+ //
+ // This file provides an operating system independent interface to alarm(2) 
+ // type functionality. The Alarm class allows a one-shot alarm to be set up 
+ // at some number of seconds in the future. When the alarm triggers, a method
+ // is called to process the event
+ //
+ 
//===--===//
+ 
+ #ifndef LLVM_SYSTEM_ALARM_H
+ #define LLVM_SYSTEM_ALARM_H
+ 
+ namespace llvm {
+ namespace sys {
+ 
+   /// This function registers an alarm to trigger some number of \p seconds 
in 
+   /// the future. When that time arrives, the \p callback is called. You can
+   /// only call this once. Each time 
+   /// @returns nothing
+   void SetupAlarm(
+ unsigned seconds ///< Number of seconds in future when alarm arrives
+   );
+ 
+   /// This function terminates the alarm previously set up 
+   /// @returns nothing
+   void TerminateAlarm();
+ 
+   /// This function acquires the status of the alarm. 
+   /// @returns -1=cancelled, 0=untriggered, 1=triggered
+   int AlarmStatus();
+ 
+ } // End sys namespace
+ } // End llvm namespace
+ 
+ #endif



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


[llvm-commits] CVS: llvm/lib/System/Unix/Alarm.inc

2005-12-21 Thread Reid Spencer


Changes in directory llvm/lib/System/Unix:

Alarm.inc added (r1.1)
---
Log message:

Implement a generic polled Alarm function. This merely removes the system
dependent portion of the lib/Support/SlowOperationTimer code into the
lib/System implementation where it can be ported to different platforms.


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

 Alarm.inc |   68 ++
 1 files changed, 68 insertions(+)


Index: llvm/lib/System/Unix/Alarm.inc
diff -c /dev/null llvm/lib/System/Unix/Alarm.inc:1.1
*** /dev/null   Wed Dec 21 21:23:56 2005
--- llvm/lib/System/Unix/Alarm.inc  Wed Dec 21 21:23:46 2005
***
*** 0 
--- 1,68 
+ //===-- Alarm.inc - Implement Unix Alarm Support 
--===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by the Reid Spencer and is distributed under the
+ // University of Illinois Open Source License. See LICENSE.TXT for details.
+ //
+ 
//===--===//
+ //
+ // This file implements the UNIX Alarm support.
+ //
+ 
//===--===//
+ 
+ #include 
+ #include 
+ #include 
+ using namespace llvm;
+ 
+ /// AlarmCancelled - This flag is set by the SIGINT signal handler if the
+ /// user presses CTRL-C.
+ static volatile bool AlarmCancelled = false;
+ 
+ /// AlarmTriggered - This flag is set by the SIGALRM signal handler if the 
+ /// alarm was triggered.
+ static volatile bool AlarmTriggered = false;
+ 
+ /// NestedSOI - Sanity check.  Alarms cannot be nested or run in parallel.  
+ /// This ensures that they never do.
+ static bool NestedSOI = false;
+ 
+ static RETSIGTYPE SigIntHandler(int Sig) {
+   AlarmCancelled = true;
+   signal(SIGINT, SigIntHandler);
+ }
+ 
+ static RETSIGTYPE SigAlarmHandler(int Sig) {
+   AlarmTriggered = true;
+ }
+ 
+ static void (*OldSigIntHandler) (int);
+ 
+ void sys::SetupAlarm(unsigned seconds) {
+   assert(!NestedSOI && "sys::SetupAlarm calls cannot be nested!");
+   NestedSOI = true;
+   AlarmCancelled = false;
+   AlarmTriggered = false;
+   ::signal(SIGALRM, SigAlarmHandler);
+   OldSigIntHandler = ::signal(SIGINT, SigIntHandler);
+   ::alarm(seconds);
+ }
+ 
+ void sys::TerminateAlarm() {
+   assert(NestedSOI && "sys::TerminateAlarm called without sys::SetupAlarm!");
+   ::alarm(0);
+   ::signal(SIGALRM, SIG_DFL);
+   ::signal(SIGINT, OldSigIntHandler);
+   AlarmCancelled = false;
+   AlarmTriggered = false;
+   NestedSOI = false;
+ }
+ 
+ int sys::AlarmStatus() {
+   if (AlarmCancelled)
+ return -1;
+   if (AlarmTriggered)
+ return 1;
+   return 0;
+ }



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


[llvm-commits] CVS: llvm/lib/System/Win32/Alarm.inc

2005-12-21 Thread Reid Spencer


Changes in directory llvm/lib/System/Win32:

Alarm.inc added (r1.1)
---
Log message:

Implement a generic polled Alarm function. This merely removes the system
dependent portion of the lib/Support/SlowOperationTimer code into the
lib/System implementation where it can be ported to different platforms.


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

 Alarm.inc |   36 
 1 files changed, 36 insertions(+)


Index: llvm/lib/System/Win32/Alarm.inc
diff -c /dev/null llvm/lib/System/Win32/Alarm.inc:1.1
*** /dev/null   Wed Dec 21 21:23:56 2005
--- llvm/lib/System/Win32/Alarm.inc Wed Dec 21 21:23:46 2005
***
*** 0 
--- 1,36 
+ //===-- Alarm.inc - Implement Win32 Alarm Support 
-===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by the Reid Spencer and is distributed under the
+ // University of Illinois Open Source License. See LICENSE.TXT for details.
+ //
+ 
//===--===//
+ //
+ // This file implements the Win32 Alarm support.
+ //
+ 
//===--===//
+ 
+ #include 
+ using namespace llvm;
+ 
+ /// NestedSOI - Sanity check.  Alarms cannot be nested or run in parallel.  
+ /// This ensures that they never do.
+ static bool NestedSOI = false;
+ 
+ void sys::SetupAlarm(unsigned seconds) {
+   assert(!NestedSOI && "sys::SetupAlarm calls cannot be nested!");
+   NestedSOI = true;
+   // FIXME: Implement for Win32
+ }
+ 
+ void sys::TerminateAlarm() {
+   assert(NestedSOI && "sys::TerminateAlarm called without sys::SetupAlarm!");
+   // FIXME: Implement for Win32
+   NestedSOI = false;
+ }
+ 
+ int sys::AlarmStatus() {
+   // FIXME: Implement for Win32
+   return 0;
+ }



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


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

2005-12-21 Thread Reid Spencer


Changes in directory llvm/lib/Support:

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

For PR351: http://llvm.cs.uiuc.edu/PR351 :
Move the system dependent portion to lib/System/*/Alarm.inc. This makes the
SlowOperationInformer platform independent.


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

 SlowOperationInformer.cpp |   49 +-
 1 files changed, 6 insertions(+), 43 deletions(-)


Index: llvm/lib/Support/SlowOperationInformer.cpp
diff -u llvm/lib/Support/SlowOperationInformer.cpp:1.6 
llvm/lib/Support/SlowOperationInformer.cpp:1.7
--- llvm/lib/Support/SlowOperationInformer.cpp:1.6  Thu Apr 21 17:52:05 2005
+++ llvm/lib/Support/SlowOperationInformer.cpp  Wed Dec 21 21:31:26 2005
@@ -12,63 +12,25 @@
 
//===--===//
 
 #include "llvm/Support/SlowOperationInformer.h"
-#include "llvm/Config/config.h" // Get the signal handler return type
+#include "llvm/System/Alarm.h"
 #include 
 #include 
-#include 
-#include 
 #include 
 using namespace llvm;
 
-/// OperationCancelled - This flag is set by the SIGINT signal handler if the
-/// user presses CTRL-C.
-static volatile bool OperationCancelled;
-
-/// ShouldShowStatus - This flag gets set if the operation takes a long time.
-///
-static volatile bool ShouldShowStatus;
-
-/// NestedSOI - Sanity check.  SlowOperationInformers cannot be nested or run 
in
-/// parallel.  This ensures that they never do.
-static bool NestedSOI = false;
-
-static RETSIGTYPE SigIntHandler(int Sig) {
-  OperationCancelled = true;
-  signal(SIGINT, SigIntHandler);
-}
-
-static RETSIGTYPE SigAlarmHandler(int Sig) {
-  ShouldShowStatus = true;
-}
-
-static void (*OldSigIntHandler) (int);
-
-
 SlowOperationInformer::SlowOperationInformer(const std::string &Name)
   : OperationName(Name), LastPrintAmount(0) {
-  assert(!NestedSOI && "SlowerOperationInformer objects cannot be nested!");
-  NestedSOI = true;
-
-  OperationCancelled = 0;
-  ShouldShowStatus = 0;
-
-  signal(SIGALRM, SigAlarmHandler);
-  OldSigIntHandler = signal(SIGINT, SigIntHandler);
-  alarm(1);
+  sys::SetupAlarm(1);
 }
 
 SlowOperationInformer::~SlowOperationInformer() {
-  NestedSOI = false;
+  sys::TerminateAlarm();
   if (LastPrintAmount) {
 // If we have printed something, make _sure_ we print the 100% amount, and
 // also print a newline.
 std::cout << std::string(LastPrintAmount, '\b') << "Progress "
   << OperationName << ": 100%  \n";
   }
-
-  alarm(0);
-  signal(SIGALRM, SIG_DFL);
-  signal(SIGINT, OldSigIntHandler);
 }
 
 /// progress - Clients should periodically call this method when they are in
@@ -76,7 +38,8 @@
 /// along the operation is, given in 1/10ths of a percent (in other words,
 /// Amount should range from 0 to 1000).
 void SlowOperationInformer::progress(unsigned Amount) {
-  if (OperationCancelled) {
+  int status = sys::AlarmStatus();
+  if (status == -1) {
 std::cout << "\n";
 LastPrintAmount = 0;
 throw "While " + OperationName + ", operation cancelled.";
@@ -84,7 +47,7 @@
 
   // If we haven't spent enough time in this operation to warrant displaying 
the
   // progress bar, don't do so yet.
-  if (!ShouldShowStatus)
+  if (status == 0)
 return;
 
   // Delete whatever we printed last time.



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


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

2005-12-21 Thread Duraid Madina


Changes in directory llvm/lib/Target/IA64:

IA64.td updated: 1.3 -> 1.4
IA64InstrInfo.td updated: 1.30 -> 1.31
IA64RegisterInfo.td updated: 1.11 -> 1.12
---
Log message:

update tablegen files - nothing to see here



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

 IA64.td |1 +
 IA64InstrInfo.td|   19 +++
 IA64RegisterInfo.td |4 ++--
 3 files changed, 18 insertions(+), 6 deletions(-)


Index: llvm/lib/Target/IA64/IA64.td
diff -u llvm/lib/Target/IA64/IA64.td:1.3 llvm/lib/Target/IA64/IA64.td:1.4
--- llvm/lib/Target/IA64/IA64.td:1.3Fri Sep 30 01:42:24 2005
+++ llvm/lib/Target/IA64/IA64.tdWed Dec 21 21:56:03 2005
@@ -47,6 +47,7 @@
 
 //  r1, // global data pointer (GP)  - XXX NOT callee saved, we do it ourselves
 //  r12, // memory stack pointer (SP)- XXX NOT callee saved, we do it ourselves
+//  rp, // return branch register (rp/b0) - we do this ourselves
   //  r13 (thread pointer) we do not touch, ever. it's not here. //
   //r15, // our frame pointer (FP)
   


Index: llvm/lib/Target/IA64/IA64InstrInfo.td
diff -u llvm/lib/Target/IA64/IA64InstrInfo.td:1.30 
llvm/lib/Target/IA64/IA64InstrInfo.td:1.31
--- llvm/lib/Target/IA64/IA64InstrInfo.td:1.30  Sun Dec  4 20:34:29 2005
+++ llvm/lib/Target/IA64/IA64InstrInfo.td   Wed Dec 21 21:56:03 2005
@@ -23,7 +23,7 @@
 def s14imm  : Operand {
   let PrintMethod = "printS14ImmOperand";
 }
-def s22imm  : Operand {
+def s22imm  : Operand {
   let PrintMethod = "printS22ImmOperand";
 }
 def u64imm  : Operand {
@@ -116,7 +116,12 @@
 def ADDL_GA : AForm_DAG<0x03, 0x0b, (ops GR:$dst, GR:$src1, 
globaladdress:$imm),
"addl $dst = $imm, $src1;;",
   []>;
-  
+
+// hmm 
+def ADDL_EA : AForm_DAG<0x03, 0x0b, (ops GR:$dst, GR:$src1, calltarget:$imm),
+   "addl $dst = $imm, $src1;;",
+  []>;
+ 
 def SUB  : AForm_DAG<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2),
"sub $dst = $src1, $src2;;",
   [(set GR:$dst, (sub GR:$src1, GR:$src2))]>;
@@ -639,7 +644,7 @@
 "($qp) br.cond.sptk $dst;;">;
 }
 
-let isCall = 1, isTerminator = 1, isBranch = 1, 
+let isCall = 1, /* isTerminator = 1, isBranch = 1, */
   Uses = [out0,out1,out2,out3,out4,out5,out6,out7],
 // all calls clobber non-callee-saved registers, and for now, they are these:
   Defs = [r2,r3,r8,r9,r10,r11,r14,r15,r16,r17,r18,r19,r20,r21,r22,r23,r24,
@@ -659,8 +664,14 @@
   def BRCALL: RawForm<0x03, 0xb0, (ops calltarget:$dst),
   "br.call.sptk rp = $dst;;">;   // FIXME: teach llvm about branch regs?
 // new daggy stuff!  
-  def BRCALL_IPREL : RawForm<0x03, 0xb0, (ops calltarget:$dst, variable_ops),
+
+// calls a globaladdress
+  def BRCALL_IPREL_GA : RawForm<0x03, 0xb0, (ops calltarget:$dst, 
variable_ops),
+  "br.call.sptk rp = $dst;;">;   // FIXME: teach llvm about branch regs?
+// calls an externalsymbol
+  def BRCALL_IPREL_ES : RawForm<0x03, 0xb0, (ops calltarget:$dst, 
variable_ops),
   "br.call.sptk rp = $dst;;">;   // FIXME: teach llvm about branch regs?
+// calls through a function descriptor
   def BRCALL_INDIRECT : RawForm<0x03, 0xb0, (ops GR:$branchreg, variable_ops),
   "br.call.sptk rp = $branchreg;;">; // FIXME: teach llvm about branch regs?
   def BRLCOND_CALL : RawForm<0x03, 0xb0, (ops PR:$qp, i64imm:$dst),


Index: llvm/lib/Target/IA64/IA64RegisterInfo.td
diff -u llvm/lib/Target/IA64/IA64RegisterInfo.td:1.11 
llvm/lib/Target/IA64/IA64RegisterInfo.td:1.12
--- llvm/lib/Target/IA64/IA64RegisterInfo.td:1.11   Wed Nov 30 22:51:06 2005
+++ llvm/lib/Target/IA64/IA64RegisterInfo.tdWed Dec 21 21:56:03 2005
@@ -235,8 +235,8 @@
 def GR : RegisterClass<"IA64", [i64], 64, 
[

-//FIXME!: for readability, we don't want the out registers to be the first
-//ones allocated
+//FIXME!: for both readability and performance, we don't want the out
+//registers to be the first ones allocated
 
 out7, out6, out5, out4, out3, out2, out1, out0,
 r3,  r8,  r9,  r10, r11, r14,



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


[llvm-commits] CVS: llvm/include/llvm/System/Alarm.h

2005-12-21 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

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

Fix documentation for the AlarmSetup function.


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

 Alarm.h |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/System/Alarm.h
diff -u llvm/include/llvm/System/Alarm.h:1.1 
llvm/include/llvm/System/Alarm.h:1.2
--- llvm/include/llvm/System/Alarm.h:1.1Wed Dec 21 21:23:46 2005
+++ llvm/include/llvm/System/Alarm.hWed Dec 21 21:57:15 2005
@@ -21,8 +21,11 @@
 namespace sys {
 
   /// This function registers an alarm to trigger some number of \p seconds in 
-  /// the future. When that time arrives, the \p callback is called. You can
-  /// only call this once. Each time 
+  /// the future. When that time arrives, the AlarmStatus function will begin
+  /// to return 1 instead of 0. The user must poll the status of the alarm by
+  /// making occasional calls to AlarmStatus. If the user sends an interrupt
+  /// signal, AlarmStatus will begin returning -1, even if the alarm event
+  /// occurred.
   /// @returns nothing
   void SetupAlarm(
 unsigned seconds ///< Number of seconds in future when alarm arrives



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


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

2005-12-21 Thread Duraid Madina


Changes in directory llvm/lib/Target/IA64:

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

kill SelectCALL() in the DAG isel, we handle this in lowering now, like
SPARCv8. (we copy sparcv8's workaround for tablegen not being nice about
ISD::CALL/TAILCALL)


---
Diffs of the changes:  (+47 -189)

 IA64ISelDAGToDAG.cpp |  236 ++-
 1 files changed, 47 insertions(+), 189 deletions(-)


Index: llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp
diff -u llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.13 
llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.14
--- llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.13  Wed Nov 30 17:02:08 2005
+++ llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp   Wed Dec 21 21:58:17 2005
@@ -94,7 +94,6 @@
 
 private:
 SDOperand SelectDIV(SDOperand Op);
-SDOperand SelectCALL(SDOperand Op);
   };
 }
 
@@ -327,191 +326,6 @@
   return Result;
 }
 
-
-SDOperand IA64DAGToDAGISel::SelectCALL(SDOperand Op) {
-  SDNode *N = Op.Val;
-  SDOperand Chain = Select(N->getOperand(0));
-  
-  unsigned CallOpcode;
-  std::vector CallOperands;
-
-  // save the current GP, SP and RP : FIXME: do we need to do all 3 always?
-  SDOperand GPBeforeCall = CurDAG->getCopyFromReg(Chain, IA64::r1, MVT::i64);
-  Chain = GPBeforeCall.getValue(1);
-  SDOperand SPBeforeCall = CurDAG->getCopyFromReg(Chain, IA64::r12, MVT::i64);
-  Chain = SPBeforeCall.getValue(1);
-  SDOperand RPBeforeCall = CurDAG->getCopyFromReg(Chain, IA64::rp, MVT::i64);
-  Chain = RPBeforeCall.getValue(1);
-
-  // if we can call directly, do so
-  if (GlobalAddressSDNode *GASD =
-  dyn_cast(N->getOperand(1))) {
-CallOpcode = IA64::BRCALL_IPREL;
-CallOperands.push_back(CurDAG->getTargetGlobalAddress(GASD->getGlobal(),
-  MVT::i64));
-  } else if (ExternalSymbolSDNode *ESSDN = // FIXME: we currently NEED this
-// case for correctness, to avoid
-// "non-pic code with imm reloc.n
-// against dynamic symbol" errors
- dyn_cast(N->getOperand(1))) {
-CallOpcode = IA64::BRCALL_IPREL;
-CallOperands.push_back(N->getOperand(1));
-  } else {
-// otherwise we need to load the function descriptor,
-// load the branch target (function)'s entry point and GP,
-// branch (call) then restore the GP
-
-SDOperand FnDescriptor = Select(N->getOperand(1));
-   
-// load the branch target's entry point [mem] and 
-// GP value [mem+8]
-SDOperand targetEntryPoint=CurDAG->getTargetNode(IA64::LD8, MVT::i64,
-   FnDescriptor);
-Chain = targetEntryPoint.getValue(1);
-SDOperand targetGPAddr=CurDAG->getTargetNode(IA64::ADDS, MVT::i64, 
-   FnDescriptor, CurDAG->getConstant(8, MVT::i64));
-Chain = targetGPAddr.getValue(1);
-SDOperand targetGP=CurDAG->getTargetNode(IA64::LD8, MVT::i64,
-   targetGPAddr);
-Chain = targetGP.getValue(1);
-
-/* FIXME? (methcall still fails)
-SDOperand targetEntryPoint=CurDAG->getLoad(MVT::i64, Chain, FnDescriptor,
-   CurDAG->getSrcValue(0));
-SDOperand targetGPAddr=CurDAG->getNode(ISD::ADD, MVT::i64, FnDescriptor, 
-   CurDAG->getConstant(8, MVT::i64));
-SDOperand targetGP=CurDAG->getLoad(MVT::i64, Chain, targetGPAddr,
-  CurDAG->getSrcValue(0));
-*/
-
-/* this is just the long way of writing the two lines below?
-// Copy the callee GP into r1
-SDOperand r1 = CurDAG->getRegister(IA64::r1, MVT::i64);
-Chain = CurDAG->getNode(ISD::CopyToReg, MVT::i64, Chain, r1,
-targetGP);
-
-
-// Copy the callee address into the b6 branch register
-SDOperand B6 = CurDAG->getRegister(IA64::B6, MVT::i64);
-Chain = CurDAG->getNode(ISD::CopyToReg, MVT::i64, Chain, B6,
-targetEntryPoint);
-*/
-
-Chain = CurDAG->getCopyToReg(Chain, IA64::r1, targetGP);
-Chain = CurDAG->getCopyToReg(Chain, IA64::B6, targetEntryPoint);
-
-CallOperands.push_back(CurDAG->getRegister(IA64::B6, MVT::i64));
-CallOpcode = IA64::BRCALL_INDIRECT;
-  }
- 
-  // see section 8.5.8 of "Itanium Software Conventions and
-  // Runtime Architecture Guide to see some examples of what's going
-  // on here. (in short: int args get mapped 1:1 'slot-wise' to out0->out7,
-  // while FP args get mapped to F8->F15 as needed)
-  
-  // TODO: support in-memory arguments
- 
-  unsigned used_FPArgs=0; // how many FP args have been used so far?
-
-  unsigned intArgs[] = {IA64::out0, IA64::out1, IA64::out2, IA64::out3,
-IA64::out4, IA64::out5, IA64::out6, IA64::out7 };
-  unsigned FPArgs[] = {IA64::F8, IA64::F9, IA64::F10, IA64::F11,
-   IA64::F12, IA64::F13, IA64::F14, IA64::F15 };
-
-  SDOperand InFlag;  // Null incoming f

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

2005-12-21 Thread Duraid Madina


Changes in directory llvm/lib/Target/IA64:

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

I shoulda done this a *long* time ago (tm): implement calls properly,
i.e. r1/r12/rp are saved/restored regardless of scheduling/luck

TODO: calls to external symbols, indirect (function descriptor) calls,
  performance (we're being paranoid right now)

BUG: the code for handling calls to vararg functions breaks if FP
args are passed (this will make printf() go haywire so a bunch of
tests will fail)

BUG: this seems to trigger some legalize nastiness



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

 IA64ISelLowering.cpp |  174 ++-
 1 files changed, 158 insertions(+), 16 deletions(-)


Index: llvm/lib/Target/IA64/IA64ISelLowering.cpp
diff -u llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.5 
llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.6
--- llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.5   Wed Dec 21 14:51:36 2005
+++ llvm/lib/Target/IA64/IA64ISelLowering.cpp   Wed Dec 21 22:07:40 2005
@@ -282,13 +282,25 @@
   MF.getInfo()->outRegsUsed=
 std::max(outRegsUsed, MF.getInfo()->outRegsUsed);
 
+  // keep stack frame 16-byte aligned
+  //assert(NumBytes==((NumBytes+15) & ~15) && "stack frame not 16-byte 
aligned!");
+  NumBytes = (NumBytes+15) & ~15;
+  
   Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
 DAG.getConstant(NumBytes, getPointerTy()));
 
-  std::vector args_to_use;
+  SDOperand StackPtr, NullSV;
+  std::vector Stores;
+  std::vector RegValuesToPass;
+  unsigned ArgOffset = 16;
+  
   for (unsigned i = 0, e = Args.size(); i != e; ++i)
 {
-  switch (getValueType(Args[i].second)) {
+  SDOperand Val = Args[i].first;
+  MVT::ValueType ObjectVT = Val.getValueType();
+  SDOperand ValToStore;
+  unsigned ObjSize=8;
+  switch (ObjectVT) {
   default: assert(0 && "unexpected argument type!");
   case MVT::i1:
   case MVT::i8:
@@ -297,34 +309,164 @@
 //promote to 64-bits, sign/zero extending based on type
 //of the argument
 if(Args[i].second->isSigned())
-  Args[i].first = DAG.getNode(ISD::SIGN_EXTEND, MVT::i64,
-  Args[i].first);
+  Val = DAG.getNode(ISD::SIGN_EXTEND, MVT::i64, Val);
 else
-  Args[i].first = DAG.getNode(ISD::ZERO_EXTEND, MVT::i64,
-  Args[i].first);
+  Val = DAG.getNode(ISD::ZERO_EXTEND, MVT::i64, Val);
+// XXX: fall through
+  case MVT::i64:
+//ObjSize = 8;
+if(RegValuesToPass.size() >= 8) {
+  ValToStore = Val;
+} else {
+  RegValuesToPass.push_back(Val);
+}
 break;
   case MVT::f32:
 //promote to 64-bits
-Args[i].first = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Args[i].first);
+Val = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Val);
+// XXX: fall through
   case MVT::f64:
-  case MVT::i64:
+if(RegValuesToPass.size() >= 8) {
+  ValToStore = Val;
+} else {
+  RegValuesToPass.push_back(Val);
+}
 break;
   }
-  args_to_use.push_back(Args[i].first);
+  
+  if(ValToStore.Val) {
+if(!StackPtr.Val) {
+  StackPtr = DAG.getRegister(IA64::r12, MVT::i64);
+  NullSV = DAG.getSrcValue(NULL);
+}
+SDOperand PtrOff = DAG.getConstant(ArgOffset, getPointerTy());
+PtrOff = DAG.getNode(ISD::ADD, MVT::i64, StackPtr, PtrOff);
+Stores.push_back(DAG.getNode(ISD::STORE, MVT::Other, Chain,
+ ValToStore, PtrOff, NullSV));
+  }
+  ArgOffset += ObjSize;
 }
 
+  // Emit all stores, make sure they occur before any copies into physregs.
+  if (!Stores.empty())
+Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, Stores);
+
+  static const unsigned IntArgRegs[] = {
+IA64::out0, IA64::out1, IA64::out2, IA64::out3, 
+IA64::out4, IA64::out5, IA64::out6, IA64::out7
+  };
+
+  static const unsigned FPArgRegs[] = {
+IA64::F8,  IA64::F9,  IA64::F10, IA64::F11, 
+IA64::F12, IA64::F13, IA64::F14, IA64::F15
+  };
+
+  SDOperand InFlag;
+  
+  // save the current GP, SP and RP : FIXME: do we need to do all 3 always?
+  SDOperand GPBeforeCall = DAG.getCopyFromReg(Chain, IA64::r1, MVT::i64, 
InFlag);
+  Chain = GPBeforeCall;
+  InFlag = Chain.getValue(1);
+  SDOperand SPBeforeCall = DAG.getCopyFromReg(Chain, IA64::r12, MVT::i64, 
InFlag);
+  Chain = SPBeforeCall;
+  InFlag = Chain.getValue(1);
+  SDOperand RPBeforeCall = DAG.getCopyFromReg(Chain, IA64::rp, MVT::i64, 
InFlag);
+  Chain = RPBeforeCall;
+  InFlag = Chain.getValue(1);
+
+  // Build a sequence of copy-to-reg nodes chained together with token chain
+  // and flag operands which copy the outgoing integer args into regs out[0-7]
+  // mapped 1:1 and the FP args into regs F8-F15 "lazily"
+  // TODO: for performance, we should only copy FP args into int regs when we
+  // know this is r

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

2005-12-21 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.240 -> 1.241
---
Log message:

The 81st column doesn't like code in it.


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

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


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.240 
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.241
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.240 Wed Dec 21 14:51:36 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp   Wed Dec 21 23:23:45 2005
@@ -1454,7 +1454,7 @@
 Tmp2 = LegalizeOp(Node->getOperand(1));   // RHS
 if (Tmp1 != Node->getOperand(0) || Tmp2 != Node->getOperand(1) ||
 Tmp3 != Node->getOperand(2) || Tmp4 != Node->getOperand(3)) {
-  Result = DAG.getNode(ISD::SELECT_CC, Node->getValueType(0), Tmp1, 
Tmp2, 
+  Result = DAG.getNode(ISD::SELECT_CC, Node->getValueType(0), 
Tmp1,Tmp2, 
Tmp3, Tmp4, Node->getOperand(4));
 }
 break;
@@ -1590,7 +1590,8 @@
   }
 }
 
-switch(TLI.getOperationAction(ISD::SETCC, 
Node->getOperand(0).getValueType())) {
+switch(TLI.getOperationAction(ISD::SETCC,
+  Node->getOperand(0).getValueType())) {
 default: 
   assert(0 && "Cannot handle this action for SETCC yet!");
   break;
@@ -1611,7 +1612,7 @@
"Fell off of the edge of the floating point world");
   
 // If the target supports SETCC of this type, use it.
-if (TLI.getOperationAction(ISD::SETCC, NewInTy) == 
TargetLowering::Legal)
+if (TLI.isOperationLegal(ISD::SETCC, NewInTy))
   break;
   }
   if (MVT::isInteger(NewInTy))



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

2005-12-21 Thread Chris Lattner


Changes in directory llvm/lib/Analysis/IPA:

CallGraph.cpp updated: 1.48 -> 1.49
---
Log message:

Separate the call graph implementation from its interface.  This implements
the rough idea sketched out in 
http://nondot.org/sabre/LLVMNotes/CallGraphClass.txt,
allowing new spiffy implementations of the callgraph interface to be built.

Many thanks to Saem Ghani for contributing this!


---
Diffs of the changes:  (+179 -106)

 CallGraph.cpp |  285 --
 1 files changed, 179 insertions(+), 106 deletions(-)


Index: llvm/lib/Analysis/IPA/CallGraph.cpp
diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.48 
llvm/lib/Analysis/IPA/CallGraph.cpp:1.49
--- llvm/lib/Analysis/IPA/CallGraph.cpp:1.48Thu Apr 21 16:08:44 2005
+++ llvm/lib/Analysis/IPA/CallGraph.cpp Thu Dec 22 00:07:52 2005
@@ -7,7 +7,8 @@
 //
 
//===--===//
 //
-//  This file implements the CallGraph class.
+// This file implements the CallGraph class and provides the BasicCallGraph
+// default implementation.
 //
 
//===--===//
 
@@ -15,22 +16,10 @@
 #include "llvm/Module.h"
 #include "llvm/Instructions.h"
 #include "llvm/Support/CallSite.h"
-#include "llvm/ADT/STLExtras.h"
 #include 
 using namespace llvm;
 
-static RegisterAnalysis X("callgraph", "Call Graph Construction");
-
-// getNodeFor - Return the node for the specified function or create one if it
-// does not already exist.
-//
-CallGraphNode *CallGraph::getNodeFor(Function *F) {
-  CallGraphNode *&CGN = FunctionMap[F];
-  if (CGN) return CGN;
-
-  assert((!F || F->getParent() == Mod) && "Function not in current module!");
-  return CGN = new CallGraphNode(F);
-}
+void llvm::BasicCallGraphStub() {}
 
 static bool isOnlyADirectCall(Function *F, CallSite CS) {
   if (!CS.getInstruction()) return false;
@@ -39,125 +28,194 @@
   return true;
 }
 
-// addToCallGraph - Add a function to the call graph, and link the node to all
-// of the functions that it calls.
+namespace {
+
+//===--===//
+// BasicCallGraph class definition
 //
-void CallGraph::addToCallGraph(Function *F) {
-  CallGraphNode *Node = getNodeFor(F);
+class BasicCallGraph : public CallGraph, public ModulePass {
+  // Root is root of the call graph, or the external node if a 'main' function
+  // couldn't be found.
+  //
+  CallGraphNode *Root;
 
-  // If this function has external linkage, anything could call it...
-  if (!F->hasInternalLinkage()) {
-ExternalCallingNode->addCalledFunction(Node);
-
-// Found the entry point?
-if (F->getName() == "main") {
-  if (Root)// Found multiple external mains?  Don't pick one.
-Root = ExternalCallingNode;
-  else
-Root = Node;  // Found a main, keep track of it!
-}
+  // ExternalCallingNode - This node has edges to all external functions and
+  // those internal functions that have their address taken.
+  CallGraphNode *ExternalCallingNode;
+
+  // CallsExternalNode - This node has edges to it from all functions making
+  // indirect calls or calling an external function.
+  CallGraphNode *CallsExternalNode;
+
+public:
+  BasicCallGraph() : Root(0), ExternalCallingNode(0), CallsExternalNode(0) {}
+  ~BasicCallGraph() { destroy(); }
+
+  // runOnModule - Compute the call graph for the specified module.
+  virtual bool runOnModule(Module &M) {
+destroy();
+CallGraph::initialize(M);
+
+ExternalCallingNode = getNodeFor(0);
+CallsExternalNode = new CallGraphNode(0);
+Root = 0;
+  
+// Add every function to the call graph...
+for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
+  addToCallGraph(I);
+  
+// If we didn't find a main function, use the external call graph node
+if (Root == 0) Root = ExternalCallingNode;
+
+return false;
   }
 
-  // If this function is not defined in this translation unit, it could call
-  // anything.
-  if (F->isExternal() && !F->getIntrinsicID())
-Node->addCalledFunction(CallsExternalNode);
-
-  // Loop over all of the users of the function... looking for callers...
-  //
-  bool isUsedExternally = false;
-  for (Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E; ++I) {
-if (Instruction *Inst = dyn_cast(*I)) {
-  if (isOnlyADirectCall(F, CallSite::get(Inst)))
-getNodeFor(Inst->getParent()->getParent())->addCalledFunction(Node);
-  else
-isUsedExternally = true;
-} else if (GlobalValue *GV = dyn_cast(*I)) {
-  for (Value::use_iterator I = GV->use_begin(), E = GV->use_end();
-   I != E; ++I)
-if (Instruction *Inst = dyn_cast(*I)) {
+  virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+AU.setPreservesAll();
+  }
+
+  virtual void print(std::ostream &o, const Module *M) const {
+o << "CallGraph Root is: ";
+if (Functio

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

2005-12-21 Thread Chris Lattner


Changes in directory llvm:

CREDITS.TXT updated: 1.43 -> 1.44
---
Log message:

credit where credit is due


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

 CREDITS.TXT |6 +-
 1 files changed, 5 insertions(+), 1 deletion(-)


Index: llvm/CREDITS.TXT
diff -u llvm/CREDITS.TXT:1.43 llvm/CREDITS.TXT:1.44
--- llvm/CREDITS.TXT:1.43   Mon Nov 28 18:57:06 2005
+++ llvm/CREDITS.TXTThu Dec 22 00:09:08 2005
@@ -54,13 +54,17 @@
 N: Brian Gaeke
 E: [EMAIL PROTECTED]
 W: http://www.students.uiuc.edu/~gaeke/
-D: Portions of X86 static and JIT compilers; SparcV8 backend
+D: Portions of X86 static and JIT compilers; initial SparcV8 backend
 D: Dynamic trace optimizer 
 D: FreeBSD/X86 compatibility fixes, the llvm-nm tool
 
 N: Louis Gerbarg
 D: Portions of the PowerPC backend
 
+N: Saem Ghani
+E: [EMAIL PROTECTED]
+D: Callgraph class cleanups
+
 N: Paolo Invernizzi
 E: [EMAIL PROTECTED]
 D: Visual C++ compatibility fixes 



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


[llvm-commits] CVS: llvm/include/llvm/Analysis/CallGraph.h LinkAllAnalyses.h

2005-12-21 Thread Chris Lattner


Changes in directory llvm/include/llvm/Analysis:

CallGraph.h updated: 1.43 -> 1.44
LinkAllAnalyses.h updated: 1.2 -> 1.3
---
Log message:

Separate the call graph implementation from its interface.  This implements
the rough idea sketched out in 
http://nondot.org/sabre/LLVMNotes/CallGraphClass.txt,
allowing new spiffy implementations of the callgraph interface to be built.

Many thanks to Saem Ghani for contributing this!


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

 CallGraph.h   |   94 --
 LinkAllAnalyses.h |2 -
 2 files changed, 28 insertions(+), 68 deletions(-)


Index: llvm/include/llvm/Analysis/CallGraph.h
diff -u llvm/include/llvm/Analysis/CallGraph.h:1.43 
llvm/include/llvm/Analysis/CallGraph.h:1.44
--- llvm/include/llvm/Analysis/CallGraph.h:1.43 Thu Apr 21 15:16:31 2005
+++ llvm/include/llvm/Analysis/CallGraph.h  Thu Dec 22 00:07:52 2005
@@ -64,25 +64,13 @@
 
//===--===//
 // CallGraph class definition
 //
-class CallGraph : public ModulePass {
+class CallGraph {
+protected:
   Module *Mod;  // The module this call graph represents
 
   typedef std::map FunctionMapTy;
   FunctionMapTy FunctionMap;// Map from a function to its node
 
-  // Root is root of the call graph, or the external node if a 'main' function
-  // couldn't be found.
-  //
-  CallGraphNode *Root;
-
-  // ExternalCallingNode - This node has edges to all external functions and
-  // those internal functions that have their address taken.
-  CallGraphNode *ExternalCallingNode;
-
-  // CallsExternalNode - This node has edges to it from all functions making
-  // indirect calls or calling an external function.
-  CallGraphNode *CallsExternalNode;
-
 public:
   //===-
   // Accessors...
@@ -90,15 +78,6 @@
   typedef FunctionMapTy::iterator iterator;
   typedef FunctionMapTy::const_iterator const_iterator;
 
-  CallGraphNode *getExternalCallingNode() const { return ExternalCallingNode; }
-  CallGraphNode *getCallsExternalNode()   const { return CallsExternalNode; }
-
-  // getRoot - Return the root of the call graph, which is either main, or if
-  // main cannot be found, the external node.
-  //
-CallGraphNode *getRoot()   { return Root; }
-  const CallGraphNode *getRoot() const { return Root; }
-
   /// getModule - Return the module the call graph corresponds to.
   ///
   Module &getModule() const { return *Mod; }
@@ -108,7 +87,6 @@
   inline const_iterator begin() const { return FunctionMap.begin(); }
   inline const_iterator end()   const { return FunctionMap.end();   }
 
-
   // Subscripting operators, return the call graph node for the provided
   // function
   inline const CallGraphNode *operator[](const Function *F) const {
@@ -122,6 +100,16 @@
 return I->second;
   }
 
+  //Returns the CallGraphNode which is used to represent undetermined calls 
+  // into the callgraph.  Override this if you want behavioural inheritance.
+  virtual CallGraphNode* getExternalCallingNode() const { return 0; }
+  
+  //Return the root/main method in the module, or some other root node, such
+  // as the externalcallingnode.  Overload these if you behavioural 
+  // inheritance.
+  virtual CallGraphNode* getRoot() { return 0; }
+  virtual const CallGraphNode* getRoot() const { return 0; }
+  
   //===-
   // Functions to keep a call graph up to date with a function that has been
   // modified.
@@ -147,54 +135,27 @@
   //===-
   // Pass infrastructure interface glue code...
   //
-  CallGraph() : Root(0), CallsExternalNode(0) {}
-  ~CallGraph() { destroy(); }
-
-  // runOnModule - Compute the call graph for the specified module.
-  virtual bool runOnModule(Module &M);
-
-  // getAnalysisUsage - This obviously provides a call graph
-  virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-AU.setPreservesAll();
-  }
-
-  // releaseMemory - Data structures can be large, so free memory aggressively.
-  virtual void releaseMemory() {
-destroy();
-  }
+protected:
+  CallGraph() {}
+  
+public:
+  virtual ~CallGraph() { destroy(); }
 
-  /// Print the types found in the module.  If the optional Module parameter is
-  /// passed in, then the types are printed symbolically if possible, using the
-  /// symbol table from the module.
+  /// initialize - Call this method before calling other methods, 
+  /// re/initializes the state of the CallGraph.
   ///
-  void print(std::ostream &o, const Module *M) const;
+  void initialize(Module &M);
 
-  /// dump - Print out this call graph.
-  ///
-  void dump() const;
+  virtual void print(std::ostream &o, const Module *M) const;
 
   // stub - dummy function, just ignore it
   static void stub();
-private:
-  //===--

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

2005-12-21 Thread Duraid Madina


Changes in directory llvm/lib/Target/IA64:

IA64InstrInfo.td updated: 1.31 -> 1.32
---
Log message:

we need to emit the getf.d instruction in lowering, so add it
to IA64ISD




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

 IA64InstrInfo.td |   13 +++--
 1 files changed, 11 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/IA64/IA64InstrInfo.td
diff -u llvm/lib/Target/IA64/IA64InstrInfo.td:1.31 
llvm/lib/Target/IA64/IA64InstrInfo.td:1.32
--- llvm/lib/Target/IA64/IA64InstrInfo.td:1.31  Wed Dec 21 21:56:03 2005
+++ llvm/lib/Target/IA64/IA64InstrInfo.td   Thu Dec 22 00:38:38 2005
@@ -15,6 +15,14 @@
 
 include "IA64InstrFormats.td"
 
+//===--===//
+// IA-64 specific DAG Nodes.
+//
+
+def IA64getfd : SDNode<"IA64ISD::GETFD", SDTFPToIntOp, []>;
+
+//===-
+
 def u2imm : Operand;
 def u6imm : Operand;
 def s8imm : Operand {
@@ -614,8 +622,9 @@
 def FNORMD : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src),
   "fnorm.d $dst = $src;;">;
 
-def GETFD : AForm<0x03, 0x0b, (ops GR:$dst, FP:$src),
-  "getf.d $dst = $src;;">;
+def GETFD : AForm_DAG<0x03, 0x0b, (ops GR:$dst, FP:$src),
+  "getf.d $dst = $src;;",
+  [(set GR:$dst, (IA64getfd FP:$src))]>;
 def SETFD : AForm<0x03, 0x0b, (ops FP:$dst, GR:$src),
   "setf.d $dst = $src;;">;
 



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


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

2005-12-21 Thread Duraid Madina


Changes in directory llvm/lib/Target/IA64:

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

this should take care of calls to varadic functions, but it doesn.,t
BUG: calling printf(string, float) will load the float into the wrong
register, completely forget about loading the string, etce


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

 IA64ISelLowering.cpp |   21 ++---
 1 files changed, 14 insertions(+), 7 deletions(-)


Index: llvm/lib/Target/IA64/IA64ISelLowering.cpp
diff -u llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.6 
llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.7
--- llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.6   Wed Dec 21 22:07:40 2005
+++ llvm/lib/Target/IA64/IA64ISelLowering.cpp   Thu Dec 22 00:39:57 2005
@@ -388,16 +388,22 @@
 InFlag = Chain.getValue(1);
 
 //FIXME: for performance, only do the following when required
-
+
 // if we have just copied an FP arg, copy its in-memory representation
 // to the appropriate integer register
-/*if(MVT::isFloatingPoint(RegValuesToPass[i].getValueType())) {
-  Chain = DAG.getTargetNode(IA64::GETFD, MVT::i64, RegValuesToPass[i], 
Chain, InFlag);
-  InFlag = Chain.getValue(0); // XXX
-  Chain = DAG.getCopyToReg(Chain, IntArgRegs[i], Chain, InFlag); // 
...thrice!
+if(MVT::isFloatingPoint(RegValuesToPass[i].getValueType())) {
+  std::vector GETFDRetTypes;
+  std::vector GETFDOperands;
+  GETFDRetTypes.push_back(MVT::i64);
+  GETFDRetTypes.push_back(MVT::Flag);
+  GETFDOperands.push_back(RegValuesToPass[i]);
+  GETFDOperands.push_back(Chain);
+  GETFDOperands.push_back(InFlag);
+  
+  Chain = DAG.getNode(IA64ISD::GETFD, GETFDRetTypes, GETFDOperands);
+  Chain = DAG.getCopyToReg(Chain, IntArgRegs[i], Chain.getValue(0), 
Chain.getValue(1)); // ...thrice!
   InFlag = Chain.getValue(1);
-} */
-
+}
   }
 
   std::vector RetVals;
@@ -452,6 +458,7 @@
   RetVal = DAG.getNode(RetTy->isSigned() ? ISD::AssertSext 
:ISD::AssertZext,
MVT::i64, RetVal, DAG.getValueType(RetTyVT));
   RetVal = DAG.getNode(ISD::TRUNCATE, RetTyVT, RetVal);
+  break;
 case MVT::i64:
   RetVal = DAG.getCopyFromReg(Chain, IA64::r8, MVT::i64, InFlag);
   Chain = RetVal.getValue(1);



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


[llvm-commits] CVS: llvm/lib/Target/IA64/IA64ISelLowering.h

2005-12-21 Thread Duraid Madina


Changes in directory llvm/lib/Target/IA64:

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

we can't all have brains now, can we



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

 IA64ISelLowering.h |4 
 1 files changed, 4 insertions(+)


Index: llvm/lib/Target/IA64/IA64ISelLowering.h
diff -u llvm/lib/Target/IA64/IA64ISelLowering.h:1.1 
llvm/lib/Target/IA64/IA64ISelLowering.h:1.2
--- llvm/lib/Target/IA64/IA64ISelLowering.h:1.1 Fri Oct 28 12:46:36 2005
+++ llvm/lib/Target/IA64/IA64ISelLowering.h Thu Dec 22 00:41:39 2005
@@ -38,6 +38,10 @@
   /// operand, producing an f64 value containing the integer representation
   /// of that FP value.
   FCTIDZ, FCTIWZ,
+  
+  /// GETFD - the getf.d instruction takes a floating point operand and
+  /// returns its 64-bit memory representation as an i64
+  GETFD
 };
   }  
   



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

2005-12-21 Thread Duraid Madina


Changes in directory llvm/include/llvm/CodeGen:

SelectionDAG.h updated: 1.80 -> 1.81
---
Log message:

i need to do this to take over the earth

when I take over the earth, sabre will be happy because i'll stop asking
him silly questions!!



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

 SelectionDAG.h |9 +
 1 files changed, 9 insertions(+)


Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.80 
llvm/include/llvm/CodeGen/SelectionDAG.h:1.81
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.80   Sun Dec 18 15:00:53 2005
+++ llvm/include/llvm/CodeGen/SelectionDAG.hThu Dec 22 01:02:51 2005
@@ -364,6 +364,15 @@
 return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops);
   }
   SDOperand getTargetNode(unsigned Opcode, MVT::ValueType VT1,
+  MVT::ValueType VT2, SDOperand Op1) {
+std::vector ResultTys;
+ResultTys.push_back(VT1);
+ResultTys.push_back(VT2);
+std::vector Ops;
+Ops.push_back(Op1);
+return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops);
+  }
+  SDOperand getTargetNode(unsigned Opcode, MVT::ValueType VT1,
   MVT::ValueType VT2, SDOperand Op1, SDOperand Op2) {
 std::vector ResultTys;
 ResultTys.push_back(VT1);



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


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

2005-12-21 Thread Duraid Madina


Changes in directory llvm/lib/Target/IA64:

IA64InstrInfo.td updated: 1.32 -> 1.33
---
Log message:

oops, back this out



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

 IA64InstrInfo.td |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)


Index: llvm/lib/Target/IA64/IA64InstrInfo.td
diff -u llvm/lib/Target/IA64/IA64InstrInfo.td:1.32 
llvm/lib/Target/IA64/IA64InstrInfo.td:1.33
--- llvm/lib/Target/IA64/IA64InstrInfo.td:1.32  Thu Dec 22 00:38:38 2005
+++ llvm/lib/Target/IA64/IA64InstrInfo.td   Thu Dec 22 01:13:51 2005
@@ -622,9 +622,8 @@
 def FNORMD : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src),
   "fnorm.d $dst = $src;;">;
 
-def GETFD : AForm_DAG<0x03, 0x0b, (ops GR:$dst, FP:$src),
-  "getf.d $dst = $src;;",
-  [(set GR:$dst, (IA64getfd FP:$src))]>;
+def GETFD : AForm<0x03, 0x0b, (ops GR:$dst, FP:$src),
+  "getf.d $dst = $src;;">;
 def SETFD : AForm<0x03, 0x0b, (ops FP:$dst, GR:$src),
   "setf.d $dst = $src;;">;
 



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


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

2005-12-21 Thread Duraid Madina


Changes in directory llvm/lib/Target/IA64:

IA64ISelDAGToDAG.cpp updated: 1.14 -> 1.15
---
Log message:

we can't do this directly in lowering, so we need this case



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

 IA64ISelDAGToDAG.cpp |8 
 1 files changed, 8 insertions(+)


Index: llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp
diff -u llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.14 
llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.15
--- llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.14  Wed Dec 21 21:58:17 2005
+++ llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp   Thu Dec 22 01:14:45 2005
@@ -343,6 +343,14 @@
 
   case ISD::Register: return Op; // XXX: this is a hack, tblgen one day?
   
+  case IA64ISD::GETFD: {
+SDOperand Input = Select(N->getOperand(0));
+SDOperand Result = CurDAG->getTargetNode(IA64::GETFD, MVT::i64, MVT::Flag, 
Input);
+CodeGenMap[Op.getValue(0)] = Result;
+CodeGenMap[Op.getValue(1)] = Result.getValue(1);
+return Result.getValue(Op.ResNo);
+  } 
+  
   case ISD::CALL:
   case ISD::TAILCALL: { {
 // FIXME: This is a workaround for a bug in tblgen.



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