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

2007-05-11 Thread Dan Gohman


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.73 -> 1.74
---
Log message:

Simplify BranchInst::getSuccessor, avoiding a conditional operator.


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

 Instructions.h |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.73 
llvm/include/llvm/Instructions.h:1.74
--- llvm/include/llvm/Instructions.h:1.73   Fri Apr 27 15:35:56 2007
+++ llvm/include/llvm/Instructions.hFri May 11 15:59:29 2007
@@ -1323,8 +1323,7 @@
 
   BasicBlock *getSuccessor(unsigned i) const {
 assert(i < getNumSuccessors() && "Successor # out of range for Branch!");
-return (i == 0) ? cast(getOperand(0)) :
-  cast(getOperand(1));
+return cast(getOperand(i));
   }
 
   void setSuccessor(unsigned idx, BasicBlock *NewSucc) {



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


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.72 -> 1.73
---
Log message:

add a GEP helper function


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

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


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.72 
llvm/include/llvm/Instructions.h:1.73
--- llvm/include/llvm/Instructions.h:1.72   Sun Apr 22 17:22:02 2007
+++ llvm/include/llvm/Instructions.hFri Apr 27 15:35:56 2007
@@ -441,6 +441,12 @@
   /// zeros.  If so, the result pointer and the first operand have the same
   /// value, just potentially different types.
   bool hasAllZeroIndices() const;
+  
+  /// hasAllConstantIndices - Return true if all of the indices of this GEP are
+  /// constant integers.  If so, the result pointer and the first operand have
+  /// a constant offset between them.
+  bool hasAllConstantIndices() const;
+  
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const GetElementPtrInst *) { return true; }



___
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-22 Thread Christopher Lamb


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.71 -> 1.72
---
Log message:

PR400: http://llvm.org/PR400  phase 1 implementation feedback.


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

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


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.71 
llvm/include/llvm/Instructions.h:1.72
--- llvm/include/llvm/Instructions.h:1.71   Sun Apr 22 14:24:39 2007
+++ llvm/include/llvm/Instructions.hSun Apr 22 17:22:02 2007
@@ -255,8 +255,7 @@
   /// getAlignment - Return the alignment of the access that is being performed
   ///
   unsigned getAlignment() const {
-signed Log2AlignVal = ((SubclassData>>1)-1);
-return ((Log2AlignVal < 0) ? 0 : 1<>1)) >> 1;
   }
   
   void setAlignment(unsigned Align);
@@ -331,8 +330,7 @@
   /// getAlignment - Return the alignment of the access that is being performed
   ///
   unsigned getAlignment() const {
-signed Log2AlignVal = ((SubclassData>>1)-1);
-return ((Log2AlignVal < 0) ? 0 : 1<>1)) >> 1;
   }
   
   void setAlignment(unsigned Align);



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

2007-04-22 Thread Chris Lattner
> +  /// getAlignment - Return the alignment of the access that is  
> being performed
> +  ///
> +  unsigned getAlignment() const {
> +signed Log2AlignVal = ((SubclassData>>1)-1);
> +return ((Log2AlignVal < 0) ? 0 : 1< +  }

I think that this can be written as:
((1 << (SubclassData>>1)) >> 1

which is branchless and simpler.

> +  /// getAlignment - Return the alignment of the access that is  
> being performed
> +  ///
> +  unsigned getAlignment() const {
> +signed Log2AlignVal = ((SubclassData>>1)-1);
> +return ((Log2AlignVal < 0) ? 0 : 1< +  }

Likewise,

-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-22 Thread Christopher Lamb


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.70 -> 1.71
---
Log message:

PR400: http://llvm.org/PR400  work phase 1. Add attributed load/store 
instructions for volatile/align to LLVM.


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

 Instructions.h |   44 +---
 1 files changed, 37 insertions(+), 7 deletions(-)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.70 
llvm/include/llvm/Instructions.h:1.71
--- llvm/include/llvm/Instructions.h:1.70   Sun Apr 22 12:28:03 2007
+++ llvm/include/llvm/Instructions.hSun Apr 22 14:24:39 2007
@@ -211,9 +211,11 @@
 /// SubclassData field in Value to store whether or not the load is volatile.
 ///
 class LoadInst : public UnaryInstruction {
+
   LoadInst(const LoadInst &LI)
 : UnaryInstruction(LI.getType(), Load, LI.getOperand(0)) {
 setVolatile(LI.isVolatile());
+setAlignment(LI.getAlignment());
 
 #ifndef NDEBUG
 AssertOK();
@@ -223,14 +225,16 @@
 public:
   LoadInst(Value *Ptr, const std::string &Name, Instruction *InsertBefore);
   LoadInst(Value *Ptr, const std::string &Name, BasicBlock *InsertAtEnd);
-  LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false,
+  LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false, 
+   Instruction *InsertBefore = 0);
+  LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, unsigned 
Align,
Instruction *InsertBefore = 0);
   LoadInst(Value *Ptr, const std::string &Name, bool isVolatile,
BasicBlock *InsertAtEnd);
 
   LoadInst(Value *Ptr, const char *Name, Instruction *InsertBefore);
   LoadInst(Value *Ptr, const char *Name, BasicBlock *InsertAtEnd);
-  explicit LoadInst(Value *Ptr, const char *Name = 0, bool isVolatile = false,
+  explicit LoadInst(Value *Ptr, const char *Name = 0, bool isVolatile = false, 
 Instruction *InsertBefore = 0);
   LoadInst(Value *Ptr, const char *Name, bool isVolatile,
BasicBlock *InsertAtEnd);
@@ -238,14 +242,25 @@
   /// isVolatile - Return true if this is a load from a volatile memory
   /// location.
   ///
-  bool isVolatile() const { return SubclassData; }
+  bool isVolatile() const { return SubclassData & 1; }
 
   /// setVolatile - Specify whether this is a volatile load or not.
   ///
-  void setVolatile(bool V) { SubclassData = V; }
+  void setVolatile(bool V) { 
+SubclassData = (SubclassData & ~1) | ((V) ? 1 : 0); 
+  }
 
   virtual LoadInst *clone() const;
 
+  /// getAlignment - Return the alignment of the access that is being performed
+  ///
+  unsigned getAlignment() const {
+signed Log2AlignVal = ((SubclassData>>1)-1);
+return ((Log2AlignVal < 0) ? 0 : 1<>1)-1);
+return ((Log2AlignVal < 0) ? 0 : 1

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

2007-04-21 Thread Reid Spencer


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.68 -> 1.69
---
Log message:

Revert Christopher Lamb's load/store alignment changes. 


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

 Instructions.h |   40 +++-
 1 files changed, 7 insertions(+), 33 deletions(-)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.68 
llvm/include/llvm/Instructions.h:1.69
--- llvm/include/llvm/Instructions.h:1.68   Sat Apr 21 09:32:59 2007
+++ llvm/include/llvm/Instructions.hSat Apr 21 13:36:27 2007
@@ -211,11 +211,9 @@
 /// SubclassData field in Value to store whether or not the load is volatile.
 ///
 class LoadInst : public UnaryInstruction {
-
   LoadInst(const LoadInst &LI)
 : UnaryInstruction(LI.getType(), Load, LI.getOperand(0)) {
 setVolatile(LI.isVolatile());
-setAlignment(LI.getAlignment());
 
 #ifndef NDEBUG
 AssertOK();
@@ -225,16 +223,14 @@
 public:
   LoadInst(Value *Ptr, const std::string &Name, Instruction *InsertBefore);
   LoadInst(Value *Ptr, const std::string &Name, BasicBlock *InsertAtEnd);
-  LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false, 
-   Instruction *InsertBefore = 0);
-  LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, unsigned 
Align,
+  LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false,
Instruction *InsertBefore = 0);
   LoadInst(Value *Ptr, const std::string &Name, bool isVolatile,
BasicBlock *InsertAtEnd);
 
   LoadInst(Value *Ptr, const char *Name, Instruction *InsertBefore);
   LoadInst(Value *Ptr, const char *Name, BasicBlock *InsertAtEnd);
-  explicit LoadInst(Value *Ptr, const char *Name = 0, bool isVolatile = false, 
+  explicit LoadInst(Value *Ptr, const char *Name = 0, bool isVolatile = false,
 Instruction *InsertBefore = 0);
   LoadInst(Value *Ptr, const char *Name, bool isVolatile,
BasicBlock *InsertAtEnd);
@@ -242,23 +238,14 @@
   /// isVolatile - Return true if this is a load from a volatile memory
   /// location.
   ///
-  bool isVolatile() const { return SubclassData & 1; }
+  bool isVolatile() const { return SubclassData; }
 
   /// setVolatile - Specify whether this is a volatile load or not.
   ///
-  void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | unsigned(V); 
}
+  void setVolatile(bool V) { SubclassData = V; }
 
   virtual LoadInst *clone() const;
 
-  /// getAlignment - Return the alignment of the access that is being performed
-  ///
-  unsigned getAlignment() const {
-signed Log2AlignVal = ((SubclassData>>1)-1);
-return ((Log2AlignVal < 0) ? 0 : 1<>1)-1);
-return ((Log2AlignVal < 0) ? 0 : 1

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

2007-04-21 Thread Jeff Cohen
Jeff Cohen wrote:
> Changes in directory llvm/include/llvm:
>
> Instructions.h updated: 1.67 -> 1.68
> ---
> Log message:
>
> The expression "SubclassData = (SubclassData & ~1) | (V) ? 1 : 0;" does not 
> do what
> was intended!  | has higher precedence than ?.  Caught by Visual Studio.
>   

Unfortunately, this wasn't the cause of the failures.  It didn't fix a 
single one.  They look like this:

FAIL: /usr/home/jeffc/llvm/test/CodeGen/X86/vec_zero.ll: exit(1) at line 1
while running: llvm-upgrade < 
/usr/home/jeffc/llvm/test/CodeGen/X86/vec_zero.ll | llvm-as | llc 
-march=x86 -mattr=+sse2 | grep xorps | wc -l | grep 2
Assertion failed: (0 && "ValueType does not correspond to LLVM type!"), 
function getTypeForValueType, file 
/usr/home/jeffc/llvm/lib/VMCore/ValueTypes.cpp, line 91.



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


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.67 -> 1.68
---
Log message:

The expression "SubclassData = (SubclassData & ~1) | (V) ? 1 : 0;" does not do 
what
was intended!  | has higher precedence than ?.  Caught by Visual Studio.


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

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


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.67 
llvm/include/llvm/Instructions.h:1.68
--- llvm/include/llvm/Instructions.h:1.67   Sat Apr 21 03:16:25 2007
+++ llvm/include/llvm/Instructions.hSat Apr 21 09:32:59 2007
@@ -246,7 +246,7 @@
 
   /// setVolatile - Specify whether this is a volatile load or not.
   ///
-  void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | (V) ? 1 : 0; 
}
+  void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | unsigned(V); 
}
 
   virtual LoadInst *clone() const;
 
@@ -311,7 +311,7 @@
 
   /// setVolatile - Specify whether this is a volatile load or not.
   ///
-  void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | (V) ? 1 : 0; 
}
+  void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | unsigned(V); 
}
 
   /// Transparently provide more efficient getOperand methods.
   Value *getOperand(unsigned i) const {



___
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-21 Thread Christopher Lamb


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.66 -> 1.67
---
Log message:


add support for alignment attributes on load/store instructions


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

 Instructions.h |   40 +---
 1 files changed, 33 insertions(+), 7 deletions(-)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.66 
llvm/include/llvm/Instructions.h:1.67
--- llvm/include/llvm/Instructions.h:1.66   Fri Apr 13 19:12:57 2007
+++ llvm/include/llvm/Instructions.hSat Apr 21 03:16:25 2007
@@ -211,9 +211,11 @@
 /// SubclassData field in Value to store whether or not the load is volatile.
 ///
 class LoadInst : public UnaryInstruction {
+
   LoadInst(const LoadInst &LI)
 : UnaryInstruction(LI.getType(), Load, LI.getOperand(0)) {
 setVolatile(LI.isVolatile());
+setAlignment(LI.getAlignment());
 
 #ifndef NDEBUG
 AssertOK();
@@ -223,14 +225,16 @@
 public:
   LoadInst(Value *Ptr, const std::string &Name, Instruction *InsertBefore);
   LoadInst(Value *Ptr, const std::string &Name, BasicBlock *InsertAtEnd);
-  LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false,
+  LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false, 
+   Instruction *InsertBefore = 0);
+  LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, unsigned 
Align,
Instruction *InsertBefore = 0);
   LoadInst(Value *Ptr, const std::string &Name, bool isVolatile,
BasicBlock *InsertAtEnd);
 
   LoadInst(Value *Ptr, const char *Name, Instruction *InsertBefore);
   LoadInst(Value *Ptr, const char *Name, BasicBlock *InsertAtEnd);
-  explicit LoadInst(Value *Ptr, const char *Name = 0, bool isVolatile = false,
+  explicit LoadInst(Value *Ptr, const char *Name = 0, bool isVolatile = false, 
 Instruction *InsertBefore = 0);
   LoadInst(Value *Ptr, const char *Name, bool isVolatile,
BasicBlock *InsertAtEnd);
@@ -238,14 +242,23 @@
   /// isVolatile - Return true if this is a load from a volatile memory
   /// location.
   ///
-  bool isVolatile() const { return SubclassData; }
+  bool isVolatile() const { return SubclassData & 1; }
 
   /// setVolatile - Specify whether this is a volatile load or not.
   ///
-  void setVolatile(bool V) { SubclassData = V; }
+  void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | (V) ? 1 : 0; 
}
 
   virtual LoadInst *clone() const;
 
+  /// getAlignment - Return the alignment of the access that is being performed
+  ///
+  unsigned getAlignment() const {
+signed Log2AlignVal = ((SubclassData>>1)-1);
+return ((Log2AlignVal < 0) ? 0 : 1<>1)-1);
+return ((Log2AlignVal < 0) ? 0 : 1

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

2007-04-13 Thread Chris Lattner


Changes in directory llvm/include/llvm:

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

add GetElementPtrInst::hasAllZeroIndices, a long-overdue helper method.
Writing it twice in the same day was too much for me.


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

 Instructions.h |5 +
 1 files changed, 5 insertions(+)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.65 
llvm/include/llvm/Instructions.h:1.66
--- llvm/include/llvm/Instructions.h:1.65   Mon Apr  9 13:00:57 2007
+++ llvm/include/llvm/Instructions.hFri Apr 13 19:12:57 2007
@@ -408,6 +408,11 @@
   inline bool hasIndices() const {
 return getNumOperands() > 1;
   }
+  
+  /// hasAllZeroIndices - Return true if all of the indices of this GEP are
+  /// zeros.  If so, the result pointer and the first operand have the same
+  /// value, just potentially different types.
+  bool hasAllZeroIndices() const;
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const GetElementPtrInst *) { return true; }



___
llvm-commits mailing list
[EMAIL PROTECTED]
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/include/llvm/Instructions.h

2007-02-28 Thread Reid Spencer


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.62 -> 1.63
---
Log message:

Provide an ICmpInst::makeConstantRange to generate a ConstantRange value
from a predicate and an APInt. This is removed from ConstantRange class
so that ConstantRange doesn't have to depend on lib/VMCore.


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

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


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.62 
llvm/include/llvm/Instructions.h:1.63
--- llvm/include/llvm/Instructions.h:1.62   Fri Feb 23 18:55:48 2007
+++ llvm/include/llvm/Instructions.hWed Feb 28 16:00:54 2007
@@ -24,6 +24,8 @@
 class ConstantInt;
 class PointerType;
 class VectorType;
+class ConstantRange;
+class APInt;
 
 
//===--===//
 // AllocationInst Class
@@ -536,6 +538,10 @@
   /// @brief Determine if the predicate is signed.
   static bool isSignedPredicate(Predicate pred);
 
+  /// Initialize a set of values that all satisfy the predicate with C. 
+  /// @brief Make a ConstantRange for a relation with a constant value.
+  static ConstantRange makeConstantRange(Predicate pred, const APInt &C);
+
   /// Exchange the two operands to this instruction in such a way that it does
   /// not modify the semantics of the instruction. The predicate value may be
   /// changed to retain the same result if the predicate is order dependent



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


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.56 -> 1.57
---
Log message:

eliminate instruction ctors that take vectors.


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

 Instructions.h |   12 
 1 files changed, 12 deletions(-)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.56 
llvm/include/llvm/Instructions.h:1.57
--- llvm/include/llvm/Instructions.h:1.56   Mon Feb 12 19:04:01 2007
+++ llvm/include/llvm/Instructions.hTue Feb 13 00:22:32 2007
@@ -17,7 +17,6 @@
 #define LLVM_INSTRUCTIONS_H
 
 #include "llvm/InstrTypes.h"
-#include   // fixme remove.
 
 namespace llvm {
 
@@ -700,11 +699,6 @@
   CallInst(Value *F, Value *const *Args, unsigned NumArgs,
const std::string &Name, BasicBlock *InsertAtEnd);
   
-  CallInst(Value *F, const std::vector &Par,
-   const std::string &Name = "", Instruction *InsertBefore = 0);
-  CallInst(Value *F, const std::vector &Par,
-   const std::string &Name, BasicBlock *InsertAtEnd);
-
   // Alternate CallInst ctors w/ two actuals, w/ one actual and no
   // actuals, respectively.
   CallInst(Value *F, Value *Actual1, Value *Actual2,
@@ -1487,12 +1481,6 @@
 Value* const *Args, unsigned NumArgs);
 public:
   InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
- const std::vector &Params, const std::string &Name = "",
- Instruction *InsertBefore = 0);
-  InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
- const std::vector &Params, const std::string &Name,
- BasicBlock *InsertAtEnd);
-  InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
  Value* const* Args, unsigned NumArgs, const std::string &Name = 
"",
  Instruction *InsertBefore = 0);
   InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,



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


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.55 -> 1.56
---
Log message:

Add invokeinst and callinst ctors that don't take vectors.


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

 Instructions.h |   13 -
 1 files changed, 12 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.55 
llvm/include/llvm/Instructions.h:1.56
--- llvm/include/llvm/Instructions.h:1.55   Mon Feb 12 18:58:44 2007
+++ llvm/include/llvm/Instructions.hMon Feb 12 19:04:01 2007
@@ -695,6 +695,11 @@
   void init(Value *Func);
 
 public:
+  CallInst(Value *F, Value* const *Args, unsigned NumArgs,
+   const std::string &Name = "", Instruction *InsertBefore = 0);
+  CallInst(Value *F, Value *const *Args, unsigned NumArgs,
+   const std::string &Name, BasicBlock *InsertAtEnd);
+  
   CallInst(Value *F, const std::vector &Par,
const std::string &Name = "", Instruction *InsertBefore = 0);
   CallInst(Value *F, const std::vector &Par,
@@ -1479,7 +1484,7 @@
 class InvokeInst : public TerminatorInst {
   InvokeInst(const InvokeInst &BI);
   void init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
-const std::vector &Params);
+Value* const *Args, unsigned NumArgs);
 public:
   InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
  const std::vector &Params, const std::string &Name = "",
@@ -1487,6 +1492,12 @@
   InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
  const std::vector &Params, const std::string &Name,
  BasicBlock *InsertAtEnd);
+  InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
+ Value* const* Args, unsigned NumArgs, const std::string &Name = 
"",
+ Instruction *InsertBefore = 0);
+  InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
+ Value* const* Args, unsigned NumArgs, const std::string &Name,
+ BasicBlock *InsertAtEnd);
   ~InvokeInst();
 
   virtual InvokeInst *clone() const;



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


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.54 -> 1.55
---
Log message:

remove some dead methods.


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

 Instructions.h |   11 +--
 1 files changed, 1 insertion(+), 10 deletions(-)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.54 
llvm/include/llvm/Instructions.h:1.55
--- llvm/include/llvm/Instructions.h:1.54   Sun Feb 11 23:00:35 2007
+++ llvm/include/llvm/Instructions.hMon Feb 12 18:58:44 2007
@@ -345,10 +345,6 @@
   /// list of indices.  The first ctor can optionally insert before an existing
   /// instruction, the second appends the new instruction to the specified
   /// BasicBlock.
-  GetElementPtrInst(Value *Ptr, const std::vector &Idx,
-const std::string &Name = "", Instruction *InsertBefore 
=0);
-  GetElementPtrInst(Value *Ptr, const std::vector &Idx,
-const std::string &Name, BasicBlock *InsertAtEnd);
   GetElementPtrInst(Value *Ptr, Value* const *Idx, unsigned NumIdx,
 const std::string &Name = "", Instruction *InsertBefore 
=0);
   GetElementPtrInst(Value *Ptr, Value* const *Idx, unsigned NumIdx,
@@ -383,11 +379,6 @@
 Value* const *Idx, unsigned NumIdx,
 bool AllowStructLeaf = false);
   
-  static const Type *getIndexedType(const Type *Ptr,
-const std::vector &Indices,
-bool AllowStructLeaf = false) {
-return getIndexedType(Ptr, &Indices[0], Indices.size(), AllowStructLeaf);
-  }
   static const Type *getIndexedType(const Type *Ptr, Value *Idx0, Value *Idx1,
 bool AllowStructLeaf = false);
   static const Type *getIndexedType(const Type *Ptr, Value *Idx);
@@ -698,7 +689,7 @@
 ///
 class CallInst : public Instruction {
   CallInst(const CallInst &CI);
-  void init(Value *Func, const std::vector &Params);
+  void init(Value *Func, Value* const *Params, unsigned NumParams);
   void init(Value *Func, Value *Actual1, Value *Actual2);
   void init(Value *Func, Value *Actual);
   void init(Value *Func);



___
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 Module.h

2007-02-11 Thread Chris Lattner


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.53 -> 1.54
Module.h updated: 1.83 -> 1.84
---
Log message:

add #include


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

 Instructions.h |1 +
 Module.h   |1 +
 2 files changed, 2 insertions(+)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.53 
llvm/include/llvm/Instructions.h:1.54
--- llvm/include/llvm/Instructions.h:1.53   Thu Feb  1 20:16:21 2007
+++ llvm/include/llvm/Instructions.hSun Feb 11 23:00:35 2007
@@ -17,6 +17,7 @@
 #define LLVM_INSTRUCTIONS_H
 
 #include "llvm/InstrTypes.h"
+#include   // fixme remove.
 
 namespace llvm {
 


Index: llvm/include/llvm/Module.h
diff -u llvm/include/llvm/Module.h:1.83 llvm/include/llvm/Module.h:1.84
--- llvm/include/llvm/Module.h:1.83 Mon Feb  5 15:17:06 2007
+++ llvm/include/llvm/Module.h  Sun Feb 11 23:00:35 2007
@@ -17,6 +17,7 @@
 #include "llvm/Function.h"
 #include "llvm/GlobalVariable.h"
 #include "llvm/Support/DataTypes.h"
+#include 
 
 namespace llvm {
 



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


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

2007-01-31 Thread Chris Lattner


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.51 -> 1.52
---
Log message:

implement the new GEP instruction ctors.


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

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


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.51 
llvm/include/llvm/Instructions.h:1.52
--- llvm/include/llvm/Instructions.h:1.51   Tue Jan 30 22:39:29 2007
+++ llvm/include/llvm/Instructions.hWed Jan 31 13:47:18 2007
@@ -336,7 +336,7 @@
 for (unsigned i = 0, E = NumOperands; i != E; ++i)
   OL[i].init(GEPIOL[i], this);
   }
-  void init(Value *Ptr, const std::vector &Idx);
+  void init(Value *Ptr, Value* const *Idx, unsigned NumIdx);
   void init(Value *Ptr, Value *Idx0, Value *Idx1);
   void init(Value *Ptr, Value *Idx);
 public:



___
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-01-14 Thread Chris Lattner


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.49 -> 1.50
---
Log message:

add accessors


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

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


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.49 
llvm/include/llvm/Instructions.h:1.50
--- llvm/include/llvm/Instructions.h:1.49   Thu Dec 28 22:10:59 2006
+++ llvm/include/llvm/Instructions.hSun Jan 14 13:41:24 2007
@@ -467,6 +467,9 @@
   /// @brief Return the predicate for this instruction.
   Predicate getPredicate() const { return Predicate(SubclassData); }
 
+  /// @brief Set the predicate for this instruction to the specified value.
+  void setPredicate(Predicate P) { SubclassData = P; }
+  
   /// For example, EQ -> NE, UGT -> ULE, SLT -> SGE, etc.
   /// @returns the inverse predicate for the instruction's current predicate. 
   /// @brief Return the inverse of the instruction's predicate.
@@ -609,6 +612,9 @@
   /// @brief Return the predicate for this instruction.
   Predicate getPredicate() const { return Predicate(SubclassData); }
 
+  /// @brief Set the predicate for this instruction to the specified value.
+  void setPredicate(Predicate P) { SubclassData = P; }
+
   /// For example, OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
   /// @returns the inverse predicate for the instructions current predicate. 
   /// @brief Return the inverse of the predicate



___
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

2006-12-28 Thread Reid Spencer


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.48 -> 1.49
---
Log message:

Doxygenify a comment.


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

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


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.48 
llvm/include/llvm/Instructions.h:1.49
--- llvm/include/llvm/Instructions.h:1.48   Sat Dec 23 00:05:40 2006
+++ llvm/include/llvm/Instructions.hThu Dec 28 22:10:59 2006
@@ -729,7 +729,8 @@
 return static_cast(dyn_cast(getOperand(0)));
   }
 
-  // getCalledValue - Get a pointer to a method that is invoked by this inst.
+  /// getCalledValue - Get a pointer to the function that is invoked by this 
+  /// instruction
   inline const Value *getCalledValue() const { return getOperand(0); }
   inline   Value *getCalledValue()   { return getOperand(0); }
 



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


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

2006-10-04 Thread Chris Lattner


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.43 -> 1.44
---
Log message:

Add insertelement/extractelement helper ctors.


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

 Instructions.h |8 
 1 files changed, 8 insertions(+)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.43 
llvm/include/llvm/Instructions.h:1.44
--- llvm/include/llvm/Instructions.h:1.43   Tue Oct  3 12:09:12 2006
+++ llvm/include/llvm/Instructions.hThu Oct  5 01:24:58 2006
@@ -775,8 +775,12 @@
 public:
   ExtractElementInst(Value *Vec, Value *Idx, const std::string &Name = "",
  Instruction *InsertBefore = 0);
+  ExtractElementInst(Value *Vec, unsigned Idx, const std::string &Name = "",
+ Instruction *InsertBefore = 0);
   ExtractElementInst(Value *Vec, Value *Idx, const std::string &Name,
  BasicBlock *InsertAtEnd);
+  ExtractElementInst(Value *Vec, unsigned Idx, const std::string &Name,
+ BasicBlock *InsertAtEnd);
 
   /// isValidOperands - Return true if an extractelement instruction can be
   /// formed with the specified operands.
@@ -820,8 +824,12 @@
 public:
   InsertElementInst(Value *Vec, Value *NewElt, Value *Idx,
 const std::string &Name = "",Instruction *InsertBefore = 
0);
+  InsertElementInst(Value *Vec, Value *NewElt, unsigned Idx,
+const std::string &Name = "",Instruction *InsertBefore = 
0);
   InsertElementInst(Value *Vec, Value *NewElt, Value *Idx,
 const std::string &Name, BasicBlock *InsertAtEnd);
+  InsertElementInst(Value *Vec, Value *NewElt, unsigned Idx,
+const std::string &Name, BasicBlock *InsertAtEnd);
 
   /// isValidOperands - Return true if an insertelement instruction can be
   /// formed with the specified operands.



___
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

2006-10-03 Thread Chris Lattner


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.42 -> 1.43
---
Log message:

clean up use of 'explicit'.  This is PR934: http://llvm.org/PR934 .
Patch contributed by Kevin Sopp!


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

 Instructions.h |   85 -
 1 files changed, 42 insertions(+), 43 deletions(-)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.42 
llvm/include/llvm/Instructions.h:1.43
--- llvm/include/llvm/Instructions.h:1.42   Mon Sep 18 15:44:37 2006
+++ llvm/include/llvm/Instructions.hTue Oct  3 12:09:12 2006
@@ -42,7 +42,7 @@
 public:
   // Out of line virtual method, so the vtable, etc has a home.
   virtual ~AllocationInst();
-  
+
   /// isArrayAllocation - Return true if there is an allocation size parameter
   /// to the allocation instruction that is not 1.
   ///
@@ -73,7 +73,7 @@
 assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!");
 Alignment = Align;
   }
-  
+
   virtual Instruction *clone() const = 0;
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -104,21 +104,21 @@
   MallocInst(const Type *Ty, Value *ArraySize, const std::string &Name,
  BasicBlock *InsertAtEnd)
 : AllocationInst(Ty, ArraySize, Malloc, 0, Name, InsertAtEnd) {}
-  
-  explicit MallocInst(const Type *Ty, const std::string &Name,
-  Instruction *InsertBefore = 0)
+
+  MallocInst(const Type *Ty, const std::string &Name,
+ Instruction *InsertBefore = 0)
 : AllocationInst(Ty, 0, Malloc, 0, Name, InsertBefore) {}
   MallocInst(const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd)
 : AllocationInst(Ty, 0, Malloc, 0, Name, InsertAtEnd) {}
-  
-  MallocInst(const Type *Ty, Value *ArraySize, unsigned Align, 
+
+  MallocInst(const Type *Ty, Value *ArraySize, unsigned Align,
  const std::string &Name, BasicBlock *InsertAtEnd)
 : AllocationInst(Ty, ArraySize, Malloc, Align, Name, InsertAtEnd) {}
   MallocInst(const Type *Ty, Value *ArraySize, unsigned Align,
   const std::string &Name = "",
   Instruction *InsertBefore = 0)
 : AllocationInst(Ty, ArraySize, Malloc, Align, Name, InsertBefore) {}
-  
+
   virtual MallocInst *clone() const;
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -154,14 +154,14 @@
 : AllocationInst(Ty, 0, Alloca, 0, Name, InsertBefore) {}
   AllocaInst(const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd)
 : AllocationInst(Ty, 0, Alloca, 0, Name, InsertAtEnd) {}
-  
+
   AllocaInst(const Type *Ty, Value *ArraySize, unsigned Align,
  const std::string &Name = "", Instruction *InsertBefore = 0)
 : AllocationInst(Ty, ArraySize, Alloca, Align, Name, InsertBefore) {}
   AllocaInst(const Type *Ty, Value *ArraySize, unsigned Align,
  const std::string &Name, BasicBlock *InsertAtEnd)
 : AllocationInst(Ty, ArraySize, Alloca, Align, Name, InsertAtEnd) {}
-  
+
   virtual AllocaInst *clone() const;
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -222,8 +222,8 @@
 public:
   LoadInst(Value *Ptr, const std::string &Name, Instruction *InsertBefore);
   LoadInst(Value *Ptr, const std::string &Name, BasicBlock *InsertAtEnd);
-  LoadInst(Value *Ptr, const std::string &Name = "", bool isVolatile = false,
-   Instruction *InsertBefore = 0);
+  explicit LoadInst(Value *Ptr, const std::string &Name = "",
+bool isVolatile = false, Instruction *InsertBefore = 0);
   LoadInst(Value *Ptr, const std::string &Name, bool isVolatile,
BasicBlock *InsertAtEnd);
 
@@ -458,13 +458,13 @@
   bool isEquality() const {
 return getOpcode() == SetEQ || getOpcode() == SetNE;
   }
-  
+
   /// isRelational - Return true if this comparison is a /<=/>= comparison.
   ///
   bool isRelational() const {
 return !isEquality();
   }
-  
+
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const SetCondInst *) { return true; }
   static inline bool classof(const Instruction *I) {
@@ -501,8 +501,8 @@
   /// isTruncIntCast - Return true if this is a truncating integer cast
   /// instruction, e.g. a cast from long to uint.
   bool isTruncIntCast() const;
-  
-  
+
+
   virtual CastInst *clone() const;
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -550,8 +550,7 @@
BasicBlock *InsertAtEnd);
   explicit CallInst(Value *F, const std::string &Name = "",
 Instruction *InsertBefore = 0);
-  explicit CallInst(Value *F, const std::string &Name,
-BasicBlock *InsertAtEnd);
+  CallInst(Value *F, const std::string &Name, BasicBlock *InsertAtEnd);
   ~CallInst();
 
   virtual CallInst *clone() const;
@@ -640,14 +639,14 @@
   /// isLogicalShift - Return true if this is a logical shift left or a 

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

2006-09-18 Thread Nick Lewycky


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.41 -> 1.42
---
Log message:

Fix findCaseDest to return null when BB is both the default dest and one
of the numeric cases.


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

 Instructions.h |2 ++
 1 files changed, 2 insertions(+)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.41 
llvm/include/llvm/Instructions.h:1.42
--- llvm/include/llvm/Instructions.h:1.41   Mon Sep 18 14:03:59 2006
+++ llvm/include/llvm/Instructions.hMon Sep 18 15:44:37 2006
@@ -1313,6 +1313,8 @@
   /// findCaseDest - Finds the unique case value for a given successor. Returns
   /// null if the successor is not found, not unique, or is the default case.
   ConstantInt *findCaseDest(BasicBlock *BB) {
+if (BB == getDefaultDest()) return NULL;
+
 ConstantInt *CI = NULL;
 for (unsigned i = 1, e = getNumCases(); i != e; ++i) {
   if (getSuccessor(i) == BB) {



___
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

2006-09-18 Thread Nick Lewycky


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.40 -> 1.41
---
Log message:

Add a new helper method to SwitchInst. Useful when you've got a BB from
somewhere (like the dominator graph) and would like to know which case it
came from.


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

 Instructions.h |   13 +
 1 files changed, 13 insertions(+)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.40 
llvm/include/llvm/Instructions.h:1.41
--- llvm/include/llvm/Instructions.h:1.40   Sun Sep 17 23:54:57 2006
+++ llvm/include/llvm/Instructions.hMon Sep 18 14:03:59 2006
@@ -1310,6 +1310,19 @@
 return 0;
   }
 
+  /// findCaseDest - Finds the unique case value for a given successor. Returns
+  /// null if the successor is not found, not unique, or is the default case.
+  ConstantInt *findCaseDest(BasicBlock *BB) {
+ConstantInt *CI = NULL;
+for (unsigned i = 1, e = getNumCases(); i != e; ++i) {
+  if (getSuccessor(i) == BB) {
+if (CI) return NULL;   // Multiple cases lead to BB.
+else CI = getCaseValue(i);
+  }
+}
+return CI;
+  }
+
   /// addCase - Add an entry to the switch instruction...
   ///
   void addCase(ConstantInt *OnVal, BasicBlock *Dest);



___
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

2006-09-17 Thread Chris Lattner


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.39 -> 1.40
---
Log message:

add a helper method


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

 Instructions.h |5 +
 1 files changed, 5 insertions(+)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.39 
llvm/include/llvm/Instructions.h:1.40
--- llvm/include/llvm/Instructions.h:1.39   Sun Sep 17 14:29:56 2006
+++ llvm/include/llvm/Instructions.hSun Sep 17 23:54:57 2006
@@ -498,6 +498,11 @@
 : UnaryInstruction(Ty, Cast, S, Name, InsertAtEnd) {
   }
 
+  /// isTruncIntCast - Return true if this is a truncating integer cast
+  /// instruction, e.g. a cast from long to uint.
+  bool isTruncIntCast() const;
+  
+  
   virtual CastInst *clone() const;
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:



___
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

2006-05-19 Thread Reid Spencer


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.35 -> 1.36
---
Log message:

Fix some doxygen usage in these headers.


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

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


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.35 
llvm/include/llvm/Instructions.h:1.36
--- llvm/include/llvm/Instructions.h:1.35   Tue May  9 23:38:35 2006
+++ llvm/include/llvm/Instructions.hFri May 19 14:07:54 2006
@@ -927,7 +927,7 @@
   ///
   unsigned getNumIncomingValues() const { return getNumOperands()/2; }
 
-  /// getIncomingValue - Return incoming value #x
+  /// getIncomingValue - Return incoming value number x
   ///
   Value *getIncomingValue(unsigned i) const {
 assert(i*2 < getNumOperands() && "Invalid value number!");
@@ -941,7 +941,7 @@
 return i*2;
   }
 
-  /// getIncomingBlock - Return incoming basic block #x
+  /// getIncomingBlock - Return incoming basic block number x
   ///
   BasicBlock *getIncomingBlock(unsigned i) const {
 return reinterpret_cast(getOperand(i*2+1));



___
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

2006-05-09 Thread Chris Lattner


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.34 -> 1.35
---
Log message:

Add alloca/malloc ctors that don't take array sizes.


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

 Instructions.h |   29 +
 1 files changed, 21 insertions(+), 8 deletions(-)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.34 
llvm/include/llvm/Instructions.h:1.35
--- llvm/include/llvm/Instructions.h:1.34   Fri Apr 14 17:20:07 2006
+++ llvm/include/llvm/Instructions.hTue May  9 23:38:35 2006
@@ -104,13 +104,20 @@
   MallocInst(const Type *Ty, Value *ArraySize, const std::string &Name,
  BasicBlock *InsertAtEnd)
 : AllocationInst(Ty, ArraySize, Malloc, 0, Name, InsertAtEnd) {}
+  
+  explicit MallocInst(const Type *Ty, const std::string &Name,
+  Instruction *InsertBefore = 0)
+: AllocationInst(Ty, 0, Malloc, 0, Name, InsertBefore) {}
+  MallocInst(const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd)
+: AllocationInst(Ty, 0, Malloc, 0, Name, InsertAtEnd) {}
+  
   MallocInst(const Type *Ty, Value *ArraySize, unsigned Align, 
  const std::string &Name, BasicBlock *InsertAtEnd)
-  : AllocationInst(Ty, ArraySize, Malloc, Align, Name, InsertAtEnd) {}
-  explicit MallocInst(const Type *Ty, Value *ArraySize, unsigned Align,
+: AllocationInst(Ty, ArraySize, Malloc, Align, Name, InsertAtEnd) {}
+  MallocInst(const Type *Ty, Value *ArraySize, unsigned Align,
   const std::string &Name = "",
   Instruction *InsertBefore = 0)
-  : AllocationInst(Ty, ArraySize, Malloc, Align, Name, InsertBefore) {}
+: AllocationInst(Ty, ArraySize, Malloc, Align, Name, InsertBefore) {}
   
   virtual MallocInst *clone() const;
 
@@ -141,13 +148,19 @@
   AllocaInst(const Type *Ty, Value *ArraySize, const std::string &Name,
  BasicBlock *InsertAtEnd)
 : AllocationInst(Ty, ArraySize, Alloca, 0, Name, InsertAtEnd) {}
+
+  AllocaInst(const Type *Ty, const std::string &Name,
+ Instruction *InsertBefore = 0)
+: AllocationInst(Ty, 0, Alloca, 0, Name, InsertBefore) {}
+  AllocaInst(const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd)
+: AllocationInst(Ty, 0, Alloca, 0, Name, InsertAtEnd) {}
+  
+  AllocaInst(const Type *Ty, Value *ArraySize, unsigned Align,
+ const std::string &Name = "", Instruction *InsertBefore = 0)
+: AllocationInst(Ty, ArraySize, Alloca, Align, Name, InsertBefore) {}
   AllocaInst(const Type *Ty, Value *ArraySize, unsigned Align,
  const std::string &Name, BasicBlock *InsertAtEnd)
-  : AllocationInst(Ty, ArraySize, Alloca, Align, Name, InsertAtEnd) {}
-  explicit AllocaInst(const Type *Ty, Value *ArraySize, unsigned Align,
-  const std::string &Name = "",
-  Instruction *InsertBefore = 0)
-  : AllocationInst(Ty, ArraySize, Alloca, Align, Name, InsertBefore) {}
+: AllocationInst(Ty, ArraySize, Alloca, Align, Name, InsertAtEnd) {}
   
   virtual AllocaInst *clone() const;
 



___
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

2006-04-14 Thread Chris Lattner


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.33 -> 1.34
---
Log message:

These instructions always return a packed vector.  Improve the class 
definitions to expose this fact.


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

 Instructions.h |   29 +++--
 1 files changed, 15 insertions(+), 14 deletions(-)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.33 
llvm/include/llvm/Instructions.h:1.34
--- llvm/include/llvm/Instructions.h:1.33   Fri Apr  7 23:04:54 2006
+++ llvm/include/llvm/Instructions.hFri Apr 14 17:20:07 2006
@@ -24,6 +24,7 @@
 class BasicBlock;
 class ConstantInt;
 class PointerType;
+class PackedType;
 
 
//===--===//
 // AllocationInst Class
@@ -776,13 +777,7 @@
 ///
 class InsertElementInst : public Instruction {
   Use Ops[3];
-  InsertElementInst(const InsertElementInst &IE) : 
-Instruction(IE.getType(), InsertElement, Ops, 3) {
-Ops[0].init(IE.Ops[0], this);
-Ops[1].init(IE.Ops[1], this);
-Ops[2].init(IE.Ops[2], this);
-  }
-
+  InsertElementInst(const InsertElementInst &IE);
 public:
   InsertElementInst(Value *Vec, Value *NewElt, Value *Idx,
 const std::string &Name = "",Instruction *InsertBefore = 
0);
@@ -798,6 +793,12 @@
 
   virtual bool mayWriteToMemory() const { return false; }
 
+  /// getType - Overload to return most specific packed type.
+  ///
+  inline const PackedType *getType() const {
+return reinterpret_cast(Instruction::getType());
+  }
+  
   /// Transparently provide more efficient getOperand methods.
   Value *getOperand(unsigned i) const {
 assert(i < 3 && "getOperand() out of range!");
@@ -828,13 +829,7 @@
 ///
 class ShuffleVectorInst : public Instruction {
   Use Ops[3];
-  ShuffleVectorInst(const ShuffleVectorInst &IE) : 
-Instruction(IE.getType(), ShuffleVector, Ops, 3) {
-  Ops[0].init(IE.Ops[0], this);
-  Ops[1].init(IE.Ops[1], this);
-  Ops[2].init(IE.Ops[2], this);
-}
-  
+  ShuffleVectorInst(const ShuffleVectorInst &IE);  
 public:
   ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
 const std::string &Name = "", Instruction *InsertBefor = 
0);
@@ -850,6 +845,12 @@
   
   virtual bool mayWriteToMemory() const { return false; }
   
+  /// getType - Overload to return most specific packed type.
+  ///
+  inline const PackedType *getType() const {
+return reinterpret_cast(Instruction::getType());
+  }
+  
   /// Transparently provide more efficient getOperand methods.
   Value *getOperand(unsigned i) const {
 assert(i < 3 && "getOperand() out of range!");



___
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

2006-04-07 Thread Chris Lattner


Changes in directory llvm/include/llvm:

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

Add methods to check insert/extract element instructions for validity


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

 Instructions.h |   11 ++-
 1 files changed, 10 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.32 
llvm/include/llvm/Instructions.h:1.33
--- llvm/include/llvm/Instructions.h:1.32   Fri Apr  7 20:15:18 2006
+++ llvm/include/llvm/Instructions.hFri Apr  7 23:04:54 2006
@@ -738,6 +738,10 @@
   ExtractElementInst(Value *Vec, Value *Idx, const std::string &Name,
  BasicBlock *InsertAtEnd);
 
+  /// isValidOperands - Return true if an extractelement instruction can be
+  /// formed with the specified operands.
+  static bool isValidOperands(const Value *Vec, const Value *Idx);
+  
   virtual ExtractElementInst *clone() const;
 
   virtual bool mayWriteToMemory() const { return false; }
@@ -785,6 +789,11 @@
   InsertElementInst(Value *Vec, Value *NewElt, Value *Idx,
 const std::string &Name, BasicBlock *InsertAtEnd);
 
+  /// isValidOperands - Return true if an insertelement instruction can be
+  /// formed with the specified operands.
+  static bool isValidOperands(const Value *Vec, const Value *NewElt,
+  const Value *Idx);
+  
   virtual InsertElementInst *clone() const;
 
   virtual bool mayWriteToMemory() const { return false; }
@@ -832,7 +841,7 @@
   ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
 const std::string &Name, BasicBlock *InsertAtEnd);
   
-  /// isValidOperands - Return true if a value shufflevector instruction can be
+  /// isValidOperands - Return true if a shufflevector instruction can be
   /// formed with the specified operands.
   static bool isValidOperands(const Value *V1, const Value *V2,
   const Value *Mask);



___
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

2005-11-05 Thread Chris Lattner


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.28 -> 1.29
---
Log message:

add an accessor


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

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


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.28 
llvm/include/llvm/Instructions.h:1.29
--- llvm/include/llvm/Instructions.h:1.28   Sat Nov  5 03:21:28 2005
+++ llvm/include/llvm/Instructions.hSat Nov  5 15:58:30 2005
@@ -68,6 +68,10 @@
   /// by the instruction.
   ///
   unsigned getAlignment() const { return Alignment; }
+  void setAlignment(unsigned Align) {
+assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!");
+Alignment = Align;
+  }
   
   virtual Instruction *clone() const = 0;
 



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


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

2005-11-05 Thread Nate Begeman


Changes in directory llvm/include/llvm:

Instructions.h updated: 1.27 -> 1.28
---
Log message:

Add support alignment of allocation instructions.
Add support for specifying alignment and size of setjmp jmpbufs.

No targets currently do anything with this information, nor is it presrved
in the bytecode representation.  That's coming up next.


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

 Instructions.h |   36 
 1 files changed, 28 insertions(+), 8 deletions(-)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.27 
llvm/include/llvm/Instructions.h:1.28
--- llvm/include/llvm/Instructions.h:1.27   Thu Aug  4 19:49:06 2005
+++ llvm/include/llvm/Instructions.hSat Nov  5 03:21:28 2005
@@ -33,10 +33,11 @@
 /// AllocaInst.
 ///
 class AllocationInst : public UnaryInstruction {
+  unsigned Alignment;
 protected:
-  AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy,
+  AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy, unsigned 
Align,
  const std::string &Name = "", Instruction *InsertBefore = 0);
-  AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy,
+  AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy, unsigned 
Align,
  const std::string &Name, BasicBlock *InsertAtEnd);
 
 public:
@@ -63,6 +64,11 @@
   ///
   const Type *getAllocatedType() const;
 
+  /// getAlignment - Return the alignment of the memory that is being allocated
+  /// by the instruction.
+  ///
+  unsigned getAlignment() const { return Alignment; }
+  
   virtual Instruction *clone() const = 0;
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -89,11 +95,18 @@
   explicit MallocInst(const Type *Ty, Value *ArraySize = 0,
   const std::string &Name = "",
   Instruction *InsertBefore = 0)
-: AllocationInst(Ty, ArraySize, Malloc, Name, InsertBefore) {}
+: AllocationInst(Ty, ArraySize, Malloc, 0, Name, InsertBefore) {}
   MallocInst(const Type *Ty, Value *ArraySize, const std::string &Name,
  BasicBlock *InsertAtEnd)
-: AllocationInst(Ty, ArraySize, Malloc, Name, InsertAtEnd) {}
-
+: AllocationInst(Ty, ArraySize, Malloc, 0, Name, InsertAtEnd) {}
+  MallocInst(const Type *Ty, Value *ArraySize, unsigned Align, 
+ const std::string &Name, BasicBlock *InsertAtEnd)
+  : AllocationInst(Ty, ArraySize, Malloc, Align, Name, InsertAtEnd) {}
+  explicit MallocInst(const Type *Ty, Value *ArraySize, unsigned Align,
+  const std::string &Name = "",
+  Instruction *InsertBefore = 0)
+  : AllocationInst(Ty, ArraySize, Malloc, Align, Name, InsertBefore) {}
+  
   virtual MallocInst *clone() const;
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -119,11 +132,18 @@
   explicit AllocaInst(const Type *Ty, Value *ArraySize = 0,
   const std::string &Name = "",
   Instruction *InsertBefore = 0)
-: AllocationInst(Ty, ArraySize, Alloca, Name, InsertBefore) {}
+: AllocationInst(Ty, ArraySize, Alloca, 0, Name, InsertBefore) {}
   AllocaInst(const Type *Ty, Value *ArraySize, const std::string &Name,
  BasicBlock *InsertAtEnd)
-: AllocationInst(Ty, ArraySize, Alloca, Name, InsertAtEnd) {}
-
+: AllocationInst(Ty, ArraySize, Alloca, 0, Name, InsertAtEnd) {}
+  AllocaInst(const Type *Ty, Value *ArraySize, unsigned Align,
+ const std::string &Name, BasicBlock *InsertAtEnd)
+  : AllocationInst(Ty, ArraySize, Alloca, Align, Name, InsertAtEnd) {}
+  explicit AllocaInst(const Type *Ty, Value *ArraySize, unsigned Align,
+  const std::string &Name = "",
+  Instruction *InsertBefore = 0)
+  : AllocationInst(Ty, ArraySize, Alloca, Align, Name, InsertBefore) {}
+  
   virtual AllocaInst *clone() const;
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:



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