[llvm-commits] CVS: llvm-www/pubs/2007-SOSP-SVA.html

2007-09-24 Thread John Criswell


Changes in directory llvm-www/pubs:

2007-SOSP-SVA.html added (r1.1)
---
Log message:

Adding SOSP 2007 paper on Secure Virtual Architecture.


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

 2007-SOSP-SVA.html |   83 +
 1 files changed, 83 insertions(+)


Index: llvm-www/pubs/2007-SOSP-SVA.html
diff -c /dev/null llvm-www/pubs/2007-SOSP-SVA.html:1.1
*** /dev/null   Mon Sep 24 10:37:04 2007
--- llvm-www/pubs/2007-SOSP-SVA.htmlMon Sep 24 10:36:54 2007
***
*** 0 
--- 1,83 
+ !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
+ html
+ head
+   meta http-equiv=Content-Type content=text/html; charset=UTF-8
+   link rel=stylesheet href=../llvm.css type=text/css media=screen
+   titleSecure Virtual Architecture: A Safe Execution Environment for
+ Commodity Operating Systems/title
+ /head
+ body
+ 
+ div class=pub_title
+ Secure Virtual Architecture: A Safe Execution Environment for
+ Commodity Operating Systems
+ /div
+ div class=pub_author
+   John Criswell,
+   Andrew Lenharth,
+   Dinakar Dhurjati, and
+   a href=http://www.cs.uiuc.edu/~vadve;Vikram Adve/a
+ /div
+ 
+ h2Abstract:/h2
+ blockquote
+ This paper describes an efficient and robust
+ approach to provide a isafe execution environment/i for an entire
+ operating system, such as Linux, and all its applications.  The
+ approach, which we call iSecure Virtual Architecture/i (SVA),
+ defines a virtual, low-level, typed instruction set suitable for
+ executing iall/i code on a system, including kernel and
+ application code.  SVA code is translated for execution by a virtual
+ machine transparently, offline or online.
+ SVA aims to enforce ifine-grained (object level) memory safety/i,
+ icontrol-flow integrity/i,
+ itype safety for a subset of objects/i, and isound analysis/i.
+ A virtual machine implementing SVA achieves these goals by using a
+ novel approach that exploits properties of existing memory pools in
+ the kernel and by preserving the kernel's explicit control over
+ memory, including custom allocators and explicit deallocation.
+ Furthermore, the safety properties can be encoded compactly as
+ extensions to the SVA type system,
+ allowing the (complex) safety checking compiler to be outside
+ the trusted computing base.  SVA also defines a set of OS interface
+ operations that abstract all privileged hardware instructions,
+ allowing the virtual machine to monitor all privileged operations
+ and control the physical resources on a given hardware platform.
+ We have ported the Linux kernel to SVA, treating it as a new
+ architecture, and made only minimal code changes (less than 300 lines of code)
+ to the machine-independent parts of the kernel and device drivers.
+ SVA is able to prevent 4 out of 5 memory safety exploits previously reported
+ for the Linux 2.4.22 kernel for which exploit code is available, and would
+ prevent the fifth one simply by compiling an additional kernel library.
+ /blockquote
+ 
+ h2Download:/h2
+ h3Paper:/h3
+ ul
+   lia href=2007-SOSP-SVA.pdf
+   Secure Virtual Architecture: A Safe Execution Environment for
+ Commodity Operating Systems
+   /a (PDF)/li
+ /ul
+ 
+ h2BibTeX Entry:/h2
+ pre
+ @inproceedings{SVA:SOSP07,
+  author = {John Criswell, Andrew Lenharth , Dinakar Dhurjati, and Vikram 
Adve},
+  title = {Secure Virtual Architecture: A Safe Execution Environment for 
Commodity Operating Systems},
+  booktitle = {SOSP '07: Proceedings of the Twenty First ACM Symposium on 
Operating Systems Principles},
+  month = {October},
+  year = {2007},
+  location = {Stevenson, WA},
+ }
+ /pre
+ 
+ !-- *** 
--
+ hr
+   a href=http://jigsaw.w3.org/css-validator/check/referer;img
+   src=http://jigsaw.w3.org/css-validator/images/vcss; alt=Valid CSS!/a
+   a href=http://validator.w3.org/check/referer;img
+   src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01! //a
+ 
+ /body
+ /html



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


[llvm-commits] CVS: llvm-www/pubs/2007-10-17-SOSP-SVA.html

2007-09-24 Thread John Criswell


Changes in directory llvm-www/pubs:

2007-10-17-SOSP-SVA.html added (r1.1)
---
Log message:



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

 2007-10-17-SOSP-SVA.html |   83 +++
 1 files changed, 83 insertions(+)


Index: llvm-www/pubs/2007-10-17-SOSP-SVA.html
diff -c /dev/null llvm-www/pubs/2007-10-17-SOSP-SVA.html:1.1
*** /dev/null   Mon Sep 24 10:43:40 2007
--- llvm-www/pubs/2007-10-17-SOSP-SVA.html  Mon Sep 24 10:43:30 2007
***
*** 0 
--- 1,83 
+ !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
+ html
+ head
+   meta http-equiv=Content-Type content=text/html; charset=UTF-8
+   link rel=stylesheet href=../llvm.css type=text/css media=screen
+   titleSecure Virtual Architecture: A Safe Execution Environment for
+ Commodity Operating Systems/title
+ /head
+ body
+ 
+ div class=pub_title
+ Secure Virtual Architecture: A Safe Execution Environment for
+ Commodity Operating Systems
+ /div
+ div class=pub_author
+   John Criswell,
+   Andrew Lenharth,
+   Dinakar Dhurjati, and
+   a href=http://www.cs.uiuc.edu/~vadve;Vikram Adve/a
+ /div
+ 
+ h2Abstract:/h2
+ blockquote
+ This paper describes an efficient and robust
+ approach to provide a isafe execution environment/i for an entire
+ operating system, such as Linux, and all its applications.  The
+ approach, which we call iSecure Virtual Architecture/i (SVA),
+ defines a virtual, low-level, typed instruction set suitable for
+ executing iall/i code on a system, including kernel and
+ application code.  SVA code is translated for execution by a virtual
+ machine transparently, offline or online.
+ SVA aims to enforce ifine-grained (object level) memory safety/i,
+ icontrol-flow integrity/i,
+ itype safety for a subset of objects/i, and isound analysis/i.
+ A virtual machine implementing SVA achieves these goals by using a
+ novel approach that exploits properties of existing memory pools in
+ the kernel and by preserving the kernel's explicit control over
+ memory, including custom allocators and explicit deallocation.
+ Furthermore, the safety properties can be encoded compactly as
+ extensions to the SVA type system,
+ allowing the (complex) safety checking compiler to be outside
+ the trusted computing base.  SVA also defines a set of OS interface
+ operations that abstract all privileged hardware instructions,
+ allowing the virtual machine to monitor all privileged operations
+ and control the physical resources on a given hardware platform.
+ We have ported the Linux kernel to SVA, treating it as a new
+ architecture, and made only minimal code changes (less than 300 lines of code)
+ to the machine-independent parts of the kernel and device drivers.
+ SVA is able to prevent 4 out of 5 memory safety exploits previously reported
+ for the Linux 2.4.22 kernel for which exploit code is available, and would
+ prevent the fifth one simply by compiling an additional kernel library.
+ /blockquote
+ 
+ h2Download:/h2
+ h3Paper:/h3
+ ul
+   lia href=2007-SOSP-SVA.pdf
+   Secure Virtual Architecture: A Safe Execution Environment for
+ Commodity Operating Systems
+   /a (PDF)/li
+ /ul
+ 
+ h2BibTeX Entry:/h2
+ pre
+ @inproceedings{SVA:SOSP07,
+  author = {John Criswell, Andrew Lenharth , Dinakar Dhurjati, and Vikram 
Adve},
+  title = {Secure Virtual Architecture: A Safe Execution Environment for 
Commodity Operating Systems},
+  booktitle = {SOSP '07: Proceedings of the Twenty First ACM Symposium on 
Operating Systems Principles},
+  month = {October},
+  year = {2007},
+  location = {Stevenson, WA},
+ }
+ /pre
+ 
+ !-- *** 
--
+ hr
+   a href=http://jigsaw.w3.org/css-validator/check/referer;img
+   src=http://jigsaw.w3.org/css-validator/images/vcss; alt=Valid CSS!/a
+   a href=http://validator.w3.org/check/referer;img
+   src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01! //a
+ 
+ /body
+ /html



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


[llvm-commits] [llvm] r42261 - /llvm/trunk/include/llvm/Instructions.h

2007-09-24 Thread Dan Gohman
Author: djg
Date: Mon Sep 24 10:46:02 2007
New Revision: 42261

URL: http://llvm.org/viewvc/llvm-project?rev=42261view=rev
Log:
Remove an unnecessary static_cast.

Modified:
llvm/trunk/include/llvm/Instructions.h

Modified: llvm/trunk/include/llvm/Instructions.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=42261r1=42260r2=42261view=diff

==
--- llvm/trunk/include/llvm/Instructions.h (original)
+++ llvm/trunk/include/llvm/Instructions.h Mon Sep 24 10:46:02 2007
@@ -917,7 +917,7 @@
   /// if it is a direct call.  If it is a call through a function pointer,
   /// return null.
   Function *getCalledFunction() const {
-return static_castFunction*(dyn_castFunction(getOperand(0)));
+return dyn_castFunction(getOperand(0));
   }
 
   /// getCalledValue - Get a pointer to the function that is invoked by this 


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


[llvm-commits] [llvm] r42262 - in /llvm/trunk: include/llvm/CodeGen/MachineModuleInfo.h lib/Transforms/Scalar/GVNPRE.cpp

2007-09-24 Thread Dan Gohman
Author: djg
Date: Mon Sep 24 10:48:49 2007
New Revision: 42262

URL: http://llvm.org/viewvc/llvm-project?rev=42262view=rev
Log:
explicit keywords.

Modified:
llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h
llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp

Modified: llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h?rev=42262r1=42261r2=42262view=diff

==
--- llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h Mon Sep 24 10:48:49 2007
@@ -161,7 +161,7 @@
   
 public:
   AnchorDesc();
-  AnchorDesc(AnchoredDesc *D);
+  explicit AnchorDesc(AnchoredDesc *D);
   
   // Accessors
   unsigned getAnchorTag() const { return AnchorTag; }
@@ -201,7 +201,7 @@
 
 protected:
 
-  AnchoredDesc(unsigned T);
+  explicit AnchoredDesc(unsigned T);
 
 public:  
   // Accessors.
@@ -291,7 +291,7 @@
   unsigned Flags;   // Miscellaneous flags.
 
 public:
-  TypeDesc(unsigned T);
+  explicit TypeDesc(unsigned T);
 
   // Accessors
   DebugInfoDesc *getContext()const { return Context; }
@@ -382,7 +382,7 @@
   DebugInfoDesc *FromType;  // Type derived from.
 
 public:
-  DerivedTypeDesc(unsigned T);
+  explicit DerivedTypeDesc(unsigned T);
   
   // Accessors
   TypeDesc *getFromType() const {
@@ -421,7 +421,7 @@
   std::vectorDebugInfoDesc * Elements;// Information used to compose type.
 
 public:
-  CompositeTypeDesc(unsigned T);
+  explicit CompositeTypeDesc(unsigned T);
   
   // Accessors
   std::vectorDebugInfoDesc * getElements() { return Elements; }
@@ -536,7 +536,7 @@
   DebugInfoDesc *TyDesc;// Type of variable.
 
 public:
-  VariableDesc(unsigned T);
+  explicit VariableDesc(unsigned T);
 
   // Accessors
   DebugInfoDesc *getContext()const { return Context; }
@@ -595,7 +595,7 @@
   bool IsDefinition;// Is the global defined in context.
   
 protected:
-  GlobalDesc(unsigned T);
+  explicit GlobalDesc(unsigned T);
 
 public:
   // Accessors
@@ -962,7 +962,7 @@
   Function *Personality;// Personality function.
   std::vectorint TypeIds; // List of type ids (filters negative)
 
-  LandingPadInfo(MachineBasicBlock *MBB)
+  explicit LandingPadInfo(MachineBasicBlock *MBB)
   : LandingPadBlock(MBB)
   , LandingPadLabel(0)
   , Personality(NULL)  

Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=42262r1=42261r2=42262view=diff

==
--- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Mon Sep 24 10:48:49 2007
@@ -70,7 +70,7 @@
   SmallVectoruint32_t, 4 varargs;
   
   Expression() { }
-  Expression(ExpressionOpcode o) : opcode(o) { }
+  explicit Expression(ExpressionOpcode o) : opcode(o) { }
   
   bool operator==(const Expression other) const {
 if (opcode != other.opcode)


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


[llvm-commits] [llvm] r42263 - /llvm/trunk/test/CodeGen/Generic/fwdtwice.ll

2007-09-24 Thread Dan Gohman
Author: djg
Date: Mon Sep 24 10:50:11 2007
New Revision: 42263

URL: http://llvm.org/viewvc/llvm-project?rev=42263view=rev
Log:
Fix a typo in a comment.

Modified:
llvm/trunk/test/CodeGen/Generic/fwdtwice.ll

Modified: llvm/trunk/test/CodeGen/Generic/fwdtwice.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/fwdtwice.ll?rev=42263r1=42262r2=42263view=diff

==
--- llvm/trunk/test/CodeGen/Generic/fwdtwice.ll (original)
+++ llvm/trunk/test/CodeGen/Generic/fwdtwice.ll Mon Sep 24 10:50:11 2007
@@ -4,7 +4,7 @@
 ;; Test the sequence:
 ;; cast - setle 0, %cast - br %cond
 ;; This sequence should cause the cast value to be forwarded twice,
-;; i.e., cast is forwarded to the setle and teh setle is forwarded
+;; i.e., cast is forwarded to the setle and the setle is forwarded
 ;; to the branch.
 ;; register argument of the branch-on-register instruction, i.e.,
 ;; 


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


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

2007-09-24 Thread John Criswell


Changes in directory llvm-www/pubs:

index.html updated: 1.58 - 1.59
---
Log message:

Added SOSP paper on Secure Virtual Architecture.


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

 index.html |7 +++
 1 files changed, 7 insertions(+)


Index: llvm-www/pubs/index.html
diff -u llvm-www/pubs/index.html:1.58 llvm-www/pubs/index.html:1.59
--- llvm-www/pubs/index.html:1.58   Tue Aug 28 00:17:12 2007
+++ llvm-www/pubs/index.htmlMon Sep 24 10:50:20 2007
@@ -3,6 +3,13 @@
 
 ol
 
+lia href=2007-SOSP-SVA.html
+Secure Virtual Architecture: A Safe Execution Environment for Commodity
+Operating Systems/abrJohn Criswell, Andrew Lenharth, Dinakar Dhurjati, and
+Vikram Adve
+br
+iProceedings of the Twenty First ACM Symposium on Operating Systems 
Principles (SOSP '07)/i, Stevenson, WA, October 2007./li
+
 lia href=2007-08-16-TRANSACT-Tanger.htmlTransactifying Applications 
 Using an Open Compiler Framework/abrPascal Felber, Christof Fetzer,
 Ulrich Mueller, Torvald Riegel, Martin Suesskraut, and Heiko Sturzrehmbr



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


[llvm-commits] [llvm] r42264 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp test/CodeGen/X86/extractelement-from-arg.ll

2007-09-24 Thread Dan Gohman
Author: djg
Date: Mon Sep 24 10:54:53 2007
New Revision: 42264

URL: http://llvm.org/viewvc/llvm-project?rev=42264view=rev
Log:
Use the correct result value type instead of using getValueType(0)
in ExpandEXTRACT_VECTOR_ELT and SplitVectorOp. This fixes an abort
in the included testcase.

Added:
llvm/trunk/test/CodeGen/X86/extractelement-from-arg.ll
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=42264r1=42263r2=42264view=diff

==
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Sep 24 10:54:53 2007
@@ -3870,8 +3870,7 @@
   SDOperand Vec = Op.getOperand(0);
   SDOperand Idx = Op.getOperand(1);
   
-  SDNode *InVal = Vec.Val;
-  MVT::ValueType TVT = InVal-getValueType(0);
+  MVT::ValueType TVT = Vec.getValueType();
   unsigned NumElems = MVT::getVectorNumElements(TVT);
   
   switch (TLI.getOperationAction(ISD::EXTRACT_VECTOR_ELT, TVT)) {
@@ -5803,10 +5802,10 @@
  SDOperand Hi) {
   assert(MVT::isVector(Op.getValueType())  Cannot split non-vector type!);
   SDNode *Node = Op.Val;
-  unsigned NumElements = MVT::getVectorNumElements(Node-getValueType(0));
+  unsigned NumElements = MVT::getVectorNumElements(Op.getValueType());
   assert(NumElements  1  Cannot split a single element vector!);
   unsigned NewNumElts = NumElements/2;
-  MVT::ValueType NewEltVT = MVT::getVectorElementType(Node-getValueType(0));
+  MVT::ValueType NewEltVT = MVT::getVectorElementType(Op.getValueType());
   MVT::ValueType NewVT = MVT::getVectorType(NewEltVT, NewNumElts);
   
   // See if we already split it.

Added: llvm/trunk/test/CodeGen/X86/extractelement-from-arg.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/extractelement-from-arg.ll?rev=42264view=auto

==
--- llvm/trunk/test/CodeGen/X86/extractelement-from-arg.ll (added)
+++ llvm/trunk/test/CodeGen/X86/extractelement-from-arg.ll Mon Sep 24 10:54:53 
2007
@@ -0,0 +1,7 @@
+; RUN: llvm-as %s -o - | llc -march=x86-64
+
+define void @test(float* %R, 4 x float %X) {
+   %tmp = extractelement 4 x float %X, i32 3
+   store float %tmp, float* %R
+   ret void
+}


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


Re: [llvm-commits] [llvm] r42248 - in /llvm/trunk: include/llvm/Analysis/Dominators.h include/llvm/Analysis/PostDominators.h lib/VMCore/DominatorCalculation.h lib/VMCore/Dominators.cpp

2007-09-24 Thread Tanya Lattner
Owen,

Could you please add doxygen style comments for the new functions you  
are adding/moving? Its useful to have comments before the function  
describing what it does.

Thanks,
Tanya

On Sep 23, 2007, at 2:31 PM, Owen Anderson wrote:

 Author: resistor
 Date: Sun Sep 23 16:31:44 2007
 New Revision: 42248

 URL: http://llvm.org/viewvc/llvm-project?rev=42248view=rev
 Log:
 Factor the dominator tree calculation details out into  
 DominatorCalculation.h.  This
 change is not useful in and of itself, but it lays the groundwork  
 for combining
 the dominator and postdominator implementations.

 Also, factor a few methods that are common to DominatorTree and  
 PostDominatorTree
 into DominatorTreeBase.  Again, this will make merging the two  
 calculation methods
 simpler in the future.

 Added:
 llvm/trunk/lib/VMCore/DominatorCalculation.h
 Modified:
 llvm/trunk/include/llvm/Analysis/Dominators.h
 llvm/trunk/include/llvm/Analysis/PostDominators.h
 llvm/trunk/lib/VMCore/Dominators.cpp

 Modified: llvm/trunk/include/llvm/Analysis/Dominators.h
 URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ 
 Analysis/Dominators.h?rev=42248r1=42247r2=42248view=diff

 == 
 
 --- llvm/trunk/include/llvm/Analysis/Dominators.h (original)
 +++ llvm/trunk/include/llvm/Analysis/Dominators.h Sun Sep 23  
 16:31:44 2007
 @@ -129,6 +129,7 @@

// Info - Collection of information used during the computation  
 of idoms.
DenseMapBasicBlock*, InfoRec Info;
 +  unsigned DFSPass(BasicBlock *V, unsigned N);

  public:
DominatorTreeBase(intptr_t ID, bool isPostDom)
 @@ -278,6 +279,13 @@
/// updateDFSNumbers - Assign In and Out numbers to the nodes  
 while walking
/// dominator tree in dfs order.
void updateDFSNumbers();
 +
 +  DomTreeNode *getNodeForBlock(BasicBlock *BB);
 +
 +  inline BasicBlock *getIDom(BasicBlock *BB) const {
 +DenseMapBasicBlock*, BasicBlock*::const_iterator I =  
 IDoms.find(BB);
 +return I != IDoms.end() ? I-second : 0;
 +  }
  };

  //===-
 @@ -304,17 +312,13 @@
/// BB is split and now it has one successor. Update dominator  
 tree to
/// reflect this change.
void splitBlock(BasicBlock *BB);
 +
  private:
 -  void calculate(Function F);
 -  DomTreeNode *getNodeForBlock(BasicBlock *BB);
 -  unsigned DFSPass(BasicBlock *V, unsigned N);
 -  void Compress(BasicBlock *V);
 -  BasicBlock *Eval(BasicBlock *v);
 -  void Link(BasicBlock *V, BasicBlock *W, InfoRec WInfo);
 -  inline BasicBlock *getIDom(BasicBlock *BB) const {
 -DenseMapBasicBlock*, BasicBlock*::const_iterator I =  
 IDoms.find(BB);
 -return I != IDoms.end() ? I-second : 0;
 -  }
 +  friend void DTcalculate(DominatorTree DT, Function F);
 +  friend void DTCompress(DominatorTree DT, BasicBlock *VIn);
 +  friend BasicBlock *DTEval(DominatorTree DT, BasicBlock *v);
 +  friend void DTLink(DominatorTree DT, BasicBlock *V,
 + BasicBlock *W, InfoRec WInfo);
  };

  //===-

 Modified: llvm/trunk/include/llvm/Analysis/PostDominators.h
 URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ 
 Analysis/PostDominators.h?rev=42248r1=42247r2=42248view=diff

 == 
 
 --- llvm/trunk/include/llvm/Analysis/PostDominators.h (original)
 +++ llvm/trunk/include/llvm/Analysis/PostDominators.h Sun Sep 23  
 16:31:44 2007
 @@ -38,16 +38,10 @@
}
  private:
void calculate(Function F);
 -  DomTreeNode *getNodeForBlock(BasicBlock *BB);
unsigned DFSPass(BasicBlock *V, unsigned N);
void Compress(BasicBlock *V, InfoRec VInfo);
BasicBlock *Eval(BasicBlock *V);
void Link(BasicBlock *V, BasicBlock *W, InfoRec WInfo);
 -
 -  inline BasicBlock *getIDom(BasicBlock *BB) const {
 -DenseMapBasicBlock*, BasicBlock*::const_iterator I =  
 IDoms.find(BB);
 -return I != IDoms.end() ? I-second : 0;
 -  }
  };



 Added: llvm/trunk/lib/VMCore/DominatorCalculation.h
 URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ 
 DominatorCalculation.h?rev=42248view=auto

 == 
 
 --- llvm/trunk/lib/VMCore/DominatorCalculation.h (added)
 +++ llvm/trunk/lib/VMCore/DominatorCalculation.h Sun Sep 23  
 16:31:44 2007
 @@ -0,0 +1,213 @@
 +//==- llvm/VMCore/DominatorCalculation.h - Dominator Calculation - 
 *- C++ -*-==//
 +//
 +// The LLVM Compiler Infrastructure
 +//
 +// This file was developed by Owen Anderson and is distributed under
 +// the University of Illinois Open Source License. See LICENSE.TXT  
 for details.
 +//
 +// 
 ===--- 
 ---===//
 +
 +#ifndef LLVM_VMCORE_DOMINATOR_CALCULATION_H
 +#define LLVM_VMCORE_DOMINATOR_CALCULATION_H
 +
 +#include llvm/Analysis/Dominators.h
 +
 

[llvm-commits] [llvm] r42265 - /llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp

2007-09-24 Thread Dan Gohman
Author: djg
Date: Mon Sep 24 11:44:26 2007
New Revision: 42265

URL: http://llvm.org/viewvc/llvm-project?rev=42265view=rev
Log:
The code that used the StartLabelId label was removed, so remove the
code that creates the label too.

Modified:
llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp

Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=42265r1=42264r2=42265view=diff

==
--- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Mon Sep 24 11:44:26 2007
@@ -1278,18 +1278,12 @@
   MachineBasicBlock::iterator MBBI = MBB.begin();
   
   // Prepare for frame info.
-  unsigned FrameLabelId = 0, StartLabelId = 0;
+  unsigned FrameLabelId = 0;
   
   // Get the number of bytes to allocate from the FrameInfo
   uint64_t StackSize = MFI-getStackSize();
   uint64_t NumBytes = StackSize - X86FI-getCalleeSavedFrameSize();
 
-  if (MMI  MMI-needsFrameInfo()) {
-// Mark function start
-StartLabelId = MMI-NextLabelID();
-BuildMI(MBB, MBBI, TII.get(X86::LABEL)).addImm(StartLabelId);
-  }
-
   if (hasFP(MF)) {
 // Get the offset of the stack slot for the EBP register... which is
 // guaranteed to be the last slot by processFunctionBeforeFrameFinalized.


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


[llvm-commits] [llvm] r42266 - /llvm/trunk/test/CFrontend/2007-09-17-WeakRef.c

2007-09-24 Thread Tanya Lattner
Author: tbrethou
Date: Mon Sep 24 12:14:53 2007
New Revision: 42266

URL: http://llvm.org/viewvc/llvm-project?rev=42266view=rev
Log:
XFAIL for llvm-gcc4.0

Modified:
llvm/trunk/test/CFrontend/2007-09-17-WeakRef.c

Modified: llvm/trunk/test/CFrontend/2007-09-17-WeakRef.c
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/2007-09-17-WeakRef.c?rev=42266r1=42265r2=42266view=diff

==
--- llvm/trunk/test/CFrontend/2007-09-17-WeakRef.c (original)
+++ llvm/trunk/test/CFrontend/2007-09-17-WeakRef.c Mon Sep 24 12:14:53 2007
@@ -1,6 +1,6 @@
 // RUN: %llvmgcc -O1 -S %s -o - | grep icmp
 // PR1678
-
+// XFAIL: llvmgcc4.0.1
 extern void B (void);
 static __typeof(B) A __attribute__ ((__weakref__(B)));
 int active (void)


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


[llvm-commits] [llvm] r42267 - /llvm/trunk/docs/ProgrammersManual.html

2007-09-24 Thread Daniel Berlin
Author: dannyb
Date: Mon Sep 24 12:52:25 2007
New Revision: 42267

URL: http://llvm.org/viewvc/llvm-project?rev=42267view=rev
Log:
Add section on bit containers.
(Not the most well written stuff in the universe :P)

Modified:
llvm/trunk/docs/ProgrammersManual.html

Modified: llvm/trunk/docs/ProgrammersManual.html
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ProgrammersManual.html?rev=42267r1=42266r2=42267view=diff

==
--- llvm/trunk/docs/ProgrammersManual.html (original)
+++ llvm/trunk/docs/ProgrammersManual.html Mon Sep 24 12:52:25 2007
@@ -77,6 +77,11 @@
   lia href=#dss_maplt;mapgt;/a/li
   lia href=#dss_othermapOther Map-Like Container Options/a/li
 /ul/li
+lia href=#ds_bitBitVector-like containers/a
+ul
+  lia href=#dss_bitvectorA dense bitvector/a/li
+  lia href=#dss_sparsebitvectorA sparse bitvector/a/li
+/ul/li
   /ul
   /li
   lia href=#commonHelpful Hints for Common Operations/a
@@ -705,6 +710,11 @@
 iteration, but do not support efficient look-up based on a key.
 /li
 
+lia a href=#ds_bitbit/a container provides an efficient way to store 
and
+perform set operations on sets of numeric id's, while automatically
+eliminating duplicates.  Bit containers require a maximum of 1 bit for each
+identifier you want to store.
+/li
 /ul
 
 p
@@ -1276,6 +1286,45 @@
 
 /div
 
+!-- === 
--
+div class=doc_subsection
+  a name=ds_bitBit storage containers (BitVector, SparseBitVector)/a
+/div
+
+div class=doc_text
+Unlike the other containers, there are only two bit storage containers, and 
when
+to use each is relatively straightforward.
+/div
+
+!-- ___ 
--
+div class=doc_subsubsection
+  a name=dss_bitvectorBitVector/a
+/div
+
+div class=doc_text
+p The BitVector container provides a fixed size set of bits for manipulation.
+It supports individual bit setting/testing, as well as set operations.  The set
+operations take time O(size of bitvector), but operations are performed one 
word
+at a time, instead of one bit at a time.  This makes the BitVector very fast 
for
+set operations compared to other containers.  Use the BitVector when you expect
+the number of set bits to be high (IE a dense set).
+/p
+/div
+
+!-- ___ 
--
+div class=doc_subsubsection
+  a name=dss_sparsebitvectorSparseBitVector/a
+/div
+
+div class=doc_text
+p The SparseBitVector container is much like BitVector, with one major
+difference: Only the bits that are set, are stored.  This makes the
+SparseBitVector much more space efficient than BitVector when the set is 
sparse,
+as well as making set operations O(number of set bits) instead of O(size of
+universe).  The downside to the SparseBitVector is that setting and testing of 
random bits is O(N), and on large SparseBitVectors, this can be slower than 
BitVector. In our implementation, setting or testing bits in sorted order
+(either forwards or reverse) is O(1) worst case.  Testing and setting bits 
within 128 bits (depends on size) of the current bit is also O(1).  As a 
general statement, testing/setting bits in a SparseBitVector is O(distance away 
from last set bit).
+/p
+/div
 
 !-- *** 
--
 div class=doc_section


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


Re: [llvm-commits] [llvm] r42266 - /llvm/trunk/test/CFrontend/2007-09-17-WeakRef.c

2007-09-24 Thread Duncan Sands
Hi Tanya,

 XFAIL for llvm-gcc4.0

I'm pretty sure this only failed for llvm-gcc-4.2
but passed with 4.0...  Did you mean 4.2 here?

Thanks,

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


Re: [llvm-commits] [llvm] r42266 - /llvm/trunk/test/CFrontend/2007-09-17-WeakRef.c

2007-09-24 Thread Tanya M. Lattner

 I'm pretty sure this only failed for llvm-gcc-4.2
 but passed with 4.0...  Did you mean 4.2 here?

No. This fails for me on llvm-gcc4.0.

-Tanya


 Thanks,

 Duncan.

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


[llvm-commits] [llvm] r42268 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td

2007-09-24 Thread Dan Gohman
Author: djg
Date: Mon Sep 24 14:25:06 2007
New Revision: 42268

URL: http://llvm.org/viewvc/llvm-project?rev=42268view=rev
Log:
Fix the syntax for the .loc directive in preparation for using it.

Modified:
llvm/trunk/lib/Target/X86/X86InstrInfo.td

Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=42268r1=42267r2=42268view=diff

==
--- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Mon Sep 24 14:25:06 2007
@@ -2434,7 +2434,7 @@
 
 def DWARF_LOC   : I0, Pseudo, (outs),
 (ins i32imm:$line, i32imm:$col, i32imm:$file),
-; .loc ${file:debug}, ${line:debug}, ${col:debug},
+.loc\t${file:debug} ${line:debug} ${col:debug},
 [(dwarf_loc (i32 imm:$line), (i32 imm:$col),
   (i32 imm:$file))];
 


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


[llvm-commits] [llvm] r42270 - in /llvm/trunk: lib/Transforms/Scalar/LICM.cpp test/Transforms/LICM/2007-09-24-PromoteNullValue.ll

2007-09-24 Thread Devang Patel
Author: dpatel
Date: Mon Sep 24 15:02:42 2007
New Revision: 42270

URL: http://llvm.org/viewvc/llvm-project?rev=42270view=rev
Log:
 Do not promote null values because it may be unsafe to do so.

Added:
llvm/trunk/test/Transforms/LICM/2007-09-24-PromoteNullValue.ll
Modified:
llvm/trunk/lib/Transforms/Scalar/LICM.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=42270r1=42269r2=42270view=diff

==
--- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Mon Sep 24 15:02:42 2007
@@ -800,6 +800,10 @@
   break;
 }
 
+  // Do not promote null values because it may be unsafe to do so.
+  if (isaConstantPointerNull(V))
+PointerOk = false;
+
   if (GetElementPtrInst *GEP = dyn_castGetElementPtrInst(V)) {
 // If GEP base is NULL then the calculated address used by Store or
 // Load instruction is invalid. Do not promote this value because

Added: llvm/trunk/test/Transforms/LICM/2007-09-24-PromoteNullValue.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LICM/2007-09-24-PromoteNullValue.ll?rev=42270view=auto

==
--- llvm/trunk/test/Transforms/LICM/2007-09-24-PromoteNullValue.ll (added)
+++ llvm/trunk/test/Transforms/LICM/2007-09-24-PromoteNullValue.ll Mon Sep 24 
15:02:42 2007
@@ -0,0 +1,46 @@
+; Do not promote null value because it may be unsafe to do so.
+; RUN: llvm-as  %s | opt -licm | llvm-dis | not grep promoted
+
+define i32 @f(i32 %foo, i32 %bar, i32 %com) {
+entry:
+   %tmp2 = icmp eq i32 %foo, 0 ; i1 [#uses=1]
+   br i1 %tmp2, label %cond_next, label %cond_true
+
+cond_true: ; preds = %entry
+   br label %return
+
+cond_next: ; preds = %entry
+   br label %bb
+
+bb:; preds = %bb15, %cond_next
+   switch i32 %bar, label %bb15 [
+i32 1, label %bb6
+   ]
+
+bb6:   ; preds = %bb
+   %tmp8 = icmp eq i32 %com, 0 ; i1 [#uses=1]
+   br i1 %tmp8, label %cond_next14, label %cond_true11
+
+cond_true11:   ; preds = %bb6
+   br label %return
+
+cond_next14:   ; preds = %bb6
+   store i8 0, i8* null
+   br label %bb15
+
+bb15:  ; preds = %cond_next14, %bb
+   br label %bb
+
+return:; preds = %cond_true11, %cond_true
+   %storemerge = phi i32 [ 0, %cond_true ], [ undef, %cond_true11 ]
; i32 [#uses=1]
+   ret i32 %storemerge
+}
+
+define i32 @kdMain() {
+entry:
+   %tmp1 = call i32 @f( i32 0, i32 1, i32 1 )  ; i32 
[#uses=0]
+   call void @exit( i32 0 )
+   unreachable
+}
+
+declare void @exit(i32)


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


Re: [llvm-commits] [llvm] r42269 - in /llvm/trunk: include/llvm/ADT/DenseMap.h include/llvm/ADT/SparseBitVector.h lib/Analysis/IPA/Andersens.cpp

2007-09-24 Thread Duncan Sands
Hi DannyB,

 @@ -287,6 +286,14 @@
  }
  BecameZero = allzero;
}
 +  // Get a hash value for this element;
 +  uint64_t getHashValue() const {

shouldn't there be a blank line before the added lines?

 +// The Offline constraint graph optimization portion includes offline 
 variable

The Offline - The offline

 +// substitution algorithms intended to pointer and location equivalences.

Does not parse!

 +// graph.  Due to various optimizations, not always the case that there 
 is a

not always the case - it is not always the case

 +  // True if our ponits-to set is in the Set2PEClass map

ponits-to - points-to

 +  // True if our node has no indirect constraints (Complex or otherwise)

Complex - complex

 +  // their arg nodes, which must be kept at the same position relative to
 +  // their base function node.
 +  // kept at the same position relative to their base function node.

Looks like this last line shouldn't be there.

Ciao,

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


[llvm-commits] [llvm] r42271 - in /llvm/trunk/lib/Target/Mips: MipsAsmPrinter.cpp MipsISelDAGToDAG.cpp MipsInstrInfo.td

2007-09-24 Thread Bruno Cardoso Lopes
Author: bruno
Date: Mon Sep 24 15:15:11 2007
New Revision: 42271

URL: http://llvm.org/viewvc/llvm-project?rev=42271view=rev
Log:
Added LoadEffective pattern to handle stack locations.
Fixed some comments

Modified:
llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp
llvm/trunk/lib/Target/Mips/MipsInstrInfo.td

Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=42271r1=42270r2=42271view=diff

==
--- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Mon Sep 24 15:15:11 2007
@@ -141,7 +141,7 @@
   #endif
 
   unsigned int Bitmask = getSavedRegsBitmask(false, MF);
-  O  \t.mask\t; 
+  O  \t.mask \t; 
   printHex32(Bitmask);
   O  ,  Offset  \n;
 }
@@ -366,9 +366,16 @@
 void MipsAsmPrinter::
 printMemOperand(const MachineInstr *MI, int opNum, const char *Modifier) 
 {
-  // lw/sw $reg, MemOperand
-  // will turn into :
-  // lw/sw $reg, imm($reg)
+  // when using stack locations for not load/store instructions
+  // print the same way as all normal 3 operand instructions.
+  if (Modifier  !strcmp(Modifier, stackloc)) {
+printOperand(MI, opNum+1);
+O  , ;
+printOperand(MI, opNum);
+return;
+  }
+
+  // Load/Store memory operands -- imm($reg)
   printOperand(MI, opNum);
   O  (;
   printOperand(MI, opNum+1);

Modified: llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp?rev=42271r1=42270r2=42271view=diff

==
--- llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp Mon Sep 24 15:15:11 2007
@@ -196,8 +196,8 @@
   }
 
   ///
-  // Instruction Selection not handled by custom or by the 
-  // auto-generated tablegen selection should be handled here
+  // Instruction Selection not handled by the auto-generated 
+  // tablegen selection should be handled here.
   /// 
   switch(Opcode) {
 

Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.td?rev=42271r1=42270r2=42271view=diff

==
--- llvm/trunk/lib/Target/Mips/MipsInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Mon Sep 24 15:15:11 2007
@@ -332,6 +332,12 @@
   !strconcat(instr_asm,  $dst, $src), 
   [], IIAlu;
 
+class EffectiveAddressstring instr_asm : 
+  FI0x09, 
+ (outs CPURegs:$dst), 
+ (ins mem:$addr),
+ instr_asm,
+ [(set CPURegs:$dst, addr:$addr)], IIAlu;
 
 
//===--===//
 // Pseudo instructions
@@ -468,6 +474,12 @@
 jr $target, [(MipsRet CPURegs:$target)], IIBranch;
 }
 
+// FrameIndexes are legalized when they are operands from load/store 
+// instructions. The same not happens for stack address copies, so an
+// add op with mem ComplexPattern is used and the stack address copy
+// can be matched. It's similar to Sparc LEA_ADDRi
+def LEA_ADDiu : EffectiveAddressaddiu $dst, ${addr:stackloc};
+
 
//===--===//
 //  Arbitrary patterns that map to one or more instructions
 
//===--===//


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


Re: [llvm-commits] [llvm] r42270 - in /llvm/trunk: lib/Transforms/Scalar/LICM.cpp test/Transforms/LICM/2007-09-24-PromoteNullValue.ll

2007-09-24 Thread Dan Gohman
 Do not promote null values because it may be unsafe to do so.

Interesting. See our earlier discussion on LICM checking for
NULL constants :-}.

Dan

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


[llvm-commits] [llvm] r42272 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter.cpp

2007-09-24 Thread Dan Gohman
Author: djg
Date: Mon Sep 24 15:58:13 2007
New Revision: 42272

URL: http://llvm.org/viewvc/llvm-project?rev=42272view=rev
Log:
Add a routine for emitting .file directives, for setting up
file numbers to use with .loc directives.

Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/lib/CodeGen/AsmPrinter.cpp

Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=42272r1=42271r2=42272view=diff

==
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Mon Sep 24 15:58:13 2007
@@ -248,6 +248,9 @@
 /// @verbatim (Eg. '\t') @endverbatim
 void EmitString(const std::string String) const;
 
+/// EmitFile - Emit a .file directive.
+void EmitFile(unsigned Number, const std::string Name) const;
+
 
//===--===//
 
 /// EmitAlignment - Emit an alignment directive to the specified power of

Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter.cpp?rev=42272r1=42271r2=42272view=diff

==
--- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Mon Sep 24 15:58:13 2007
@@ -618,6 +618,17 @@
 }
 
 
+/// EmitFile - Emit a .file directive.
+void AsmPrinter::EmitFile(unsigned Number, const std::string Name) const {
+  O  \t.file\t  Number   \;
+  for (unsigned i = 0, N = Name.size(); i  N; ++i) {
+unsigned char C = Name[i];
+printStringChar(O, C);
+  }
+  O  \;
+}
+
+
 
//===--===//
 
 // EmitAlignment - Emit an alignment directive to the specified power of


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


[llvm-commits] [llvm] r42273 - /llvm/trunk/lib/VMCore/ConstantFold.cpp

2007-09-24 Thread Dale Johannesen
Author: johannes
Date: Mon Sep 24 16:06:09 2007
New Revision: 42273

URL: http://llvm.org/viewvc/llvm-project?rev=42273view=rev
Log:
float-int conversion rounds toward 0.  Duh.
Fixes PR1698.


Modified:
llvm/trunk/lib/VMCore/ConstantFold.cpp

Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.cpp?rev=42273r1=42272r2=42273view=diff

==
--- llvm/trunk/lib/VMCore/ConstantFold.cpp (original)
+++ llvm/trunk/lib/VMCore/ConstantFold.cpp Mon Sep 24 16:06:09 2007
@@ -196,7 +196,7 @@
   uint32_t DestBitWidth = castIntegerType(DestTy)-getBitWidth();
   APFloat::opStatus status = V.convertToInteger(x, DestBitWidth, 
  opc==Instruction::FPToSI,
- APFloat::rmNearestTiesToEven);
+ APFloat::rmTowardZero);
   if (status!=APFloat::opOK  status!=APFloat::opInexact)
 return 0; // give up
   APInt Val(DestBitWidth, 2, x);


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


[llvm-commits] [llvm] r42274 - in /llvm/trunk: include/llvm/Target/TargetAsmInfo.h lib/Target/TargetAsmInfo.cpp

2007-09-24 Thread Dan Gohman
Author: djg
Date: Mon Sep 24 16:09:53 2007
New Revision: 42274

URL: http://llvm.org/viewvc/llvm-project?rev=42274view=rev
Log:
Merge hasDotLoc and hasDotFile into hasDotLocAndDotFile since .loc and .file
aren't really usable without each other. 

Modified:
llvm/trunk/include/llvm/Target/TargetAsmInfo.h
llvm/trunk/lib/Target/TargetAsmInfo.cpp

Modified: llvm/trunk/include/llvm/Target/TargetAsmInfo.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetAsmInfo.h?rev=42274r1=42273r2=42274view=diff

==
--- llvm/trunk/include/llvm/Target/TargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Mon Sep 24 16:09:53 2007
@@ -286,14 +286,11 @@
 ///
 bool HasLEB128; // Defaults to false.
 
-/// hasDotLoc - True if target asm supports .loc directives.
+/// hasDotLocAndDotFile - True if target asm supports .loc and .file
+/// directives for emitting debugging information.
 ///
-bool HasDotLoc; // Defaults to false.
+bool HasDotLocAndDotFile; // Defaults to false.
 
-/// HasDotFile - True if target asm supports .file directives.
-///
-bool HasDotFile; // Defaults to false.
-
 /// SupportsDebugInformation - True if target supports emission of 
debugging
 /// information.
 bool SupportsDebugInformation;
@@ -568,11 +565,8 @@
 bool hasLEB128() const {
   return HasLEB128;
 }
-bool hasDotLoc() const {
-  return HasDotLoc;
-}
-bool hasDotFile() const {
-  return HasDotFile;
+bool hasDotLocAndDotFile() const {
+  return HasDotLocAndDotFile;
 }
 bool doesSupportDebugInformation() const {
   return SupportsDebugInformation;

Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=42274r1=42273r2=42274view=diff

==
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Mon Sep 24 16:09:53 2007
@@ -81,8 +81,7 @@
   AbsoluteDebugSectionOffsets(false),
   AbsoluteEHSectionOffsets(false),
   HasLEB128(false),
-  HasDotLoc(false),
-  HasDotFile(false),
+  HasDotLocAndDotFile(false),
   SupportsDebugInformation(false),
   SupportsExceptionHandling(false),
   DwarfRequiresFrameSection(true),


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


[llvm-commits] [llvm] r42275 - /llvm/trunk/lib/CodeGen/DwarfWriter.cpp

2007-09-24 Thread Dan Gohman
Author: djg
Date: Mon Sep 24 16:32:18 2007
New Revision: 42275

URL: http://llvm.org/viewvc/llvm-project?rev=42275view=rev
Log:
Add support for emitting .file directives to set up file numbers for
use with .loc directives.

Modified:
llvm/trunk/lib/CodeGen/DwarfWriter.cpp

Modified: llvm/trunk/lib/CodeGen/DwarfWriter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfWriter.cpp?rev=42275r1=42274r2=42275view=diff

==
--- llvm/trunk/lib/CodeGen/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/DwarfWriter.cpp Mon Sep 24 16:32:18 2007
@@ -28,6 +28,7 @@
 #include llvm/Support/CommandLine.h
 #include llvm/Support/DataTypes.h
 #include llvm/Support/Mangler.h
+#include llvm/System/Path.h
 #include llvm/Target/TargetAsmInfo.h
 #include llvm/Target/MRegisterInfo.h
 #include llvm/Target/TargetData.h
@@ -1967,6 +1968,19 @@
 if (didInitial) return;
 didInitial = true;
 
+// Print out .file directives to specify files for .loc directives.
+if (TAI-hasDotLocAndDotFile()) {
+  const UniqueVectorSourceFileInfo SourceFiles = MMI-getSourceFiles();
+  const UniqueVectorstd::string Directories = MMI-getDirectories();
+  for (unsigned i = 1, e = SourceFiles.size(); i = e; ++i) {
+sys::Path FullPath(Directories[SourceFiles[i].getDirectoryID()]);
+bool AppendOk = FullPath.appendComponent(SourceFiles[i].getName());
+assert(AppendOk  Could not append filename to directory!);
+Asm-EmitFile(i, FullPath.toString());
+Asm-EOL();
+  }
+}
+
 // Dwarf sections base addresses.
 if (TAI-doesDwarfRequireFrameSection()) {
   Asm-SwitchToDataSection(TAI-getDwarfFrameSection());


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


[llvm-commits] [llvm] r42276 - /llvm/trunk/lib/CodeGen/DwarfWriter.cpp

2007-09-24 Thread Dan Gohman
Author: djg
Date: Mon Sep 24 16:36:21 2007
New Revision: 42276

URL: http://llvm.org/viewvc/llvm-project?rev=42276view=rev
Log:
Move the Asm-EOL() call for EmitDebugARanges outside the #ifdef for
consistency with the other currently empty sections.

Modified:
llvm/trunk/lib/CodeGen/DwarfWriter.cpp

Modified: llvm/trunk/lib/CodeGen/DwarfWriter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfWriter.cpp?rev=42276r1=42275r2=42276view=diff

==
--- llvm/trunk/lib/CodeGen/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/DwarfWriter.cpp Mon Sep 24 16:36:21 2007
@@ -2525,9 +2525,9 @@
 
 Asm-EmitInt32(0); Asm-EOL(EOM (1));
 Asm-EmitInt32(0); Asm-EOL(EOM (2));
+  #endif
 
 Asm-EOL();
-  #endif
   }
 
   /// EmitDebugRanges - Emit visible names into a debug ranges section.


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


[llvm-commits] [llvm] r42277 - /llvm/trunk/lib/CodeGen/DwarfWriter.cpp

2007-09-24 Thread Dan Gohman
Author: djg
Date: Mon Sep 24 16:43:52 2007
New Revision: 42277

URL: http://llvm.org/viewvc/llvm-project?rev=42277view=rev
Log:
Don't emit .debug_line header data if there aren't any lines to put in it,
such as will happen when .loc directives are used.

Modified:
llvm/trunk/lib/CodeGen/DwarfWriter.cpp

Modified: llvm/trunk/lib/CodeGen/DwarfWriter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfWriter.cpp?rev=42277r1=42276r2=42277view=diff

==
--- llvm/trunk/lib/CodeGen/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/DwarfWriter.cpp Mon Sep 24 16:43:52 2007
@@ -2196,6 +2196,11 @@
   /// EmitDebugLines - Emit source line information.
   ///
   void EmitDebugLines() {
+// If there are no lines to emit (such as when we're using .loc directives
+// to emit .debug_line information) don't emit a .debug_line header.
+if (SectionSourceLines.empty())
+  return;
+
 // Minimum line delta, thus ranging from -10..(255-10).
 const int MinLineDelta = -(DW_LNS_fixed_advance_pc + 1);
 // Maximum line delta, thus ranging from -10..(255-10).


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


[llvm-commits] [llvm] r42278 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

2007-09-24 Thread Dan Gohman
Author: djg
Date: Mon Sep 24 16:54:14 2007
New Revision: 42278

URL: http://llvm.org/viewvc/llvm-project?rev=42278view=rev
Log:
Add support on x86 for having Legalize lower ISD::LOCATION to ISD::DEBUG_LOC
instead of ISD::LABEL with a manual .debug_line entry when the assembler
supports .file and .loc directives.

Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=42278r1=42277r2=42278view=diff

==
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Sep 24 16:54:14 2007
@@ -32,6 +32,7 @@
 #include llvm/CodeGen/SelectionDAG.h
 #include llvm/CodeGen/SSARegMap.h
 #include llvm/Support/MathExtras.h
+#include llvm/Target/TargetAsmInfo.h
 #include llvm/Target/TargetOptions.h
 #include llvm/ADT/StringExtras.h
 #include llvm/ParameterAttributes.h
@@ -229,9 +230,13 @@
   setOperationAction(ISD::MEMSET  , MVT::Other, Custom);
   setOperationAction(ISD::MEMCPY  , MVT::Other, Custom);
 
-  // We don't have line number support yet.
+  // Use the default ISD::LOCATION expansion, and tell Legalize it's
+  // ok to use DEBUG_LOC if we have an assembler that supports it.
   setOperationAction(ISD::LOCATION, MVT::Other, Expand);
-  setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
+  if (TM.getTargetAsmInfo()-hasDotLocAndDotFile())
+setOperationAction(ISD::DEBUG_LOC, MVT::Other, Legal);
+  else
+setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
   // FIXME - use subtarget debug flags
   if (!Subtarget-isTargetDarwin() 
   !Subtarget-isTargetELF() 


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


Re: [llvm-commits] [llvm] r42269 - in /llvm/trunk: include/llvm/ADT/DenseMap.h include/llvm/ADT/SparseBitVector.h lib/Analysis/IPA/Andersens.cpp

2007-09-24 Thread Daniel Berlin
On 9/24/07, Duncan Sands [EMAIL PROTECTED] wrote:
 Hi DannyB,

  @@ -287,6 +286,14 @@
   }
   BecameZero = allzero;
 }
  +  // Get a hash value for this element;
  +  uint64_t getHashValue() const {

 shouldn't there be a blank line before the added lines?

  +// The Offline constraint graph optimization portion includes offline 
  variable

 The Offline - The offline

  +// substitution algorithms intended to pointer and location equivalences.

 Does not parse!

  +// graph.  Due to various optimizations, not always the case that 
  there is a

 not always the case - it is not always the case

  +  // True if our ponits-to set is in the Set2PEClass map

 ponits-to - points-to

  +  // True if our node has no indirect constraints (Complex or 
  otherwise)

 Complex - complex

  +  // their arg nodes, which must be kept at the same position relative 
  to
  +  // their base function node.
  +  // kept at the same position relative to their base function node.

 Looks like this last line shouldn't be there.

All fixed

 Ciao,

 Duncan.

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


[llvm-commits] [llvm] r42279 - in /llvm/trunk: include/llvm/ADT/SparseBitVector.h lib/Analysis/IPA/Andersens.cpp

2007-09-24 Thread Daniel Berlin
Author: dannyb
Date: Mon Sep 24 17:20:45 2007
New Revision: 42279

URL: http://llvm.org/viewvc/llvm-project?rev=42279view=rev
Log:
Comment fixups

Modified:
llvm/trunk/include/llvm/ADT/SparseBitVector.h
llvm/trunk/lib/Analysis/IPA/Andersens.cpp

Modified: llvm/trunk/include/llvm/ADT/SparseBitVector.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SparseBitVector.h?rev=42279r1=42278r2=42279view=diff

==
--- llvm/trunk/include/llvm/ADT/SparseBitVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SparseBitVector.h Mon Sep 24 17:20:45 2007
@@ -286,6 +286,7 @@
 }
 BecameZero = allzero;
   }
+
   // Get a hash value for this element;
   uint64_t getHashValue() const {
 uint64_t HashVal = 0;

Modified: llvm/trunk/lib/Analysis/IPA/Andersens.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/Andersens.cpp?rev=42279r1=42278r2=42279view=diff

==
--- llvm/trunk/lib/Analysis/IPA/Andersens.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/Andersens.cpp Mon Sep 24 17:20:45 2007
@@ -30,11 +30,11 @@
 // B can point to.  Constraints can handle copies, loads, and stores, and
 // address taking.
 //
-// The Offline constraint graph optimization portion includes offline variable
-// substitution algorithms intended to pointer and location equivalences.
-// Pointer equivalences are those pointers that will have the same points-to
-// sets, and location equivalences are those variables that always appear
-// together in points-to sets.
+// The offline constraint graph optimization portion includes offline variable
+// substitution algorithms intended to computer pointer and location
+// equivalences.  Pointer equivalences are those pointers that will have the
+// same points-to sets, and location equivalences are those variables that
+// always appear together in points-to sets.
 //
 // The inclusion constraint solving phase iteratively propagates the inclusion
 // constraints until a fixed point is reached.  This is an O(N^3) algorithm.
@@ -137,10 +137,10 @@
 };
 
 // Node class - This class is used to represent a node in the constraint
-// graph.  Due to various optimizations, not always the case that there is 
a
-// mapping from a Node to a Value.  In particular, we add artificial Node's
-// that represent the set of pointed-to variables shared for each location
-// equivalent Node.
+// graph.  Due to various optimizations, it is not always the case that
+// there is a mapping from a Node to a Value.  In particular, we add
+// artificial Node's that represent the set of pointed-to variables shared
+// for each location equivalent Node.
 struct Node {
   Value *Val;
   SparseBitVector *Edges;
@@ -160,15 +160,14 @@
   // Number of incoming edges, used during variable substitution to early
   // free the points-to sets
   unsigned NumInEdges;
-  // True if our ponits-to set is in the Set2PEClass map
+  // True if our points-to set is in the Set2PEClass map
   bool StoredInHash;
-  // True if our node has no indirect constraints (Complex or otherwise)
+  // True if our node has no indirect constraints (complex or otherwise)
   bool Direct;
   // True if the node is address taken, *or* it is part of a group of nodes
   // that must be kept together.  This is set to true for functions and
   // their arg nodes, which must be kept at the same position relative to
   // their base function node.
-  // kept at the same position relative to their base function node.
   bool AddressTaken;
 
   // Nodes in cycles (or in equivalence classes) are united together using 
a


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


[llvm-commits] [llvm] r42280 - /llvm/trunk/lib/Analysis/IPA/Andersens.cpp

2007-09-24 Thread Bill Wendling
Author: void
Date: Mon Sep 24 17:43:48 2007
New Revision: 42280

URL: http://llvm.org/viewvc/llvm-project?rev=42280view=rev
Log:
Don't execute dump unless NDEBUG isn't defined.

Modified:
llvm/trunk/lib/Analysis/IPA/Andersens.cpp

Modified: llvm/trunk/lib/Analysis/IPA/Andersens.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/Andersens.cpp?rev=42280r1=42279r2=42280view=diff

==
--- llvm/trunk/lib/Analysis/IPA/Andersens.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/Andersens.cpp Mon Sep 24 17:43:48 2007
@@ -1185,7 +1185,9 @@
 }
 
 void dumpToDOUT(SparseBitVector *bitmap) {
+#ifndef NDEBUG
   dump(*bitmap, DOUT);
+#endif
 }
 
 


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


[llvm-commits] [llvm] r42281 - /llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp

2007-09-24 Thread Dale Johannesen
Author: johannes
Date: Mon Sep 24 17:52:39 2007
New Revision: 42281

URL: http://llvm.org/viewvc/llvm-project?rev=42281view=rev
Log:
When mixing SSE and x87 codegen, it's possible to
have situations where an SSE instruction turns into
multiple blocks, with the live range of an x87
register crossing them.  To do this correctly make
sure we examine all blocks when inserting
FP_REG_KILL.  PR 1697.  (This was exposed by my
fix for PR 1681, but the same thing could happen
mixing x87 long double with SSE.)


Modified:
llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp

Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=42281r1=42280r2=42281view=diff

==
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Sep 24 17:52:39 2007
@@ -482,14 +482,17 @@
   // block defines any FP values.  If so, put an FP_REG_KILL instruction before
   // the terminator of the block.
 
-  // Note that FP stack instructions *are* used in SSE code for long double,
-  // so we do need this check.
-  bool ContainsFPCode = false;
+  // Note that FP stack instructions are used in all modes for long double,
+  // so we always need to do this check.
+  // Also note that it's possible for an FP stack register to be live across
+  // an instruction that produces multiple basic blocks (SSE CMOV) so we
+  // must check all the generated basic blocks.
 
   // Scan all of the machine instructions in these MBBs, checking for FP
   // stores.  (RFP32 and RFP64 will not exist in SSE mode, but RFP80 might.)
   MachineFunction::iterator MBBI = FirstMBB;
   do {
+bool ContainsFPCode = false;
 for (MachineBasicBlock::iterator I = MBBI-begin(), E = MBBI-end();
  !ContainsFPCode  I != E; ++I) {
   if (I-getNumOperands() != 0  I-getOperand(0).isRegister()) {
@@ -507,35 +510,34 @@
 }
   }
 }
-  } while (!ContainsFPCode  *(MBBI++) != BB);
-
-  // Check PHI nodes in successor blocks.  These PHI's will be lowered to have
-  // a copy of the input value in this block.  In SSE mode, we only care about
-  // 80-bit values.
-  if (!ContainsFPCode) {
-// Final check, check LLVM BB's that are successors to the LLVM BB
-// corresponding to BB for FP PHI nodes.
-const BasicBlock *LLVMBB = BB-getBasicBlock();
-const PHINode *PN;
-for (succ_const_iterator SI = succ_begin(LLVMBB), E = succ_end(LLVMBB);
- !ContainsFPCode  SI != E; ++SI) {
-  for (BasicBlock::const_iterator II = SI-begin();
-   (PN = dyn_castPHINode(II)); ++II) {
-if (PN-getType()==Type::X86_FP80Ty ||
-(!Subtarget-hasSSE2()  PN-getType()-isFloatingPoint())) {
-  ContainsFPCode = true;
-  break;
+// Check PHI nodes in successor blocks.  These PHI's will be lowered to 
have
+// a copy of the input value in this block.  In SSE mode, we only care 
about
+// 80-bit values.
+if (!ContainsFPCode) {
+  // Final check, check LLVM BB's that are successors to the LLVM BB
+  // corresponding to BB for FP PHI nodes.
+  const BasicBlock *LLVMBB = BB-getBasicBlock();
+  const PHINode *PN;
+  for (succ_const_iterator SI = succ_begin(LLVMBB), E = succ_end(LLVMBB);
+   !ContainsFPCode  SI != E; ++SI) {
+for (BasicBlock::const_iterator II = SI-begin();
+ (PN = dyn_castPHINode(II)); ++II) {
+  if (PN-getType()==Type::X86_FP80Ty ||
+  (!Subtarget-hasSSE1()  PN-getType()-isFloatingPoint()) ||
+  (!Subtarget-hasSSE2()  PN-getType()==Type::DoubleTy)) {
+ContainsFPCode = true;
+break;
+  }
 }
   }
 }
-  }
-
-  // Finally, if we found any FP code, emit the FP_REG_KILL instruction.
-  if (ContainsFPCode) {
-BuildMI(*BB, BB-getFirstTerminator(),
-TM.getInstrInfo()-get(X86::FP_REG_KILL));
-++NumFPKill;
-  }
+// Finally, if we found any FP code, emit the FP_REG_KILL instruction.
+if (ContainsFPCode) {
+  BuildMI(*MBBI, MBBI-getFirstTerminator(),
+  TM.getInstrInfo()-get(X86::FP_REG_KILL));
+  ++NumFPKill;
+}
+  } while (*(MBBI++) != BB);
 }
 
 /// MatchAddress - Add the specified node to the specified addressing mode,


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


[llvm-commits] [llvm] r42282 - in /llvm/trunk: lib/Target/TargetSelectionDAG.td utils/TableGen/DAGISelEmitter.cpp

2007-09-24 Thread Evan Cheng
Author: evancheng
Date: Mon Sep 24 20:48:59 2007
New Revision: 42282

URL: http://llvm.org/viewvc/llvm-project?rev=42282view=rev
Log:
Rename keyword modify - implicit.

Modified:
llvm/trunk/lib/Target/TargetSelectionDAG.td
llvm/trunk/utils/TableGen/DAGISelEmitter.cpp

Modified: llvm/trunk/lib/Target/TargetSelectionDAG.td
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetSelectionDAG.td?rev=42282r1=42281r2=42282view=diff

==
--- llvm/trunk/lib/Target/TargetSelectionDAG.td (original)
+++ llvm/trunk/lib/Target/TargetSelectionDAG.td Mon Sep 24 20:48:59 2007
@@ -197,7 +197,7 @@
 }
 
 def set;
-def modify;
+def implicit;
 def parallel;
 def node;
 def srcvalue;

Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=42282r1=42281r2=42282view=diff

==
--- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Mon Sep 24 20:48:59 2007
@@ -691,7 +691,7 @@
   MadeChange |= UpdateNodeType(MVT::isVoid, TP);
 }
 return MadeChange;
-  } else if (getOperator()-getName() == modify ||
+  } else if (getOperator()-getName() == implicit ||
  getOperator()-getName() == parallel) {
 bool MadeChange = false;
 for (unsigned i = 0; i  getNumChildren(); ++i)
@@ -976,7 +976,7 @@
   !Operator-isSubClassOf(SDNodeXForm) 
   !Operator-isSubClassOf(Intrinsic) 
   Operator-getName() != set 
-  Operator-getName() != modify 
+  Operator-getName() != implicit 
   Operator-getName() != parallel)
 error(Unrecognized node ' + Operator-getName() + '!);
   
@@ -1385,15 +1385,15 @@
 if (!isUse  Pat-getTransformFn())
   I-error(Cannot specify a transform function for a non-input value!);
 return;
-  } else if (Pat-getOperator()-getName() == modify) {
+  } else if (Pat-getOperator()-getName() == implicit) {
 for (unsigned i = 0, e = Pat-getNumChildren(); i != e; ++i) {
   TreePatternNode *Dest = Pat-getChild(i);
   if (!Dest-isLeaf())
-I-error(modify value should be a register!);
+I-error(implicitly defined value should be a register!);
 
   DefInit *Val = dynamic_castDefInit*(Dest-getLeafValue());
   if (!Val || !Val-getDef()-isSubClassOf(Register))
-I-error(modify value should be a register!);
+I-error(implicitly defined value should be a register!);
   InstImpResults.push_back(Val-getDef());
 }
 return;
@@ -2789,7 +2789,7 @@
   CodeGenInstruction II = CGT.getInstruction(Op-getName());
   const DAGInstruction Inst = ISE.getInstruction(Op);
   TreePattern *InstPat = Inst.getPattern();
-  // FIXME: Assume actual pattern comes before modify.
+  // FIXME: Assume actual pattern comes before implicit.
   TreePatternNode *InstPatNode =
 isRoot ? (InstPat ? InstPat-getTree(0) : Pattern)
: (InstPat ? InstPat-getTree(0) : NULL);


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


[llvm-commits] [llvm] r42284 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h lib/CodeGen/SelectionDAG/ScheduleDAG.cpp lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp lib/CodeGen/SelectionDAG/Schedul

2007-09-24 Thread Evan Cheng
Author: evancheng
Date: Mon Sep 24 20:54:36 2007
New Revision: 42284

URL: http://llvm.org/viewvc/llvm-project?rev=42284view=rev
Log:
Added major new capabilities to scheduler (only BURR for now) to support 
physical register dependency. The BURR scheduler can now backtrace and 
duplicate instructions in order to avoid expensive / impossible to copy 
values (e.g. status flag EFLAGS for x86) from being clobbered.

Modified:
llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp

Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=42284r1=42283r2=42284view=diff

==
--- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Mon Sep 24 20:54:36 2007
@@ -79,12 +79,13 @@
   /// SDep - Scheduling dependency. It keeps track of dependent nodes,
   /// cost of the depdenency, etc.
   struct SDep {
-SUnit*Dep;  // Dependent - either a predecessor or a successor.
-bool  isCtrl;   // True iff it's a control dependency.
-unsigned  PhyReg;   // If non-zero, this dep is a phy register dependency.
-int   Cost; // Cost of the dependency.
-SDep(SUnit *d, bool c, unsigned r, int t)
-  : Dep(d), isCtrl(c), PhyReg(r), Cost(t) {}
+SUnit*Dep;   // Dependent - either a predecessor or a 
successor.
+unsigned  Reg;   // If non-zero, this dep is a phy register 
dependency.
+int   Cost;  // Cost of the dependency.
+bool  isCtrl: 1; // True iff it's a control dependency.
+bool  isSpecial : 1; // True iff it's a special ctrl dep added during 
sched.
+SDep(SUnit *d, unsigned r, int t, bool c, bool s)
+  : Dep(d), Reg(r), Cost(t), isCtrl(c), isSpecial(s) {}
   };
 
   /// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or
@@ -92,6 +93,8 @@
   struct SUnit {
 SDNode *Node;   // Representative node.
 SmallVectorSDNode*,4 FlaggedNodes;// All nodes flagged to Node.
+unsigned InstanceNo;// Instance#. One SDNode can be 
multiple
+// SUnit due to cloning.
 
 // Preds/Succs - The SUnits before/after us in the graph.  The boolean 
value
 // is true if the edge is a token chain edge, false if it is a value edge. 
@@ -103,6 +106,8 @@
 typedef SmallVectorSDep, 4::const_iterator const_pred_iterator;
 typedef SmallVectorSDep, 4::const_iterator const_succ_iterator;
 
+unsigned NodeNum;   // Entry # of node in the node vector.
+unsigned short Latency; // Node latency.
 short NumPreds; // # of preds.
 short NumSuccs; // # of sucss.
 short NumPredsLeft; // # of preds not scheduled.
@@ -111,42 +116,94 @@
 short NumChainSuccsLeft;// # of chain succs not scheduled.
 bool isTwoAddress : 1;  // Is a two-address instruction.
 bool isCommutable : 1;  // Is a commutable instruction.
+bool hasImplicitDefs  : 1;  // Has implicit physical reg defs.
 bool isPending: 1;  // True once pending.
 bool isAvailable  : 1;  // True once available.
 bool isScheduled  : 1;  // True once scheduled.
-unsigned short Latency; // Node latency.
 unsigned CycleBound;// Upper/lower cycle to be scheduled 
at.
 unsigned Cycle; // Once scheduled, the cycle of the op.
 unsigned Depth; // Node depth;
 unsigned Height;// Node height;
-unsigned NodeNum;   // Entry # of node in the node vector.
 
 SUnit(SDNode *node, unsigned nodenum)
-  : Node(node), NumPreds(0), NumSuccs(0), NumPredsLeft(0), NumSuccsLeft(0),
+  : Node(node), InstanceNo(0), NodeNum(nodenum), Latency(0),
+NumPreds(0), NumSuccs(0), NumPredsLeft(0), NumSuccsLeft(0),
 NumChainPredsLeft(0), NumChainSuccsLeft(0),
-isTwoAddress(false), isCommutable(false),
+isTwoAddress(false), isCommutable(false), hasImplicitDefs(false),
 isPending(false), isAvailable(false), isScheduled(false),
-Latency(0), CycleBound(0), Cycle(0), Depth(0), Height(0),
-NodeNum(nodenum) {}
-
+CycleBound(0), Cycle(0), Depth(0), Height(0) {}
+
 /// addPred - This adds the specified node as a pred of the current node if
 /// not already.  This returns true if this is a new pred.

[llvm-commits] [llvm] r42286 - /llvm/trunk/docs/ReleaseNotes.html

2007-09-24 Thread Owen Anderson
Author: resistor
Date: Mon Sep 24 21:10:58 2007
New Revision: 42286

URL: http://llvm.org/viewvc/llvm-project?rev=42286view=rev
Log:
Fill in the sections about my contributions.

Modified:
llvm/trunk/docs/ReleaseNotes.html

Modified: llvm/trunk/docs/ReleaseNotes.html
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=42286r1=42285r2=42286view=diff

==
--- llvm/trunk/docs/ReleaseNotes.html (original)
+++ llvm/trunk/docs/ReleaseNotes.html Mon Sep 24 21:10:58 2007
@@ -98,9 +98,17 @@
 
 ul
 
-liOwen DSE and MemDep analysis/li
-liOwen GVN/li
-liOwen GVN-PRE, not in llvm-gcc/li
+liOwen Anderson wrote the new MemoryDependenceAnalysis pass, which provides 
+a lazy, caching layer on top of alias analysis.  He then used it to rewrite
+DeadStoreElimination which resulted in significantly better compile time 
in 
+common cases, /li
+liOwen implemented the new GVN pass, which is also based on 
+MemoryDependenceAnalysis.  This pass replaces GCSE/LoadVN in the standard
+set of passes, providing more aggressive optimization at a some-what 
+improved compile-time cost./li
+liOwen implemented GVN-PRE, a partial redundancy elimination algorithm that
+shares some details with the new GVN pass.  It is still in need of compile
+time tuning, and is not turned on by default./li
 liDevang merged ETForest and DomTree into a single easier to use data
 structure./li
 liNick Lewycky improved loop trip count analysis to handle many more common


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


[llvm-commits] [llvm-gcc-4.0] r42287 - in /llvm-gcc-4.0/trunk/gcc: c-common.h llvm-backend.cpp objc/objc-act.c stub-objc.c

2007-09-24 Thread Bill Wendling
Author: void
Date: Mon Sep 24 21:51:18 2007
New Revision: 42287

URL: http://llvm.org/viewvc/llvm-project?rev=42287view=rev
Log:
During the processing of Objective-C protocols, the objc frontend creates two
decls for the protocol. One for the metadata and another for when it's
referenced. However, protocols are internal global, so when we do a lookup
for the reference, it doesn't find the first decl because it's not external.
This will perform a second lookup for objective C protocols if we don't find
it among the external globals.


Modified:
llvm-gcc-4.0/trunk/gcc/c-common.h
llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp
llvm-gcc-4.0/trunk/gcc/objc/objc-act.c
llvm-gcc-4.0/trunk/gcc/stub-objc.c

Modified: llvm-gcc-4.0/trunk/gcc/c-common.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/c-common.h?rev=42287r1=42286r2=42287view=diff

==
--- llvm-gcc-4.0/trunk/gcc/c-common.h (original)
+++ llvm-gcc-4.0/trunk/gcc/c-common.h Mon Sep 24 21:51:18 2007
@@ -1139,6 +1139,12 @@
 extern void objc_remove_weak_read (tree*);
 /* APPLE LOCAL end radar 4426814 */
 
+/* APPLE LOCAL begin - LLVM radar 5476262 */
+#ifdef ENABLE_LLVM
+extern bool objc_is_protocol_reference (const char *name);
+#endif
+/* APPLE LOCAL end - LLVM radar 5476262 */
+
 /* APPLE LOCAL begin C* language */
 extern void objc_set_method_opt (int);
 void objc_finish_foreach_loop (location_t, tree, tree, tree, tree);

Modified: llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp?rev=42287r1=42286r2=42287view=diff

==
--- llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp Mon Sep 24 21:51:18 2007
@@ -66,6 +66,7 @@
 #include function.h
 #include tree-inline.h
 #include langhooks.h
+#include c-common.h
 }
 
 // Non-zero if bytecode from PCH is successfully read.
@@ -1060,6 +1061,14 @@
   // If the global has a name, prevent multiple vars with the same name 
from
   // being created.
   GlobalVariable *GVE = TheModule-getGlobalVariable(Name);
+
+  // And Objective-C @protocol will create a decl for the
+  // protocol metadata and then when the protocol is
+  // referenced. However, protocols have file-scope, so they
+  // aren't found in the GlobalVariable list unless we look at
+  // non-extern globals as well.
+  if (!GVE  c_dialect_objc()  objc_is_protocol_reference(Name))
+   GVE = TheModule-getGlobalVariable(Name, true);
 
   if (GVE == 0) {
 GV = new GlobalVariable(Ty, false, GlobalValue::ExternalLinkage,0,

Modified: llvm-gcc-4.0/trunk/gcc/objc/objc-act.c
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/objc/objc-act.c?rev=42287r1=42286r2=42287view=diff

==
--- llvm-gcc-4.0/trunk/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.0/trunk/gcc/objc/objc-act.c Mon Sep 24 21:51:18 2007
@@ -11669,6 +11669,19 @@
 }
 }
 
+/* APPLE LOCAL begin - LLVM radar 5476262 */
+#ifdef ENABLE_LLVM
+/* This routine returns true if the name is the same as a protocol
+   reference name.  */
+
+bool
+objc_is_protocol_reference (const char *name)
+{
+  return flag_objc_abi == 2  strstr (name, _OBJC_PROTOCOL_$_) != 0;
+}
+#endif
+/* APPLE LOCAL end - LLVM radar 5476262 */
+
 /* This routine builds the protocol_reference_chain for each protocol name used
@protocol(MyProtocol) expression. IDENT is current protocol name.  */
 

Modified: llvm-gcc-4.0/trunk/gcc/stub-objc.c
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/stub-objc.c?rev=42287r1=42286r2=42287view=diff

==
--- llvm-gcc-4.0/trunk/gcc/stub-objc.c (original)
+++ llvm-gcc-4.0/trunk/gcc/stub-objc.c Mon Sep 24 21:51:18 2007
@@ -548,3 +548,13 @@
   return false;
 }
 /* APPLE LOCAL end radar 4985544 */
+
+/* APPLE LOCAL begin - LLVM radar 5476262 */
+#ifdef ENABLE_LLVM
+bool
+objc_is_protocol_reference (const char * ARG_UNUSED(name))
+{
+  return false;
+}
+#endif
+/* APPLE LOCAL end - LLVM radar 5476262 */


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


[llvm-commits] [llvm-gcc-4.0] r42288 - /llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp

2007-09-24 Thread Bill Wendling
Author: void
Date: Mon Sep 24 22:18:23 2007
New Revision: 42288

URL: http://llvm.org/viewvc/llvm-project?rev=42288view=rev
Log:
Tabs are the devil's work!

Modified:
llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp

Modified: llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp?rev=42288r1=42287r2=42288view=diff

==
--- llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp Mon Sep 24 22:18:23 2007
@@ -1060,7 +1060,7 @@
 } else {
   // If the global has a name, prevent multiple vars with the same name 
from
   // being created.
-  GlobalVariable *GVE = TheModule-getGlobalVariable(Name);
+  GlobalVariable *GVE = TheModule-getGlobalVariable(Name, true);
 
   // And Objective-C @protocol will create a decl for the
   // protocol metadata and then when the protocol is
@@ -1068,7 +1068,7 @@
   // aren't found in the GlobalVariable list unless we look at
   // non-extern globals as well.
   if (!GVE  c_dialect_objc()  objc_is_protocol_reference(Name))
-   GVE = TheModule-getGlobalVariable(Name, true);
+GVE = TheModule-getGlobalVariable(Name, true);
 
   if (GVE == 0) {
 GV = new GlobalVariable(Ty, false, GlobalValue::ExternalLinkage,0,


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


[llvm-commits] [llvm-gcc-4.0] r42289 - /llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp

2007-09-24 Thread Bill Wendling
Author: void
Date: Mon Sep 24 22:21:18 2007
New Revision: 42289

URL: http://llvm.org/viewvc/llvm-project?rev=42289view=rev
Log:
Oops!

Modified:
llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp

Modified: llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp?rev=42289r1=42288r2=42289view=diff

==
--- llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp Mon Sep 24 22:21:18 2007
@@ -1060,7 +1060,7 @@
 } else {
   // If the global has a name, prevent multiple vars with the same name 
from
   // being created.
-  GlobalVariable *GVE = TheModule-getGlobalVariable(Name, true);
+  GlobalVariable *GVE = TheModule-getGlobalVariable(Name);
 
   // And Objective-C @protocol will create a decl for the
   // protocol metadata and then when the protocol is


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


Re: [llvm-commits] [llvm] r42278 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

2007-09-24 Thread Chris Lattner
 URL: http://llvm.org/viewvc/llvm-project?rev=42278view=rev
 Log:
 Add support on x86 for having Legalize lower ISD::LOCATION to  
 ISD::DEBUG_LOC
 instead of ISD::LABEL with a manual .debug_line entry when the  
 assembler
 supports .file and .loc directives.

Nice!


 -  // We don't have line number support yet.
 +  // Use the default ISD::LOCATION expansion, and tell Legalize it's
 +  // ok to use DEBUG_LOC if we have an assembler that supports it.
setOperationAction(ISD::LOCATION, MVT::Other, Expand);
 -  setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
 +  if (TM.getTargetAsmInfo()-hasDotLocAndDotFile())
 +setOperationAction(ISD::DEBUG_LOC, MVT::Other, Legal);
 +  else
 +setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);

Would it make sense to move this to a superclass?  It doesn't seem  
like any other definition would make sense.

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