[llvm-commits] [llvm] r78628 - /llvm/trunk/autoconf/configure.ac

Gabor Greif ggreif at gmail.com
Tue Aug 11 14:22:27 PDT 2009


On 11 Aug., 17:51, Chris Lattner <clatt... at apple.com> wrote:
> On Aug 10, 2009, at 5:59 PM, Gabor Greif wrote:
>
> > Author: ggreif
> > Date: Mon Aug 10 19:59:39 2009
> > New Revision: 78628
>
> > URL:http://llvm.org/viewvc/llvm-project?rev=78628&view=rev
> > Log:
> > Lay the groundwork for my upcoming ilist sentinel shrinking patch
> > by defining a LLVM_COMPACT_SENTINELS symbol to 0 or 1 in config.h.
>
> Gabor, it is usually a bad idea to make major ABI changes like this  
> based on build settings like ENABLE_OPTIMIZED and DISABLE_ASSERTIONS.  
> Why do you need this?

Hi Chris,

the reason is that I originally had a patch in the tree where
NDEBUG caused the sentinels to only have a back pointer, but no
forward pointer.
Because NDEBUG disabled assertions, no one looked at the forward
pointer anyway.

Now, this turned out to be a suboptimal idea, because llvm-gcc (e.g.)
sets NDEBUG
in some rather strange ways, so the clients sometimes were configured
differently,
causing major disagreements in the size and field offset of
llvm::Function, for example.

That patch had been backed out, and I was puzzled until yesterday,
when I understood the reason.

Now the feature of lean sentinels is an interesting one, since it
saves 2 pointers per
llvm::Function and one pointer per llvm::BasicBlock, without any
additional overhead.

So I hope to get this feature back. Shantonu nudged me in the
direction of config.h,
which is a much more reliable way of putting in a preprocessor symbol
then NDEBUG.

This is how I came up with LLVM_COMPACT_SENTINELS in configure. It
defaults to 1 if
in Release-Asserts mode. Now if clients include the same config.h and
link against the
Release-Asserts libraries, there will be no trouble. I guess this is
the primary use case.

Making --enable-compact-sentinels a configure option to all LLVM
clients is IMHO not
a good idea.

But I would love to hear of ways to get this right.

Cheers,

   Gabor

PS: the original patch is this: <http://llvm.org/viewvc/llvm-project?
view=rev&revision=66415>
I plan to resubmit ASAP.

>
> -Chris
>
>
>
>
>
>
>
> > I'm asking for 3 favors:
> > - may an autofoo expert look at this and suggest improvements?
> > - may a cmake expert suggest analogous functionality for config.h?
> > - may somebody with the right autofoo mix regenerate configure?  
> > (mine is too new)
>
> > Thanks!
> > --This line, and those below, will be ignored--
>
> > M    configure.ac
>
> > Modified:
> >    llvm/trunk/autoconf/configure.ac
>
> > Modified: llvm/trunk/autoconf/configure.ac
> > URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?...
>
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > ======================================================================
> > --- llvm/trunk/autoconf/configure.ac (original)
> > +++ llvm/trunk/autoconf/configure.ac Mon Aug 10 19:59:39 2009
> > @@ -312,6 +312,17 @@
> >   AC_SUBST(DISABLE_ASSERTIONS,[[DISABLE_ASSERTIONS=1]])
> > fi
>
> > +dnl LLVM_COMPACT_SENTINELS : can be used to shrink ilist's end  
> > iterators and disable certain checks on them:
> > +if test ${ENABLE_OPTIMIZED},${DISABLE_ASSERTIONS} =  
> > "ENABLE_OPTIMIZED=1,DISABLE_ASSERTIONS=1" ; then
> > +  AC_SUBST(LLVM_COMPACT_SENTINELS,[1])
> > +else
> > +  AC_SUBST(LLVM_COMPACT_SENTINELS,[0])
> > +fi
> > +
> > +AC_DEFINE_UNQUOTED([LLVM_COMPACT_SENTINELS],$LLVM_COMPACT_SENTINELS,
> > +                   [Define to 1 for ilist sentinel compaction])
> > +
> > +
> > dnl --enable-expensive-checks : check whether they want to turn on  
> > expensive debug checks:
> > AC_ARG_ENABLE(expensive-checks,AS_HELP_STRING(
> >   --enable-expensive-checks,[Compile with expensive debug checks  
> > enabled (default is NO)]),, enableval="no")
>
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-comm... at cs.uiuc.edu
> >http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-comm... at cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list