[LLVMdev] [PATCH] use-diet for review

Dan Gohman gohman at apple.com
Tue Apr 29 09:01:39 PDT 2008


Hi Gabor,

Thanks for posting the memory savings. 13% less memory usage
in 447.dealII is very impressive.

I haven't taken more than a very brief peek at this patch, but I
have a few questions already.

Is there a header missing? I don't see
DECLARE_TRANSPARENT_OPERAND_ACCESSORS
defined anywhere.

Also, what affect does this macro have on doxygen?

In User.h:

+public:
+  template <unsigned Idx> Use &Op() {
+    return OperandTraits<User>::op_begin(this)[Idx];
+  }
+  template <unsigned Idx> const Use &Op() const {
+    return OperandTraits<User>::op_begin(const_cast<User*>(this))[Idx];
+  }
+  Use *allocHungoffUses(unsigned) const;
+  void dropHungoffUses(Use *U) {
+    if (OperandList == U) {
+      OperandList = 0;
+      NumOperands = 0;
+    }
+    Use::zap(U, U->getImpliedUser(), true);
+  }

At a very brief scan, it looks like allocHungoffUses and dropHungoffUses
can be made protected, not public. And maybe those Op things too.

Hmm, and why the operand index for Op is a non-type template parameter?
In an optimized build, these should be inlined, while in a non-optimized
build, having them be templates incurs instantiation overhead.

Dan

On Tue, April 29, 2008 1:27 am, Gabor Greif wrote:
> Hi all,
>
> I have reported more than enough about the space savings achieved
> and the associated costs, here comes the current patch for review.
>
> Since this one is substantially smaller than the previous one, I did
> not cut it in pieces. The front part is about headers and the rest
> the .cpp and other files.
>
> Cheers,
>
> 	Gabor
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>





More information about the llvm-dev mailing list