[llvm-commits] [127542] add a note

2007-05-23 Thread clattner
Revision: 127542
Author:   clattner
Date: 2007-05-23 00:02:15 -0700 (Wed, 23 May 2007)

Log Message:
---
add a note

Modified Paths:
--
apple-local/branches/llvm/README.LLVM

Modified: apple-local/branches/llvm/README.LLVM
===
--- apple-local/branches/llvm/README.LLVM   2007-05-23 05:10:53 UTC (rev 
127541)
+++ apple-local/branches/llvm/README.LLVM   2007-05-23 07:02:15 UTC (rev 
127542)
@@ -45,7 +45,13 @@
 If llvm-gcc doesn't build right, try building LLVM with OPTIMIZE_OPTION=-O2.
 This may be host compiler version specific.
 
+If you get an error message building llvm-gcc like this:
+  ...gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by 
+  /usr/lib/libstdc++.so.6)
 
+you are probably hitting http://llvm.org/PR896.  Please reconfigure with the
+--disable-shared option to work around this.
+
 //===---
 X86-64/AMD-64/EM64-T for any OS other than Darwin/Mac OS X:
 


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


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

2007-05-23 Thread Evan Cheng


Changes in directory llvm/include/llvm/Target:

TargetInstrInfo.h updated: 1.123 -> 1.124
---
Log message:

Add a couple of target hooks for predication.

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

 TargetInstrInfo.h |   15 ++-
 1 files changed, 14 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/Target/TargetInstrInfo.h
diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.123 
llvm/include/llvm/Target/TargetInstrInfo.h:1.124
--- llvm/include/llvm/Target/TargetInstrInfo.h:1.123Mon May 21 20:21:58 2007
+++ llvm/include/llvm/Target/TargetInstrInfo.h  Wed May 23 02:19:12 2007
@@ -393,10 +393,23 @@
 abort();
   }
 
+  /// isPredicable - Returns true if the instruction is already predicated.
+  ///
+  virtual bool isPredicated(MachineInstr *MI) const {
+return false;
+  }
+
   /// PredicateInstruction - Convert the instruction into a predicated
   /// instruction. It returns true if the operation was successful.
   virtual bool PredicateInstruction(MachineInstr *MI,
-std::vector &Cond) const;
+std::vector &Pred) const;
+
+  /// SubsumesPredicate - Returns true if the first specified predicated
+  /// subsumes the second, e.g. GE subsumes GT.
+  virtual bool SubsumesPredicate(std::vector &Pred1,
+ std::vector &Pred2) const {
+return false;
+  }
 
   /// getPointerRegClass - Returns a TargetRegisterClass used for pointer
   /// values.



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


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

2007-05-23 Thread Evan Cheng


Changes in directory llvm/lib/Target:

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

Rename a parameter.

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

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


Index: llvm/lib/Target/TargetInstrInfo.cpp
diff -u llvm/lib/Target/TargetInstrInfo.cpp:1.30 
llvm/lib/Target/TargetInstrInfo.cpp:1.31
--- llvm/lib/Target/TargetInstrInfo.cpp:1.30Wed May 16 19:11:35 2007
+++ llvm/lib/Target/TargetInstrInfo.cpp Wed May 23 02:21:11 2007
@@ -61,7 +61,7 @@
 }
 
 bool TargetInstrInfo::PredicateInstruction(MachineInstr *MI,
-  std::vector &Cond) const 
{
+  std::vector &Pred) const 
{
   bool MadeChange = false;
   const TargetInstrDescriptor *TID = MI->getInstrDescriptor();
   if (TID->Flags & M_PREDICABLE) {
@@ -69,13 +69,13 @@
   if ((TID->OpInfo[i].Flags & M_PREDICATE_OPERAND)) {
 MachineOperand &MO = MI->getOperand(i);
 if (MO.isReg()) {
-  MO.setReg(Cond[j].getReg());
+  MO.setReg(Pred[j].getReg());
   MadeChange = true;
 } else if (MO.isImm()) {
-  MO.setImm(Cond[j].getImmedValue());
+  MO.setImm(Pred[j].getImmedValue());
   MadeChange = true;
 } else if (MO.isMBB()) {
-  MO.setMachineBasicBlock(Cond[j].getMachineBasicBlock());
+  MO.setMachineBasicBlock(Pred[j].getMachineBasicBlock());
   MadeChange = true;
 }
 ++j;



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


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

2007-05-23 Thread Evan Cheng


Changes in directory llvm/lib/Target/ARM:

ARMInstrInfo.cpp updated: 1.30 -> 1.31
ARMInstrInfo.h updated: 1.11 -> 1.12
---
Log message:

Hooks for predication support.

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

 ARMInstrInfo.cpp |   41 +
 ARMInstrInfo.h   |7 ++-
 2 files changed, 39 insertions(+), 9 deletions(-)


Index: llvm/lib/Target/ARM/ARMInstrInfo.cpp
diff -u llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.30 
llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.31
--- llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.30   Mon May 21 18:17:32 2007
+++ llvm/lib/Target/ARM/ARMInstrInfo.cppWed May 23 02:22:05 2007
@@ -298,11 +298,6 @@
   return NewMIs[0];
 }
 
-static bool isPredicated(MachineInstr *MI) {
-  MachineOperand *PMO = MI->findFirstPredOperand();
-  return PMO && PMO->getImmedValue() != ARMCC::AL;
-}
-
 // Branch analysis.
 bool ARMInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock 
*&TBB,
  MachineBasicBlock *&FBB,
@@ -436,23 +431,53 @@
   return false;
 }
 
+bool ARMInstrInfo::isPredicated(MachineInstr *MI) const {
+  MachineOperand *PMO = MI->findFirstPredOperand();
+  return PMO && PMO->getImmedValue() != ARMCC::AL;
+}
+
 bool ARMInstrInfo::PredicateInstruction(MachineInstr *MI,
-  std::vector &Cond) const 
{
+  std::vector &Pred) const 
{
   unsigned Opc = MI->getOpcode();
   if (Opc == ARM::B || Opc == ARM::tB) {
 MI->setInstrDescriptor(get(Opc == ARM::B ? ARM::Bcc : ARM::tBcc));
-MI->addImmOperand(Cond[0].getImmedValue());
+MI->addImmOperand(Pred[0].getImmedValue());
 return true;
   }
 
   MachineOperand *PMO = MI->findFirstPredOperand();
   if (PMO) {
-PMO->setImm(Cond[0].getImmedValue());
+PMO->setImm(Pred[0].getImmedValue());
 return true;
   }
   return false;
 }
 
+bool ARMInstrInfo::SubsumesPredicate(std::vector &Pred1,
+ std::vector &Pred2) const{
+  if (Pred1.size() > 1 || Pred2.size() > 1)
+return false;
+
+  ARMCC::CondCodes CC1 = (ARMCC::CondCodes)Pred1[0].getImmedValue();
+  ARMCC::CondCodes CC2 = (ARMCC::CondCodes)Pred2[0].getImmedValue();
+  if (CC1 == CC2)
+return true;
+
+  switch (CC1) {
+  default:
+return false;
+  case ARMCC::AL:
+return true;
+  case ARMCC::HS:
+return CC2 == ARMCC::HI || CC2 == ARMCC::EQ;
+  case ARMCC::LS:
+return CC2 == ARMCC::LO || CC2 == ARMCC::EQ;
+  case ARMCC::GE:
+return CC2 == ARMCC::GT || CC2 == ARMCC::EQ;
+  case ARMCC::LE:  return "le";
+return CC2 == ARMCC::LT || CC2 == ARMCC::EQ;
+  }
+}
 
 /// FIXME: Works around a gcc miscompilation with -fstrict-aliasing
 static unsigned getNumJTEntries(const std::vector &JT,


Index: llvm/lib/Target/ARM/ARMInstrInfo.h
diff -u llvm/lib/Target/ARM/ARMInstrInfo.h:1.11 
llvm/lib/Target/ARM/ARMInstrInfo.h:1.12
--- llvm/lib/Target/ARM/ARMInstrInfo.h:1.11 Thu May 17 19:18:17 2007
+++ llvm/lib/Target/ARM/ARMInstrInfo.h  Wed May 23 02:22:05 2007
@@ -104,8 +104,13 @@
   virtual bool ReverseBranchCondition(std::vector &Cond) const;
 
   // Predication support.
+  virtual bool isPredicated(MachineInstr *MI) const;
+
   virtual bool PredicateInstruction(MachineInstr *MI,
-std::vector &Cond) const;
+std::vector &Pred) const;
+
+  virtual bool SubsumesPredicate(std::vector &Pred1,
+ std::vector &Pred1) const;
 };
 
   // Utility routines



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


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

2007-05-23 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen:

IfConversion.cpp updated: 1.11 -> 1.12
---
Log message:

Preliminary iterative if-conversion support.

---
Diffs of the changes:  (+166 -96)

 IfConversion.cpp |  262 ++-
 1 files changed, 166 insertions(+), 96 deletions(-)


Index: llvm/lib/CodeGen/IfConversion.cpp
diff -u llvm/lib/CodeGen/IfConversion.cpp:1.11 
llvm/lib/CodeGen/IfConversion.cpp:1.12
--- llvm/lib/CodeGen/IfConversion.cpp:1.11  Mon May 21 17:22:58 2007
+++ llvm/lib/CodeGen/IfConversion.cpp   Wed May 23 02:23:16 2007
@@ -28,7 +28,8 @@
 namespace {
   class IfConverter : public MachineFunctionPass {
 enum BBICKind {
-  ICInvalid,   // BB data invalid.
+  ICNotAnalyzed,   // BB has not been analyzed.
+  ICReAnalyze, // BB must be re-analyzed.
   ICNotClassfied,  // BB data valid, but not classified.
   ICEarlyExit, // BB is entry of an early-exit sub-CFG.
   ICTriangle,  // BB is entry of a triangle sub-CFG.
@@ -43,19 +44,31 @@
 /// classification, and common tail block of its successors (if it's a
 /// diamond shape), its size, whether it's predicable, and whether any
 /// instruction can clobber the 'would-be' predicate.
+///
+/// Kind- Type of block. See BBICKind.
+/// NonPredSize - Number of non-predicated instructions.
+/// isPredicable- Is it predicable. (FIXME: Remove.)
+/// hasEarlyExit- Ends with a return, indirect jump or br to jumptable.
+/// ModifyPredicate - FIXME: Not used right now. True if BB would modify
+///   the predicate (e.g. has cmp, call, etc.)
+/// BB  - Corresponding MachineBasicBlock.
+/// TrueBB / FalseBB- See AnalyzeBranch().
+/// BrCond  - Conditions for end of block conditional branches.
+/// Predicate   - Predicate used in the BB.
 struct BBInfo {
   BBICKind Kind;
-  unsigned Size;
+  unsigned NonPredSize;
   bool isPredicable;
-  bool ClobbersPred;
   bool hasEarlyExit;
+  bool ModifyPredicate;
   MachineBasicBlock *BB;
   MachineBasicBlock *TrueBB;
   MachineBasicBlock *FalseBB;
   MachineBasicBlock *TailBB;
-  std::vector Cond;
-  BBInfo() : Kind(ICInvalid), Size(0), isPredicable(false),
- ClobbersPred(false), hasEarlyExit(false),
+  std::vector BrCond;
+  std::vector Predicate;
+  BBInfo() : Kind(ICNotAnalyzed), NonPredSize(0), isPredicable(false),
+ hasEarlyExit(false), ModifyPredicate(false),
  BB(0), TrueBB(0), FalseBB(0), TailBB(0) {}
 };
 
@@ -75,13 +88,15 @@
 
   private:
 void StructuralAnalysis(MachineBasicBlock *BB);
-void FeasibilityAnalysis(BBInfo &BBI);
-void InitialFunctionAnalysis(MachineFunction &MF,
- std::vector &Candidates);
+void FeasibilityAnalysis(BBInfo &BBI,
+ std::vector &Cond);
+void AnalyzeBlocks(MachineFunction &MF,
+   std::vector &Candidates);
+void InvalidatePreds(MachineBasicBlock *BB);
 bool IfConvertEarlyExit(BBInfo &BBI);
 bool IfConvertTriangle(BBInfo &BBI);
 bool IfConvertDiamond(BBInfo &BBI);
-void PredicateBlock(MachineBasicBlock *BB,
+void PredicateBlock(BBInfo &BBI,
 std::vector &Cond,
 bool IgnoreTerm = false);
 void MergeBlocks(BBInfo &TrueBBI, BBInfo &FalseBBI);
@@ -101,26 +116,34 @@
   BBAnalysis.resize(NumBBs);
 
   std::vector Candidates;
-  // Do an intial analysis for each basic block and finding all the potential
-  // candidates to perform if-convesion.
-  InitialFunctionAnalysis(MF, Candidates);
-
   MadeChange = false;
-  for (unsigned i = 0, e = Candidates.size(); i != e; ++i) {
-BBInfo &BBI = *Candidates[i];
-switch (BBI.Kind) {
-default: assert(false && "Unexpected!");
-  break;
-case ICEarlyExit:
-  MadeChange |= IfConvertEarlyExit(BBI);
-  break;
-case ICTriangle:
-  MadeChange |= IfConvertTriangle(BBI);
-  break;
-case ICDiamond:
-  MadeChange |= IfConvertDiamond(BBI);
-  break;
+  while (true) {
+bool Change = false;
+
+// Do an intial analysis for each basic block and finding all the potential
+// candidates to perform if-convesion.
+AnalyzeBlocks(MF, Candidates);
+while (!Candidates.empty()) {
+  BBInfo &BBI = *Candidates.back();
+  Candidates.pop_back();
+  switch (BBI.Kind) {
+  default: assert(false && "Unexpected!");
+break;
+  case ICEarlyExit:
+Change |= IfConvertEarlyExit(BBI);
+break;
+  case ICTriangle:
+Change |= IfConvertTriangle(BBI);
+break;
+  case ICDiamond:
+Change |= IfConvertDiamond(BBI);
+break;
+  }
 }
+
+MadeChange |= Change;
+if (!Change)
+  break;
   }
 
   BBAnalysis.clear();
@@ -145,18 +168,21 @@
 void

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

2007-05-23 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.308 -> 1.309
---
Log message:

prevent exponential recursion in isNegatibleForFree


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

 DAGCombiner.cpp |   15 +--
 1 files changed, 9 insertions(+), 6 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.308 
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.309
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.308 Fri May 18 13:41:29 2007
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp   Wed May 23 02:35:22 2007
@@ -352,7 +352,10 @@
 /// isNegatibleForFree - Return 1 if we can compute the negated form of the
 /// specified expression for the same cost as the expression itself, or 2 if we
 /// can compute the negated form more cheaply than the expression itself.
-static char isNegatibleForFree(SDOperand Op) {
+static char isNegatibleForFree(SDOperand Op, unsigned Depth = 0) {
+  // Don't recurse exponentially.
+  if (Depth > 6) return false;
+  
   // fneg is removable even if it has multiple uses.
   if (Op.getOpcode() == ISD::FNEG) return 2;
   
@@ -368,10 +371,10 @@
 if (!UnsafeFPMath) return 0;
 
 // -(A+B) -> -A - B
-if (char V = isNegatibleForFree(Op.getOperand(0)))
+if (char V = isNegatibleForFree(Op.getOperand(0), Depth+1))
   return V;
 // -(A+B) -> -B - A
-return isNegatibleForFree(Op.getOperand(1));
+return isNegatibleForFree(Op.getOperand(1), Depth+1);
   case ISD::FSUB:
 // We can't turn -(A-B) into B-A when we honor signed zeros. 
 if (!UnsafeFPMath) return 0;
@@ -384,15 +387,15 @@
 if (HonorSignDependentRoundingFPMath()) return 0;
 
 // -(X*Y) -> (-X * Y) or (X*-Y)
-if (char V = isNegatibleForFree(Op.getOperand(0)))
+if (char V = isNegatibleForFree(Op.getOperand(0), Depth+1))
   return V;
   
-return isNegatibleForFree(Op.getOperand(1));
+return isNegatibleForFree(Op.getOperand(1), Depth+1);
 
   case ISD::FP_EXTEND:
   case ISD::FP_ROUND:
   case ISD::FSIN:
-return isNegatibleForFree(Op.getOperand(0));
+return isNegatibleForFree(Op.getOperand(0), Depth+1);
   }
 }
 



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


[llvm-commits] [127543] From TOT: prevent exponential recursion in isNegatibleForFree

2007-05-23 Thread bwendlin
Revision: 127543
Author:   bwendlin
Date: 2007-05-23 01:01:23 -0700 (Wed, 23 May 2007)

Log Message:
---
>From TOT: prevent exponential recursion in isNegatibleForFree

Modified Paths:
--

apple-local/branches/llvm-leopard/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Modified: 
apple-local/branches/llvm-leopard/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===
--- 
apple-local/branches/llvm-leopard/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp 
2007-05-23 07:02:15 UTC (rev 127542)
+++ 
apple-local/branches/llvm-leopard/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp 
2007-05-23 08:01:23 UTC (rev 127543)
@@ -351,7 +351,10 @@
 /// isNegatibleForFree - Return 1 if we can compute the negated form of the
 /// specified expression for the same cost as the expression itself, or 2 if we
 /// can compute the negated form more cheaply than the expression itself.
-static char isNegatibleForFree(SDOperand Op) {
+static char isNegatibleForFree(SDOperand Op, unsigned Depth = 0) {
+  // Don't recurse exponentially.
+  if (Depth > 6) return false;
+  
   // fneg is removable even if it has multiple uses.
   if (Op.getOpcode() == ISD::FNEG) return 2;
   
@@ -367,10 +370,10 @@
 if (!UnsafeFPMath) return 0;
 
 // -(A+B) -> -A - B
-if (char V = isNegatibleForFree(Op.getOperand(0)))
+if (char V = isNegatibleForFree(Op.getOperand(0), Depth+1))
   return V;
 // -(A+B) -> -B - A
-return isNegatibleForFree(Op.getOperand(1));
+return isNegatibleForFree(Op.getOperand(1), Depth+1);
   case ISD::FSUB:
 // We can't turn -(A-B) into B-A when we honor signed zeros. 
 if (!UnsafeFPMath) return 0;
@@ -383,15 +386,15 @@
 if (HonorSignDependentRoundingFPMath()) return 0;
 
 // -(X*Y) -> (-X * Y) or (X*-Y)
-if (char V = isNegatibleForFree(Op.getOperand(0)))
+if (char V = isNegatibleForFree(Op.getOperand(0), Depth+1))
   return V;
   
-return isNegatibleForFree(Op.getOperand(1));
+return isNegatibleForFree(Op.getOperand(1), Depth+1);
 
   case ISD::FP_EXTEND:
   case ISD::FP_ROUND:
   case ISD::FSIN:
-return isNegatibleForFree(Op.getOperand(0));
+return isNegatibleForFree(Op.getOperand(0), Depth+1);
   }
 }
 


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


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

2007-05-23 Thread Anton Korobeynikov


Changes in directory llvm/lib/CodeGen:

DwarfWriter.cpp updated: 1.148 -> 1.149
MachineModuleInfo.cpp updated: 1.14 -> 1.15
---
Log message:

Mark all calls as "could throw", when exceptions are enabled. Emit necessary LP 
info too. This fixes PR1439: http://llvm.org/PR1439 


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

 DwarfWriter.cpp   |2 +-
 MachineModuleInfo.cpp |   16 
 2 files changed, 13 insertions(+), 5 deletions(-)


Index: llvm/lib/CodeGen/DwarfWriter.cpp
diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.148 
llvm/lib/CodeGen/DwarfWriter.cpp:1.149
--- llvm/lib/CodeGen/DwarfWriter.cpp:1.148  Tue May 22 13:13:40 2007
+++ llvm/lib/CodeGen/DwarfWriter.cppWed May 23 06:08:30 2007
@@ -2852,7 +2852,7 @@
   
   EmitLabel("eh_frame_begin", EHFrameInfo.Number);
 
-  EmitSectionOffset("eh_frame_begin", "section_eh_frame",
+  EmitSectionOffset("eh_frame_begin", "eh_frame_common",
 EHFrameInfo.Number, EHFrameInfo.PersonalityIndex,
 true, true);
   Asm->EOL("FDE CIE offset");


Index: llvm/lib/CodeGen/MachineModuleInfo.cpp
diff -u llvm/lib/CodeGen/MachineModuleInfo.cpp:1.14 
llvm/lib/CodeGen/MachineModuleInfo.cpp:1.15
--- llvm/lib/CodeGen/MachineModuleInfo.cpp:1.14 Sun May 13 10:42:26 2007
+++ llvm/lib/CodeGen/MachineModuleInfo.cpp  Wed May 23 06:08:31 2007
@@ -1723,7 +1723,9 @@
 LandingPadInfo &LandingPad = LandingPads[i];
 LandingPad.LandingPadLabel = MappedLabel(LandingPad.LandingPadLabel);
 
-if (!LandingPad.LandingPadLabel) {
+// Special case: we *should* emit LPs with null LP MBB. This indicates
+// "rethrow" case.
+if (!LandingPad.LandingPadLabel && LandingPad.LandingPadBlock) {
   LandingPads.erase(LandingPads.begin() + i);
   continue;
 }
@@ -1768,9 +1770,15 @@
 /// getPersonalityIndex - Return unique index for current personality
 /// function. NULL personality function should always get zero index.
 unsigned MachineModuleInfo::getPersonalityIndex() const {
-  const Function* Personality = (!LandingPads.empty() ?
- LandingPads[0].Personality : NULL);
-
+  const Function* Personality = NULL;
+  
+  // Scan landing pads. If there is at least one non-NULL personality - use it.
+  for (unsigned i = 0; i != LandingPads.size(); ++i)
+if (LandingPads[i].Personality) {
+  Personality = LandingPads[i].Personality;
+  break;
+}
+  
   for (unsigned i = 0; i < Personalities.size(); ++i) {
 if (Personalities[i] == Personality)
   return i;



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


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

2007-05-23 Thread Anton Korobeynikov


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.452 -> 1.453
---
Log message:

Mark all calls as "could throw", when exceptions are enabled. Emit necessary LP 
info too. This fixes PR1439: http://llvm.org/PR1439 


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

 SelectionDAGISel.cpp |   71 +++
 1 files changed, 38 insertions(+), 33 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.452 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.453
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.452Fri May 18 
12:52:13 2007
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Wed May 23 06:08:31 2007
@@ -529,8 +529,9 @@
   void ExportFromCurrentBlock(Value *V);
   void LowerCallTo(Instruction &I,
const Type *CalledValueTy, unsigned CallingConv,
-   bool IsTailCall, SDOperand Callee, unsigned OpIdx);
- 
+   bool IsTailCall, SDOperand Callee, unsigned OpIdx,
+   MachineBasicBlock *LandingPad = NULL);
+  
   // Terminator instructions.
   void visitRet(ReturnInst &I);
   void visitBr(BranchInst &I);
@@ -1341,31 +1342,13 @@
   if (!AsTerminator) {
 // Mark landing pad so that it doesn't get deleted in branch folding.
 LandingPad->setIsLandingPad();
-
-// Insert a label before the invoke call to mark the try range.
-// This can be used to detect deletion of the invoke via the
-// MachineModuleInfo.
-MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
-unsigned BeginLabel = MMI->NextLabelID();
-DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, getRoot(),
-DAG.getConstant(BeginLabel, MVT::i32)));
-
+
 LowerCallTo(I, I.getCalledValue()->getType(),
-   I.getCallingConv(),
-   false,
-   getValue(I.getOperand(0)),
-   3);
-
-// Insert a label before the invoke call to mark the try range.
-// This can be used to detect deletion of the invoke via the
-// MachineModuleInfo.
-unsigned EndLabel = MMI->NextLabelID();
-DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, getRoot(),
-DAG.getConstant(EndLabel, MVT::i32)));
-
-// Inform MachineModuleInfo of range.
-MMI->addInvoke(LandingPad, BeginLabel, EndLabel);
-
+I.getCallingConv(),
+false,
+getValue(I.getOperand(0)),
+3, LandingPad);
+
 // Update successor info
 CurMBB->addSuccessor(Return);
 CurMBB->addSuccessor(LandingPad);
@@ -2782,11 +2765,14 @@
const Type *CalledValueTy,
unsigned CallingConv,
bool IsTailCall,
-   SDOperand Callee, unsigned OpIdx) {
+   SDOperand Callee, unsigned OpIdx,
+   MachineBasicBlock *LandingPad) {
   const PointerType *PT = cast(CalledValueTy);
   const FunctionType *FTy = cast(PT->getElementType());
   const ParamAttrsList *Attrs = FTy->getParamAttrs();
-
+  MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
+  unsigned BeginLabel = 0, EndLabel = 0;
+
   TargetLowering::ArgListTy Args;
   TargetLowering::ArgListEntry Entry;
   Args.reserve(I.getNumOperands());
@@ -2803,6 +2789,14 @@
 Args.push_back(Entry);
   }
 
+  if (ExceptionHandling) {
+// Insert a label before the invoke call to mark the try range.  This can 
be
+// used to detect deletion of the invoke via the MachineModuleInfo.
+BeginLabel = MMI->NextLabelID();
+DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, getRoot(),
+DAG.getConstant(BeginLabel, MVT::i32)));
+  }
+  
   std::pair Result =
 TLI.LowerCallTo(getRoot(), I.getType(), 
 Attrs && Attrs->paramHasAttr(0, ParamAttr::SExt),
@@ -2811,6 +2805,17 @@
   if (I.getType() != Type::VoidTy)
 setValue(&I, Result.first);
   DAG.setRoot(Result.second);
+
+  if (ExceptionHandling) {
+// Insert a label at the end of the invoke call to mark the try range.  
This
+// can be used to detect deletion of the invoke via the MachineModuleInfo.
+EndLabel = MMI->NextLabelID();
+DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, getRoot(),
+DAG.getConstant(EndLabel, MVT::i32)));
+
+// Inform MachineModuleInfo of range.
+MMI->addInvoke(LandingPad, BeginLabel, EndLabel);
+  }
 }
 
 
@@ -2871,12 +2876,12 @@
 Callee = getValue(I.getOperand(0));
   else
 Callee = DAG.getExternalSymbol(RenameFn, TLI.getPointerTy());
-
+
   LowerCallTo(I, I.getCalledValue()->getType(),
- I.getCa

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

2007-05-23 Thread Anton Korobeynikov


Changes in directory llvm/include/llvm/CodeGen:

MachineModuleInfo.h updated: 1.14 -> 1.15
---
Log message:

Mark all calls as "could throw", when exceptions are enabled. Emit necessary LP 
info too. This fixes PR1439: http://llvm.org/PR1439 


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

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


Index: llvm/include/llvm/CodeGen/MachineModuleInfo.h
diff -u llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.14 
llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.15
--- llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.14  Sun May 13 10:42:26 2007
+++ llvm/include/llvm/CodeGen/MachineModuleInfo.h   Wed May 23 06:08:30 2007
@@ -967,6 +967,7 @@
   LandingPadInfo(MachineBasicBlock *MBB)
   : LandingPadBlock(MBB)
   , LandingPadLabel(0)
+  , Personality(NULL)  
   , TypeIds()
   , IsFilter(false)
   {}



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


[llvm-commits] Stub calls in Linux/PPC

2007-05-23 Thread Nicolas Geoffray
Here's a patch to make stubs work in linux/ppc. I'll commit it if
there's no objection.

Chris: Just a question. I noticed on cvsweb that you wrote the lines:
 MCE.emitWordBE(0x9421ffe0); // stwu r1,-32(r1)
 MCE.emitWordBE(0x7d6802a6); // mflr r11
 MCE.emitWordBE(0x91610028); // stw r11, 40(r1)

Why 32 when calling the stub?


Cheers,
Nicolas
Index: lib/Target/PowerPC/PPCJITInfo.cpp
===
RCS file: /var/cvs/llvm/llvm/lib/Target/PowerPC/PPCJITInfo.cpp,v
retrieving revision 1.37
diff -t -d -u -p -5 -r1.37 PPCJITInfo.cpp
--- lib/Target/PowerPC/PPCJITInfo.cpp	25 Feb 2007 05:04:13 -	1.37
+++ lib/Target/PowerPC/PPCJITInfo.cpp	23 May 2007 13:51:52 -
@@ -12,10 +12,11 @@
 //===--===//
 
 #define DEBUG_TYPE "jit"
 #include "PPCJITInfo.h"
 #include "PPCRelocations.h"
+#include "PPCTargetMachine.h"
 #include "llvm/CodeGen/MachineCodeEmitter.h"
 #include "llvm/Config/alloca.h"
 #include "llvm/Support/Debug.h"
 #include 
 using namespace llvm;
@@ -145,60 +146,56 @@ asm(
 asm(
 ".text\n"
 ".align 2\n"
 ".globl PPC32CompilationCallback\n"
 "PPC32CompilationCallback:\n"
-// Make space for 8 ints r[3-10] and 13 doubles f[1-13] and the 
+// Make space for 8 ints r[3-10] and 8 doubles f[1-8] and the 
 // FIXME: need to save v[0-19] for altivec?
 // FIXME: could shrink frame
 // Set up a proper stack frame
 // FIXME Layout
-//   PowerPC64 ABI linkage-  24 bytes
-// parameters -  32 bytes
-//   13 double registers  - 104 bytes
+//   8 double registers   -  64 bytes
 //   8 int registers  -  32 bytes
 "mflr 0\n"
 "stw 0,  4(1)\n"
-"stwu 1, -180(1)\n"
+"stwu 1, -104(1)\n"
 // Save all int arg registers
-"stw 10, 176(1)\n""stw 9,  172(1)\n"
-"stw 8,  168(1)\n""stw 7,  164(1)\n"
-"stw 6,  160(1)\n""stw 5,  156(1)\n"
-"stw 4,  152(1)\n""stw 3,  148(1)\n"
+"stw 10, 100(1)\n"   "stw 9,  96(1)\n"
+"stw 8,  92(1)\n""stw 7,  88(1)\n"
+"stw 6,  84(1)\n""stw 5,  80(1)\n"
+"stw 4,  76(1)\n""stw 3,  72(1)\n"
 // Save all call-clobbered FP regs.
-"stfd 10, 144(1)\n"
-"stfd 9,  136(1)\n"   "stfd 8,  128(1)\n"
-"stfd 7,  120(1)\n"   "stfd 6,  112(1)\n"
-"stfd 5,  104(1)\n"   "stfd 4,   96(1)\n"
-"stfd 3,   88(1)\n"   "stfd 2,   80(1)\n"
-"stfd 1,   72(1)\n"
+"stfd 8,  64(1)\n"
+"stfd 7,  56(1)\n"   "stfd 6,  48(1)\n"
+"stfd 5,  40(1)\n"   "stfd 4,  32(1)\n"
+"stfd 3,  24(1)\n"   "stfd 2,  16(1)\n"
+"stfd 1,  8(1)\n"
 // Arguments to Compilation Callback:
 // r3 - our lr (address of the call instruction in stub plus 4)
 // r4 - stub's lr (address of instruction that called the stub plus 4)
 // r5 - is64Bit - always 0.
 "mr   3, 0\n"
-"lwz  11, 180(1)\n" // stub's frame
-"lwz  4, 4(11)\n" // stub's lr
+"lwz  5, 104(1)\n" // stub's frame
+"lwz  4, 4(5)\n" // stub's lr
 "li   5, 0\n"   // 0 == 32 bit
 "bl PPCCompilationCallbackC\n"
 "mtctr 3\n"
 // Restore all int arg registers
-"lwz 10, 176(1)\n""lwz 9,  172(1)\n"
-"lwz 8,  168(1)\n""lwz 7,  164(1)\n"
-"lwz 6,  160(1)\n""lwz 5,  156(1)\n"
-"lwz 4,  152(1)\n""lwz 3,  148(1)\n"
+"lwz 10, 100(1)\n"   "lwz 9,  96(1)\n"
+"lwz 8,  92(1)\n""lwz 7,  88(1)\n"
+"lwz 6,  84(1)\n""lwz 5,  80(1)\n"
+"lwz 4,  76(1)\n""lwz 3,  72(1)\n"
 // Restore all FP arg registers
-"lfd 10, 144(1)\n"
-"lfd 9,  136(1)\n""lfd 8,  128(1)\n"
-"lfd 7,  120(1)\n""lfd 6,  112(1)\n"
-"lfd 5,  104(1)\n""lfd 4,   96(1)\n"
-"lfd 3,   88(1)\n""lfd 2,   80(1)\n"
-"lfd 1,   72(1)\n"
+"lfd 8,  64(1)\n"
+"lfd 7,  56(1)\n""lfd 6,  48(1)\n"
+"lfd 5,  40(1)\n""lfd 4,  32(1)\n"
+"lfd 3,  24(1)\n""lfd 2,  16(1)\n"
+"lfd 1,  8(1)\n"
 // Pop 3 frames off the stack and branch to target
-"lwz  1, 184(1)\n"
-"lwz  11, 4(1)\n"
-"mtlr 11\n"
+"lwz  1, 104(1)\n"
+"lwz  0, 4(1)\n"
+"mtlr 0\n"
 "bctr\n"
 );
 #else
 void PPC32CompilationCallback() {
   assert(0 && "This is not a power pc, you can't execute this!");
@@ -348,14 +345,18 @@ void *PPCJITInfo::emitFunctionStub(void 
   MCE.startFunctionStub(10*4);
   if (is64Bit) {
 MCE.emitWordBE(0xf821ffb1); // stdu r1,-80(r1)
 MCE.emitWordBE(0x7d6802a6); // mflr r11
 MCE.emitWordBE(0xf9610060); // std r11, 96(r1)
-  } else {
+  } else if (TM.getSubtargetImpl()->isMachoABI()){
 MCE.emitWordBE(0x9421ffe0); // stwu r1,-32(r1)
 MCE.emitWordBE(0x7d6802a6); // mflr r11
 MCE.emitWordBE(0x91610028); // stw r11, 40(r1)
+  } else {
+MCE.emitWordBE(0x9421ffe0); // stwu r1,-32(r1)
+MCE.emitWordBE(0x7d6802a6); // mflr r11
+MCE.emitWordBE(0x91610024); // 

[llvm-commits] Fwd: [127591] Fix PR1404.

2007-05-23 Thread Devang Patel


Begin forwarded message:


Date: May 23, 2007 8:31:01 AM PDT
To: [EMAIL PROTECTED]
Subject: [127591] Fix PR1404.

Revision: 127591
Author:   dpatel
Date: 2007-05-23 08:31:00 -0700 (Wed, 23 May 2007)

Log Message:
---
Fix PR1404. Patch by Duncan Sands.
Prune local values from LLVMValues vector.

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

Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp
===
--- apple-local/branches/llvm/gcc/llvm-convert.cpp	2007-05-23  
09:21:47 UTC (rev 127590)
+++ apple-local/branches/llvm/gcc/llvm-convert.cpp	2007-05-23  
15:31:00 UTC (rev 127591)

@@ -128,7 +128,8 @@
 // If there was an error, we may have disabled creating LLVM  
values.

 if (Index == 0) return 0;
   }
-  assert ((Index - 1) < LLVMValues.size() && "Invalid LLVM Value  
index");
+  assert ((Index - 1) < LLVMValues.size() && "Invalid LLVM value  
index");
+  assert (LLVMValues[Index - 1] && "Trying to use deleted LLVM  
value!");


   return LLVMValues[Index - 1];
 }
@@ -153,7 +154,8 @@

   // Insert the new value into the value map.  We know that it  
can't already

   // exist in the mapping.
-  LLVMValuesMap[New] = Idx+1;
+  if (New)
+LLVMValuesMap[New] = Idx+1;
 }

 // Read LLVM Types string table
@@ -198,7 +200,7 @@

   for (std::vector::iterator I = LLVMValues.begin(),
  E = LLVMValues.end(); I != E; ++I)  {
-if (Constant *C = dyn_cast(*I))
+if (Constant *C = dyn_cast_or_null(*I))
   ValuesForPCH.push_back(C);
 else
   // Non constant values, e.g. arguments, are not at global  
scope.

@@ -216,6 +218,36 @@
  "llvm.pch.values", TheModule);
 }

+/// eraseLocalLLVMValues - drop all non-global values from the  
LLVM values map.

+void eraseLocalLLVMValues() {
+  // Try to reduce the size of LLVMValues by removing local values  
from the end.

+  std::vector::reverse_iterator I, E;
+
+  for (I = LLVMValues.rbegin(), E = LLVMValues.rend(); I != E; ++I) {
+if (Value *V = *I) {
+  if (isa(V))
+break;
+  else
+LLVMValuesMap.erase(V);
+}
+  }
+
+  LLVMValues.erase(I.base(), LLVMValues.end()); // Drop erased values
+
+  // Iterate over LLVMValuesMap since it may be much smaller than  
LLVMValues.

+  for (LLVMValuesMapTy::iterator I = LLVMValuesMap.begin(),
+   E = LLVMValuesMap.end(); I != E; ++I) {
+assert(I->first && "Values map contains NULL!");
+if (!isa(I->first)) {
+  unsigned Index = I->second - 1;
+  assert(Index < LLVMValues.size() && LLVMValues[Index] == I- 
>first &&

+ "Inconsistent value map!");
+  LLVMValues[Index] = NULL;
+  LLVMValuesMap.erase(I);
+}
+  }
+}
+
 /// isGCC_SSA_Temporary - Return true if this is an SSA temporary  
that we can
 /// directly compile into an LLVM temporary.  This saves us from  
creating an
 /// alloca and creating loads/stores of that alloca (a compile- 
time win).  We

@@ -689,7 +721,11 @@
 if (SI->getNumSuccessors() > 1)
   SI->setSuccessor(0, SI->getSuccessor(1));
   }
-
+
+  // Remove any cached LLVM values that are local to this  
function.  Such values
+  // may be deleted when the optimizers run, so would be dangerous  
to keep.

+  eraseLocalLLVMValues();
+
   return Fn;
 }





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


Re: [llvm-commits] [LLVMdev] Simplifing the handling of pre-legalize vector nodes

2007-05-23 Thread Dan Gohman
Ok, I now have a patch that implements this. It's a work in progress, and
still rough in some areas (some details below), but it works well enough
to allow the LLVM regression tests to pass on x86. I'm posting it now so
that people can see what I'm up to.

On Wed, May 23, 2007 at 12:03:30AM -0700, Chris Lattner wrote:
> On Mon, 21 May 2007, Dan Gohman wrote:
> > It seems that a number of things would be considerably simpler if the
> > pre-legalize nodes could use the same node kinds as post-legalize; the only
> > thing preventing that is that the MVT::ValueType enum isn't able to describe
> > vector types with arbitrarily long vector lengths.
> 
> Yep, I'm sure you know this, but this is to support generic vectors.  For 
> example, if you had an input .ll that operated on 128-wide vectors, we 
> want to be able to split that up to use 4-wide vectors if your target 
> supports them.

Last time I tried this it caused an impressive amount of register pressure;
long-vector loads/stores require special ScheduleDAG dependencies, but LLVM
was forcing long-vector dependencies on all the operators so that operations
on the individual sub-vectors couldn't be scheduled around to reduce register
pressure. But that's a different topic :-).

> Going forward, we will also likely have to do something similar to this 
> for integer types, in order to handle stuff like i47 that gets legalized 
> into 2 x i32 or something.  I am not looking forward to duplicating all of 
> the arithmetic nodes for IADD variants etc (urk, imagine vectors of 
> strange-sized-integers! VIADD??)

urk indeed...

My current patch is specific to vectors, as the table elements for extended
types are std::pairs of vector lengths and element types. Perhaps the thing
to do then is to make it a table of Type*. Then it would be usable for any
machine-illegal type.

> > I'm currently considering ways to make this possible. One idea is to rename
> > the MVT::ValueType enum to something else and make MVT::ValueType a plain
> > integer type. Values beyond the range of the original enum are interpreted
> > as indices into a UniqueVector which holds pairs of vector lengths and
> > element types.
> 
> That is a very interesting idea.  It handles the generality of arbitrary 
> value types, but is nice and fast for the common code that doesn't use the 
> craziness :).  I like it!

One downside is that debuggers no longer print MVT::ValueTypes with enum
names.

> > Before I do much more experimentation with this, I wanted to run the idea by
> > the list to see what feedback it might get. Has anyone thought about doing
> > this before? Are there other approaches that might be better?
> 
> This approach sounds very sensible.  Make sure the SelectionDAG owns the 
> table though.

I wasn't sure if it should go in the SelectionDAG or the TargetLowering.
My current patch just uses a global table because it was easier and allowed
me to get to the LegalizeDAG.cpp changes. But I'll definately clean this up.

> > Another idea is to get rid of the ValueType concept altogether and just use
> > Type* for everything. I don't know how this would work with various
> > tablegen'd pieces of code though.
> 
> I'd suggest sticking with ValueTypes.  Among other things, they can be 
> indexed into arrays and Type*'s can't.  This is important for the various 
> tables in targetlowering that the legalizer consults to find out if a 
> type/operation is valid.

Ok.

Dan

-- 
Dan Gohman, Cray Inc.
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] Patch for correct landing pad code emission

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

Please find attached patch, which fixes LLVM's behaviour during code
emission in LPs.

Currently AddLandingPad() function emits llvm.eh.exception only for
TRY_EXCEPT blocks. But sometimes (see, e.g. g++.dg/eh/unexpected1.C) gcc
generates code of form:

try {
 throw();
} finally {
 
 Unwind_Resume();
}

so, the exception is rethrown upper. In order to correctly handle this
situation we should emit landing pad info for TRY_FINALLY blocks also.
Attached patch does this.

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics & Mechanics, Saint Petersburg State University.

diff -r a0a12058b290 gcc/llvm-convert.cpp
--- a/gcc/llvm-convert.cpp	Fri May 18 09:02:30 2007 +
+++ b/gcc/llvm-convert.cpp	Wed May 23 20:11:25 2007 +0400
@@ -1906,38 +1927,44 @@ void TreeToLLVM::AddLandingPad() {
   break;
 }
   }
-  
-  if (!TryCatch) return;
-  
-  // Gather the typeinfo.
-  std::vector TypeInfos;
-  tree Catches = TREE_OPERAND(TryCatch, 1);
-  GatherTypeInfo(Catches, TypeInfos);
-  
-  CreateExceptionValues();
-  
-  // Choose type of landing pad type.
-  Function *F = FuncEHSelector;
-  
-  if (TREE_CODE(Catches) == STATEMENT_LIST &&
-  !tsi_end_p(tsi_start(Catches)) &&
-  TREE_CODE(tsi_stmt(tsi_start(Catches))) == EH_FILTER_EXPR) {
-F = FuncEHFilter;
-  }
-  
-  // Fetch and store the exception.
-  Value *Ex = new CallInst(FuncEHException, "eh_ptr", CurBB);
-  new StoreInst(Ex, ExceptionValue, CurBB);
+
+  if (!TryCatch) {
+CreateExceptionValues();
+
+// Fetch and store the exception.
+Value *Ex = new CallInst(FuncEHException, "eh_ptr", CurBB);
+new StoreInst(Ex, ExceptionValue, CurBB);
+  } else {
+// Gather the typeinfo.
+std::vector TypeInfos;
+tree Catches = TREE_OPERAND(TryCatch, 1);
+GatherTypeInfo(Catches, TypeInfos);
+  
+CreateExceptionValues();
+  
+// Choose type of landing pad type.
+Function *F = FuncEHSelector;
+  
+if (TREE_CODE(Catches) == STATEMENT_LIST &&
+!tsi_end_p(tsi_start(Catches)) &&
+TREE_CODE(tsi_stmt(tsi_start(Catches))) == EH_FILTER_EXPR) {
+  F = FuncEHFilter;
+}
+  
+// Fetch and store the exception.
+Value *Ex = new CallInst(FuncEHException, "eh_ptr", CurBB);
+new StoreInst(Ex, ExceptionValue, CurBB);
 
-  // Fetch and store exception handler.
-  std::vector Args;
-  Args.push_back(new LoadInst(ExceptionValue, "eh_ptr", CurBB));
-  Args.push_back(CastToType(Instruction::BitCast, FuncCPPPersonality,
-PointerType::get(Type::Int8Ty)));
-  for (unsigned i = 0, N = TypeInfos.size(); i < N; ++i)
-Args.push_back(TypeInfos[i]);
-  Value *Select = new CallInst(F, &Args[0], Args.size(), "eh_select", CurBB);
-  new StoreInst(Select, ExceptionSelectorValue, CurBB);
+// Fetch and store exception handler.
+std::vector Args;
+Args.push_back(new LoadInst(ExceptionValue, "eh_ptr", CurBB));
+Args.push_back(CastToType(Instruction::BitCast, FuncCPPPersonality,
+  PointerType::get(Type::Int8Ty)));
+for (unsigned i = 0, N = TypeInfos.size(); i < N; ++i)
+  Args.push_back(TypeInfos[i]);
+Value *Select = new CallInst(F, &Args[0], Args.size(), "eh_select", CurBB);
+new StoreInst(Select, ExceptionSelectorValue, CurBB);
+  }
 }
 
 
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-www/releases/2.0/

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/releases/2.0:

---
Log message:

Directory /var/cvs/llvm/llvm-www/releases/2.0 added to the repository


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

 0 files changed



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


[llvm-commits] CVS: llvm-www/releases/2.0/llvm-2.0.tar.gz llvm-gcc4-2.0-ppc-darwin8.9.0.tar.gz llvm-gcc4-2.0-x86-darwin8.tar.gz llvm-gcc4-2.0-x86-linux-RHEL4.tar.gz llvm-gcc4-2.0-x86-mingw32.tar.bz2 l

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/releases/2.0:

llvm-2.0.tar.gz added (r1.1)
llvm-gcc4-2.0-ppc-darwin8.9.0.tar.gz added (r1.1)
llvm-gcc4-2.0-x86-darwin8.tar.gz added (r1.1)
llvm-gcc4-2.0-x86-linux-RHEL4.tar.gz added (r1.1)
llvm-gcc4-2.0-x86-mingw32.tar.bz2 added (r1.1)
llvm-gcc4-2.0.source.tar.gz added (r1.1)
llvm-test-2.0.tar.gz added (r1.1)
---
Log message:

2.0 Release


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

 llvm-2.0.tar.gz  |0 
 llvm-gcc4-2.0-ppc-darwin8.9.0.tar.gz |0 
 llvm-gcc4-2.0-x86-darwin8.tar.gz |0 
 llvm-gcc4-2.0-x86-linux-RHEL4.tar.gz |0 
 llvm-gcc4-2.0-x86-mingw32.tar.bz2|0 
 llvm-gcc4-2.0.source.tar.gz  |0 
 llvm-test-2.0.tar.gz |0 
 7 files changed


Index: llvm-www/releases/2.0/llvm-2.0.tar.gz


Index: llvm-www/releases/2.0/llvm-gcc4-2.0-ppc-darwin8.9.0.tar.gz


Index: llvm-www/releases/2.0/llvm-gcc4-2.0-x86-darwin8.tar.gz


Index: llvm-www/releases/2.0/llvm-gcc4-2.0-x86-linux-RHEL4.tar.gz


Index: llvm-www/releases/2.0/llvm-gcc4-2.0-x86-mingw32.tar.bz2


Index: llvm-www/releases/2.0/llvm-gcc4-2.0.source.tar.gz


Index: llvm-www/releases/2.0/llvm-test-2.0.tar.gz



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


[llvm-commits] CVS: llvm-www/releases/2.0/docs/

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/releases/2.0/docs:

---
Log message:

Directory /var/cvs/llvm/llvm-www/releases/2.0/docs added to the repository


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

 0 files changed



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


[llvm-commits] CVS: llvm-www/releases/2.0/docs/CommandGuide/

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/releases/2.0/docs/CommandGuide:

---
Log message:

Directory /var/cvs/llvm/llvm-www/releases/2.0/docs/CommandGuide added to the 
repository


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

 0 files changed



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


[llvm-commits] CVS: llvm-www/releases/2.0/docs/HistoricalNotes/

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/releases/2.0/docs/HistoricalNotes:

---
Log message:

Directory /var/cvs/llvm/llvm-www/releases/2.0/docs/HistoricalNotes added to the 
repository


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

 0 files changed



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


[llvm-commits] CVS: llvm-www/releases/2.0/docs/img/

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/releases/2.0/docs/img:

---
Log message:

Directory /var/cvs/llvm/llvm-www/releases/2.0/docs/img added to the repository


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

 0 files changed



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


[llvm-commits] CVS: llvm-www/releases/2.0/docs/CommandGuide/html/

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/releases/2.0/docs/CommandGuide/html:

---
Log message:

Directory /var/cvs/llvm/llvm-www/releases/2.0/docs/CommandGuide/html added to 
the repository


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

 0 files changed



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


[llvm-commits] CVS: llvm-www/releases/2.0/docs/CommandGuide/ps/

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/releases/2.0/docs/CommandGuide/ps:

---
Log message:

Directory /var/cvs/llvm/llvm-www/releases/2.0/docs/CommandGuide/ps added to the 
repository


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

 0 files changed



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


[llvm-commits] CVS: llvm-www/releases/2.0/docs/CommandGuide/man/

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/releases/2.0/docs/CommandGuide/man:

---
Log message:

Directory /var/cvs/llvm/llvm-www/releases/2.0/docs/CommandGuide/man added to 
the repository


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

 0 files changed



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


[llvm-commits] CVS: llvm-www/releases/2.0/docs/img/Debugging.gif libdeps.gif lines.gif objdeps.gif venusflytrap.jpg

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/releases/2.0/docs/img:

Debugging.gif added (r1.1)
libdeps.gif added (r1.1)
lines.gif added (r1.1)
objdeps.gif added (r1.1)
venusflytrap.jpg added (r1.1)
---
Log message:

2.0 Release docs






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

 Debugging.gif|0 
 libdeps.gif  |0 
 lines.gif|0 
 objdeps.gif  |0 
 venusflytrap.jpg |0 
 5 files changed


Index: llvm-www/releases/2.0/docs/img/Debugging.gif


Index: llvm-www/releases/2.0/docs/img/libdeps.gif


Index: llvm-www/releases/2.0/docs/img/lines.gif


Index: llvm-www/releases/2.0/docs/img/objdeps.gif


Index: llvm-www/releases/2.0/docs/img/venusflytrap.jpg



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


[llvm-commits] CVS: llvm-www/releases/download.html

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/releases:

download.html updated: 1.40 -> 1.41
---
Log message:

2.0 Release


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

 download.html |   20 
 1 files changed, 20 insertions(+)


Index: llvm-www/releases/download.html
diff -u llvm-www/releases/download.html:1.40 
llvm-www/releases/download.html:1.41
--- llvm-www/releases/download.html:1.40Sat Nov 25 14:21:27 2006
+++ llvm-www/releases/download.html Wed May 23 13:29:22 2007
@@ -30,6 +30,26 @@
 
 
 
+Download LLVM 2.0
+
+
+
+
+Please read the Release Notes 
before
+downloading:
+
+
+  LLVM source code (4.5M)
+  LLVM Test Suite (54M)
+  LLVM-GCC 4 Front End 
Binaries for MacOS X/x86 (38M)
+  LLVM-GCC 4 Front End 
Binaries for MacOS X/PowerPC (36M)
+  LLVM-GCC 4 Front End 
Binaries for Red Hat Enterprise Linux4/x86 (29M)
+  LLVM-GCC 4 Front End 
Binaries for Mingw32/x86 (15M)
+  LLVM-GCC 4 Front End Source 
Code (35M)
+
+
+
+
 Download LLVM 1.9
 
 



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


[llvm-commits] CVS: llvm-www/releases/index.html

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/releases:

index.html updated: 1.34 -> 1.35
---
Log message:

2.0 release


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

 index.html |4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


Index: llvm-www/releases/index.html
diff -u llvm-www/releases/index.html:1.34 llvm-www/releases/index.html:1.35
--- llvm-www/releases/index.html:1.34   Mon Nov 27 10:07:38 2006
+++ llvm-www/releases/index.htmlWed May 23 13:31:24 2007
@@ -15,7 +15,7 @@
 
 
 
-LLVM is distributed under the University of
+LLVM is distributed under the University of
 Illinois Open Source License, an http://www.opensource.org/licenses/UoI-NCSA.php";>OSI-approved
 license.
@@ -39,6 +39,8 @@
 
 Always - Anonymous CVS access; release notes.
+23 May 2007 - 2.0 release download; release notes.
 19 Nov 2006 - 1.9 release download; release notes.
 9 Aug 2006 - 1.8 release download; http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-www/releases/index.html

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/releases:

index.html updated: 1.35 -> 1.36
---
Log message:

Fix 2.0 link


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

 index.html |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm-www/releases/index.html
diff -u llvm-www/releases/index.html:1.35 llvm-www/releases/index.html:1.36
--- llvm-www/releases/index.html:1.35   Wed May 23 13:31:24 2007
+++ llvm-www/releases/index.htmlWed May 23 13:37:34 2007
@@ -40,7 +40,7 @@
 Always - Anonymous CVS access; release notes.
 23 May 2007 - 2.0 release download; release notes.
+href="2.0/docs/ReleaseNotes.html">release notes.
 19 Nov 2006 - 1.9 release download; release notes.
 9 Aug 2006 - 1.8 release download; http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-www/header.incl www-index.html

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www:

header.incl updated: 1.56 -> 1.57
www-index.html updated: 1.141 -> 1.142
---
Log message:

2.0 Release


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

 header.incl|1 +
 www-index.html |4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)


Index: llvm-www/header.incl
diff -u llvm-www/header.incl:1.56 llvm-www/header.incl:1.57
--- llvm-www/header.incl:1.56   Wed Apr  4 09:14:21 2007
+++ llvm-www/header.inclWed May 23 13:42:43 2007
@@ -69,6 +69,7 @@
 Status Updates
 
   
+  http://lists.cs.uiuc.edu/pipermail/llvm-announce/2007-May/23.html";>May
 23, 2007
   http://lists.cs.uiuc.edu/pipermail/llvm-announce/2007-February/21.html";>Feb
 21, 2007
   http://lists.cs.uiuc.edu/pipermail/llvm-announce/2006-November/20.html";>Nov
 19, 2006
   http://lists.cs.uiuc.edu/pipermail/llvm-announce/2006-August/19.html";>Aug
 9, 2006   


Index: llvm-www/www-index.html
diff -u llvm-www/www-index.html:1.141 llvm-www/www-index.html:1.142
--- llvm-www/www-index.html:1.141   Sat Mar 31 20:28:38 2007
+++ llvm-www/www-index.html Wed May 23 13:42:43 2007
@@ -102,9 +102,9 @@
 Latest LLVM Release!
 
 
-  November 19, 2006: LLVM 1.9 is now available
+  May 23, 2007: LLVM 2.0 is now available
   for download!  LLVM is publicly available under an open source License.  Also, you might want to
+  href="releases/2.0/LICENSE.TXT">License.  Also, you might want to
   check out the new 
   features in CVS that will appear in the next LLVM release.  If
   you want them early, download LLVM through 



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


[llvm-commits] CVS: llvm-www/header.incl

2007-05-23 Thread Chris Lattner


Changes in directory llvm-www:

header.incl updated: 1.57 -> 1.58
---
Log message:

1.9 -> 2.0


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

 header.incl |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm-www/header.incl
diff -u llvm-www/header.incl:1.57 llvm-www/header.incl:1.58
--- llvm-www/header.incl:1.57   Wed May 23 13:42:43 2007
+++ llvm-www/header.inclWed May 23 13:44:37 2007
@@ -39,7 +39,7 @@
 Download!
 
 Download now:
-LLVM 1.9
+LLVM 2.0
 
 
 Try the
@@ -47,7 +47,7 @@
 
 
 View the open-source
-license
+license
 
 
 



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


[llvm-commits] CVS: llvm-www/demo/index.cgi

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/demo:

index.cgi updated: 1.68 -> 1.69
---
Log message:

Remove stacker for now.


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

 index.cgi |7 ++-
 1 files changed, 2 insertions(+), 5 deletions(-)


Index: llvm-www/demo/index.cgi
diff -u llvm-www/demo/index.cgi:1.68 llvm-www/demo/index.cgi:1.69
--- llvm-www/demo/index.cgi:1.68Tue Jan  9 12:19:56 2007
+++ llvm-www/demo/index.cgi Wed May 23 13:52:16 2007
@@ -5,7 +5,7 @@
 # doing remote web JO99C compilations.  (It could still be used for that
 # purpose, though the two scripts have diverged somewhat.)
 #
-# Last modified $Date: 2007/01/09 18:19:56 $
+# Last modified $Date: 2007/05/23 18:52:16 $
 #
 
 use strict;
@@ -183,12 +183,9 @@
 print "By the way, what language is this code in?: ",
   $c->radio_group(
 -name=> 'language',
--values  => [ 'C', 'C++', 'Stacker' ],
+-values  => [ 'C', 'C++' ],
 -default => 'C'
   );
-print "Look here for 
-information about Stacker and examples.\n";
 
 print '';
 



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


Re: [llvm-commits] Regalloc Refactoring

2007-05-23 Thread David Greene
Chris Lattner wrote:

> What did Evan ask for?  Are you referring to the addrequired bit?

Not sure what you mean by "addrequired bit."

If I understand correctly, Evan wants me to create an infrastructure
to allow pluggable coalescers.

I'd rather not do that right now as I've got a ton of other things
on my plate.  It turns out that I'll be writing another colaescer
sometime in the future so this functionality will be needed but
I'd rather keep this particular patch as small as possible (it's
already big) and do the pluggable coalescer infrastructure separately.

If I've got to write this other infrastructure now, it'll probably be
a few weeks at least before I'd have anything, and possibly longer.
I think it's best to get coalescing separated from liveness analysis
ASAP so Evan and others can make tweaks to both without disrupting
future patches.

Ok?

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


[llvm-commits] CVS: llvm-www/demo/index.cgi

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/demo:

index.cgi updated: 1.69 -> 1.70
---
Log message:

Add some spacing


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

 index.cgi |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm-www/demo/index.cgi
diff -u llvm-www/demo/index.cgi:1.69 llvm-www/demo/index.cgi:1.70
--- llvm-www/demo/index.cgi:1.69Wed May 23 13:52:16 2007
+++ llvm-www/demo/index.cgi Wed May 23 13:53:13 2007
@@ -5,7 +5,7 @@
 # doing remote web JO99C compilations.  (It could still be used for that
 # purpose, though the two scripts have diverged somewhat.)
 #
-# Last modified $Date: 2007/05/23 18:52:16 $
+# Last modified $Date: 2007/05/23 18:53:13 $
 #
 
 use strict;
@@ -187,6 +187,7 @@
 -default => 'C'
   );
 
+print '';
 print '';
 
 print $c->checkbox(



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


[llvm-commits] CVS: llvm-www/demo/index.cgi

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/demo:

index.cgi updated: 1.70 -> 1.71
---
Log message:

Demo uses 2.0 now.


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

 index.cgi |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)


Index: llvm-www/demo/index.cgi
diff -u llvm-www/demo/index.cgi:1.70 llvm-www/demo/index.cgi:1.71
--- llvm-www/demo/index.cgi:1.70Wed May 23 13:53:13 2007
+++ llvm-www/demo/index.cgi Wed May 23 14:07:31 2007
@@ -5,7 +5,7 @@
 # doing remote web JO99C compilations.  (It could still be used for that
 # purpose, though the two scripts have diverged somewhat.)
 #
-# Last modified $Date: 2007/05/23 18:53:13 $
+# Last modified $Date: 2007/05/23 19:07:31 $
 #
 
 use strict;
@@ -30,8 +30,7 @@
 my @PREPENDPATHDIRS =
   (  
 '/home/vadve/shared/llvm-gcc4/bin/',
-'/home/vadve/shared/llvm19/Debug/bin',
-'/home/vadve/shared/llvm19/projects/Stacker/Debug/bin');
+'/home/vadve/shared/llvm-2.0/Debug/bin');
 
 sub getname {
 my ($extension) = @_;



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


[llvm-commits] CVS: llvm-www/demo/index.cgi

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/demo:

index.cgi updated: 1.71 -> 1.72
---
Log message:

Switch to llvm-ld


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

 index.cgi |   13 +
 1 files changed, 5 insertions(+), 8 deletions(-)


Index: llvm-www/demo/index.cgi
diff -u llvm-www/demo/index.cgi:1.71 llvm-www/demo/index.cgi:1.72
--- llvm-www/demo/index.cgi:1.71Wed May 23 14:07:31 2007
+++ llvm-www/demo/index.cgi Wed May 23 14:13:12 2007
@@ -5,7 +5,7 @@
 # doing remote web JO99C compilations.  (It could still be used for that
 # purpose, though the two scripts have diverged somewhat.)
 #
-# Last modified $Date: 2007/05/23 19:07:31 $
+# Last modified $Date: 2007/05/23 19:13:12 $
 #
 
 use strict;
@@ -249,17 +249,14 @@
 my $sanitycheckfail = '';
 
 # insert tool-specific sanity checks here
-$sanitycheckfail .= ' gccas' 
-  if `gccas --help 2>&1` !~ /assembler for GCC/;
-
 $sanitycheckfail .= ' llvm-dis'
   if `llvm-dis --help 2>&1` !~ /ll disassembler/;
 
 $sanitycheckfail .= ' llvm-gcc'
   if ( `llvm-gcc --version 2>&1` !~ /Free Software Foundation/ );
 
-$sanitycheckfail .= ' gccld'
-  if `gccld --help 2>&1` !~ /llvm linker for GCC/;
+$sanitycheckfail .= ' llvm-ld'
+  if `llvm-ld --help 2>&1` !~ /llvm linker for GCC/;
 
 $sanitycheckfail .= ' llvm-bcanalyzer'
   if `llvm-bcanalyzer --help 2>&1` !~ /bcanalyzer/;
@@ -392,8 +389,8 @@
   if ( $c->param('showstats') );
 my $tmpFile = getname(".bc");
 try_run(
-"optimizing linker (gccld)",
-"gccld $stats -o=$tmpFile $bytecodeFile > $outputFile 2>&1",
+"optimizing linker (llvm-ld)",
+"llvm-ld $stats -o=$tmpFile $bytecodeFile > $outputFile 2>&1",
 $outputFile
 );
 system("mv $tmpFile.bc $bytecodeFile");



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


[llvm-commits] CVS: llvm-www/demo/index.cgi

2007-05-23 Thread Tanya Lattner


Changes in directory llvm-www/demo:

index.cgi updated: 1.72 -> 1.73
---
Log message:

Modify llvm-ld check


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

 index.cgi |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm-www/demo/index.cgi
diff -u llvm-www/demo/index.cgi:1.72 llvm-www/demo/index.cgi:1.73
--- llvm-www/demo/index.cgi:1.72Wed May 23 14:13:12 2007
+++ llvm-www/demo/index.cgi Wed May 23 14:14:41 2007
@@ -5,7 +5,7 @@
 # doing remote web JO99C compilations.  (It could still be used for that
 # purpose, though the two scripts have diverged somewhat.)
 #
-# Last modified $Date: 2007/05/23 19:13:12 $
+# Last modified $Date: 2007/05/23 19:14:41 $
 #
 
 use strict;
@@ -256,7 +256,7 @@
   if ( `llvm-gcc --version 2>&1` !~ /Free Software Foundation/ );
 
 $sanitycheckfail .= ' llvm-ld'
-  if `llvm-ld --help 2>&1` !~ /llvm linker for GCC/;
+  if `llvm-ld --help 2>&1` !~ /llvm linker/;
 
 $sanitycheckfail .= ' llvm-bcanalyzer'
   if `llvm-bcanalyzer --help 2>&1` !~ /bcanalyzer/;



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


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

2007-05-23 Thread Devang Patel


Changes in directory llvm/lib/VMCore:

Dominators.cpp updated: 1.101 -> 1.102
---
Log message:

Add dump() routines for debugging assistance.


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

 Dominators.cpp |   14 ++
 1 files changed, 14 insertions(+)


Index: llvm/lib/VMCore/Dominators.cpp
diff -u llvm/lib/VMCore/Dominators.cpp:1.101 
llvm/lib/VMCore/Dominators.cpp:1.102
--- llvm/lib/VMCore/Dominators.cpp:1.101Thu May  3 15:55:18 2007
+++ llvm/lib/VMCore/Dominators.cpp  Wed May 23 14:55:36 2007
@@ -21,6 +21,7 @@
 #include "llvm/ADT/SetOperations.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/Instructions.h"
+#include "llvm/Support/Streams.h"
 #include 
 using namespace llvm;
 
@@ -363,6 +364,10 @@
   PrintDomTree(getRootNode(), o, 1);
 }
 
+void DominatorTreeBase::dump() {
+  print (llvm::cerr);
+}
+
 bool DominatorTree::runOnFunction(Function &F) {
   reset(); // Reset from the last time we were run...
   Roots.push_back(&F.getEntryBlock());
@@ -476,6 +481,11 @@
   }
 }
 
+void DominanceFrontierBase::dump() {
+  print (llvm::cerr);
+}
+
+
 
//===--===//
 // ETOccurrence Implementation
 
//===--===//
@@ -1019,3 +1029,7 @@
   }
   o << "\n";
 }
+
+void ETForestBase::dump() {
+  print (llvm::cerr);
+}



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

2007-05-23 Thread Devang Patel


Changes in directory llvm/include/llvm/Analysis:

Dominators.h updated: 1.82 -> 1.83
---
Log message:

Add dump() routines for debugging assistance.


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

 Dominators.h |3 +++
 1 files changed, 3 insertions(+)


Index: llvm/include/llvm/Analysis/Dominators.h
diff -u llvm/include/llvm/Analysis/Dominators.h:1.82 
llvm/include/llvm/Analysis/Dominators.h:1.83
--- llvm/include/llvm/Analysis/Dominators.h:1.82Sun May 13 20:54:16 2007
+++ llvm/include/llvm/Analysis/Dominators.h Wed May 23 14:55:36 2007
@@ -199,6 +199,7 @@
   void print(std::ostream *OS, const Module* M = 0) const {
 if (OS) print(*OS, M);
   }
+  virtual void dump();
 };
 
 //===-
@@ -372,6 +373,7 @@
   void print(std::ostream *OS, const Module* M = 0) const {
 if (OS) print(*OS, M);
   }
+  virtual void dump();
 protected:
   /// getNode - return the (Post)DominatorTree node for the specified basic
   /// block.  This is the same as using operator[] on this class.
@@ -467,6 +469,7 @@
   void print(std::ostream *OS, const Module* M = 0) const {
 if (OS) print(*OS, M);
   }
+  virtual void dump();
 };
 
 



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


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

2007-05-23 Thread Dale Johannesen


Changes in directory llvm/lib/CodeGen:

BranchFolding.cpp updated: 1.55 -> 1.56
---
Log message:

Two tail merging improvements:
When considering blocks with more than 2 predecessors, merge the block with 
the largest number of matching insns, rather than the first block found.
Considering that 1 matching insn is enough to show a win for candidates that
already end with a branch.


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

 BranchFolding.cpp |   86 --
 1 files changed, 45 insertions(+), 41 deletions(-)


Index: llvm/lib/CodeGen/BranchFolding.cpp
diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.55 
llvm/lib/CodeGen/BranchFolding.cpp:1.56
--- llvm/lib/CodeGen/BranchFolding.cpp:1.55 Tue May 22 12:14:46 2007
+++ llvm/lib/CodeGen/BranchFolding.cpp  Wed May 23 16:07:20 2007
@@ -234,10 +234,15 @@
   return Hash;
 }
 
-/// HashEndOfMBB - Hash the last two instructions in the MBB.  We hash two
-/// instructions, because cross-jumping only saves code when at least two
-/// instructions are removed (since a branch must be inserted).
-static unsigned HashEndOfMBB(const MachineBasicBlock *MBB) {
+/// HashEndOfMBB - Hash the last few instructions in the MBB.  For blocks
+/// with no successors, we hash two instructions, because cross-jumping 
+/// only saves code when at least two instructions are removed (since a 
+/// branch must be inserted).  For blocks with a successor, one of the
+/// two blocks to be tail-merged will end with a branch already, so
+/// it gains to cross-jump even for one instruction.
+
+static unsigned HashEndOfMBB(const MachineBasicBlock *MBB,
+ unsigned minCommonTailLength) {
   MachineBasicBlock::const_iterator I = MBB->end();
   if (I == MBB->begin())
 return 0;   // Empty MBB.
@@ -245,7 +250,7 @@
   --I;
   unsigned Hash = HashMachineInstr(I);
 
-  if (I == MBB->begin())
+  if (I == MBB->begin() || minCommonTailLength == 1)
 return Hash;   // Single instr MBB.
   
   --I;
@@ -425,6 +430,7 @@
 
 bool BranchFolder::TryMergeBlocks(MachineBasicBlock *SuccBB,
   MachineBasicBlock* PredBB) {
+  unsigned minCommonTailLength = (SuccBB ? 1 : 2);
   MadeChange = false;
   
   // Sort by hash value so that blocks with identical end sequences sort
@@ -446,44 +452,42 @@
   continue;
 }
 
-// Determine the actual length of the shared tail between these two basic
-// blocks.  Because the hash can have collisions, it's possible that this 
is
-// less than 2.
-MachineBasicBlock::iterator BBI1, BBI2;
-unsigned CommonTailLen = 
-  ComputeCommonTailLength(CurMBB, (MergePotentials.end()-2)->second, 
-  BBI1, BBI2);
-
-// If the tails don't have at least two instructions in common, see if 
there
-// is anything else in the equivalence class that does match.
+// Look through all the blocks that have the same hash as this one, and
+// find the one that has the largest number of instructions in common.  
 // Since instructions may get combined later (e.g. single stores into
 // store multiple) this measure is not particularly accurate.
-if (CommonTailLen < 2) {
-  unsigned FoundMatch = ~0U;
-  for (int i = MergePotentials.size()-2;
-   i != -1 && MergePotentials[i].first == CurHash; --i) {
-CommonTailLen = ComputeCommonTailLength(CurMBB, 
-MergePotentials[i].second,
-BBI1, BBI2);
-if (CommonTailLen >= 2) {
-  FoundMatch = i;
-  break;
-}
-  }
-  
-  // If we didn't find anything that has at least two instructions matching
-  // this one, bail out.
-  if (FoundMatch == ~0U) {
-// Put the unconditional branch back, if we need one.
-if (SuccBB && CurMBB != PredBB)
-  FixTail(CurMBB, SuccBB, TII);
-MergePotentials.pop_back();
-continue;
-  }
+MachineBasicBlock::iterator BBI1, BBI2;
+
+unsigned FoundMatch = ~0U;
+unsigned maxCommonTailLength = 0U;
+for (int i = MergePotentials.size()-2;
+ i != -1 && MergePotentials[i].first == CurHash; --i) {
+  MachineBasicBlock::iterator TrialBBI1, TrialBBI2;
+  unsigned CommonTailLen = ComputeCommonTailLength(CurMBB, 
+  MergePotentials[i].second,
+  TrialBBI1, TrialBBI2);
+  if (CommonTailLen >= minCommonTailLength &&
+  CommonTailLen >= maxCommonTailLength) {
+FoundMatch = i;
+maxCommonTailLength = CommonTailLen;
+BBI1 = TrialBBI1;
+BBI2 = TrialBBI2;
+  }
+}  
+
+// If we didn't find anything that has at least minCommonTailLength 
+// instructions matching this one, bail out.
+if (FoundMatch == ~0U) {
+  // Put the unconditional branch back, if we need one.
+  i

[llvm-commits] CVS: llvm/test/CodeGen/X86/test-pic-jtbl.ll

2007-05-23 Thread Dale Johannesen


Changes in directory llvm/test/CodeGen/X86:

test-pic-jtbl.ll updated: 1.3 -> 1.4
---
Log message:

tail merging shrinks this code a bit.  Could do more in future.


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

 test-pic-jtbl.ll |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


Index: llvm/test/CodeGen/X86/test-pic-jtbl.ll
diff -u llvm/test/CodeGen/X86/test-pic-jtbl.ll:1.3 
llvm/test/CodeGen/X86/test-pic-jtbl.ll:1.4
--- llvm/test/CodeGen/X86/test-pic-jtbl.ll:1.3  Mon Apr 16 12:36:07 2007
+++ llvm/test/CodeGen/X86/test-pic-jtbl.ll  Wed May 23 16:09:26 2007
@@ -2,9 +2,10 @@
 ; RUN:   -o %t -f
 ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
 ; RUN: grep piclabel %t | wc -l | grep 3 
-; RUN: grep PLT %t | wc -l | grep 13 
+; RUN: grep PLT %t | wc -l | grep 11 
 ; RUN: grep GOTOFF %t | wc -l | grep 1 
-; RUN: grep JTI %t | wc -l | grep 15
+; RUN: grep JTI %t | wc -l | grep 13
+; Improved tail merging could reduce the number of PLT's and JTI's further.
 
 define void @bar(i32 %n.u) {
 entry:



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


Re: [llvm-commits] Patch for correct landing pad code emission

2007-05-23 Thread Duncan Sands
Hi Anton,

> Please find attached patch, which fixes LLVM's behaviour during code
> emission in LPs.
> 
> Currently AddLandingPad() function emits llvm.eh.exception only for
> TRY_EXCEPT blocks. But sometimes (see, e.g. g++.dg/eh/unexpected1.C) gcc
> generates code of form:
> 
> try {
>  throw();
> } finally {
>  
>  Unwind_Resume();
> }
> 
> so, the exception is rethrown upper. In order to correctly handle this
> situation we should emit landing pad info for TRY_FINALLY blocks also.
> Attached patch does this.

while this patch works, I think it is suboptimal in some cases.
I am still investigating how to avoid this suboptimality.  I suggest
this patch be put on hold for a day or two until I have finished.

Ciao,

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


Re: [llvm-commits] Patch for correct landing pad code emission

2007-05-23 Thread Anton Korobeynikov
Hello, Duncan.

> while this patch works, I think it is suboptimal in some cases.
Well, I agree. We need such bookkeeping only if we already caught an
exception and want to rethrow it. Dunno, whether optimiser will kill
such "suboptimality".

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics & Mechanics, Saint Petersburg State University.


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


Re: [llvm-commits] Patch for correct landing pad code emission

2007-05-23 Thread Duncan Sands
Hi Anton,

> while this patch works, I think it is suboptimal in some cases.
> I am still investigating how to avoid this suboptimality.  I suggest
> this patch be put on hold for a day or two until I have finished.

I don't think it can be improved at this point.  However the patch
could be a bit neater (see attachment).

Ciao,

Duncan.
Index: gcc.llvm.master/gcc/llvm-convert.cpp
===
--- gcc.llvm.master.orig/gcc/llvm-convert.cpp	2007-05-23 19:20:09.0 +0200
+++ gcc.llvm.master/gcc/llvm-convert.cpp	2007-05-23 19:32:52.0 +0200
@@ -1945,7 +1945,13 @@
   break;
 }
   }
-  
+
+  CreateExceptionValues();
+
+  // Fetch and store the exception.
+  Value *Ex = new CallInst(FuncEHException, "eh_ptr", CurBB);
+  new StoreInst(Ex, ExceptionValue, CurBB);
+
   if (!TryCatch) return;
   
   // Gather the typeinfo.
@@ -1953,8 +1959,6 @@
   tree Catches = TREE_OPERAND(TryCatch, 1);
   GatherTypeInfo(Catches, TypeInfos);
   
-  CreateExceptionValues();
-  
   // Choose type of landing pad type.
   Function *F = FuncEHSelector;
   
@@ -1964,10 +1968,6 @@
 F = FuncEHFilter;
   }
   
-  // Fetch and store the exception.
-  Value *Ex = new CallInst(FuncEHException, "eh_ptr", CurBB);
-  new StoreInst(Ex, ExceptionValue, CurBB);
-
   // Fetch and store exception handler.
   std::vector Args;
   Args.push_back(new LoadInst(ExceptionValue, "eh_ptr", CurBB));
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] Patch for correct landing pad code emission

2007-05-23 Thread Anton Korobeynikov
Hello,

> > while this patch works, I think it is suboptimal in some cases.
> > I am still investigating how to avoid this suboptimality.  I suggest
> > this patch be put on hold for a day or two until I have finished.
> 
> I don't think it can be improved at this point.  However the patch
> could be a bit neater (see attachment).
Yes. This looks much better :) Patch can be improved after PR1443 will
be fixed.

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics & Mechanics, Saint Petersburg State University.


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


[llvm-commits] CVS: llvm/test/CodeGen/ARM/2007-05-23-BadPreIndexedStore.ll

2007-05-23 Thread Evan Cheng


Changes in directory llvm/test/CodeGen/ARM:

2007-05-23-BadPreIndexedStore.ll added (r1.1)
---
Log message:

Add a new test case.

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

 2007-05-23-BadPreIndexedStore.ll |   34 ++
 1 files changed, 34 insertions(+)


Index: llvm/test/CodeGen/ARM/2007-05-23-BadPreIndexedStore.ll
diff -c /dev/null llvm/test/CodeGen/ARM/2007-05-23-BadPreIndexedStore.ll:1.1
*** /dev/null   Wed May 23 21:31:25 2007
--- llvm/test/CodeGen/ARM/2007-05-23-BadPreIndexedStore.ll  Wed May 23 
21:31:15 2007
***
*** 0 
--- 1,34 
+ ; RUN: llvm-as < %s | llc -march=arm | not grep {str.*\\!}
+ 
+   %struct.shape_edge_t = type { %struct.shape_edge_t*, 
%struct.shape_edge_t*, i32, i32, i32, i32 }
+   %struct.shape_path_t = type { %struct.shape_edge_t*, 
%struct.shape_edge_t*, i32, i32, i32, i32, i32, i32 }
+   %struct.shape_pool_t = type { i8* (%struct.shape_pool_t*, i8*, i32)*, 
i8* (%struct.shape_pool_t*, i32)*, void (%struct.shape_pool_t*, i8*)* }
+ 
+ define %struct.shape_path_t* @shape_path_alloc(%struct.shape_pool_t* %pool, 
i32* %shape) {
+ entry:
+   br i1 false, label %cond_false, label %bb45
+ 
+ bb45: ; preds = %entry
+   ret %struct.shape_path_t* null
+ 
+ cond_false:   ; preds = %entry
+   br i1 false, label %bb140, label %bb174
+ 
+ bb140:; preds = %bb140, %cond_false
+   %indvar = phi i32 [ 0, %cond_false ], [ %indvar.next, %bb140 ]  
;  [#uses=2]
+   %edge.230.0.rec = shl i32 %indvar, 1;  [#uses=3]
+   %edge.230.0 = getelementptr %struct.shape_edge_t* null, i32 
%edge.230.0.rec ; <%struct.shape_edge_t*> [#uses=1]
+   %edge.230.0.sum6970 = or i32 %edge.230.0.rec, 1 ;  
[#uses=2]
+   %tmp154 = getelementptr %struct.shape_edge_t* null, i32 
%edge.230.0.sum6970 ; <%struct.shape_edge_t*> [#uses=1]
+   %tmp11.i5 = getelementptr %struct.shape_edge_t* null, i32 
%edge.230.0.sum6970, i32 0; <%struct.shape_edge_t**> [#uses=1]
+   store %struct.shape_edge_t* %edge.230.0, %struct.shape_edge_t** 
%tmp11.i5
+   store %struct.shape_edge_t* %tmp154, %struct.shape_edge_t** null
+   %tmp16254.0.rec = add i32 %edge.230.0.rec, 2;  
[#uses=1]
+   %xp.350.sum = add i32 0, %tmp16254.0.rec;  
[#uses=1]
+   %tmp168 = icmp slt i32 %xp.350.sum, 0   ;  [#uses=1]
+   %indvar.next = add i32 %indvar, 1   ;  [#uses=1]
+   br i1 %tmp168, label %bb140, label %bb174
+ 
+ bb174:; preds = %bb140, %cond_false
+   ret %struct.shape_path_t* null
+ }



___
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

2007-05-23 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.309 -> 1.310
---
Log message:

Fix a typo that caused combiner to create mal-formed pre-indexed store where 
value store is the same as the base pointer.

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

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


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.309 
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.310
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.309 Wed May 23 02:35:22 2007
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp   Wed May 23 21:35:39 2007
@@ -3267,12 +3267,12 @@
 return false;
   
   // Try turning it into a pre-indexed load / store except when:
-  // 1) The base is a frame index.
-  // 2) If N is a store and the ptr is either the same as or is a
+  // 1) The new base ptr is a frame index.
+  // 2) If N is a store and the new base ptr is either the same as or is a
   //predecessor of the value being stored.
-  // 3) Another use of base ptr is a predecessor of N. If ptr is folded
+  // 3) Another use of old base ptr is a predecessor of N. If ptr is folded
   //that would create a cycle.
-  // 4) All uses are load / store ops that use it as base ptr.
+  // 4) All uses are load / store ops that use it as old base ptr.
 
   // Check #1.  Preinc'ing a frame index would require copying the stack 
pointer
   // (plus the implicit offset) to a register to preinc anyway.
@@ -3282,11 +3282,11 @@
   // Check #2.
   if (!isLoad) {
 SDOperand Val = cast(N)->getValue();
-if (Val == Ptr || Ptr.Val->isPredecessor(Val.Val))
+if (Val == BasePtr || BasePtr.Val->isPredecessor(Val.Val))
   return false;
   }
 
-  // Now check for #2 and #3.
+  // Now check for #3 and #4.
   bool RealUse = false;
   for (SDNode::use_iterator I = Ptr.Val->use_begin(),
  E = Ptr.Val->use_end(); I != E; ++I) {



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


Re: [llvm-commits] Stub calls in Linux/PPC

2007-05-23 Thread Nate Begeman


On May 23, 2007, at 6:55 AM, Nicolas Geoffray wrote:


Here's a patch to make stubs work in linux/ppc. I'll commit it if
there's no objection.

Chris: Just a question. I noticed on cvsweb that you wrote the lines:
 MCE.emitWordBE(0x9421ffe0); // stwu r1,-32(r1)
 MCE.emitWordBE(0x7d6802a6); // mflr r11
 MCE.emitWordBE(0x91610028); // stw r11, 40(r1)

Why 32 when calling the stub?


Parameter area + 16 byte stack alignment.  We only bother to set this  
up when we're going to call the compilation callback, which will want  
to store the LR at the very least here.  In a nutshell, the ABI  
requires it :)



Cheers,
Nicolas
Index: lib/Target/PowerPC/PPCJITInfo.cpp
===
RCS file: /var/cvs/llvm/llvm/lib/Target/PowerPC/PPCJITInfo.cpp,v
retrieving revision 1.37
diff -t -d -u -p -5 -r1.37 PPCJITInfo.cpp
--- lib/Target/PowerPC/PPCJITInfo.cpp   25 Feb 2007 05:04:13 -  1.37
+++ lib/Target/PowerPC/PPCJITInfo.cpp   23 May 2007 13:51:52 -
@@ -12,10 +12,11 @@
 // 
===--- 
---===//


 #define DEBUG_TYPE "jit"
 #include "PPCJITInfo.h"
 #include "PPCRelocations.h"
+#include "PPCTargetMachine.h"
 #include "llvm/CodeGen/MachineCodeEmitter.h"
 #include "llvm/Config/alloca.h"
 #include "llvm/Support/Debug.h"
 #include 
 using namespace llvm;
@@ -145,60 +146,56 @@ asm(
 asm(
 ".text\n"
 ".align 2\n"
 ".globl PPC32CompilationCallback\n"
 "PPC32CompilationCallback:\n"
-// Make space for 8 ints r[3-10] and 13 doubles f[1-13] and the
+// Make space for 8 ints r[3-10] and 8 doubles f[1-8] and the


This is an ABI change on Darwin, the first 13 fp regs might have  
arguments in them, and we have to save them, since presumably the  
compilation callback could clobber anything it wanted.  Please revert  
this part of the patch.


Thanks,
Nate

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


Re: [llvm-commits] [LLVMdev] Simplifing the handling of pre-legalize vector nodes

2007-05-23 Thread Chris Lattner
On May 23, 2007, at 8:56 AM, Dan Gohman wrote:
> Ok, I now have a patch that implements this. It's a work in  
> progress, and
> still rough in some areas (some details below), but it works well  
> enough
> to allow the LLVM regression tests to pass on x86. I'm posting it  
> now so
> that people can see what I'm up to.

Cool!

> On Wed, May 23, 2007 at 12:03:30AM -0700, Chris Lattner wrote:
>> On Mon, 21 May 2007, Dan Gohman wrote:
>>> It seems that a number of things would be considerably simpler if  
>>> the
>>> pre-legalize nodes could use the same node kinds as post- 
>>> legalize; the only
>>> thing preventing that is that the MVT::ValueType enum isn't able  
>>> to describe
>>> vector types with arbitrarily long vector lengths.
>>
>> Yep, I'm sure you know this, but this is to support generic  
>> vectors.  For
>> example, if you had an input .ll that operated on 128-wide  
>> vectors, we
>> want to be able to split that up to use 4-wide vectors if your target
>> supports them.
>
> Last time I tried this it caused an impressive amount of register  
> pressure;
> long-vector loads/stores require special ScheduleDAG dependencies,  
> but LLVM
> was forcing long-vector dependencies on all the operators so that  
> operations
> on the individual sub-vectors couldn't be scheduled around to  
> reduce register
> pressure. But that's a different topic :-).

In theory -combiner-alias-analysis should fix this, or at least help  
it, by making the stores independent of each other so they can be  
reordered.  It isn't on by default because of its compile time hit.   
At some point, we should finish it up.

>> Going forward, we will also likely have to do something similar to  
>> this
>> for integer types, in order to handle stuff like i47 that gets  
>> legalized
>> into 2 x i32 or something.  I am not looking forward to  
>> duplicating all of
>> the arithmetic nodes for IADD variants etc (urk, imagine vectors of
>> strange-sized-integers! VIADD??)
>
> urk indeed...
>
> My current patch is specific to vectors, as the table elements for  
> extended
> types are std::pairs of vector lengths and element types. Perhaps  
> the thing
> to do then is to make it a table of Type*. Then it would be usable  
> for any
> machine-illegal type.

Sure, it makes sense to get a start, and extend it from there.

>>> I'm currently considering ways to make this possible. One idea is  
>>> to rename
>>> the MVT::ValueType enum to something else and make MVT::ValueType  
>>> a plain
>>> integer type. Values beyond the range of the original enum are  
>>> interpreted
>>> as indices into a UniqueVector which holds pairs of vector  
>>> lengths and
>>> element types.
>>
>> That is a very interesting idea.  It handles the generality of  
>> arbitrary
>> value types, but is nice and fast for the common code that doesn't  
>> use the
>> craziness :).  I like it!
>
> One downside is that debuggers no longer print MVT::ValueTypes with  
> enum
> names.

Slightly annoying, but not a big deal.

>>> Before I do much more experimentation with this, I wanted to run  
>>> the idea by
>>> the list to see what feedback it might get. Has anyone thought  
>>> about doing
>>> this before? Are there other approaches that might be better?
>>
>> This approach sounds very sensible.  Make sure the SelectionDAG  
>> owns the
>> table though.
>
> I wasn't sure if it should go in the SelectionDAG or the  
> TargetLowering.

It should be in SelectionDAG.  The protocol is that the interfaces in  
include/llvm/Target/* are immutable once created (though the  
interfaces can hack on data structures passed in, like  
SelectionDAGs).  The classes instantiated from include/llvm/CodeGen  
represent code as it is being hacked on.  As such, CodeGen/ 
SelectionDAG is the right place to go.

> My current patch just uses a global table because it was easier and  
> allowed
> me to get to the LegalizeDAG.cpp changes. But I'll definately clean  
> this up.

Sounds good.

Some quick thoughts about the patch:


diff -u -r1.34 ValueTypes.h
--- include/llvm/CodeGen/ValueTypes.h
+++ include/llvm/CodeGen/ValueTypes.h

Meta-comment about this file: when the table is moved to not be  
global, the 'simple' functions should stay, the complex ones should  
move to be methods on SelectionDAG.  Note that tools like tblgen use  
ValueTypes.h (for simple VTs), but don't link the llvm libraries in.


  // iPTR - An int value the size of the pointer of the current
  // target.  This should only be used internal to tblgen!
-iPTR   = 255
+iPTR   = 255,

Can there be more than 255 elts in the table?  If so, I'd suggest  
turning this into ~0U or something.

-  /// MVT::isInteger - Return true if this is a simple integer, or a  
packed
+  typedef int ValueType;

Can these be negative?  If not, plz use unsigned instead of int.


+  /// MVT::isExtendedIntegerVector - Test if the given ValueType is a
+  /// vector (simple or extended) with a floating-point elem