[llvm-commits] CVS: llvm/include/llvm/ExecutionEngine/GenericValue.h

Reid Spencer rspencer at reidspencer.com
Sat Mar 3 16:16:14 PST 2007


On Sat, 2007-03-03 at 13:07 -0800, Chris Lattner wrote:
> On Mar 2, 2007, at 11:37 PM, Reid Spencer wrote:
> > Changes in directory llvm/include/llvm/ExecutionEngine:
> > GenericValue.h updated: 1.9 -> 1.10
> > ---
> > Log message:
> >
> > Add APIntVal as a possible GenericeValue.
> 
> Shouldn't APInt eliminate all of the other, smaller, integers?

Not if you want to retain any kind of speed in LLI. Its slow enough,
didn't want to slow it down more. Note that because GenericValue is a
union I have to make the APInt member a pointer, which means a memory
allocation. Pretty certain we don't want a memory allocation on every
arithmetic operation.

Reid.

> 
> -Chris
> 
> > ---
> > Diffs of the changes:  (+3 -0)
> >
> >  GenericValue.h |    3 +++
> >  1 files changed, 3 insertions(+)
> >
> >
> > Index: llvm/include/llvm/ExecutionEngine/GenericValue.h
> > diff -u llvm/include/llvm/ExecutionEngine/GenericValue.h:1.9 llvm/ 
> > include/llvm/ExecutionEngine/GenericValue.h:1.10
> > --- llvm/include/llvm/ExecutionEngine/GenericValue.h:1.9	Thu Jan 11  
> > 12:21:28 2007
> > +++ llvm/include/llvm/ExecutionEngine/GenericValue.h	Sat Mar  3  
> > 01:36:44 2007
> > @@ -20,6 +20,8 @@
> >  namespace llvm {
> >
> >  typedef uintptr_t PointerTy;
> > +class APInt;
> > +class Type;
> >
> >  union GenericValue {
> >    bool            Int1Val;
> > @@ -27,6 +29,7 @@
> >    unsigned short  Int16Val;
> >    unsigned int    Int32Val;
> >    uint64_t        Int64Val;
> > +  APInt          *APIntVal;
> >    double          DoubleVal;
> >    float           FloatVal;
> >    struct { unsigned int first; unsigned int second; } UIntPairVal;
> >
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list