[llvm-commits] CVS: llvm/test/CodeGen/Generic/2007-02-16-BranchFold.ll switch-lower-feature.ll

2007-04-09 Thread Anton Korobeynikov


Changes in directory llvm/test/CodeGen/Generic:

2007-02-16-BranchFold.ll updated: 1.3 -> 1.4
switch-lower-feature.ll updated: 1.2 -> 1.3
---
Log message:

Next stage into switch lowering refactoring
1. Fix some bugs in the jump table lowering threshold
2. Implement much better metric for optimal pivot selection
3. Tune thresholds for different lowering methods
4. Implement shift-and trick for lowering small ( 
[#uses=1]
 @str1 = external global [11 x i8]  ; <[11 x i8]*> [#uses=1]
 
-
 declare i32 @fprintf(%struct.FILE*, i8*, ...)
 
 define i16 @main_bb_2E_i9_2E_i_2E_i932_2E_ce(%struct.list* 
%l_addr.01.0.i2.i.i929, %struct.operator** %tmp66.i62.i.out) {
 newFuncRoot:
br label %bb.i9.i.i932.ce
 
-bb36.i.i.exitStub: ; preds = %bb.i9.i.i932.ce
+NewDefault:; preds = %LeafBlock, %LeafBlock1, %LeafBlock2, 
%LeafBlock3
+   br label %bb36.i.i.exitStub
+
+bb36.i.i.exitStub: ; preds = %NewDefault
store %struct.operator* %tmp66.i62.i, %struct.operator** 
%tmp66.i62.i.out
ret i16 0
 
-bb.i14.i.exitStub: ; preds = %bb.i9.i.i932.ce
+bb.i14.i.exitStub: ; preds = %LeafBlock
store %struct.operator* %tmp66.i62.i, %struct.operator** 
%tmp66.i62.i.out
ret i16 1
 
-bb12.i.i935.exitStub:  ; preds = %bb.i9.i.i932.ce
+bb12.i.i935.exitStub:  ; preds = %LeafBlock1
store %struct.operator* %tmp66.i62.i, %struct.operator** 
%tmp66.i62.i.out
ret i16 2
 
-bb20.i.i937.exitStub:  ; preds = %bb.i9.i.i932.ce
+bb20.i.i937.exitStub:  ; preds = %LeafBlock2
store %struct.operator* %tmp66.i62.i, %struct.operator** 
%tmp66.i62.i.out
ret i16 3
 
-bb28.i.i938.exitStub:  ; preds = %bb.i9.i.i932.ce
+bb28.i.i938.exitStub:  ; preds = %LeafBlock3
store %struct.operator* %tmp66.i62.i, %struct.operator** 
%tmp66.i62.i.out
ret i16 4
 
@@ -61,11 +63,34 @@
%tmp3.i8.i = load %struct.FILE** @outfile   ; 
<%struct.FILE*> [#uses=1]
%tmp5.i9.i = call i32 (%struct.FILE*, i8*, ...)* @fprintf( 
%struct.FILE* %tmp3.i8.i, i8* getelementptr ([11 x i8]* @str1, i32 0, i32 0), 
i32 %tmp2.i7.i )   ;  [#uses=0]
%tmp7.i10.i = getelementptr %struct.operator* %tmp66.i62.i, i32 0, i32 
5;  [#uses=1]
-   %tmp8.i11.i = load i32* %tmp7.i10.i ;  [#uses=1]
-   switch i32 %tmp8.i11.i, label %bb36.i.i.exitStub [
-i32 -1, label %bb.i14.i.exitStub
-i32 0, label %bb12.i.i935.exitStub
-i32 1, label %bb20.i.i937.exitStub
-i32 2, label %bb28.i.i938.exitStub
-   ]
+   %tmp8.i11.i = load i32* %tmp7.i10.i ;  [#uses=7]
+   br label %NodeBlock5
+
+NodeBlock5:; preds = %bb.i9.i.i932.ce
+   icmp slt i32 %tmp8.i11.i, 1 ; :0 [#uses=1]
+   br i1 %0, label %NodeBlock, label %NodeBlock4
+
+NodeBlock4:; preds = %NodeBlock5
+   icmp slt i32 %tmp8.i11.i, 2 ; :1 [#uses=1]
+   br i1 %1, label %LeafBlock2, label %LeafBlock3
+
+LeafBlock3:; preds = %NodeBlock4
+   icmp eq i32 %tmp8.i11.i, 2  ; :2 [#uses=1]
+   br i1 %2, label %bb28.i.i938.exitStub, label %NewDefault
+
+LeafBlock2:; preds = %NodeBlock4
+   icmp eq i32 %tmp8.i11.i, 1  ; :3 [#uses=1]
+   br i1 %3, label %bb20.i.i937.exitStub, label %NewDefault
+
+NodeBlock: ; preds = %NodeBlock5
+   icmp slt i32 %tmp8.i11.i, 0 ; :4 [#uses=1]
+   br i1 %4, label %LeafBlock, label %LeafBlock1
+
+LeafBlock1:; preds = %NodeBlock
+   icmp eq i32 %tmp8.i11.i, 0  ; :5 [#uses=1]
+   br i1 %5, label %bb12.i.i935.exitStub, label %NewDefault
+
+LeafBlock: ; preds = %NodeBlock
+   icmp eq i32 %tmp8.i11.i, -1 ; :6 [#uses=1]
+   br i1 %6, label %bb.i14.i.exitStub, label %NewDefault
 }


Index: llvm/test/CodeGen/Generic/switch-lower-feature.ll
diff -u llvm/test/CodeGen/Generic/switch-lower-feature.ll:1.2 
llvm/test/CodeGen/Generic/switch-lower-feature.ll:1.3
--- llvm/test/CodeGen/Generic/switch-lower-feature.ll:1.2   Wed Apr  4 
16:14:49 2007
+++ llvm/test/CodeGen/Generic/switch-lower-feature.ll   Mon Apr  9 07:31:58 2007
@@ -1,10 +1,7 @@
 ; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$7 | wc -l | grep 1 &&
 ; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$6 | wc -l | grep 1 &&
 ; RUN: llvm-as < %s | llc -march=x86 -o - | grep 1024 | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep 1023 | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep jg | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep jb | wc -l | grep 1 &&
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep jae | wc -l | grep 1 &&
+; RUN: llvm-as < %s | llc -march=x86 -o - | grep jb | wc -l | grep 2 &&
 ; RUN: llvm-as < %s | llc -march=x86 -o - | grep je | w

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

2007-04-09 Thread Anton Korobeynikov


Changes in directory llvm/include/llvm/CodeGen:

SelectionDAGISel.h updated: 1.36 -> 1.37
---
Log message:

Next stage into switch lowering refactoring
1. Fix some bugs in the jump table lowering threshold
2. Implement much better metric for optimal pivot selection
3. Tune thresholds for different lowering methods
4. Implement shift-and trick for lowering small ( JumpTableBlock;
- 
+
+  struct BitTestCase {
+BitTestCase(uint64_t M, MachineBasicBlock* T, MachineBasicBlock* Tr):
+  Mask(M), ThisBB(T), TargetBB(Tr) { };
+uint64_t Mask;
+MachineBasicBlock* ThisBB;
+MachineBasicBlock* TargetBB;
+  };
+  
+  typedef SmallVector BitTestInfo;
+
+  struct BitTestBlock {
+BitTestBlock(uint64_t F, uint64_t R, Value* SV,
+ unsigned Rg, bool E,
+ MachineBasicBlock* P, MachineBasicBlock* D,
+ const BitTestInfo& C):
+  First(F), Range(R), SValue(SV), Reg(Rg), Emitted(E),
+  Parent(P), Default(D), Cases(C) { };
+uint64_t First;
+uint64_t Range;
+Value  *SValue;
+unsigned Reg;
+bool Emitted;
+MachineBasicBlock *Parent;
+MachineBasicBlock *Default;
+BitTestInfo Cases;
+  };
 protected:
   /// Pick a safe ordering and emit instructions for each target node in the
   /// graph.
@@ -157,6 +183,8 @@
   /// JTCases - Vector of JumpTable structures which holds necessary 
information
   /// for emitting a jump tables during SwitchInst code generation.
   std::vector JTCases;
+
+  std::vector BitTestCases;
 };
 
 }



___
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-04-09 Thread Anton Korobeynikov


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.409 -> 1.410
---
Log message:

Next stage into switch lowering refactoring
1. Fix some bugs in the jump table lowering threshold
2. Implement much better metric for optimal pivot selection
3. Tune thresholds for different lowering methods
4. Implement shift-and trick for lowering small (   CaseVector;
+  typedef std::vector   CaseBitsVector;
   typedef CaseVector::iteratorCaseItr;
   typedef std::pair CaseRange;
 
@@ -404,9 +414,7 @@
   /// The comparison function for sorting the switch case values in the vector.
   /// WARNING: Case ranges should be disjoint!
   struct CaseCmp {
-bool operator () (const Case& C1,
-  const Case& C2) {
-
+bool operator () (const Case& C1, const Case& C2) {
   assert(isa(C1.Low) && isa(C2.High));
   const ConstantInt* CI1 = cast(C1.Low);
   const ConstantInt* CI2 = cast(C2.High);
@@ -414,6 +422,12 @@
 }
   };
 
+  struct CaseBitsCmp {
+bool operator () (const CaseBits& C1, const CaseBits& C2) {
+  return C1.Bits > C2.Bits;
+}
+  };
+
   unsigned Clusterify(CaseVector& Cases, const SwitchInst &SI);
   
 public:
@@ -430,6 +444,7 @@
   /// JTCases - Vector of JumpTable structures used to communicate
   /// SwitchInst code generation information.
   std::vector JTCases;
+  std::vector BitTestCases;
   
   /// FuncInfo - Information about the function as a whole.
   ///
@@ -531,7 +546,15 @@
CaseRecVector& WorkList,
Value* SV,
MachineBasicBlock* Default);
+  bool handleBitTestsSwitchCase(CaseRec& CR,
+CaseRecVector& WorkList,
+Value* SV,
+MachineBasicBlock* Default);  
   void visitSwitchCase(SelectionDAGISel::CaseBlock &CB);
+  void visitBitTestHeader(SelectionDAGISel::BitTestBlock &B);
+  void visitBitTestCase(MachineBasicBlock* NextMBB,
+unsigned Reg,
+SelectionDAGISel::BitTestCase &B);
   void visitJumpTable(SelectionDAGISel::JumpTable &JT);
   void visitJumpTableHeader(SelectionDAGISel::JumpTable &JT,
 SelectionDAGISel::JumpTableHeader &JTH);
@@ -1210,9 +1233,98 @@
 DAG.setRoot(BrCond);
   else
 DAG.setRoot(DAG.getNode(ISD::BR, MVT::Other, BrCond, 
-DAG.getBasicBlock(JT.MBB))); 
+DAG.getBasicBlock(JT.MBB)));
+
+  return;
 }
 
+/// visitBitTestHeader - This function emits necessary code to produce value
+/// suitable for "bit tests"
+void SelectionDAGLowering::visitBitTestHeader(SelectionDAGISel::BitTestBlock 
&B) {
+  // Subtract the minimum value
+  SDOperand SwitchOp = getValue(B.SValue);
+  MVT::ValueType VT = SwitchOp.getValueType();
+  SDOperand SUB = DAG.getNode(ISD::SUB, VT, SwitchOp,
+  DAG.getConstant(B.First, VT));
+
+  // Check range
+  SDOperand RangeCmp = DAG.getSetCC(TLI.getSetCCResultTy(), SUB,
+DAG.getConstant(B.Range, VT),
+ISD::SETUGT);
+
+  SDOperand ShiftOp;
+  if (VT > TLI.getShiftAmountTy())
+ShiftOp = DAG.getNode(ISD::TRUNCATE, TLI.getShiftAmountTy(), SUB);
+  else
+ShiftOp = DAG.getNode(ISD::ZERO_EXTEND, TLI.getShiftAmountTy(), SUB);
+
+  // Make desired shift
+  SDOperand SwitchVal = DAG.getNode(ISD::SHL, TLI.getPointerTy(),
+DAG.getConstant(1, TLI.getPointerTy()),
+ShiftOp);
+
+  unsigned SwitchReg = FuncInfo.MakeReg(TLI.getPointerTy());
+  SDOperand CopyTo = DAG.getCopyToReg(getRoot(), SwitchReg, SwitchVal);
+  B.Reg = SwitchReg;
+
+  SDOperand BrRange = DAG.getNode(ISD::BRCOND, MVT::Other, CopyTo, RangeCmp,
+  DAG.getBasicBlock(B.Default));
+
+  // Set NextBlock to be the MBB immediately after the current one, if any.
+  // This is used to avoid emitting unnecessary branches to the next block.
+  MachineBasicBlock *NextBlock = 0;
+  MachineFunction::iterator BBI = CurMBB;
+  if (++BBI != CurMBB->getParent()->end())
+NextBlock = BBI;
+
+  MachineBasicBlock* MBB = B.Cases[0].ThisBB;
+  if (MBB == NextBlock)
+DAG.setRoot(BrRange);
+  else
+DAG.setRoot(DAG.getNode(ISD::BR, MVT::Other, CopyTo,
+DAG.getBasicBlock(MBB)));
+
+  CurMBB->addSuccessor(B.Default);
+  CurMBB->addSuccessor(MBB);
+
+  return;
+}
+
+/// visitBitTestCase - this function produces one "bit test"
+void SelectionDAGLowering::visitBitTestCase(MachineBasicBlock* NextMBB,
+unsigned Reg,
+SelectionDAGISel::BitTestCase &B) {
+  // Emit bit tests and jumps
+  SDOperand SwitchVal = DAG.getCopyFromReg(getRoot(), Reg, TLI.getPointerTy());
+  
+  SDOperand AndOp = DAG.getNode(

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

2007-04-09 Thread Jeff Cohen


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.410 -> 1.411
---
Log message:

Unbreak VC++ build.

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

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


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.410 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.411
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.410Mon Apr  9 
07:31:58 2007
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Mon Apr  9 09:32:59 2007
@@ -45,6 +45,7 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Compiler.h"
 #include 
+#include 
 using namespace llvm;
 
 #ifndef NDEBUG
@@ -1603,7 +1604,7 @@
 assert((RBegin-LEnd>=1) && "Invalid case distance");
 double LDensity = (double)LSize / (double)((LEnd - First) + 1ULL);
 double RDensity = (double)RSize / (double)((Last - RBegin) + 1ULL);
-double Metric = log(RBegin-LEnd)*(LDensity+RDensity);
+double Metric = log(double(RBegin-LEnd))*(LDensity+RDensity);
 // Should always split in some non-trivial place
 DOUT <<"=>Step\n"
  << "LEnd: " << LEnd << ", RBegin: " << RBegin << "\n"
@@ -1783,7 +1784,7 @@
   }
   
   SelectionDAGISel::BitTestBlock BTB(lowBound, range, SV,
- -1ULL, (CR.CaseBB == CurMBB),
+ -1U, (CR.CaseBB == CurMBB),
  CR.CaseBB, Default, BTC);
 
   if (CR.CaseBB == CurMBB)



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


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

2007-04-09 Thread Reid Spencer


Changes in directory llvm/lib/VMCore:

Function.cpp updated: 1.116 -> 1.117
Instructions.cpp updated: 1.81 -> 1.82
Type.cpp updated: 1.179 -> 1.180
---
Log message:

For PR1146: http://llvm.org/PR1146 :
* Add ParamAttrList pointers to Function and CallInst. 
* Move the implementation of ParamAttrList from Type.cpp to Function.cpp


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

 Function.cpp |   64 +++
 Instructions.cpp |4 +++
 Type.cpp |   59 --
 3 files changed, 68 insertions(+), 59 deletions(-)


Index: llvm/lib/VMCore/Function.cpp
diff -u llvm/lib/VMCore/Function.cpp:1.116 llvm/lib/VMCore/Function.cpp:1.117
--- llvm/lib/VMCore/Function.cpp:1.116  Mon Apr  9 01:11:23 2007
+++ llvm/lib/VMCore/Function.cppMon Apr  9 10:01:12 2007
@@ -72,12 +72,76 @@
 }
 
 
//===--===//
+// ParamAttrsList Implementation
+//===--===//
+
+uint16_t
+ParamAttrsList::getParamAttrs(uint16_t Index) const {
+  unsigned limit = attrs.size();
+  for (unsigned i = 0; i < limit; ++i)
+if (attrs[i].index == Index)
+  return attrs[i].attrs;
+  return NoAttributeSet;
+}
+
+
+std::string 
+ParamAttrsList::getParamAttrsText(uint16_t Attrs) {
+  std::string Result;
+  if (Attrs & ZExtAttribute)
+Result += "zext ";
+  if (Attrs & SExtAttribute)
+Result += "sext ";
+  if (Attrs & NoReturnAttribute)
+Result += "noreturn ";
+  if (Attrs & NoUnwindAttribute)
+Result += "nounwind ";
+  if (Attrs & InRegAttribute)
+Result += "inreg ";
+  if (Attrs & StructRetAttribute)
+Result += "sret ";  
+  return Result;
+}
+
+void
+ParamAttrsList::addAttributes(uint16_t Index, uint16_t Attrs) {
+  // First, try to replace an existing one
+  for (unsigned i = 0; i < attrs.size(); ++i)
+if (attrs[i].index == Index) {
+  attrs[i].attrs |= Attrs;
+  return;
+}
+
+  // If not found, add a new one
+  ParamAttrsWithIndex Val;
+  Val.attrs = Attrs;
+  Val.index = Index;
+  attrs.push_back(Val);
+}
+
+void
+ParamAttrsList::removeAttributes(uint16_t Index, uint16_t Attrs) {
+  // Find the index from which to remove the attributes
+  for (unsigned i = 0; i < attrs.size(); ++i)
+if (attrs[i].index == Index) {
+  attrs[i].attrs &= ~Attrs;
+  if (attrs[i].attrs == NoAttributeSet)
+attrs.erase(&attrs[i]);
+  return;
+}
+
+  // The index wasn't found above
+  assert(0 && "Index not found for removeAttributes");
+}
+
+//===--===//
 // Function Implementation
 
//===--===//
 
 Function::Function(const FunctionType *Ty, LinkageTypes Linkage,
const std::string &name, Module *ParentModule)
   : GlobalValue(PointerType::get(Ty), Value::FunctionVal, 0, 0, Linkage, name) 
{
+  ParamAttrs = 0;
   CallingConvention = 0;
   BasicBlocks.setItemParent(this);
   BasicBlocks.setParent(this);


Index: llvm/lib/VMCore/Instructions.cpp
diff -u llvm/lib/VMCore/Instructions.cpp:1.81 
llvm/lib/VMCore/Instructions.cpp:1.82
--- llvm/lib/VMCore/Instructions.cpp:1.81   Thu Mar 22 11:38:57 2007
+++ llvm/lib/VMCore/Instructions.cppMon Apr  9 10:01:12 2007
@@ -188,6 +188,7 @@
 }
 
 void CallInst::init(Value *Func, Value* const *Params, unsigned NumParams) {
+  ParamAttrs = 0;
   NumOperands = NumParams+1;
   Use *OL = OperandList = new Use[NumParams+1];
   OL[0].init(Func, this);
@@ -208,6 +209,7 @@
 }
 
 void CallInst::init(Value *Func, Value *Actual1, Value *Actual2) {
+  ParamAttrs = 0;
   NumOperands = 3;
   Use *OL = OperandList = new Use[3];
   OL[0].init(Func, this);
@@ -230,6 +232,7 @@
 }
 
 void CallInst::init(Value *Func, Value *Actual) {
+  ParamAttrs = 0;
   NumOperands = 2;
   Use *OL = OperandList = new Use[2];
   OL[0].init(Func, this);
@@ -248,6 +251,7 @@
 }
 
 void CallInst::init(Value *Func) {
+  ParamAttrs = 0;
   NumOperands = 1;
   Use *OL = OperandList = new Use[1];
   OL[0].init(Func, this);


Index: llvm/lib/VMCore/Type.cpp
diff -u llvm/lib/VMCore/Type.cpp:1.179 llvm/lib/VMCore/Type.cpp:1.180
--- llvm/lib/VMCore/Type.cpp:1.179  Mon Apr  9 01:07:52 2007
+++ llvm/lib/VMCore/Type.cppMon Apr  9 10:01:12 2007
@@ -1121,65 +1121,6 @@
   return false;
 }
 
-uint16_t
-ParamAttrsList::getParamAttrs(uint16_t Index) const {
-  unsigned limit = attrs.size();
-  for (unsigned i = 0; i < limit; ++i)
-if (attrs[i].index == Index)
-  return attrs[i].attrs;
-  return NoAttributeSet;
-}
-
-
-std::string 
-ParamAttrsList::getParamAttrsText(uint16_t Attrs) {
-  std::string Result;
-  if (Attrs & ZExtAttribute)
-Result += "zext ";
-  if (Attrs & SExtAttribute)
-Result += "sext ";
-  if (Attrs & NoReturnAttribute)
-Result += "noreturn ";
-  if (Attrs & NoUnwindAttribute)
-Result += "nou

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

2007-04-09 Thread Reid Spencer


Changes in directory llvm/include/llvm:

Function.h updated: 1.72 -> 1.73
Instructions.h updated: 1.63 -> 1.64
---
Log message:

For PR1146: http://llvm.org/PR1146 :
* Add ParamAttrList pointers to Function and CallInst. 
* Move the implementation of ParamAttrList from Type.cpp to Function.cpp


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

 Function.h |   22 +-
 Instructions.h |   12 
 2 files changed, 29 insertions(+), 5 deletions(-)


Index: llvm/include/llvm/Function.h
diff -u llvm/include/llvm/Function.h:1.72 llvm/include/llvm/Function.h:1.73
--- llvm/include/llvm/Function.h:1.72   Mon Feb  5 14:47:19 2007
+++ llvm/include/llvm/Function.hMon Apr  9 10:01:12 2007
@@ -26,6 +26,7 @@
 namespace llvm {
 
 class FunctionType;
+class ParamAttrsList;
 
 // Traits for intrusive list of instructions...
 template<> struct ilist_traits
@@ -60,11 +61,11 @@
 
 private:
   // Important things that make up a function!
-  BasicBlockListType  BasicBlocks;  // The basic blocks
-  ArgumentListType ArgumentList;// The formal arguments
-
-  ValueSymbolTable *SymTab;
-  unsigned CallingConvention;
+  BasicBlockListType  BasicBlocks;   ///< The basic blocks
+  ArgumentListType ArgumentList; ///< The formal arguments
+  ValueSymbolTable *SymTab;  ///< Symbol table of args/instructions
+  ParamAttrsList *ParamAttrs;///< Parameter attributes
+  unsigned CallingConvention;///< Calling convention to use
 
   friend class SymbolTableListTraits;
 
@@ -111,6 +112,17 @@
   unsigned getCallingConv() const { return CallingConvention; }
   void setCallingConv(unsigned CC) { CallingConvention = CC; }
 
+  /// Obtains a constant pointer to the ParamAttrsList object which holds the
+  /// parameter attributes information, if any. 
+  /// @returns 0 if no parameter attributes have been set.
+  /// @brief Get the parameter attributes.
+  const ParamAttrsList *getParamAttrs() const { return ParamAttrs; }
+
+  /// Sets the parameter attributes for this Function. To construct a 
+  /// ParamAttrsList, see ParameterAttributes.h
+  /// @brief Set the parameter attributes.
+  void setParamAttrs(ParamAttrsList *attrs) { ParamAttrs = attrs; }
+
   /// deleteBody - This method deletes the body of the function, and converts
   /// the linkage to external.
   ///


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.63 
llvm/include/llvm/Instructions.h:1.64
--- llvm/include/llvm/Instructions.h:1.63   Wed Feb 28 16:00:54 2007
+++ llvm/include/llvm/Instructions.hMon Apr  9 10:01:12 2007
@@ -26,6 +26,7 @@
 class VectorType;
 class ConstantRange;
 class APInt;
+class ParamAttrsList;
 
 
//===--===//
 // AllocationInst Class
@@ -694,6 +695,7 @@
 /// hold the calling convention of the call.
 ///
 class CallInst : public Instruction {
+  ParamAttrsList *ParamAttrs; ///< parameter attributes for call
   CallInst(const CallInst &CI);
   void init(Value *Func, Value* const *Params, unsigned NumParams);
   void init(Value *Func, Value *Actual1, Value *Actual2);
@@ -735,6 +737,16 @@
 SubclassData = (SubclassData & 1) | (CC << 1);
   }
 
+  /// Obtains a constant pointer to the ParamAttrsList object which holds the
+  /// parameter attributes information, if any. 
+  /// @brief Get the parameter attributes.
+  const ParamAttrsList *getParamAttrs() const { return ParamAttrs; }
+
+  /// Sets the parameter attributes for this CallInst. To construct a 
+  /// ParamAttrsList, see ParameterAttributes.h
+  /// @brief Set the parameter attributes.
+  void setParamAttrs(ParamAttrsList *attrs) { ParamAttrs = attrs; }
+
   /// getCalledFunction - Return the function being called by this instruction
   /// if it is a direct call.  If it is a call through a function pointer,
   /// return null.



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


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopRotation.cpp

2007-04-09 Thread Devang Patel


Changes in directory llvm/lib/Transforms/Scalar:

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

Only cosmetic changes. Zero functionality Change.


---
Diffs of the changes:  (+100 -97)

 LoopRotation.cpp |  197 +++
 1 files changed, 100 insertions(+), 97 deletions(-)


Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp
diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.1 
llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.2
--- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.1 Fri Apr  6 20:20:26 2007
+++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr  9 11:11:48 2007
@@ -11,7 +11,7 @@
 //
 
//===--===//
 
-#define DEBUG_TYPE "loop-rotation"
+#define DEBUG_TYPE "loop-rotate"
 
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Function.h"
@@ -23,7 +23,6 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/ADT/SmallVector.h"
-#include 
 
 using namespace llvm;
 
@@ -32,29 +31,28 @@
 STATISTIC(NumRotated, "Number of loops rotated");
 namespace {
 
-  cl::opt
-  RotateThreshold("rotate-threshold", cl::init(200), cl::Hidden,
-  cl::desc("The cut-off point for loop rotating"));
-
-  class VISIBILITY_HIDDEN InsnReplacementData {
+  class VISIBILITY_HIDDEN RenameData {
   public:
-InsnReplacementData(Instruction *O, Instruction *P, Instruction *H) 
-  : Original(O), PreHeader(P), Header(H) {}
+RenameData(Instruction *O, Instruction *P, Instruction *H) 
+  : Original(O), PreHeader(P), Header(H) { }
   public:
 Instruction *Original; // Original instruction
 Instruction *PreHeader; // New pre-header replacement
 Instruction *Header; // New header replacement
   };
-
+  
   class VISIBILITY_HIDDEN LoopRotate : public LoopPass {
 
   public:
+
+// Rotate Loop L as many times as possible. Return true if
+// loop is rotated at least once.
 bool runOnLoop(Loop *L, LPPassManager &LPM);
+
+// LCSSA form makes instruction renaming easier.
 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
   AU.addRequiredID(LCSSAID);
   AU.addPreservedID(LCSSAID);
-  //AU.addRequired();
-  //AU.addPreserved();
 }
 
 // Helper functions
@@ -75,7 +73,7 @@
 
 /// Find Replacement information for instruction. Return NULL if it is
 /// not available.
-InsnReplacementData *findReplacementData(Instruction *I);
+RenameData *findReplacementData(Instruction *I);
 
   private:
 
@@ -87,7 +85,7 @@
 BasicBlock *NewPreHeader;
 BasicBlock *Exit;
 
-SmallVector RD;
+SmallVector LoopHeaderInfo;
   };
   
   RegisterPass X ("loop-rotate", "Rotate Loops");
@@ -95,6 +93,8 @@
 
 LoopPass *llvm::createLoopRotatePass() { return new LoopRotate(); }
 
+/// Rotate Loop L as many times as possible. Return true if
+/// loop is rotated at least once.
 bool LoopRotate::runOnLoop(Loop *Lp, LPPassManager &LPM) {
   
   bool RotatedOneLoop = false;
@@ -109,18 +109,17 @@
   return RotatedOneLoop;
 }
 
+/// Rotate loop LP. Return true if it loop is rotated.
 bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) {
 
   L = Lp;
-  if ( NumRotated >= RotateThreshold) 
-return false;
 
   OrigHeader =  L->getHeader();
   OrigPreHeader = L->getLoopPreheader();
   OrigLatch = L->getLoopLatch();
 
   // If loop has only one block then there is not much to rotate.
-  if (L->getBlocks().size() <= 1)
+  if (L->getBlocks().size() == 1)
 return false;
 
   if (!OrigHeader || !OrigLatch || !OrigPreHeader)
@@ -135,33 +134,27 @@
   BranchInst *BI = dyn_cast(OrigHeader->getTerminator());
   if (!BI)
 return false;
+  assert (BI->isConditional() && "Branch Instruction is not condiitional");
 
+  // Updating PHInodes in loops with multiple exits adds complexity. 
+  // Keep it simple, and restrict loop rotation to loops with one exit only.
+  // In future, lift this restriction and support for multiple exits if
+  // required.
   std::vector ExitBlocks;
   L->getExitBlocks(ExitBlocks);
   if (ExitBlocks.size() > 1)
 return false;
 
   // Find new Loop header. NewHeader is a Header's one and only successor
-  // that is inside loop.  Header's all other successors are out side the
+  // that is inside loop.  Header's other successor is out side the
   // loop. Otherwise loop is not suitable for rotation.
-  for (unsigned index = 0; index < BI->getNumSuccessors(); ++index) {
-BasicBlock *S = BI->getSuccessor(index);
-if (L->contains(S)) {
-  if (!NewHeader) 
-NewHeader = S;
-  else
-// Loop Header has two successors inside loop. This loop is
-// not suitable for rotation.
-return false;
-} else {
-  if (!Exit)
-Exit = S;
-  else
-// Loop has multiple exits.
-return false;
-}
-  }
+  Exit = BI->getSuccessor(0);
+  NewHeader = BI->getSuccessor(1);
+  if (L->contains(Exit))
+std::swap(Exit,

[llvm-commits] New llvm-test regressions

2007-04-09 Thread Jeff Cohen
Changes in the last 24 hours have caused additional failures in 
llvm-tests:  burg, spiff, lencode, espresso and cdecl.



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


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopRotation.cpp

2007-04-09 Thread Devang Patel


Changes in directory llvm/lib/Transforms/Scalar:

LoopRotation.cpp updated: 1.2 -> 1.3
---
Log message:

More cosmetic changes.


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

 LoopRotation.cpp |   32 ++--
 1 files changed, 18 insertions(+), 14 deletions(-)


Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp
diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.2 
llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.3
--- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.2 Mon Apr  9 11:11:48 2007
+++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr  9 11:21:29 2007
@@ -238,10 +238,12 @@
   for (SmallVector::iterator 
  I = LoopHeaderInfo.begin(), E = LoopHeaderInfo.end(); I != E; ++I) {
 
-RenameData ILoopHeaderInfo = (*I);
+const RenameData &ILoopHeaderInfo = *I;
 Instruction *In = ILoopHeaderInfo.Original;
 Instruction *C = ILoopHeaderInfo.PreHeader;
-
+
+// If this instruction is not from new pre-header then is not new 
+// pre-header then this instruction is not handled here.
 if (C->getParent() != NewPreHeader)
   continue;
 
@@ -249,7 +251,7 @@
 if (isa(In))
   continue;
 
-for (unsigned opi = 0; opi < In->getNumOperands(); ++opi) {
+for (unsigned opi = 0, e = In->getNumOperands(); opi != e; ++opi) {
   if (Instruction *OpPhi = dyn_cast(In->getOperand(opi))) {
 if (RenameData *D = findReplacementData(OpPhi))
   C->setOperand(opi, D->PreHeader);
@@ -283,7 +285,7 @@
   for (SmallVector::iterator 
  I = LoopHeaderInfo.begin(), E = LoopHeaderInfo.end(); I != E; ++I) {
 
-RenameData ILoopHeaderInfo = (*I);
+const RenameData &ILoopHeaderInfo = *I;
 if (!ILoopHeaderInfo.Header)
   continue;
 
@@ -294,7 +296,7 @@
 // not invalidated.
 SmallVector AllUses;
 for (Value::use_iterator UI = OldPhi->use_begin(), UE = OldPhi->use_end();
- UI != UE; ++UI ) {
+ UI != UE; ++UI) {
   Instruction *U = cast(UI);
   AllUses.push_back(U);
 }
@@ -307,9 +309,10 @@
   // Used inside original header
   if (Parent == OrigHeader) {
 // Do not rename uses inside original header non-phi instructions.
-if (!isa(U))
-  continue;
 PHINode *PU = dyn_cast(U);
+if (!PU)
+  continue;
+
 // Do not rename uses inside original header phi nodes, if the
 // incoming value is for new header.
 if (PU->getBasicBlockIndex(NewHeader) != -1
@@ -322,13 +325,14 @@
 
   // Used inside loop, but not in original header.
   if (L->contains(U->getParent())) {
-if (U != NewPhi )
+if (U != NewPhi)
   U->replaceUsesOfWith(OldPhi, NewPhi);
 continue;
   }
 
   // Used inside Exit Block. Since we are in LCSSA form, U must be PHINode.
-  assert ( U->getParent() == Exit && "Need to propagate new PHI into Exit 
blocks");
+  assert (U->getParent() == Exit 
+  && "Need to propagate new PHI into Exit blocks");
   assert (isa(U) && "Use in Exit Block that is not PHINode"); 
   
 
   PHINode *UPhi = cast(U);
@@ -374,10 +378,9 @@
   for (BasicBlock::iterator I = Exit->begin(), E = Exit->end();
I != E; ++I) {
 
-if (!isa(I))
-  break;
-
 PHINode *PN = dyn_cast(I);
+if (!PN)
+  break;
 
 if (PN->getBasicBlockIndex(NewPreHeader) == -1) {
   Value *V = PN->getIncomingValueForBlock(OrigHeader);
@@ -405,7 +408,8 @@
   LoopHeaderInfo.clear();
 }
 
-/// Return true if this instruction is used outside original header.
+/// Return true if this instruction is used by any instructions in the loop 
that
+/// aren't in original header.
 bool LoopRotate::usedOutsideOriginalHeader(Instruction *In) {
 
   for (Value::use_iterator UI = In->use_begin(), UE = In->use_end();
@@ -427,7 +431,7 @@
   // Since LoopHeaderInfo is small, linear walk is OK.
   for (SmallVector::iterator 
  I = LoopHeaderInfo.begin(), E = LoopHeaderInfo.end(); I != E; ++I) 
-if ((*I).Original == In)
+if (I->Original == In)
   return &(*I);
 
   return NULL;



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


Re: [llvm-commits] New llvm-test regressions

2007-04-09 Thread Reid Spencer
On Mon, 2007-04-09 at 09:16 -0700, Jeff Cohen wrote:
> Changes in the last 24 hours have caused additional failures in 
> llvm-tests:  burg, spiff, lencode, espresso and cdecl.

I have been assuming these are a result of the PR1146 changes which
require llvm-gcc changes. Is that the issue or something else?

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

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


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopRotation.cpp

2007-04-09 Thread Devang Patel


Changes in directory llvm/lib/Transforms/Scalar:

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

Fix future bug. Of course, Chris spotted this.
Handle Argument or Undef as an incoming PHI value.


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

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


Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp
diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.3 
llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.4
--- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.3 Mon Apr  9 11:21:29 2007
+++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr  9 11:41:46 2007
@@ -369,7 +369,6 @@
   return true;
 }
 
-
 /// Make sure all Exit block PHINodes have required incoming values.
 /// If incoming value is constant or defined outside the loop then
 /// PHINode may not have an entry for new pre-header. 
@@ -382,20 +381,22 @@
 if (!PN)
   break;
 
-if (PN->getBasicBlockIndex(NewPreHeader) == -1) {
-  Value *V = PN->getIncomingValueForBlock(OrigHeader);
-  if (isa(V))
-PN->addIncoming(V, NewPreHeader);
-  else {
-RenameData *ILoopHeaderInfo = 
findReplacementData(cast(V));
-assert (ILoopHeaderInfo && ILoopHeaderInfo->PreHeader && "Missing New 
Preheader Instruction");
-PN->addIncoming(ILoopHeaderInfo->PreHeader, NewPreHeader);
-  }
+// There is already one incoming value from new pre-header block.
+if (PN->getBasicBlockIndex(NewPreHeader) != -1)
+  return;
+
+RenameData *ILoopHeaderInfo;
+Value *V = PN->getIncomingValueForBlock(OrigHeader);
+if (isa(V) && 
+(ILoopHeaderInfo = findReplacementData(cast(V {
+  assert (ILoopHeaderInfo->PreHeader && "Missing New Preheader 
Instruction");
+  PN->addIncoming(ILoopHeaderInfo->PreHeader, NewPreHeader);
+} else {
+  PN->addIncoming(V, NewPreHeader);
 }
   }
 }
 
-
 /// Initialize local data
 void LoopRotate::initialize() {
   L = NULL;



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


Re: [llvm-commits] New llvm-test regressions

2007-04-09 Thread Chris Lattner

On Apr 9, 2007, at 9:16 AM, Jeff Cohen wrote:

> Changes in the last 24 hours have caused additional failures in
> llvm-tests:  burg, spiff, lencode, espresso and cdecl.

These (and many others) all failed for my tester last night, but seem  
ok.  Make sure to update your llvm-gcc tree.

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


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopRotation.cpp

2007-04-09 Thread Devang Patel


Changes in directory llvm/lib/Transforms/Scalar:

LoopRotation.cpp updated: 1.4 -> 1.5
---
Log message:

Simpler for() loops.


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

 LoopRotation.cpp |   40 +---
 1 files changed, 17 insertions(+), 23 deletions(-)


Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp
diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.4 
llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.5
--- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.4 Mon Apr  9 11:41:46 2007
+++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr  9 12:09:13 2007
@@ -73,7 +73,7 @@
 
 /// Find Replacement information for instruction. Return NULL if it is
 /// not available.
-RenameData *findReplacementData(Instruction *I);
+const RenameData *findReplacementData(Instruction *I);
 
   private:
 
@@ -179,13 +179,10 @@
 
   NewPreHeader = new BasicBlock("bb.nph", OrigHeader->getParent(), OrigHeader);
   BasicBlock::iterator I = OrigHeader->begin(), E = OrigHeader->end();
-  for (; I != E; ++I) {
+  PHINode *PN = NULL;
+  for (; (PN = dyn_cast(I)); ++I) {
 Instruction *In = I;
 
-PHINode *PN = dyn_cast(I);
-if (!PN)
-  break;
-
 // Create new PHI node with one value incoming from OrigPreHeader.
 // NewPreHeader has only one predecessor, OrigPreHeader.
 PHINode *NPH = new PHINode(In->getType(), In->getName());
@@ -235,10 +232,8 @@
   // Update new pre-header.
   // Rename values that are defined in original header to reflects values
   // defined in new pre-header.
-  for (SmallVector::iterator 
- I = LoopHeaderInfo.begin(), E = LoopHeaderInfo.end(); I != E; ++I) {
-
-const RenameData &ILoopHeaderInfo = *I;
+  for(unsigned LHI = 0, LHI_E = LoopHeaderInfo.size(); LHI != LHI_E; ++LHI) {
+const RenameData &ILoopHeaderInfo = LoopHeaderInfo[LHI];
 Instruction *In = ILoopHeaderInfo.Original;
 Instruction *C = ILoopHeaderInfo.PreHeader;
 
@@ -253,12 +248,12 @@
 
 for (unsigned opi = 0, e = In->getNumOperands(); opi != e; ++opi) {
   if (Instruction *OpPhi = dyn_cast(In->getOperand(opi))) {
-if (RenameData *D = findReplacementData(OpPhi))
+if (const RenameData *D = findReplacementData(OpPhi))
   C->setOperand(opi, D->PreHeader);
   }
   else if (Instruction *OpInsn = 
dyn_cast(In->getOperand(opi))) {
-if (RenameData *D = findReplacementData(OpInsn))
+if (const RenameData *D = findReplacementData(OpInsn))
   C->setOperand(opi, D->PreHeader);
   }
 }
@@ -282,10 +277,9 @@
   // 2) Inside loop but not in original header
   //
   //Replace this use to reflect definition from new header.
-  for (SmallVector::iterator 
- I = LoopHeaderInfo.begin(), E = LoopHeaderInfo.end(); I != E; ++I) {
+  for(unsigned LHI = 0, LHI_E = LoopHeaderInfo.size(); LHI != LHI_E; ++LHI) {
+const RenameData &ILoopHeaderInfo = LoopHeaderInfo[LHI];
 
-const RenameData &ILoopHeaderInfo = *I;
 if (!ILoopHeaderInfo.Header)
   continue;
 
@@ -318,7 +312,7 @@
 if (PU->getBasicBlockIndex(NewHeader) != -1
 && PU->getIncomingValueForBlock(NewHeader) == U)
   continue;
-
+
U->replaceUsesOfWith(OldPhi, NewPhi);
continue;
   }
@@ -385,7 +379,7 @@
 if (PN->getBasicBlockIndex(NewPreHeader) != -1)
   return;
 
-RenameData *ILoopHeaderInfo;
+const RenameData *ILoopHeaderInfo;
 Value *V = PN->getIncomingValueForBlock(OrigHeader);
 if (isa(V) && 
 (ILoopHeaderInfo = findReplacementData(cast(V {
@@ -427,13 +421,13 @@
 
 /// Find Replacement information for instruction. Return NULL if it is
 /// not available.
-RenameData *LoopRotate::findReplacementData(Instruction *In) {
+const RenameData *LoopRotate::findReplacementData(Instruction *In) {
 
   // Since LoopHeaderInfo is small, linear walk is OK.
-  for (SmallVector::iterator 
- I = LoopHeaderInfo.begin(), E = LoopHeaderInfo.end(); I != E; ++I) 
-if (I->Original == In)
-  return &(*I);
-
+  for(unsigned LHI = 0, LHI_E = LoopHeaderInfo.size(); LHI != LHI_E; ++LHI) {
+const RenameData &ILoopHeaderInfo = LoopHeaderInfo[LHI];
+if (ILoopHeaderInfo.Original == In)
+  return &ILoopHeaderInfo;
+  }
   return NULL;
 }



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


Re: [llvm-commits] New llvm-test regressions

2007-04-09 Thread Jeff Cohen

Reid Spencer wrote:

On Mon, 2007-04-09 at 09:16 -0700, Jeff Cohen wrote:
  
Changes in the last 24 hours have caused additional failures in 
llvm-tests:  burg, spiff, lencode, espresso and cdecl.



I have been assuming these are a result of the PR1146 changes which
require llvm-gcc changes. Is that the issue or something else?


I don't know.  I didn't investigate.
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] New llvm-test regressions

2007-04-09 Thread Jeff Cohen
Chris Lattner wrote:
>
> On Apr 9, 2007, at 9:16 AM, Jeff Cohen wrote:
>
>> Changes in the last 24 hours have caused additional failures in
>> llvm-tests:  burg, spiff, lencode, espresso and cdecl.
>
> These (and many others) all failed for my tester last night, but seem 
> ok.  Make sure to update your llvm-gcc tree.
>
> -Chris

I did.

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


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

2007-04-09 Thread Chris Lattner

The function and callinst dtors need to delete their attributes.

-Chris

On Apr 9, 2007, at 8:01 AM, Reid Spencer wrote:

>
>
> Changes in directory llvm/lib/VMCore:
>
> Function.cpp updated: 1.116 -> 1.117
> Instructions.cpp updated: 1.81 -> 1.82
> Type.cpp updated: 1.179 -> 1.180
> ---
> Log message:
>
> For PR1146: http://llvm.org/PR1146 :
> * Add ParamAttrList pointers to Function and CallInst.
> * Move the implementation of ParamAttrList from Type.cpp to  
> Function.cpp

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


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

2007-04-09 Thread Chris Lattner
> For PR1146: http://llvm.org/PR1146 :
> * Add ParamAttrList pointers to Function and CallInst.
> * Move the implementation of ParamAttrList from Type.cpp to  
> Function.cpp

Don't forget InvokeInst.

-Chris

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


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

2007-04-09 Thread Reid Spencer


Changes in directory llvm/lib/VMCore:

Type.cpp updated: 1.180 -> 1.181
---
Log message:

Remove a memory leak, until ParamAttrsList is uniqued.


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

 Type.cpp |6 +-
 1 files changed, 5 insertions(+), 1 deletion(-)


Index: llvm/lib/VMCore/Type.cpp
diff -u llvm/lib/VMCore/Type.cpp:1.180 llvm/lib/VMCore/Type.cpp:1.181
--- llvm/lib/VMCore/Type.cpp:1.180  Mon Apr  9 10:01:12 2007
+++ llvm/lib/VMCore/Type.cppMon Apr  9 12:20:18 2007
@@ -1098,7 +1098,11 @@
 
   FunctionValType VT(ReturnType, Params, isVarArg, Attrs);
   FunctionType *MT = FunctionTypes->get(VT);
-  if (MT) return MT;
+  if (MT) { 
+delete Attrs; // not needed any more
+return MT;
+  }
+
 
   MT = (FunctionType*) new char[sizeof(FunctionType) + 
 sizeof(PATypeHandle)*(Params.size()+1)];



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


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

2007-04-09 Thread Reid Spencer
On Mon, 2007-04-09 at 10:14 -0700, Chris Lattner wrote:
> The function and callinst dtors need to delete their attributes.

No one is setting these yet so there's no leaks. The next patch will
unique the attributes in which case they should *not* be deleted.  Use
of ParamAttrsList in Function and CallInst won't begin until the
uniquing is implemented.  

Speaking of which, do these need to be refcounted so they go away when
the last use disappears?

> 
> -Chris
> 
> On Apr 9, 2007, at 8:01 AM, Reid Spencer wrote:
> 
> >
> >
> > Changes in directory llvm/lib/VMCore:
> >
> > Function.cpp updated: 1.116 -> 1.117
> > Instructions.cpp updated: 1.81 -> 1.82
> > Type.cpp updated: 1.179 -> 1.180
> > ---
> > Log message:
> >
> > For PR1146: http://llvm.org/PR1146 :
> > * Add ParamAttrList pointers to Function and CallInst.
> > * Move the implementation of ParamAttrList from Type.cpp to  
> > Function.cpp
> 
> ___
> llvm-commits mailing list
> llvm-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


signature.asc
Description: This is a digitally signed message part
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2007-04-09 Thread Chris Lattner
> Next stage into switch lowering refactoring
> 1. Fix some bugs in the jump table lowering threshold
> 2. Implement much better metric for optimal pivot selection
> 3. Tune thresholds for different lowering methods
> 4. Implement shift-and trick for lowering small ( length) cases with few destinations. Good testcase will follow.

Oooh, very cool.

> @@ -1484,20 +1593,33 @@
>
>uint64_t LSize = FrontCase.size();
>uint64_t RSize = TSize-LSize;
> +  DOUT << "Selecting best pivot: \n"
> +   << "First: " << First << ", Last: " << Last <<"\n"
> +   << "LSize: " << LSize << ", RSize: " << RSize << "\n";
>for (CaseItr I = CR.Range.first, J=I+1, E = CR.Range.second;
> J!=E; ++I, ++J) {
>  int64_t LEnd = cast(I->High)->getSExtValue();
>  int64_t RBegin = cast(J->Low)->getSExtValue();
> +assert((RBegin-LEnd>=1) && "Invalid case distance");
>  double LDensity = (double)LSize / (double)((LEnd - First) +  
> 1ULL);
>  double RDensity = (double)RSize / (double)((Last - RBegin) +  
> 1ULL);
> -if (Density < (LDensity + RDensity)) {
> +double Metric = log(RBegin-LEnd)*(LDensity+RDensity);

Is there any metric you can use here other than something based on  
'log'?  Can you do this determination with integer arithmetic?

> @@ -1549,6 +1671,130 @@
>return true;
>  }
>
> +/// handleBitTestsSwitchCase - if current case range has few  
> destination and
> +/// range span less, than machine word bitwidth, encode case range  
> into series
> +/// of masks and emit bit tests with these masks.
> +bool SelectionDAGLowering::handleBitTestsSwitchCase(CaseRec& CR,
> +CaseRecVector&  
> WorkList,
> +Value* SV,
> + 
> MachineBasicBlock* Default) {
> +  unsigned IntPtrBits = getSizeInBits(TLI.getPointerTy());
...
> +  if (range>IntPtrBits ||

Using intptr here is a good first step.  However, some targets has  
GPR's wider than intptr_t that are efficient (e.g. a ppc64 chip  
running in ppc32 mode).

Overall, very very nice Anton,

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


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

2007-04-09 Thread Chris Lattner

On Apr 9, 2007, at 10:22 AM, Reid Spencer wrote:

> On Mon, 2007-04-09 at 10:14 -0700, Chris Lattner wrote:
>> The function and callinst dtors need to delete their attributes.
>
> No one is setting these yet so there's no leaks.

I understand.

> The next patch will
> unique the attributes in which case they should *not* be deleted.  Use
> of ParamAttrsList in Function and CallInst won't begin until the
> uniquing is implemented.

Uniquing is tricky in the face of mutation.  I'd suggest doing an  
intermediate increment where you *just* move the attributes to call/ 
invoke/function without uniquing, then unique them as another step.

> Speaking of which, do these need to be refcounted so they go away when
> the last use disappears?

Yep, that sounds good.

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


Re: [llvm-commits] CVS: llvm-www/SVNMigration.html

2007-04-09 Thread Andrew Lenharth
On 4/6/07, Reid Spencer <[EMAIL PROTECTED]> wrote:
> +  yet, but you can visit:
> +  http://subversion.cs.uiuc.edu/viewvc/llvm";>ViewVC and
> +  http://subversion.cs.uiuc.edu/pub/svn/llvm";>Public SVN.

Would it make sense to have svn.llvm.org be an alias to
subversion.cs.uiuc.edu and use that as the published host name on
various web pages in llvm.org?

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


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

2007-04-09 Thread Reid Spencer
On Mon, 2007-04-09 at 10:14 -0700, Chris Lattner wrote:
> > For PR1146: http://llvm.org/PR1146 :
> > * Add ParamAttrList pointers to Function and CallInst.
> > * Move the implementation of ParamAttrList from Type.cpp to  
> > Function.cpp
> 
> Don't forget InvokeInst.

That always bites me. I keep thinking Invoke is a subclass of Call but
its a subclass of Terminator.  Yet another reason for getting rid of
invoke.
> 
> -Chris
> 
> ___
> llvm-commits mailing list
> llvm-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


signature.asc
Description: This is a digitally signed message part
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm-www/SVNMigration.html

2007-04-09 Thread Reid Spencer
Hi Andrew,

On Mon, 2007-04-09 at 12:31 -0500, Andrew Lenharth wrote:
> On 4/6/07, Reid Spencer <[EMAIL PROTECTED]> wrote:
> > +  yet, but you can visit:
> > +  http://subversion.cs.uiuc.edu/viewvc/llvm";>ViewVC and
> > +  http://subversion.cs.uiuc.edu/pub/svn/llvm";>Public SVN.
> 
> Would it make sense to have svn.llvm.org be an alias to
> subversion.cs.uiuc.edu and use that as the published host name on
> various web pages in llvm.org?

Yes, that's the plan. David is looking into the UIUC policy for this. I
don't expect a problem since llvm.org already points into uiuc.

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


signature.asc
Description: This is a digitally signed message part
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm-www/SVNMigration.html

2007-04-09 Thread Chris Lattner

On Apr 9, 2007, at 10:31 AM, Andrew Lenharth wrote:

> On 4/6/07, Reid Spencer <[EMAIL PROTECTED]> wrote:
>> +  yet, but you can visit:
>> +  http://subversion.cs.uiuc.edu/viewvc/llvm";>ViewVC and
>> +  http://subversion.cs.uiuc.edu/pub/svn/llvm";>Public  
>> SVN.
>
> Would it make sense to have svn.llvm.org be an alias to
> subversion.cs.uiuc.edu and use that as the published host name on
> various web pages in llvm.org?

Yes it does, done!

-Chris

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


Re: [llvm-commits] CVS: llvm-www/SVNMigration.html

2007-04-09 Thread Chris Lattner

On Apr 9, 2007, at 10:36 AM, Reid Spencer wrote:

> Hi Andrew,
>
> On Mon, 2007-04-09 at 12:31 -0500, Andrew Lenharth wrote:
>> On 4/6/07, Reid Spencer <[EMAIL PROTECTED]> wrote:
>>> +  yet, but you can visit:
>>> +  http://subversion.cs.uiuc.edu/viewvc/llvm";>ViewVC  
>>> and
>>> +  http://subversion.cs.uiuc.edu/pub/svn/llvm";>Public  
>>> SVN.
>>
>> Would it make sense to have svn.llvm.org be an alias to
>> subversion.cs.uiuc.edu and use that as the published host name on
>> various web pages in llvm.org?
>
> Yes, that's the plan. David is looking into the UIUC policy for  
> this. I
> don't expect a problem since llvm.org already points into uiuc.

I already set up the DNS so that svn.llvm.org points to  
subversion.cs.uiuc.edu.

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


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

2007-04-09 Thread Reid Spencer


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.64 -> 1.65
---
Log message:

For PR1146: http://llvm.org/PR1146 :
* Add ParamAttrs to InvokeInst class too.
* Make sure all initializes of ParamAttrs in CallInst and InvokeInst are 0
* Destruct the ParamAttrs in Call/Invoke destructors to avoid memory 
  leaks. This will change when ParamAttrsList is uniquified but needs to
  be correct until then.


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

 Instructions.h |   19 ---
 1 files changed, 16 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.64 
llvm/include/llvm/Instructions.h:1.65
--- llvm/include/llvm/Instructions.h:1.64   Mon Apr  9 10:01:12 2007
+++ llvm/include/llvm/Instructions.hMon Apr  9 13:00:57 2007
@@ -737,10 +737,11 @@
 SubclassData = (SubclassData & 1) | (CC << 1);
   }
 
-  /// Obtains a constant pointer to the ParamAttrsList object which holds the
-  /// parameter attributes information, if any. 
+  /// Obtains a pointer to the ParamAttrsList object which holds the
+  /// parameter attributes information, if any.
+  /// @returns 0 if no attributes have been set.
   /// @brief Get the parameter attributes.
-  const ParamAttrsList *getParamAttrs() const { return ParamAttrs; }
+  ParamAttrsList *getParamAttrs() const { return ParamAttrs; }
 
   /// Sets the parameter attributes for this CallInst. To construct a 
   /// ParamAttrsList, see ParameterAttributes.h
@@ -1445,6 +1446,7 @@
 /// calling convention of the call.
 ///
 class InvokeInst : public TerminatorInst {
+  ParamAttrsList *ParamAttrs;
   InvokeInst(const InvokeInst &BI);
   void init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
 Value* const *Args, unsigned NumArgs);
@@ -1466,6 +1468,17 @@
 SubclassData = CC;
   }
 
+  /// Obtains a pointer to the ParamAttrsList object which holds the
+  /// parameter attributes information, if any.
+  /// @returns 0 if no attributes have been set.
+  /// @brief Get the parameter attributes.
+  ParamAttrsList *getParamAttrs() const { return ParamAttrs; }
+
+  /// Sets the parameter attributes for this InvokeInst. To construct a 
+  /// ParamAttrsList, see ParameterAttributes.h
+  /// @brief Set the parameter attributes.
+  void setParamAttrs(ParamAttrsList *attrs) { ParamAttrs = attrs; }
+
   /// getCalledFunction - Return the function called, or null if this is an
   /// indirect function invocation.
   ///



___
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

2007-04-09 Thread Reid Spencer


Changes in directory llvm/lib/VMCore:

Instructions.cpp updated: 1.82 -> 1.83
---
Log message:

For PR1146: http://llvm.org/PR1146 :
* Add ParamAttrs to InvokeInst class too.
* Make sure all initializes of ParamAttrs in CallInst and InvokeInst are 0
* Destruct the ParamAttrs in Call/Invoke destructors to avoid memory 
  leaks. This will change when ParamAttrsList is uniquified but needs to
  be correct until then.


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

 Instructions.cpp |6 ++
 1 files changed, 6 insertions(+)


Index: llvm/lib/VMCore/Instructions.cpp
diff -u llvm/lib/VMCore/Instructions.cpp:1.82 
llvm/lib/VMCore/Instructions.cpp:1.83
--- llvm/lib/VMCore/Instructions.cpp:1.82   Mon Apr  9 10:01:12 2007
+++ llvm/lib/VMCore/Instructions.cppMon Apr  9 13:00:57 2007
@@ -17,6 +17,7 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Function.h"
 #include "llvm/Instructions.h"
+#include "llvm/ParameterAttributes.h"
 #include "llvm/Support/CallSite.h"
 #include "llvm/Support/ConstantRange.h"
 using namespace llvm;
@@ -185,6 +186,7 @@
 
 CallInst::~CallInst() {
   delete [] OperandList;
+  delete ParamAttrs; // FIXME: ParamAttrsList should be uniqued!
 }
 
 void CallInst::init(Value *Func, Value* const *Params, unsigned NumParams) {
@@ -337,6 +339,7 @@
 CallInst::CallInst(const CallInst &CI)
   : Instruction(CI.getType(), Instruction::Call, new Use[CI.getNumOperands()],
 CI.getNumOperands()) {
+  ParamAttrs = 0;
   SubclassData = CI.SubclassData;
   Use *OL = OperandList;
   Use *InOL = CI.OperandList;
@@ -351,10 +354,12 @@
 
 InvokeInst::~InvokeInst() {
   delete [] OperandList;
+  delete ParamAttrs; // FIXME: ParamAttrsList should be uniqued!
 }
 
 void InvokeInst::init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
   Value* const *Args, unsigned NumArgs) {
+  ParamAttrs = 0;
   NumOperands = 3+NumArgs;
   Use *OL = OperandList = new Use[3+NumArgs];
   OL[0].init(Fn, this);
@@ -402,6 +407,7 @@
 InvokeInst::InvokeInst(const InvokeInst &II)
   : TerminatorInst(II.getType(), Instruction::Invoke,
new Use[II.getNumOperands()], II.getNumOperands()) {
+  ParamAttrs = 0;
   SubclassData = II.SubclassData;
   Use *OL = OperandList, *InOL = II.OperandList;
   for (unsigned i = 0, e = II.getNumOperands(); i != e; ++i)



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


[llvm-commits] Ignore .svn directories when installing include files

2007-04-09 Thread Scott Michel
Speeds up installation a bit... s/b ignoring them anyway, just like
CVS directories.


-scooter
Index: Makefile.rules
===
--- Makefile.rules  (.../trunk) (revision 2452)
+++ Makefile.rules  (.../branches/llvm-spu) (revision 2452)
@@ -1691,7 +1691,7 @@
$(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
  cd $(PROJ_SRC_ROOT)/include && \
  for  hdr in `find . -type f '!' '(' -name '*~' -o -name '.cvsignore' \
- -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS ` ; do \
+ -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS | grep -v 
.svn` ; do \
instdir=`dirname "$(PROJ_includedir)/$$hdr"` ; \
if test \! -d "$$instdir" ; then \
  $(EchoCmd) Making install directory $$instdir ; \
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopRotation.cpp

2007-04-09 Thread Devang Patel


Changes in directory llvm/lib/Transforms/Scalar:

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

Do not create new pre-header. Reuse original pre-header.


---
Diffs of the changes:  (+57 -73)

 LoopRotation.cpp |  130 ---
 1 files changed, 57 insertions(+), 73 deletions(-)


Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp
diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.5 
llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.6
--- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.5 Mon Apr  9 12:09:13 2007
+++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr  9 14:04:21 2007
@@ -33,11 +33,11 @@
 
   class VISIBILITY_HIDDEN RenameData {
   public:
-RenameData(Instruction *O, Instruction *P, Instruction *H) 
+RenameData(Instruction *O, Value *P, Instruction *H) 
   : Original(O), PreHeader(P), Header(H) { }
   public:
 Instruction *Original; // Original instruction
-Instruction *PreHeader; // New pre-header replacement
+Value *PreHeader; // Original pre-header replacement
 Instruction *Header; // New header replacement
   };
   
@@ -65,7 +65,7 @@
 
 /// Make sure all Exit block PHINodes have required incoming values.
 /// If incoming value is constant or defined outside the loop then
-/// PHINode may not have an entry for new pre-header. 
+/// PHINode may not have an entry for original pre-header. 
 void  updateExitBlock();
 
 /// Return true if this instruction is used outside original header.
@@ -82,7 +82,6 @@
 BasicBlock *OrigPreHeader;
 BasicBlock *OrigLatch;
 BasicBlock *NewHeader;
-BasicBlock *NewPreHeader;
 BasicBlock *Exit;
 
 SmallVector LoopHeaderInfo;
@@ -125,6 +124,9 @@
   if (!OrigHeader || !OrigLatch || !OrigPreHeader)
 return false;
 
+  if (!OrigHeader || !OrigLatch || !OrigPreHeader)
+return false;
+
   // If loop header is not one of the loop exit block then
   // either this loop is already rotated or it is not 
   // suitable for loop rotation transformations.
@@ -164,42 +166,40 @@
   // Now, this loop is suitable for rotation.
 
   // Copy PHI nodes and other instructions from original header
-  // into new pre-header. Unlike original header, new pre-header is
-  // not a member of loop. New pre-header has only one predecessor,
-  // that is original loop pre-header.
+  // into original pre-header. Unlike original header, original pre-header is
+  // not a member of loop. 
   //
   // New loop header is one and only successor of original header that 
   // is inside the loop. All other original header successors are outside 
   // the loop. Copy PHI Nodes from original header into new loop header. 
-  // Add second incoming value, from new loop pre-header into these phi 
+  // Add second incoming value, from original loop pre-header into these phi 
   // nodes. If a value defined in original header is used outside original 
   // header then new loop header will need new phi nodes with two incoming 
   // values, one definition from original header and second definition is 
-  // from new loop pre-header (which is a clone of original header definition).
+  // from original loop pre-header.
 
-  NewPreHeader = new BasicBlock("bb.nph", OrigHeader->getParent(), OrigHeader);
+  // Remove terminator from Original pre-header. Original pre-header will
+  // receive a clone of original header terminator as a new terminator.
+  OrigPreHeader->getInstList().pop_back();
   BasicBlock::iterator I = OrigHeader->begin(), E = OrigHeader->end();
   PHINode *PN = NULL;
   for (; (PN = dyn_cast(I)); ++I) {
 Instruction *In = I;
 
-// Create new PHI node with one value incoming from OrigPreHeader.
-// NewPreHeader has only one predecessor, OrigPreHeader.
-PHINode *NPH = new PHINode(In->getType(), In->getName());
-NPH->addIncoming(PN->getIncomingValueForBlock(OrigPreHeader), 
- OrigPreHeader);
-NewPreHeader->getInstList().push_back(NPH);
-
+// PHI nodes are not copied into original pre-header. Instead their values
+// are directly propagated.
+Value * NPV = PN->getIncomingValueForBlock(OrigPreHeader);
+
 // Create new PHI node with two incoming values for NewHeader.
 // One incoming value is from OrigLatch (through OrigHeader) and 
-// second incoming value is from NewPreHeader.
+// second incoming value is from original pre-header.
 PHINode *NH = new PHINode(In->getType(), In->getName());
 NH->addIncoming(PN->getIncomingValueForBlock(OrigLatch), OrigHeader);
-NH->addIncoming(NPH, NewPreHeader);
+NH->addIncoming(NPV, OrigPreHeader);
 NewHeader->getInstList().push_front(NH);
 
-// "In" can be replaced by NPH or NH at various places.
-LoopHeaderInfo.push_back(RenameData(In, NPH, NH));
+// "In" can be replaced by NH at various places.
+LoopHeaderInfo.push_back(RenameData(In, NPV, NH));
   }
 
   // Now, handle non-phi instructions.
@@ -207,20 +207,

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

2007-04-09 Thread Reid Spencer


Changes in directory llvm:

Makefile.rules updated: 1.429 -> 1.430
---
Log message:

Speed up installation a bit by ignoring .svn directories. 

Patch by Scott Michel.


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

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


Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.429 llvm/Makefile.rules:1.430
--- llvm/Makefile.rules:1.429   Thu Mar 29 14:05:44 2007
+++ llvm/Makefile.rules Mon Apr  9 14:08:58 2007
@@ -1691,7 +1691,8 @@
$(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
  cd $(PROJ_SRC_ROOT)/include && \
  for  hdr in `find . -type f '!' '(' -name '*~' -o -name '.cvsignore' \
- -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS ` ; do \
+ -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS | \
+ grep -v .svn` ; do \
instdir=`dirname "$(PROJ_includedir)/$$hdr"` ; \
if test \! -d "$$instdir" ; then \
  $(EchoCmd) Making install directory $$instdir ; \



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


Re: [llvm-commits] Ignore .svn directories when installing include files

2007-04-09 Thread Reid Spencer
Committed. Thanks. Watch those line lengths :)

Reid.

On Mon, 2007-04-09 at 11:57 -0700, Scott Michel wrote:
> Speeds up installation a bit... s/b ignoring them anyway, just like
> CVS directories.
> 
> 
> -scooter
> ___
> llvm-commits mailing list
> llvm-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

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


[llvm-commits] CVS: llvm/lib/Transforms/Hello/Makefile

2007-04-09 Thread Reid Spencer


Changes in directory llvm/lib/Transforms/Hello:

Makefile updated: 1.6 -> 1.7
---
Log message:

Don't link against System or Support library. These things will already 
be in the opt tool.


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

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


Index: llvm/lib/Transforms/Hello/Makefile
diff -u llvm/lib/Transforms/Hello/Makefile:1.6 
llvm/lib/Transforms/Hello/Makefile:1.7
--- llvm/lib/Transforms/Hello/Makefile:1.6  Mon Aug  7 18:12:15 2006
+++ llvm/lib/Transforms/Hello/Makefile  Mon Apr  9 14:17:47 2007
@@ -10,7 +10,7 @@
 LEVEL = ../../..
 LIBRARYNAME = LLVMHello
 LOADABLE_MODULE = 1
-USEDLIBS = LLVMSupport.a LLVMSystem.a
+USEDLIBS = 
 
 include $(LEVEL)/Makefile.common
 



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


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopRotation.cpp

2007-04-09 Thread Devang Patel


Changes in directory llvm/lib/Transforms/Scalar:

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

Preserve canonical loop form.


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

 LoopRotation.cpp |   60 ++-
 1 files changed, 55 insertions(+), 5 deletions(-)


Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp
diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.6 
llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.7
--- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.6 Mon Apr  9 14:04:21 2007
+++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr  9 15:19:46 2007
@@ -75,6 +75,11 @@
 /// not available.
 const RenameData *findReplacementData(Instruction *I);
 
+/// After loop rotation, loop pre-header has multiple sucessors.
+/// Insert one forwarding basic block to ensure that loop pre-header
+/// has only one successor.
+void preserveCanonicalLoopForm(LPPassManager &LPM);
+
   private:
 
 Loop *L;
@@ -121,11 +126,8 @@
   if (L->getBlocks().size() == 1)
 return false;
 
-  if (!OrigHeader || !OrigLatch || !OrigPreHeader)
-return false;
-
-  if (!OrigHeader || !OrigLatch || !OrigPreHeader)
-return false;
+  assert (OrigHeader && OrigLatch && OrigPreHeader &&
+  "Loop is not in cannocial form");
 
   // If loop header is not one of the loop exit block then
   // either this loop is already rotated or it is not 
@@ -344,6 +346,8 @@
   // Make NewHeader as the new header for the loop.
   L->moveToHeader(NewHeader);
 
+  preserveCanonicalLoopForm(LPM);
+
   NumRotated++;
   return true;
 }
@@ -415,3 +419,49 @@
   }
   return NULL;
 }
+
+/// After loop rotation, loop pre-header has multiple sucessors.
+/// Insert one forwarding basic block to ensure that loop pre-header
+/// has only one successor.
+void LoopRotate::preserveCanonicalLoopForm(LPPassManager &LPM) {
+
+  // Right now original pre-header has two successors, new header and
+  // exit block. Insert new block between original pre-header and
+  // new header such that loop's new pre-header has only one successor.
+  BasicBlock *NewPreHeader = new BasicBlock("bb.nph", OrigHeader->getParent(), 
+OrigPreHeader);
+  LoopInfo &LI = LPM.getAnalysis();
+  if (Loop *PL = LI.getLoopFor(OrigPreHeader))
+PL->addBasicBlockToLoop(NewPreHeader, LI);
+  new BranchInst(NewHeader, NewPreHeader);
+  
+  BranchInst *OrigPH_BI = cast(OrigPreHeader->getTerminator());
+  if (OrigPH_BI->getSuccessor(0) == NewHeader)
+OrigPH_BI->setSuccessor(0, NewPreHeader);
+  else {
+assert (OrigPH_BI->getSuccessor(1) == NewPreHeader &&
+"Unexpected original pre-header terminator");
+OrigPH_BI->setSuccessor(1, NewPreHeader);
+  }
+  
+  for (BasicBlock::iterator I = NewHeader->begin(), E = NewHeader->end();
+   I != E; ++I) {
+Instruction *In = I;
+PHINode *PN = dyn_cast(In);
+if (!PN)
+  break;
+
+int index = PN->getBasicBlockIndex(OrigPreHeader);
+assert (index != -1 && "Expected incoming value from Original PreHeader");
+PN->setIncomingBlock(index, NewPreHeader);
+assert (PN->getBasicBlockIndex(OrigPreHeader) == -1 && 
+"Expected only one incoming value from Original PreHeader");
+  }
+
+  assert (NewHeader && L->getHeader() == NewHeader 
+  && "Invalid loop header after loop rotation");
+  assert (NewPreHeader && L->getLoopPreheader() == NewPreHeader
+  && "Invalid loop preheader after loop rotation");
+  assert (L->getLoopLatch() 
+  && "Invalid loop latch after loop rotation");
+}



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


[llvm-commits] [see] CVS: llvm-poolalloc/lib/DSA/Local.cpp

2007-04-09 Thread John Criswell


Changes in directory llvm-poolalloc/lib/DSA:

Local.cpp updated: 1.158.2.4.2.8 -> 1.158.2.4.2.9
---
Log message:

Reversed the order of metapools when merging.  This ensures that the object
on which we call the merge() method is never NULL.


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

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


Index: llvm-poolalloc/lib/DSA/Local.cpp
diff -u llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.4.2.8 
llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.4.2.9
--- llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.4.2.8  Tue Mar 13 20:24:01 2007
+++ llvm-poolalloc/lib/DSA/Local.cppMon Apr  9 15:20:07 2007
@@ -1466,7 +1466,7 @@
   if (L.getPool() != N.getPool()) {
 std::cerr << "kmem_cache_alloc recovered merge\n";
 MetaPoolHandle L(locs[V]), N(DSH.getNode()->getMP());
-locs[V]->merge(DSH.getNode()->getMP());
+DSH.getNode()->getMP()->merge(locs[V]);
   }
   locs[V] = DSH.getNode()->getMP();
 }



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


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

2007-04-09 Thread Chris Lattner


Changes in directory llvm/lib/Bytecode/Reader:

Reader.cpp updated: 1.246 -> 1.247
---
Log message:

Fix a bug where calling materializeModule could corrupt the module, reading
multiple copies of the function into the Function*.


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

 Reader.cpp |   17 -
 1 files changed, 8 insertions(+), 9 deletions(-)


Index: llvm/lib/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.246 
llvm/lib/Bytecode/Reader/Reader.cpp:1.247
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.246   Mon Apr  9 01:14:31 2007
+++ llvm/lib/Bytecode/Reader/Reader.cpp Mon Apr  9 15:28:40 2007
@@ -1672,15 +1672,14 @@
 return true;
   }
 
-  LazyFunctionMap::iterator Fi = LazyFunctionLoadMap.begin();
-  LazyFunctionMap::iterator Fe = LazyFunctionLoadMap.end();
-
-  while (Fi != Fe) {
-Function* Func = Fi->first;
-BlockStart = At = Fi->second.Buf;
-BlockEnd = Fi->second.EndBuf;
-ParseFunctionBody(Func);
-++Fi;
+  for (LazyFunctionMap::iterator I = LazyFunctionLoadMap.begin(),
+   E = LazyFunctionLoadMap.end(); I != E; ++I) {
+Function *Func = I->first;
+if (Func->hasNotBeenReadFromBytecode()) {
+  BlockStart = At = I->second.Buf;
+  BlockEnd = I->second.EndBuf;
+  ParseFunctionBody(Func);
+}
   }
   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

2007-04-09 Thread Chris Lattner


Changes in directory llvm/include/llvm/Target:

TargetLowering.h updated: 1.119 -> 1.120
---
Log message:

add a default ctor for AddrMode.


---
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.119 
llvm/include/llvm/Target/TargetLowering.h:1.120
--- llvm/include/llvm/Target/TargetLowering.h:1.119 Fri Mar 30 23:05:24 2007
+++ llvm/include/llvm/Target/TargetLowering.h   Mon Apr  9 16:18:34 2007
@@ -872,6 +872,7 @@
 int64_t  BaseOffs;
 bool HasBaseReg;
 int64_t  Scale;
+AddrMode() : BaseGV(0), BaseOffs(0), HasBaseReg(false), Scale(0) {}
   };
   
   /// isLegalAddressingMode - Return true if the addressing mode represented by



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


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopRotation.cpp

2007-04-09 Thread Devang Patel


Changes in directory llvm/lib/Transforms/Scalar:

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

Insert new pre-header before new header. Original pre-header may
happen to be an entry, in such case, it is not a good idea to
insert new block before entry.

Also fix typo in assertion check.


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

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


Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp
diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.7 
llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.8
--- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.7 Mon Apr  9 15:19:46 2007
+++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr  9 16:40:43 2007
@@ -429,7 +429,7 @@
   // exit block. Insert new block between original pre-header and
   // new header such that loop's new pre-header has only one successor.
   BasicBlock *NewPreHeader = new BasicBlock("bb.nph", OrigHeader->getParent(), 
-OrigPreHeader);
+NewHeader);
   LoopInfo &LI = LPM.getAnalysis();
   if (Loop *PL = LI.getLoopFor(OrigPreHeader))
 PL->addBasicBlockToLoop(NewPreHeader, LI);
@@ -439,7 +439,7 @@
   if (OrigPH_BI->getSuccessor(0) == NewHeader)
 OrigPH_BI->setSuccessor(0, NewPreHeader);
   else {
-assert (OrigPH_BI->getSuccessor(1) == NewPreHeader &&
+assert (OrigPH_BI->getSuccessor(1) == NewHeader &&
 "Unexpected original pre-header terminator");
 OrigPH_BI->setSuccessor(1, NewPreHeader);
   }



___
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-04-09 Thread Anton Korobeynikov


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.411 -> 1.412
---
Log message:

Use integer log for metric calculation


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

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


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.411 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.412
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.411Mon Apr  9 
09:32:59 2007
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Mon Apr  9 16:57:03 2007
@@ -1604,7 +1604,7 @@
 assert((RBegin-LEnd>=1) && "Invalid case distance");
 double LDensity = (double)LSize / (double)((LEnd - First) + 1ULL);
 double RDensity = (double)RSize / (double)((Last - RBegin) + 1ULL);
-double Metric = log(double(RBegin-LEnd))*(LDensity+RDensity);
+double Metric = Log2_64(RBegin-LEnd)*(LDensity+RDensity);
 // Should always split in some non-trivial place
 DOUT <<"=>Step\n"
  << "LEnd: " << LEnd << ", RBegin: " << RBegin << "\n"
@@ -1620,7 +1620,7 @@
 RSize -= J->size();
   }
   // If our case is dense we *really* should handle it earlier!
-  assert((FMetric != 0) && "Should handle dense range earlier!");
+  assert((FMetric > 0) && "Should handle dense range earlier!");
   
   CaseRange LHSR(CR.Range.first, Pivot);
   CaseRange RHSR(Pivot, CR.Range.second);



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

2007-04-09 Thread Chris Lattner


Changes in directory llvm/lib/Target/PowerPC:

PPCISelLowering.cpp updated: 1.268 -> 1.269
---
Log message:

Fix a bug in PPCTargetLowering::isLegalAddressingMode, scales other than 0/1/2
are always unsupported.


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

 PPCISelLowering.cpp |3 +++
 1 files changed, 3 insertions(+)


Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.268 
llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.269
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.268   Tue Apr  3 08:59:52 2007
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Mon Apr  9 17:10:05 2007
@@ -3389,6 +3389,9 @@
   return false;
 // Allow 2*r as r+r.
 break;
+  default:
+// No other scales are supported.
+return false;
   }
   
   return true;



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


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopRotation.cpp

2007-04-09 Thread Devang Patel


Changes in directory llvm/lib/Transforms/Scalar:

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

Check _all_ PHINodes.


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

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


Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp
diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.8 
llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.9
--- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.8 Mon Apr  9 16:40:43 2007
+++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr  9 17:20:10 2007
@@ -366,7 +366,7 @@
 
 // There is already one incoming value from original pre-header block.
 if (PN->getBasicBlockIndex(OrigPreHeader) != -1)
-  return;
+  continue;
 
 const RenameData *ILoopHeaderInfo;
 Value *V = PN->getIncomingValueForBlock(OrigHeader);



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


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp

2007-04-09 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

LoopStrengthReduce.cpp updated: 1.127 -> 1.128
---
Log message:

switch LSR to use isLegalAddressingMode instead of other simpler hooks


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

 LoopStrengthReduce.cpp |   39 +--
 1 files changed, 21 insertions(+), 18 deletions(-)


Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.127 
llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.128
--- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.127 Sat Apr  7 
02:17:27 2007
+++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp   Mon Apr  9 17:20:14 2007
@@ -143,8 +143,7 @@
 const TargetLowering *TLI;
 
   public:
-LoopStrengthReduce(const TargetLowering *tli = NULL)
-  : TLI(tli) {
+LoopStrengthReduce(const TargetLowering *tli = NULL) : TLI(tli) {
 }
 
 bool runOnLoop(Loop *L, LPPassManager &LPM);
@@ -631,20 +630,25 @@
  const TargetLowering *TLI) {
   if (SCEVConstant *SC = dyn_cast(V)) {
 int64_t VC = SC->getValue()->getSExtValue();
-if (TLI)
-  return TLI->isLegalAddressImmediate(VC, UseTy);
-else
+if (TLI) {
+  TargetLowering::AddrMode AM;
+  AM.BaseOffs = VC;
+  return TLI->isLegalAddressingMode(AM, UseTy);
+} else {
   // Defaults to PPC. PPC allows a sign-extended 16-bit immediate field.
   return (VC > -(1 << 16) && VC < (1 << 16)-1);
+}
   }
 
   if (SCEVUnknown *SU = dyn_cast(V))
 if (ConstantExpr *CE = dyn_cast(SU->getValue()))
-  if (CE->getOpcode() == Instruction::PtrToInt) {
+  if (TLI && CE->getOpcode() == Instruction::PtrToInt) {
 Constant *Op0 = CE->getOperand(0);
-if (isa(Op0) && TLI &&
-TLI->isLegalAddressImmediate(cast(Op0)))
-  return true;
+if (GlobalValue *GV = dyn_cast(Op0)) {
+  TargetLowering::AddrMode AM;
+  AM.BaseGV = GV;
+  return TLI->isLegalAddressingMode(AM, UseTy);
+}
   }
   return false;
 }
@@ -889,18 +893,11 @@
 }
 
 /// ValidStride - Check whether the given Scale is valid for all loads and 
-/// stores in UsersToProcess.  Pulled into a function to avoid disturbing the
-/// sensibilities of those who dislike goto's.
+/// stores in UsersToProcess.
 ///
 bool LoopStrengthReduce::ValidStride(int64_t Scale, 
const std::vector& UsersToProcess) {
-  int64_t Imm;
   for (unsigned i=0, e = UsersToProcess.size(); i!=e; ++i) {
-if (SCEVConstant *SC = dyn_cast(UsersToProcess[i].Imm))
-  Imm = SC->getValue()->getSExtValue();
-else
-  Imm = 0;
-
 // If this is a load or other access, pass the type of the access in.
 const Type *AccessTy = Type::VoidTy;
 if (StoreInst *SI = dyn_cast(UsersToProcess[i].Inst))
@@ -908,7 +905,13 @@
 else if (LoadInst *LI = dyn_cast(UsersToProcess[i].Inst))
   AccessTy = LI->getType();
 
-if (!TLI->isLegalAddressScaleAndImm(Scale, Imm, AccessTy))
+TargetLowering::AddrMode AM;
+if (SCEVConstant *SC = dyn_cast(UsersToProcess[i].Imm))
+  AM.BaseOffs = SC->getValue()->getSExtValue();
+AM.Scale = Scale;
+
+// If load[imm+r*scale] is illegal, bail out.
+if (!TLI->isLegalAddressingMode(AM, AccessTy))
   return false;
   }
   return true;



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


[llvm-commits] CVS: llvm/test/Transforms/LoopRotate/LRCrash-1.ll LRCrash-2.ll LRCrash-3.ll LRCrash-4.ll PhiRename-1.ll PhiSelfRefernce-1.ll dg.exp

2007-04-09 Thread Devang Patel


Changes in directory llvm/test/Transforms/LoopRotate:

LRCrash-1.ll added (r1.1)
LRCrash-2.ll added (r1.1)
LRCrash-3.ll added (r1.1)
LRCrash-4.ll added (r1.1)
PhiRename-1.ll added (r1.1)
PhiSelfRefernce-1.ll added (r1.1)
dg.exp added (r1.1)
---
Log message:

Add Loop Rotate test cases.


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

 LRCrash-1.ll |   27 ++
 LRCrash-2.ll |   30 
 LRCrash-3.ll |   41 ++
 LRCrash-4.ll |   20 ++
 PhiRename-1.ll   |   94 +++
 PhiSelfRefernce-1.ll |   41 ++
 dg.exp   |3 +
 7 files changed, 256 insertions(+)


Index: llvm/test/Transforms/LoopRotate/LRCrash-1.ll
diff -c /dev/null llvm/test/Transforms/LoopRotate/LRCrash-1.ll:1.1
*** /dev/null   Mon Apr  9 17:22:52 2007
--- llvm/test/Transforms/LoopRotate/LRCrash-1.llMon Apr  9 17:22:42 2007
***
*** 0 
--- 1,27 
+ ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-rotate -disable-output
+ 
+ 
+   %struct.relation = type { [4 x i16], i32, [4 x i16], i32, i32 }
+ 
+ 
+ 
+ 
+ 
+ 
+ void @findAllPairs() {
+ entry:
+   br i1 false, label %bb139, label %bb10.i44
+ 
+ bb10.i44: ; preds = %entry
+   ret void
+ 
+ bb127:; preds = %bb139
+   br label %bb139
+ 
+ bb139:; preds = %bb127, %entry
+   br i1 false, label %bb127, label %bb142
+ 
+ bb142:; preds = %bb139
+   %r91.0.lcssa = phi %struct.relation* [ null, %bb139 ]   ; 
<%struct.relation*> [#uses=0]
+   ret void
+ }


Index: llvm/test/Transforms/LoopRotate/LRCrash-2.ll
diff -c /dev/null llvm/test/Transforms/LoopRotate/LRCrash-2.ll:1.1
*** /dev/null   Mon Apr  9 17:22:59 2007
--- llvm/test/Transforms/LoopRotate/LRCrash-2.llMon Apr  9 17:22:42 2007
***
*** 0 
--- 1,30 
+ ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-rotate -disable-output
+ 
+ void @findAllPairs() {
+ entry:
+   br i1 false, label %bb139, label %cond_true
+ 
+ cond_true:; preds = %entry
+   ret void
+ 
+ bb90: ; preds = %bb139
+   br i1 false, label %bb136, label %cond_next121
+ 
+ cond_next121: ; preds = %bb90
+   br i1 false, label %bb136, label %bb127
+ 
+ bb127:; preds = %cond_next121
+   br label %bb136
+ 
+ bb136:; preds = %bb127, %cond_next121, %bb90
+   %changes.1 = phi i32 [ %changes.2, %bb90 ], [ %changes.2, %cond_next121 
], [ 1, %bb127 ];  [#uses=1]
+   br label %bb139
+ 
+ bb139:; preds = %bb136, %entry
+   %changes.2 = phi i32 [ %changes.1, %bb136 ], [ 0, %entry ]  
;  [#uses=3]
+   br i1 false, label %bb90, label %bb142
+ 
+ bb142:; preds = %bb139
+   %changes.2.lcssa = phi i32 [ %changes.2, %bb139 ]   ;  
[#uses=0]
+   ret void
+ }


Index: llvm/test/Transforms/LoopRotate/LRCrash-3.ll
diff -c /dev/null llvm/test/Transforms/LoopRotate/LRCrash-3.ll:1.1
*** /dev/null   Mon Apr  9 17:22:59 2007
--- llvm/test/Transforms/LoopRotate/LRCrash-3.llMon Apr  9 17:22:42 2007
***
*** 0 
--- 1,41 
+ ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-rotate -disable-output
+ 
+ 
+ 
+ 
+ void @_ZN9Classfile4readEv() {
+ entry:
+   br i1 false, label %cond_false485, label %bb405
+ 
+ bb405:; preds = %entry
+   ret void
+ 
+ cond_false485:; preds = %entry
+   br label %bb830
+ 
+ bb511:; preds = %bb830
+   br i1 false, label %bb816, label %bb830
+ 
+ cond_next667: ; preds = %bb816
+   br i1 false, label %cond_next695, label %bb680
+ 
+ bb676:; preds = %bb680
+   br label %bb680
+ 
+ bb680:; preds = %bb676, %cond_next667
+   %iftmp.68.0 = zext i1 false to i8   ;  [#uses=1]
+   br i1 false, label %bb676, label %cond_next695
+ 
+ cond_next695: ; preds = %bb680, %cond_next667
+   %iftmp.68.2 = phi i8 [ %iftmp.68.0, %bb680 ], [ undef, %cond_next667 ]  
;  [#uses=0]
+   ret void
+ 
+ bb816:; preds = %bb816, %bb511
+   br i1 false, label %cond_next667, label %bb816
+ 
+ bb830:; preds = %bb511, %cond_false485
+   br i1 false, label %bb511, label %bb835
+ 
+ bb835:; preds = %bb830
+   ret void
+ }


Index: llvm/test/Transforms/LoopRotate/LRCrash-4.ll
diff -c /dev/null llvm/test/Transforms/LoopRotate/LRCrash-4.ll:1.1
*** /dev/null   Mon Apr  9 17:22:59 2007
--- llvm/test/Transforms/LoopRotate/LRCrash-4.llMon Apr  9 17:22:42 2007
***
*** 0 
--- 1,20 
+ ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-rotate -disable-output
+ 
+ 
+ void @InterpretSEIMessage(i8* %msg) {
+ entry:
+   br label %bb15
+ 
+ bb6:  ; preds = %bb15
+   %tmp11 = getelementptr i8* %msg, i32 %offset.1   

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

2007-04-09 Thread Owen Anderson


Changes in directory llvm/lib/Transforms/Utils:

LoopSimplify.cpp updated: 1.85 -> 1.86
---
Log message:

Improve some _slow_ behavior introduced in my patches the last few days.


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

 LoopSimplify.cpp |   84 +++
 1 files changed, 42 insertions(+), 42 deletions(-)


Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp
diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.85 
llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.86
--- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.85 Sun Apr  8 19:52:49 2007
+++ llvm/lib/Transforms/Utils/LoopSimplify.cpp  Mon Apr  9 17:25:09 2007
@@ -673,6 +673,16 @@
   UpdateDomInfoForRevectoredPreds(BEBlock, BackedgeBlocks);
 }
 
+// Returns true if BasicBlock A dominates at least one block in vector B
+// Helper function for UpdateDomInfoForRevectoredPreds
+static bool BlockDominatesAny(BasicBlock* A, std::vector& B, 
ETForest& ETF) {
+   for (std::vector::iterator BI = B.begin(), BE = B.end(); 
BI != BE; ++BI) {
+   if (ETF.dominates(A, *BI))
+   return true;
+   }
+   return false;
+}
+
 /// UpdateDomInfoForRevectoredPreds - This method is used to update the four
 /// different kinds of dominator information (immediate dominators,
 /// dominator trees, et-forest and dominance frontiers) after a new block has
@@ -841,47 +851,37 @@
 // blocks that dominate a block in PredBlocks and contained NewBBSucc in
 // their dominance frontier must be updated to contain NewBB instead.
 //
-for (unsigned i = 0, e = PredBlocks.size(); i != e; ++i) {
-  BasicBlock *Pred = PredBlocks[i];
-  // Get all of the dominators of the predecessor...
-  // FIXME: There's probably a better way to do this...
-  std::vector PredDoms;
-  for (Function::iterator I = Pred->getParent()->begin(),
-   E = Pred->getParent()->end(); I != E; ++I)
-if (ETF.dominates(&(*I), Pred))
-  PredDoms.push_back(I);
-  
-  for (std::vector::const_iterator PDI = PredDoms.begin(),
- PDE = PredDoms.end(); PDI != PDE; ++PDI) {
-BasicBlock *PredDom = *PDI;
-
-// If the NewBBSucc node is in DF(PredDom), then PredDom didn't
-// dominate NewBBSucc but did dominate a predecessor of it.  Now we
-// change this entry to include NewBB in the DF instead of NewBBSucc.
-DominanceFrontier::iterator DFI = DF->find(PredDom);
-assert(DFI != DF->end() && "No dominance frontier for node?");
-if (DFI->second.count(NewBBSucc)) {
-  // If NewBBSucc should not stay in our dominator frontier, remove it.
-  // We remove it unless there is a predecessor of NewBBSucc that we
-  // dominate, but we don't strictly dominate NewBBSucc.
-  bool ShouldRemove = true;
-  if (PredDom == NewBBSucc || !ETF.dominates(PredDom, NewBBSucc)) {
-// Okay, we know that PredDom does not strictly dominate NewBBSucc.
-// Check to see if it dominates any predecessors of NewBBSucc.
-for (pred_iterator PI = pred_begin(NewBBSucc),
-   E = pred_end(NewBBSucc); PI != E; ++PI)
-  if (ETF.dominates(PredDom, *PI)) {
-ShouldRemove = false;
-break;
-  }
-  }
-
-  if (ShouldRemove)
-DF->removeFromFrontier(DFI, NewBBSucc);
-  DF->addToFrontier(DFI, NewBB);
-}
-  }
-}
-  }
+for (Function::iterator FI = NewBB->getParent()->begin(),
+FE = NewBB->getParent()->end(); FI != FE; 
++FI) {
+   DominanceFrontier::iterator DFI = DF->find(FI);
+   if (DFI == DF->end()) continue;  // unreachable block.
+   
+   // Only consider dominators of NewBBSucc
+   if (!DFI->second.count(NewBBSucc)) continue;
+   if (BlockDominatesAny(FI, PredBlocks, ETF)) {
+   // If NewBBSucc should not stay in our 
dominator frontier, remove it.
+   // We remove it unless there is a predecessor 
of NewBBSucc that we
+   // dominate, but we don't strictly dominate 
NewBBSucc.
+   bool ShouldRemove = true;
+   if ((BasicBlock*)FI == NewBBSucc || 
!ETF.dominates(FI, NewBBSucc)) {
+   // Okay, we know that PredDom does not 
strictly dominate NewBBSucc.
+   // Check to see if it dominates any 
predecessors of NewBBSucc.
+   for (pred_iterator PI = 
pred_begin(NewBBSucc),
+E = 
pred_end(NewBBSucc); PI != E; ++PI)
+   if (ETF.dominates(FI, *PI)) {
+

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

2007-04-09 Thread Chris Lattner


Changes in directory llvm/lib/Target/ARM:

ARMISelLowering.cpp updated: 1.39 -> 1.40
ARMISelLowering.h updated: 1.11 -> 1.12
---
Log message:

remove some dead target hooks, subsumed by isLegalAddressingMode


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

 ARMISelLowering.cpp |   18 --
 ARMISelLowering.h   |   12 
 2 files changed, 30 deletions(-)


Index: llvm/lib/Target/ARM/ARMISelLowering.cpp
diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.39 
llvm/lib/Target/ARM/ARMISelLowering.cpp:1.40
--- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.39Tue Apr  3 19:06:07 2007
+++ llvm/lib/Target/ARM/ARMISelLowering.cpp Mon Apr  9 17:25:41 2007
@@ -1441,24 +1441,6 @@
   }
 }
 
-/// isLegalAddressScaleAndImm - Return true if S works for IsLegalAddressScale
-/// and V works for isLegalAddressImmediate _and_ both can be applied
-/// simultaneously to the same instruction.
-bool ARMTargetLowering::isLegalAddressScaleAndImm(int64_t S, int64_t V, 
-   const Type* Ty) const {
-  if (V == 0)
-return isLegalAddressScale(S, Ty);
-  return false;
-}
-
-/// isLegalAddressScaleAndImm - Return true if S works for IsLegalAddressScale
-/// and GV works for isLegalAddressImmediate _and_ both can be applied
-/// simultaneously to the same instruction.
-bool ARMTargetLowering::isLegalAddressScaleAndImm(int64_t S, GlobalValue *GV,
-  const Type* Ty) const {
-  return false;
-}
-
 static bool getIndexedAddressParts(SDNode *Ptr, MVT::ValueType VT,
bool isSEXTLoad, SDOperand &Base,
SDOperand &Offset, bool &isInc,


Index: llvm/lib/Target/ARM/ARMISelLowering.h
diff -u llvm/lib/Target/ARM/ARMISelLowering.h:1.11 
llvm/lib/Target/ARM/ARMISelLowering.h:1.12
--- llvm/lib/Target/ARM/ARMISelLowering.h:1.11  Sun Apr  1 20:30:03 2007
+++ llvm/lib/Target/ARM/ARMISelLowering.h   Mon Apr  9 17:25:41 2007
@@ -99,18 +99,6 @@
 /// type.
 virtual bool isLegalAddressScale(int64_t S, const Type *Ty) const;
 
-/// isLegalAddressScaleAndImm - Return true if S works for 
-/// IsLegalAddressScale and V works for isLegalAddressImmediate _and_ 
-/// both can be applied simultaneously to the same instruction.
-virtual bool isLegalAddressScaleAndImm(int64_t S, int64_t V, 
-   const Type *Ty) const;
-
-/// isLegalAddressScaleAndImm - Return true if S works for 
-/// IsLegalAddressScale and GV works for isLegalAddressImmediate _and_
-/// both can be applied simultaneously to the same instruction.
-virtual bool isLegalAddressScaleAndImm(int64_t S, GlobalValue *GV,
-   const Type *Ty) const;
-
 /// getPreIndexedAddressParts - returns true by value, base pointer and
 /// offset pointer and addressing mode by reference if the node's address
 /// can be legally represented as pre-indexed load / store address.



___
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

2007-04-09 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.386 -> 1.387
X86ISelLowering.h updated: 1.95 -> 1.96
---
Log message:

remove some dead target hooks, subsumed by isLegalAddressingMode


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

 X86ISelLowering.cpp |   16 
 X86ISelLowering.h   |   12 
 2 files changed, 28 deletions(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.386 
llvm/lib/Target/X86/X86ISelLowering.cpp:1.387
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.386   Mon Apr  9 00:49:22 2007
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Mon Apr  9 17:26:30 2007
@@ -4127,22 +4127,6 @@
   }
 }
 
-/// isLegalAddressScaleAndImm - Return true if S works for IsLegalAddressScale
-/// and V works for isLegalAddressImmediate _and_ both can be applied
-/// simultaneously to the same instruction.
-bool X86TargetLowering::isLegalAddressScaleAndImm(int64_t S, int64_t V, 
-   const Type* Ty) const {
-  return isLegalAddressScale(S, Ty) && isLegalAddressImmediate(V, Ty);
-}
-
-/// isLegalAddressScaleAndImm - Return true if S works for IsLegalAddressScale
-/// and GV works for isLegalAddressImmediate _and_ both can be applied
-/// simultaneously to the same instruction.
-bool X86TargetLowering::isLegalAddressScaleAndImm(int64_t S, GlobalValue *GV,
-  const Type* Ty) const {
-  return isLegalAddressScale(S, Ty) && isLegalAddressImmediate(GV);
-}
-
 /// isShuffleMaskLegal - Targets can use this to indicate that they only
 /// support *some* VECTOR_SHUFFLE operations, those with specific masks.
 /// By default, if a target supports the VECTOR_SHUFFLE node, all mask values


Index: llvm/lib/Target/X86/X86ISelLowering.h
diff -u llvm/lib/Target/X86/X86ISelLowering.h:1.95 
llvm/lib/Target/X86/X86ISelLowering.h:1.96
--- llvm/lib/Target/X86/X86ISelLowering.h:1.95  Fri Mar 30 18:15:24 2007
+++ llvm/lib/Target/X86/X86ISelLowering.h   Mon Apr  9 17:26:30 2007
@@ -353,18 +353,6 @@
 /// type.
 virtual bool isLegalAddressScale(int64_t S, const Type *Ty) const;
 
-/// isLegalAddressScaleAndImm - Return true if S works for 
-/// IsLegalAddressScale and V works for isLegalAddressImmediate _and_ 
-/// both can be applied simultaneously to the same instruction.
-virtual bool isLegalAddressScaleAndImm(int64_t S, int64_t V, 
-   const Type *Ty) const;
-
-/// isLegalAddressScaleAndImm - Return true if S works for 
-/// IsLegalAddressScale and GV works for isLegalAddressImmediate _and_
-/// both can be applied simultaneously to the same instruction.
-virtual bool isLegalAddressScaleAndImm(int64_t S, GlobalValue *GV,
-   const Type *Ty) const;
-
 /// isShuffleMaskLegal - Targets can use this to indicate that they only
 /// support *some* VECTOR_SHUFFLE operations, those with specific masks.
 /// By default, if a target supports the VECTOR_SHUFFLE node, all mask



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

2007-04-09 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

TargetLowering.cpp updated: 1.105 -> 1.106
---
Log message:

remove some dead target hooks, subsumed by isLegalAddressingMode


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

 TargetLowering.cpp |   17 -
 1 files changed, 17 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.105 
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.106
--- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.105  Fri Mar 30 
23:05:24 2007
+++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cppMon Apr  9 17:27:04 2007
@@ -1993,23 +1993,6 @@
   return false;
 }
 
-/// isLegalAddressScaleAndImm - Return true if S works for IsLegalAddressScale
-/// and V works for isLegalAddressImmediate _and_ both can be applied
-/// simultaneously to the same instruction.
-bool TargetLowering::isLegalAddressScaleAndImm(int64_t S, int64_t V, 
-   const Type* Ty) const {
-  return false;
-}
-
-/// isLegalAddressScaleAndImm - Return true if S works for IsLegalAddressScale
-/// and GV works for isLegalAddressImmediate _and_ both can be applied
-/// simultaneously to the same instruction.
-bool TargetLowering::isLegalAddressScaleAndImm(int64_t S, GlobalValue *GV,
-   const Type* Ty) const {
-
-  return false;
-}
-
 // Magic for divide replacement
 
 struct ms {



___
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

2007-04-09 Thread Chris Lattner


Changes in directory llvm/include/llvm/Target:

TargetLowering.h updated: 1.120 -> 1.121
---
Log message:

remove some dead target hooks, subsumed by isLegalAddressingMode


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

 TargetLowering.h |   11 ---
 1 files changed, 11 deletions(-)


Index: llvm/include/llvm/Target/TargetLowering.h
diff -u llvm/include/llvm/Target/TargetLowering.h:1.120 
llvm/include/llvm/Target/TargetLowering.h:1.121
--- llvm/include/llvm/Target/TargetLowering.h:1.120 Mon Apr  9 16:18:34 2007
+++ llvm/include/llvm/Target/TargetLowering.h   Mon Apr  9 17:27:04 2007
@@ -893,17 +893,6 @@
   /// scale of the target addressing mode for load / store of the given type.
   virtual bool isLegalAddressScale(int64_t S, const Type *Ty) const;
 
-  /// isLegalAddressScaleAndImm - Return true if S works for 
IsLegalAddressScale
-  /// and V works for isLegalAddressImmediate _and_ both can be applied
-  /// simultaneously to the same instruction.
-  virtual bool isLegalAddressScaleAndImm(int64_t S, int64_t V, 
-const Type* Ty) const;
-  /// isLegalAddressScaleAndImm - Return true if S works for 
IsLegalAddressScale
-  /// and GV works for isLegalAddressImmediate _and_ both can be applied
-  /// simultaneously to the same instruction.
-  virtual bool isLegalAddressScaleAndImm(int64_t S, GlobalValue *GV,
-const Type* Ty) const;
-
   
//======//
   // Div utility functions
   //



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


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

2007-04-09 Thread Owen Anderson


Changes in directory llvm/lib/Transforms/Utils:

LoopSimplify.cpp updated: 1.86 -> 1.87
---
Log message:

Tabs -> Spaces


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

 LoopSimplify.cpp |   72 +++
 1 files changed, 36 insertions(+), 36 deletions(-)


Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp
diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.86 
llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.87
--- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.86 Mon Apr  9 17:25:09 2007
+++ llvm/lib/Transforms/Utils/LoopSimplify.cpp  Mon Apr  9 17:31:43 2007
@@ -420,7 +420,7 @@
 /// FindPHIToPartitionLoops - The first part of loop-nestification is to find a
 /// PHI node that tells us how to partition the loops.
 static PHINode *FindPHIToPartitionLoops(Loop *L, ETForest *EF, 
-   AliasAnalysis *AA) {
+  AliasAnalysis *AA) {
   for (BasicBlock::iterator I = L->getHeader()->begin(); isa(I); ) {
 PHINode *PN = cast(I);
 ++I;
@@ -676,11 +676,11 @@
 // Returns true if BasicBlock A dominates at least one block in vector B
 // Helper function for UpdateDomInfoForRevectoredPreds
 static bool BlockDominatesAny(BasicBlock* A, std::vector& B, 
ETForest& ETF) {
-   for (std::vector::iterator BI = B.begin(), BE = B.end(); 
BI != BE; ++BI) {
-   if (ETF.dominates(A, *BI))
-   return true;
-   }
-   return false;
+  for (std::vector::iterator BI = B.begin(), BE = B.end(); BI != 
BE; ++BI) {
+if (ETF.dominates(A, *BI))
+  return true;
+  }
+  return false;
 }
 
 /// UpdateDomInfoForRevectoredPreds - This method is used to update the four
@@ -852,36 +852,36 @@
 // their dominance frontier must be updated to contain NewBB instead.
 //
 for (Function::iterator FI = NewBB->getParent()->begin(),
-FE = NewBB->getParent()->end(); FI != FE; 
++FI) {
-   DominanceFrontier::iterator DFI = DF->find(FI);
-   if (DFI == DF->end()) continue;  // unreachable block.
-   
-   // Only consider dominators of NewBBSucc
-   if (!DFI->second.count(NewBBSucc)) continue;
-   if (BlockDominatesAny(FI, PredBlocks, ETF)) {
-   // If NewBBSucc should not stay in our 
dominator frontier, remove it.
-   // We remove it unless there is a predecessor 
of NewBBSucc that we
-   // dominate, but we don't strictly dominate 
NewBBSucc.
-   bool ShouldRemove = true;
-   if ((BasicBlock*)FI == NewBBSucc || 
!ETF.dominates(FI, NewBBSucc)) {
-   // Okay, we know that PredDom does not 
strictly dominate NewBBSucc.
-   // Check to see if it dominates any 
predecessors of NewBBSucc.
-   for (pred_iterator PI = 
pred_begin(NewBBSucc),
-E = 
pred_end(NewBBSucc); PI != E; ++PI)
-   if (ETF.dominates(FI, *PI)) {
-   ShouldRemove = false;
-   break;
-   }
- 
-   if (ShouldRemove)
-   DF->removeFromFrontier(DFI, 
NewBBSucc);
-   DF->addToFrontier(DFI, NewBB);
-   
-   break;
-   }
-   }
-   }
-   }
+ FE = NewBB->getParent()->end(); FI != FE; ++FI) {
+  DominanceFrontier::iterator DFI = DF->find(FI);
+  if (DFI == DF->end()) continue;  // unreachable block.
+  
+  // Only consider dominators of NewBBSucc
+  if (!DFI->second.count(NewBBSucc)) continue;
+  if (BlockDominatesAny(FI, PredBlocks, ETF)) {
+// If NewBBSucc should not stay in our dominator frontier, remove it.
+// We remove it unless there is a predecessor of NewBBSucc that we
+// dominate, but we don't strictly dominate NewBBSucc.
+bool ShouldRemove = true;
+if ((BasicBlock*)FI == NewBBSucc || !ETF.dominates(FI, NewBBSucc)) {
+  // Okay, we know that PredDom does not strictly dominate NewBBSucc.
+  // Check to see if it dominates any predecessors of NewBBSucc.
+  for (pred_iterator PI = pred_begin(NewBBSucc),
+   E = pred_end(NewBBSucc); PI != E; ++PI)
+if (ETF.dominates(FI, *PI)) {
+  ShouldRemove = false;
+  break;
+}
+  
+  if (ShouldRemove)
+DF->removeFromFro

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

2007-04-09 Thread Chris Lattner

>  /// FindPHIToPartitionLoops - The first part of loop-nestification  
> is to find a
>  /// PHI node that tells us how to partition the loops.
>  static PHINode *FindPHIToPartitionLoops(Loop *L, ETForest *EF,
> - AliasAnalysis *AA) {
> +  AliasAnalysis *AA) {

This is still indented funkily :)

> @@ -676,11 +676,11 @@
>  // Returns true if BasicBlock A dominates at least one block in  
> vector B
>  // Helper function for UpdateDomInfoForRevectoredPreds
>  static bool BlockDominatesAny(BasicBlock* A,  
> std::vector& B, ETForest& ETF) {

The vector and ETF should be const.

> @@ -852,36 +852,36 @@
>  // their dominance frontier must be updated to contain NewBB  
> instead.
>  //
>  for (Function::iterator FI = NewBB->getParent()->begin(),
> + FE = NewBB->getParent()->end(); FI != FE; ++FI) {
> +  DominanceFrontier::iterator DFI = DF->find(FI);
> +  if (DFI == DF->end()) continue;  // unreachable block.
> +
> +  // Only consider dominators of NewBBSucc
> +  if (!DFI->second.count(NewBBSucc)) continue;
> +  if (BlockDominatesAny(FI, PredBlocks, ETF)) {

Please add a blank line between these two.  :)

Thanks Owen! nice work,

-Chris



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


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

2007-04-09 Thread Owen Anderson


Changes in directory llvm/lib/Transforms/Utils:

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

Const-ify some parameters, and some cosmetic cleanups.  No functionality 
change.


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

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


Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp
diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.87 
llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.88
--- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.87 Mon Apr  9 17:31:43 2007
+++ llvm/lib/Transforms/Utils/LoopSimplify.cpp  Mon Apr  9 17:54:50 2007
@@ -419,8 +419,8 @@
 
 /// FindPHIToPartitionLoops - The first part of loop-nestification is to find a
 /// PHI node that tells us how to partition the loops.
-static PHINode *FindPHIToPartitionLoops(Loop *L, ETForest *EF, 
-  AliasAnalysis *AA) {
+static PHINode *FindPHIToPartitionLoops(Loop *L, ETForest *EF,
+AliasAnalysis *AA) {
   for (BasicBlock::iterator I = L->getHeader()->begin(); isa(I); ) {
 PHINode *PN = cast(I);
 ++I;
@@ -675,7 +675,7 @@
 
 // Returns true if BasicBlock A dominates at least one block in vector B
 // Helper function for UpdateDomInfoForRevectoredPreds
-static bool BlockDominatesAny(BasicBlock* A, std::vector& B, 
ETForest& ETF) {
+static bool BlockDominatesAny(BasicBlock* A, const std::vector& 
B, const ETForest& ETF) {
   for (std::vector::iterator BI = B.begin(), BE = B.end(); BI != 
BE; ++BI) {
 if (ETF.dominates(A, *BI))
   return true;
@@ -858,6 +858,7 @@
   
   // Only consider dominators of NewBBSucc
   if (!DFI->second.count(NewBBSucc)) continue;
+  
   if (BlockDominatesAny(FI, PredBlocks, ETF)) {
 // If NewBBSucc should not stay in our dominator frontier, remove it.
 // We remove it unless there is a predecessor of NewBBSucc that we



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


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

2007-04-09 Thread Owen Anderson


Changes in directory llvm/lib/Transforms/Utils:

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

Unconst-ify stuff that broke the build.


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

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


Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp
diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.88 
llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.89
--- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.88 Mon Apr  9 17:54:50 2007
+++ llvm/lib/Transforms/Utils/LoopSimplify.cpp  Mon Apr  9 18:08:26 2007
@@ -675,7 +675,7 @@
 
 // Returns true if BasicBlock A dominates at least one block in vector B
 // Helper function for UpdateDomInfoForRevectoredPreds
-static bool BlockDominatesAny(BasicBlock* A, const std::vector& 
B, const ETForest& ETF) {
+static bool BlockDominatesAny(BasicBlock* A, std::vector& B, 
ETForest& ETF) {
   for (std::vector::iterator BI = B.begin(), BE = B.end(); BI != 
BE; ++BI) {
 if (ETF.dominates(A, *BI))
   return true;



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


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp

2007-04-09 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

CodeGenPrepare.cpp updated: 1.2 -> 1.3
---
Log message:

eliminate the last uses of some TLI methods.


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

 CodeGenPrepare.cpp |   10 +++---
 1 files changed, 7 insertions(+), 3 deletions(-)


Index: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
diff -u llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.2 
llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.3
--- llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.2   Sun Apr  1 20:35:34 2007
+++ llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp   Mon Apr  9 18:29:07 2007
@@ -536,11 +536,15 @@
 
 // Check if it is possible to fold the expression to address mode.
 if (UseTy && isa(BinOp->getOperand(1))) {
-  uint64_t Scale = TLI.getTargetData()->getTypeSize(UseTy);
   int64_t Cst = 
cast(BinOp->getOperand(1))->getSExtValue();
   // e.g. load (gep i32 * %P, (X+42)) => load (%P + X*4 + 168).
-  if (TLI.isLegalAddressImmediate(Cst*Scale, UseTy) &&
-  (Scale == 1 || TLI.isLegalAddressScale(Scale, UseTy))) {
+  TargetLowering::AddrMode AM;
+  // FIXME: This computation isn't right, scale is incorrect.
+  AM.Scale = TLI.getTargetData()->getTypeSize(UseTy);
+  // FIXME: Should should also include other fixed offsets.
+  AM.BaseOffs = Cst*AM.Scale;
+  
+  if (TLI.isLegalAddressingMode(AM, UseTy)) {
 DestBBs.insert(GEPIBB);
 MadeChange = true;
 break;



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


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

2007-04-09 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.387 -> 1.388
X86ISelLowering.h updated: 1.96 -> 1.97
---
Log message:

remove some dead hooks


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

 X86ISelLowering.cpp |   35 ---
 X86ISelLowering.h   |   14 --
 2 files changed, 49 deletions(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.387 
llvm/lib/Target/X86/X86ISelLowering.cpp:1.388
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.387   Mon Apr  9 17:26:30 2007
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Mon Apr  9 18:31:19 2007
@@ -4092,41 +4092,6 @@
 }
 
 
-/// isLegalAddressImmediate - Return true if the integer value can be used
-/// as the offset of the target addressing mode for load / store of the
-/// given type.
-bool X86TargetLowering::isLegalAddressImmediate(int64_t V,const Type *Ty) 
const{
-  // X86 allows a sign-extended 32-bit immediate field.
-  return (V > -(1LL << 32) && V < (1LL << 32)-1);
-}
-
-/// isLegalAddressImmediate - Return true if the GlobalValue can be used as
-/// the offset of the target addressing mode.
-bool X86TargetLowering::isLegalAddressImmediate(GlobalValue *GV) const {
-  // In 64-bit mode, GV is 64-bit so it won't fit in the 32-bit displacement 
-  // field unless we are in small code model.
-  if (Subtarget->is64Bit() &&
-  getTargetMachine().getCodeModel() != CodeModel::Small)
-return false;
-  
-  return (!Subtarget->GVRequiresExtraLoad(GV, getTargetMachine(), false));
-}
-
-/// isLegalAddressScale - Return true if the integer value can be used as the
-/// scale of the target addressing mode for load / store of the given type.
-bool X86TargetLowering::isLegalAddressScale(int64_t S, const Type *Ty) const {
-  switch (S) {
-  default:
-return false;
-  case 2: case 4: case 8:
-return true;
-  // FIXME: These require both scale + index last and thus more expensive.
-  // How to tell LSR to try for 2, 4, 8 first?
-  case 3: case 5: case 9:
-return true;
-  }
-}
-
 /// isShuffleMaskLegal - Targets can use this to indicate that they only
 /// support *some* VECTOR_SHUFFLE operations, those with specific masks.
 /// By default, if a target supports the VECTOR_SHUFFLE node, all mask values


Index: llvm/lib/Target/X86/X86ISelLowering.h
diff -u llvm/lib/Target/X86/X86ISelLowering.h:1.96 
llvm/lib/Target/X86/X86ISelLowering.h:1.97
--- llvm/lib/Target/X86/X86ISelLowering.h:1.96  Mon Apr  9 17:26:30 2007
+++ llvm/lib/Target/X86/X86ISelLowering.h   Mon Apr  9 18:31:19 2007
@@ -339,20 +339,6 @@
 /// by AM is legal for this target, for a load/store of the specified type.
 virtual bool isLegalAddressingMode(const AddrMode &AM, const Type 
*Ty)const;
 
-/// isLegalAddressImmediate - Return true if the integer value can be used
-/// as the offset of the target addressing mode for load / store of the
-/// given type.
-virtual bool isLegalAddressImmediate(int64_t V, const Type *Ty) const;
-
-/// isLegalAddressImmediate - Return true if the GlobalValue can be used as
-/// the offset of the target addressing mode.
-virtual bool isLegalAddressImmediate(GlobalValue *GV) const;
-
-/// isLegalAddressScale - Return true if the integer value can be used as
-/// the scale of the target addressing mode for load / store of the given
-/// type.
-virtual bool isLegalAddressScale(int64_t S, const Type *Ty) const;
-
 /// isShuffleMaskLegal - Targets can use this to indicate that they only
 /// support *some* VECTOR_SHUFFLE operations, those with specific masks.
 /// By default, if a target supports the VECTOR_SHUFFLE node, all mask



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

2007-04-09 Thread Chris Lattner


Changes in directory llvm/lib/Target/ARM:

ARMISelLowering.cpp updated: 1.40 -> 1.41
ARMISelLowering.h updated: 1.12 -> 1.13
---
Log message:

remove dead target hooks


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

 ARMISelLowering.cpp |  133 +++-
 ARMISelLowering.h   |   14 -
 2 files changed, 49 insertions(+), 98 deletions(-)


Index: llvm/lib/Target/ARM/ARMISelLowering.cpp
diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.40 
llvm/lib/Target/ARM/ARMISelLowering.cpp:1.41
--- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.40Mon Apr  9 17:25:41 2007
+++ llvm/lib/Target/ARM/ARMISelLowering.cpp Mon Apr  9 18:33:39 2007
@@ -1295,66 +1295,14 @@
 //   ARM Optimization Hooks
 
//===--===//
 
-/// isLegalAddressingMode - Return true if the addressing mode represented
-/// by AM is legal for this target, for a load/store of the specified type.
-bool ARMTargetLowering::isLegalAddressingMode(const AddrMode &AM, 
-  const Type *Ty) const {
-  if (!isLegalAddressImmediate(AM.BaseOffs, Ty))
-return false;
-  
-  // Can never fold addr of global into load/store.
-  if (AM.BaseGV) 
-return false;
-  
-  switch (AM.Scale) {
-  case 0:  // no scale reg, must be "r+i" or "r", or "i".
-break;
-  case 1:
-if (Subtarget->isThumb())
-  return false;
-
-  default:
-switch (getValueType(Ty)) {
-default: return false;
-case MVT::i1:
-case MVT::i8:
-case MVT::i32:
-case MVT::i64:
-  // This assumes i64 is legalized to a pair of i32. If not (i.e.
-  // ldrd / strd are used, then its address mode is same as i16.
-  // r + r
-  if (AM.Scale == 1)
-return true;
-  // r + r << imm
-  if (!isPowerOf2_32(AM.Scale & ~1))
-return false;
-case MVT::i16:
-  // r + r
-  if (((unsigned)AM.HasBaseReg + AM.Scale) <= 2)
-return true;
-
-case MVT::isVoid:
-  // Note, we allow "void" uses (basically, uses that aren't loads or
-  // stores), because arm allows folding a scale into many arithmetic
-  // operations.  This should be made more precise and revisited later.
-  
-  // Allow r << imm, but the imm has to be a multiple of two.
-  if (AM.Scale & 1) return false;
-  return isPowerOf2_32(AM.Scale);
-}
-break;
-  }
-  return true;
-}
-
 /// isLegalAddressImmediate - Return true if the integer value can be used
 /// as the offset of the target addressing mode for load / store of the
 /// given type.
-bool ARMTargetLowering::isLegalAddressImmediate(int64_t V,const Type *Ty) 
const{
+static bool isLegalAddressImmediate(int64_t V, MVT::ValueType VT,
+const ARMSubtarget *Subtarget) {
   if (V == 0)
 return true;
 
-  MVT::ValueType VT = getValueType(Ty);
   if (Subtarget->isThumb()) {
 if (V < 0)
   return false;
@@ -1405,42 +1353,59 @@
   }
 }
 
-bool ARMTargetLowering::isLegalAddressImmediate(GlobalValue *GV) const {
-  return false;
-}
-
-/// isLegalAddressScale - Return true if the integer value can be used as
-/// the scale of the target addressing mode for load / store of the given
-/// type.
-bool ARMTargetLowering::isLegalAddressScale(int64_t S, const Type *Ty) const {
-  if (Subtarget->isThumb())
+/// isLegalAddressingMode - Return true if the addressing mode represented
+/// by AM is legal for this target, for a load/store of the specified type.
+bool ARMTargetLowering::isLegalAddressingMode(const AddrMode &AM, 
+  const Type *Ty) const {
+  if (!isLegalAddressImmediate(AM.BaseOffs, getValueType(Ty), Subtarget))
+return false;
+  
+  // Can never fold addr of global into load/store.
+  if (AM.BaseGV) 
 return false;
+  
+  switch (AM.Scale) {
+  case 0:  // no scale reg, must be "r+i" or "r", or "i".
+break;
+  case 1:
+if (Subtarget->isThumb())
+  return false;
 
-  MVT::ValueType VT = getValueType(Ty);
-  switch (VT) {
-  default: return false;
-  case MVT::i1:
-  case MVT::i8:
-  case MVT::i32:
-if (S < 0) S = -S;
-if (S == 1) return true;   // Allow: r + r
+  default:
+switch (getValueType(Ty)) {
+default: return false;
+case MVT::i1:
+case MVT::i8:
+case MVT::i32:
+case MVT::i64:
+  // This assumes i64 is legalized to a pair of i32. If not (i.e.
+  // ldrd / strd are used, then its address mode is same as i16.
+  // r + r
+  if (AM.Scale == 1)
+return true;
+  // r + r << imm
+  if (!isPowerOf2_32(AM.Scale & ~1))
+return false;
+case MVT::i16:
+  // r + r
+  if (((unsigned)AM.HasBaseReg + AM.Scale) <= 2)
+return true;
+
+case MVT::isVoid:
+  // Note, we allow "void" uses (basically, uses that aren't loads or
+  // stores), because arm allows folding a scale into many arithmetic
+  // operations

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

2007-04-09 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

TargetLowering.cpp updated: 1.106 -> 1.107
---
Log message:

remove dead target hooks.


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

 TargetLowering.cpp |   19 ---
 1 files changed, 19 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.106 
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.107
--- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.106  Mon Apr  9 
17:27:04 2007
+++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cppMon Apr  9 18:34:08 2007
@@ -1974,25 +1974,6 @@
   return true;
 }
 
-/// isLegalAddressImmediate - Return true if the integer value can be used as
-/// the offset of the target addressing mode for load / store of the given
-/// type.
-bool TargetLowering::isLegalAddressImmediate(int64_t V, const Type *Ty) const {
-  return false;
-}
-
-/// isLegalAddressImmediate - Return true if the GlobalValue can be used as
-/// the offset of the target addressing mode.
-bool TargetLowering::isLegalAddressImmediate(GlobalValue *GV) const {
-  return false;
-}
-
-/// isLegalAddressScale - Return true if the integer value can be used as the
-/// scale of the target addressing mode for load / store of the given type.
-bool TargetLowering::isLegalAddressScale(int64_t S, const Type *Ty) const {
-  return false;
-}
-
 // Magic for divide replacement
 
 struct ms {



___
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

2007-04-09 Thread Chris Lattner


Changes in directory llvm/include/llvm/Target:

TargetLowering.h updated: 1.121 -> 1.122
---
Log message:

remove dead target hooks.


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

 TargetLowering.h |   13 -
 1 files changed, 13 deletions(-)


Index: llvm/include/llvm/Target/TargetLowering.h
diff -u llvm/include/llvm/Target/TargetLowering.h:1.121 
llvm/include/llvm/Target/TargetLowering.h:1.122
--- llvm/include/llvm/Target/TargetLowering.h:1.121 Mon Apr  9 17:27:04 2007
+++ llvm/include/llvm/Target/TargetLowering.h   Mon Apr  9 18:34:08 2007
@@ -879,19 +879,6 @@
   /// AM is legal for this target, for a load/store of the specified type.
   /// TODO: Handle pre/postinc as well.
   virtual bool isLegalAddressingMode(const AddrMode &AM, const Type *Ty) const;
-  
-  /// isLegalAddressImmediate - Return true if the integer value can be used as
-  /// the offset of the target addressing mode for load / store of the given
-  /// type.
-  virtual bool isLegalAddressImmediate(int64_t V, const Type *Ty) const;
-
-  /// isLegalAddressImmediate - Return true if the GlobalValue can be used as
-  /// the offset of the target addressing mode.
-  virtual bool isLegalAddressImmediate(GlobalValue *GV) const;
-
-  /// isLegalAddressScale - Return true if the integer value can be used as the
-  /// scale of the target addressing mode for load / store of the given type.
-  virtual bool isLegalAddressScale(int64_t S, const Type *Ty) const;
 
   
//======//
   // Div utility functions



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


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

2007-04-09 Thread Owen Anderson


Changes in directory llvm/lib/Transforms/Utils:

LoopSimplify.cpp updated: 1.89 -> 1.90
---
Log message:

Re-constify things that don't break the build.  Last patch in this 
series, I promise.


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

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


Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp
diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.89 
llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.90
--- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.89 Mon Apr  9 18:08:26 2007
+++ llvm/lib/Transforms/Utils/LoopSimplify.cpp  Mon Apr  9 18:38:18 2007
@@ -675,8 +675,10 @@
 
 // Returns true if BasicBlock A dominates at least one block in vector B
 // Helper function for UpdateDomInfoForRevectoredPreds
-static bool BlockDominatesAny(BasicBlock* A, std::vector& B, 
ETForest& ETF) {
-  for (std::vector::iterator BI = B.begin(), BE = B.end(); BI != 
BE; ++BI) {
+static bool BlockDominatesAny(BasicBlock* A, const std::vector& B,
+  ETForest& ETF) {
+  for (std::vector::const_iterator BI = B.begin(), BE = B.end();
+   BI != BE; ++BI) {
 if (ETF.dominates(A, *BI))
   return true;
   }



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


[llvm-commits] CVS: llvm/test/Transforms/LoopRotate/PhiRename-1.ll

2007-04-09 Thread Devang Patel


Changes in directory llvm/test/Transforms/LoopRotate:

PhiRename-1.ll updated: 1.1 -> 1.2
---
Log message:

Add check for opt crash.


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

 PhiRename-1.ll |1 +
 1 files changed, 1 insertion(+)


Index: llvm/test/Transforms/LoopRotate/PhiRename-1.ll
diff -u llvm/test/Transforms/LoopRotate/PhiRename-1.ll:1.1 
llvm/test/Transforms/LoopRotate/PhiRename-1.ll:1.2
--- llvm/test/Transforms/LoopRotate/PhiRename-1.ll:1.1  Mon Apr  9 17:22:42 2007
+++ llvm/test/Transforms/LoopRotate/PhiRename-1.ll  Mon Apr  9 18:40:15 2007
@@ -1,3 +1,4 @@
+; RUN: llvm-as < %s | opt -loop-rotate -disable-output &&
 ; RUN: llvm-as < %s | opt -loop-rotate | llvm-dis | not grep "\[ .tmp224" 
 target datalayout = 
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
 



___
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-04-09 Thread Jeff Cohen


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.412 -> 1.413
---
Log message:

No longer needed.

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

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


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.412 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.413
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.412Mon Apr  9 
16:57:03 2007
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Mon Apr  9 18:42:32 2007
@@ -45,7 +45,6 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Compiler.h"
 #include 
-#include 
 using namespace llvm;
 
 #ifndef NDEBUG



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


Re: [llvm-commits] CVS: llvm/test/Transforms/LoopRotate/PhiRename-1.ll

2007-04-09 Thread Reid Spencer
On Mon, 2007-04-09 at 18:40 -0500, Devang Patel wrote:
> 
> Changes in directory llvm/test/Transforms/LoopRotate:
> 
> PhiRename-1.ll updated: 1.1 -> 1.2
> ---
> Log message:
> 
> Add check for opt crash.

This idiom is becoming more and more prevalent. While it works, its also
doubling the runtime of each test its used in. I'm wondering if we could
invest in a "notgrep" script (since we're invoking "not" anyway) that
would fail on empty input. Is this sufficient to avoid having to do
things twice?

> 
> 
> ---
> Diffs of the changes:  (+1 -0)
> 
>  PhiRename-1.ll |1 +
>  1 files changed, 1 insertion(+)
> 
> 
> Index: llvm/test/Transforms/LoopRotate/PhiRename-1.ll
> diff -u llvm/test/Transforms/LoopRotate/PhiRename-1.ll:1.1 
> llvm/test/Transforms/LoopRotate/PhiRename-1.ll:1.2
> --- llvm/test/Transforms/LoopRotate/PhiRename-1.ll:1.1Mon Apr  9 
> 17:22:42 2007
> +++ llvm/test/Transforms/LoopRotate/PhiRename-1.llMon Apr  9 18:40:15 2007
> @@ -1,3 +1,4 @@
> +; RUN: llvm-as < %s | opt -loop-rotate -disable-output &&
>  ; RUN: llvm-as < %s | opt -loop-rotate | llvm-dis | not grep "\[ .tmp224" 
>  target datalayout = 
> "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
>  
> 
> 
> 
> ___
> llvm-commits mailing list
> llvm-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

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


[llvm-commits] CVS: llvm/test/Transforms/InstCombine/set.ll

2007-04-09 Thread Chris Lattner


Changes in directory llvm/test/Transforms/InstCombine:

set.ll updated: 1.21 -> 1.22
---
Log message:

new testcase


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

 set.ll |5 +
 1 files changed, 5 insertions(+)


Index: llvm/test/Transforms/InstCombine/set.ll
diff -u llvm/test/Transforms/InstCombine/set.ll:1.21 
llvm/test/Transforms/InstCombine/set.ll:1.22
--- llvm/test/Transforms/InstCombine/set.ll:1.21Sat Dec 23 00:05:41 2006
+++ llvm/test/Transforms/InstCombine/set.ll Mon Apr  9 18:51:49 2007
@@ -145,3 +145,8 @@
 ret int %tmp.3
 }
 
+bool %test25(uint %A) {
+   %B = and uint %A, 2
+   %C = setgt uint %B, 2
+   ret bool %C
+}



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


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

2007-04-09 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.737 -> 1.738
---
Log message:

Strengthen the boundary conditions of this fold, implementing
InstCombine/set.ll:test25


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

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


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.737 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.738
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.737   Sun Apr  8 
20:37:55 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Apr  9 18:52:13 2007
@@ -4741,13 +4741,13 @@
   case ICmpInst::ICMP_ULT:
 if (Max.ult(RHSVal))
   return ReplaceInstUsesWith(I, ConstantInt::getTrue());
-if (Min.ugt(RHSVal))
+if (Min.uge(RHSVal))
   return ReplaceInstUsesWith(I, ConstantInt::getFalse());
 break;
   case ICmpInst::ICMP_UGT:
 if (Min.ugt(RHSVal))
   return ReplaceInstUsesWith(I, ConstantInt::getTrue());
-if (Max.ult(RHSVal))
+if (Max.ule(RHSVal))
   return ReplaceInstUsesWith(I, ConstantInt::getFalse());
 break;
   case ICmpInst::ICMP_SLT:
@@ -4759,7 +4759,7 @@
   case ICmpInst::ICMP_SGT: 
 if (Min.sgt(RHSVal))
   return ReplaceInstUsesWith(I, ConstantInt::getTrue());
-if (Max.slt(RHSVal))
+if (Max.sle(RHSVal))
   return ReplaceInstUsesWith(I, ConstantInt::getFalse());
 break;
   }



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


Re: [llvm-commits] CVS: llvm/test/Transforms/LoopRotate/PhiRename-1.ll

2007-04-09 Thread Chris Lattner

On Apr 9, 2007, at 4:47 PM, Reid Spencer wrote:

> On Mon, 2007-04-09 at 18:40 -0500, Devang Patel wrote:
>>
>> Changes in directory llvm/test/Transforms/LoopRotate:
>>
>> PhiRename-1.ll updated: 1.1 -> 1.2
>> ---
>> Log message:
>>
>> Add check for opt crash.
>
> This idiom is becoming more and more prevalent. While it works, its  
> also
> doubling the runtime of each test its used in. I'm wondering if we  
> could
> invest in a "notgrep" script (since we're invoking "not" anyway) that
> would fail on empty input. Is this sufficient to avoid having to do
> things twice?

I'm not worried about it.  If you're worried about testing time, I'd  
suggest changing tests like CodeGen/ARM/vfp.ll to use %t to only  
invoke llc once :)

-Chris

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


Re: [llvm-commits] CVS: llvm/test/Transforms/LoopRotate/PhiRename-1.ll

2007-04-09 Thread Reid Spencer
On Mon, 2007-04-09 at 16:57 -0700, Chris Lattner wrote:
> On Apr 9, 2007, at 4:47 PM, Reid Spencer wrote:
> 
> > On Mon, 2007-04-09 at 18:40 -0500, Devang Patel wrote:
> >>
> >> Changes in directory llvm/test/Transforms/LoopRotate:
> >>
> >> PhiRename-1.ll updated: 1.1 -> 1.2
> >> ---
> >> Log message:
> >>
> >> Add check for opt crash.
> >
> > This idiom is becoming more and more prevalent. While it works, its  
> > also
> > doubling the runtime of each test its used in. I'm wondering if we  
> > could
> > invest in a "notgrep" script (since we're invoking "not" anyway) that
> > would fail on empty input. Is this sufficient to avoid having to do
> > things twice?
> 
> I'm not worried about it.  If you're worried about testing time, I'd  
> suggest changing tests like CodeGen/ARM/vfp.ll to use %t to only  
> invoke llc once :)

Well, those need to be done anyway. I'm not overly concerned about it
but in the last year time to run the regressions has gone from about 45
seconds to > 3 minutes. Obviously, a lot of that is due to nearly 1000
new test cases, but I can imagine the number will only grow in the
future. When we get to 5000 and its taking 15 minutes, perhaps then it
becomes important?

> 
> -Chris
> 

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


Re: [llvm-commits] CVS: llvm/test/Transforms/LoopRotate/PhiRename-1.ll

2007-04-09 Thread Jeff Cohen

Reid Spencer wrote:

On Mon, 2007-04-09 at 18:40 -0500, Devang Patel wrote:
  

Changes in directory llvm/test/Transforms/LoopRotate:

PhiRename-1.ll updated: 1.1 -> 1.2
---
Log message:

Add check for opt crash.



This idiom is becoming more and more prevalent. While it works, its also
doubling the runtime of each test its used in. I'm wondering if we could
invest in a "notgrep" script (since we're invoking "not" anyway) that
would fail on empty input. Is this sufficient to avoid having to do
things twice?


It won't work.  The command can crash after producing some output, but 
still not producing a line being grepped for.
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/test/Transforms/LoopRotate/PhiRename-1.ll

2007-04-09 Thread Reid Spencer
On Mon, 2007-04-09 at 17:03 -0700, Jeff Cohen wrote:
> Reid Spencer wrote: 
> > On Mon, 2007-04-09 at 18:40 -0500, Devang Patel wrote:
> >   
> > > Changes in directory llvm/test/Transforms/LoopRotate:
> > > 
> > > PhiRename-1.ll updated: 1.1 -> 1.2
> > > ---
> > > Log message:
> > > 
> > > Add check for opt crash.
> > > 
> > 
> > This idiom is becoming more and more prevalent. While it works, its also
> > doubling the runtime of each test its used in. I'm wondering if we could
> > invest in a "notgrep" script (since we're invoking "not" anyway) that
> > would fail on empty input. Is this sufficient to avoid having to do
> > things twice?
> 
> It won't work.  The command can crash after producing some output, but
> still not producing a line being grepped for.

Okay, I wasn't so much suggesting that as the ultimate solution but
wondering more if the problem is one we should/can fix.

Perhaps dejagnu can interpret/watch the pipeline or something and check
exit statuses of each component to ensure they all return 0, not just
the last one. 

I'll file this as a "fix someday nice to have"

Reid.

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


[llvm-commits] CVS: llvm-www/DevMtgMay2007.html

2007-04-09 Thread Reid Spencer


Changes in directory llvm-www:

DevMtgMay2007.html updated: 1.52 -> 1.53
---
Log message:

Add John Criswell.


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

 DevMtgMay2007.html |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)


Index: llvm-www/DevMtgMay2007.html
diff -u llvm-www/DevMtgMay2007.html:1.52 llvm-www/DevMtgMay2007.html:1.53
--- llvm-www/DevMtgMay2007.html:1.52Fri Apr  6 15:19:07 2007
+++ llvm-www/DevMtgMay2007.html Mon Apr  9 21:34:10 2007
@@ -131,6 +131,7 @@
   
   Scott MichelBuilding The Cell BE Symbiotic Processor Element
   Backend: Practice and Experience
+  John CriswellUIUC Research, TBA
 
 
 
@@ -240,6 +241,7 @@
 Ryan BrownGoogle
 Evan ChengApple Inc.
 Jeff CohenIndependent
+John CriswellUIUC
 Han GaoAdobe Systems Incorporated.
 Dan Gohman + 1Cray Inc.
 Stuart HastingsApple Inc.
@@ -272,7 +274,7 @@
   
 
   
-  Total confirmed: 29
+  Total confirmed: 30
   
 Unconfirmed Attendees
 NameOrganization
@@ -290,6 +292,6 @@
   src="http://jigsaw.w3.org/css-validator/images/vcss"; alt="Valid CSS!">
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
-Last modified: $Date: 2007/04/06 20:19:07 $
+Last modified: $Date: 2007/04/10 02:34:10 $
 
 



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


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

2007-04-09 Thread Reid Spencer


Changes in directory llvm/docs:

LangRef.html updated: 1.227 -> 1.228
---
Log message:

Fix name of an intrinsic: bit.part_select -> part.select


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

 LangRef.html |   22 +++---
 1 files changed, 11 insertions(+), 11 deletions(-)


Index: llvm/docs/LangRef.html
diff -u llvm/docs/LangRef.html:1.227 llvm/docs/LangRef.html:1.228
--- llvm/docs/LangRef.html:1.227Wed Apr  4 14:15:59 2007
+++ llvm/docs/LangRef.html  Mon Apr  9 21:51:31 2007
@@ -184,7 +184,7 @@
   'llvm.ctpop.*' Intrinsic 
   'llvm.ctlz.*' Intrinsic 
   'llvm.cttz.*' Intrinsic 
-  'llvm.bit.part_select.*' 
Intrinsic 
+  'llvm.part_select.*' 
Intrinsic 
 
   
   Debugger intrinsics
@@ -4590,21 +4590,21 @@
 
 
 
-  'llvm.bit.part_select.*' Intrinsic
+  'llvm.part.select.*' Intrinsic
 
 
 
 
 Syntax:
-This is an overloaded intrinsic. You can use llvm.bit.part_select 
+This is an overloaded intrinsic. You can use llvm.part.select 
 on any integer bit width.
 
-  declare i17 @llvm.bit.part_select.i17.i17 (i17 %val, i32 %loBit, i32 %hiBit)
-  declare i29 @llvm.bit.part_select.i29.i29 (i29 %val, i32 %loBit, i32 %hiBit)
+  declare i17 @llvm.part.select.i17.i17 (i17 %val, i32 %loBit, i32 %hiBit)
+  declare i29 @llvm.part.select.i29.i29 (i29 %val, i32 %loBit, i32 %hiBit)
 
 
 Overview:
-The 'llvm.bit.part_select' family of intrinsic functions selects a
+The 'llvm.part.select' family of intrinsic functions selects a
 range of bits from an integer value and returns them in the same bit width as
 the original value.
 
@@ -4614,7 +4614,7 @@
 arguments must be i32 type since they specify only a bit index.
 
 Semantics:
-The operation of the 'llvm.bit.part_select' intrinsic has two modes
+The operation of the 'llvm.part.select' intrinsic has two modes
 of operation: forwards and reverse. If %loBit is greater than
 %hiBits then the intrinsic operates in reverse mode. Otherwise it
 operates in forward mode.
@@ -4632,11 +4632,11 @@
 In reverse mode, a similar computation is made except that:
 
   The bits selected wrap around to include both the highest and lowest 
bits.
-  For example, part_select(i16 X, 4, 7) selects bits from X with a mask of 
-  0x00F0 (forwards case) while part_select(i16 X, 8, 3) selects bits from X 
+  For example, part.select(i16 X, 4, 7) selects bits from X with a mask of 
+  0x00F0 (forwards case) while part.select(i16 X, 8, 3) selects bits from X 
   with a mask of 0xFF0F.
   The bits returned in the reverse case are reversed. So, if X has the 
value
-  0x6ACF and we apply part_select(i16 X, 8, 3) to it, we get back the value
+  0x6ACF and we apply part.select(i16 X, 8, 3) to it, we get back the value
   0x0A6F.
 
 
@@ -4679,7 +4679,7 @@
 
   mailto:[EMAIL PROTECTED]">Chris Lattner
   http://llvm.org";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2007/04/04 19:15:59 $
+  Last modified: $Date: 2007/04/10 02:51:31 $
 
 
 



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


[llvm-commits] CVS: llvm/include/llvm/Intrinsics.td

2007-04-09 Thread Reid Spencer


Changes in directory llvm/include/llvm:

Intrinsics.td updated: 1.53 -> 1.54
---
Log message:

Drop the "bit" prefix for the part.select intrinsic.


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

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


Index: llvm/include/llvm/Intrinsics.td
diff -u llvm/include/llvm/Intrinsics.td:1.53 
llvm/include/llvm/Intrinsics.td:1.54
--- llvm/include/llvm/Intrinsics.td:1.53Wed Apr  4 18:48:25 2007
+++ llvm/include/llvm/Intrinsics.td Mon Apr  9 21:52:46 2007
@@ -203,7 +203,7 @@
 
 // None of these intrinsics accesses memory at all.
 let Properties = [IntrNoMem] in {
-  def int_bit_part_select : 
+  def int_part_select : 
  Intrinsic<[llvm_int_ty, llvm_int_ty, llvm_i32_ty, llvm_i32_ty]>;
   def int_bswap: Intrinsic<[llvm_int_ty, llvm_int_ty]>;
   def int_ctpop: Intrinsic<[llvm_i32_ty, llvm_int_ty]>;



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


[llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/config.h

2007-04-09 Thread Jeff Cohen


Changes in directory llvm-test/MultiSource/Benchmarks/MiBench/office-ispell:

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

Use correct dirent.h header file.

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

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


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/config.h
diff -u llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/config.h:1.2 
llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/config.h:1.3
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/config.h:1.2 Thu Mar 
29 12:00:52 2007
+++ llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/config.h Mon Apr 
 9 21:59:31 2007
@@ -52,9 +52,12 @@
  */
 
 /*
- * $Id: config.h,v 1.2 2007/03/29 17:00:52 jeffc Exp $
+ * $Id: config.h,v 1.3 2007/04/10 02:59:31 jeffc Exp $
  *
  * $Log: config.h,v $
+ * Revision 1.3  2007/04/10 02:59:31  jeffc
+ * Use correct dirent.h header file.
+ *
  * Revision 1.2  2007/03/29 17:00:52  jeffc
  * Fix for src != obj.
  * Don't use obsolete header file.
@@ -118,7 +121,7 @@
 #include 
 #include 
 #ifndef USG
-#include 
+#include 
 #endif /* USG */
 
 /*



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


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

2007-04-09 Thread Jeff Cohen


Changes in directory llvm/lib/VMCore:

Verifier.cpp updated: 1.199 -> 1.200
---
Log message:

Fix build problem.

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

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


Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.199 llvm/lib/VMCore/Verifier.cpp:1.200
--- llvm/lib/VMCore/Verifier.cpp:1.199  Wed Apr  4 18:48:25 2007
+++ llvm/lib/VMCore/Verifier.cppMon Apr  9 22:10:46 2007
@@ -1028,7 +1028,7 @@
   if (GotBits < 16 || GotBits % 16 != 0)
 CheckFailed("Intrinsic requires even byte width argument", F);
   /* FALL THROUGH */
-case Intrinsic::bit_part_select:
+case Intrinsic::int_part_select:
   if (ArgNo == 1) {
 unsigned ResultBits = 
   cast(FTy->getReturnType())->getBitWidth();



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


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

2007-04-09 Thread Chris Lattner


Changes in directory llvm/lib/VMCore:

Verifier.cpp updated: 1.200 -> 1.201
---
Log message:

unbreak the build :(


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

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


Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.200 llvm/lib/VMCore/Verifier.cpp:1.201
--- llvm/lib/VMCore/Verifier.cpp:1.200  Mon Apr  9 22:10:46 2007
+++ llvm/lib/VMCore/Verifier.cppMon Apr  9 22:18:19 2007
@@ -1028,7 +1028,7 @@
   if (GotBits < 16 || GotBits % 16 != 0)
 CheckFailed("Intrinsic requires even byte width argument", F);
   /* FALL THROUGH */
-case Intrinsic::int_part_select:
+case Intrinsic::part_select:
   if (ArgNo == 1) {
 unsigned ResultBits = 
   cast(FTy->getReturnType())->getBitWidth();



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


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

2007-04-09 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen:

IntrinsicLowering.cpp updated: 1.75 -> 1.76
---
Log message:

apparently some people commit without building the tree, or they forget to
commit a LOT of files.


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

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


Index: llvm/lib/CodeGen/IntrinsicLowering.cpp
diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.75 
llvm/lib/CodeGen/IntrinsicLowering.cpp:1.76
--- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.75 Wed Apr  4 18:48:25 2007
+++ llvm/lib/CodeGen/IntrinsicLowering.cpp  Mon Apr  9 22:20:39 2007
@@ -475,7 +475,7 @@
 break;
   }
 
-  case Intrinsic::bit_part_select:
+  case Intrinsic::part_select:
 CI->replaceAllUsesWith(LowerBitPartSelect(CI));
 break;
 



___
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-04-09 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.413 -> 1.414
---
Log message:

apparently some people commit without building the tree, or they forget to
commit a LOT of files.


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

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


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.413 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.414
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.413Mon Apr  9 
18:42:32 2007
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Mon Apr  9 22:20:39 2007
@@ -2689,7 +2689,7 @@
 DAG.setRoot(Tmp.getValue(1));
 return 0;
   }
-  case Intrinsic::bit_part_select: {
+  case Intrinsic::part_select: {
 // Currently not implemented: just abort
 assert(0 && "bit_part_select intrinsic not implemented");
 abort();



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

2007-04-09 Thread Chris Lattner


Changes in directory llvm/lib/Target/ARM:

ARMISelLowering.cpp updated: 1.41 -> 1.42
---
Log message:

restore support for negative strides


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

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


Index: llvm/lib/Target/ARM/ARMISelLowering.cpp
diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.41 
llvm/lib/Target/ARM/ARMISelLowering.cpp:1.42
--- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.41Mon Apr  9 18:33:39 2007
+++ llvm/lib/Target/ARM/ARMISelLowering.cpp Mon Apr  9 22:48:29 2007
@@ -1372,6 +1372,7 @@
   return false;
 
   default:
+int Scale = AM.Scale;
 switch (getValueType(Ty)) {
 default: return false;
 case MVT::i1:
@@ -1381,14 +1382,15 @@
   // This assumes i64 is legalized to a pair of i32. If not (i.e.
   // ldrd / strd are used, then its address mode is same as i16.
   // r + r
-  if (AM.Scale == 1)
+  if (Scale < 0) Scale = -Scale;
+  if (Scale == 1)
 return true;
   // r + r << imm
-  if (!isPowerOf2_32(AM.Scale & ~1))
+  if (!isPowerOf2_32(Scale & ~1))
 return false;
 case MVT::i16:
   // r + r
-  if (((unsigned)AM.HasBaseReg + AM.Scale) <= 2)
+  if (((unsigned)AM.HasBaseReg + Scale) <= 2)
 return true;
 
 case MVT::isVoid:



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


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

2007-04-09 Thread Chris Lattner


Changes in directory llvm/include/llvm/ADT:

APInt.h updated: 1.63 -> 1.64
---
Log message:

add a method


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

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


Index: llvm/include/llvm/ADT/APInt.h
diff -u llvm/include/llvm/ADT/APInt.h:1.63 llvm/include/llvm/ADT/APInt.h:1.64
--- llvm/include/llvm/ADT/APInt.h:1.63  Wed Apr  4 01:18:21 2007
+++ llvm/include/llvm/ADT/APInt.h   Tue Apr 10 01:43:18 2007
@@ -281,6 +281,13 @@
 return *this != 0;
   }
 
+  /// getLimitedValue - Return this value, or return all ones if it is too 
large
+  /// to return.
+  uint64_t getLimitedValue(uint64_t Limit = ~0ULL) const {
+return (getActiveBits() > 64 || getZExtValue() > Limit) ?
+  Limit :  getZExtValue();
+  }
+
   /// @}
   /// @name Value Generators
   /// @{



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


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

2007-04-09 Thread Chris Lattner


Changes in directory llvm/include/llvm:

Constants.h updated: 1.144 -> 1.145
---
Log message:

getLimitedValue now just forward to APInt's getLimitedValue.  Mark it const.


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

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


Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.144 llvm/include/llvm/Constants.h:1.145
--- llvm/include/llvm/Constants.h:1.144 Mon Apr  2 20:41:34 2007
+++ llvm/include/llvm/Constants.h   Tue Apr 10 01:44:12 2007
@@ -189,9 +189,8 @@
   /// @returns the 64-bit value of this constant if its active bits number is 
   /// not greater than 64, otherwise, just return the given uint64_t number.
   /// @brief Get the constant's value if possible.
-  uint64_t getLimitedValue(uint64_t Limit) {
-return (Val.getActiveBits() > 64 || Val.getZExtValue() > Limit) ? 
-   Limit : Val.getZExtValue();
+  uint64_t getLimitedValue(uint64_t Limit = ~0ULL) const {
+return Val.getLimitedValue(Limit);
   }
 
   /// @returns the value for an integer constant of the given type that has all



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