[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-commits
Subject:    Re: [llvm] r186667 - Cleanup the stats counters for the new implementation. These actually
From:       Nick Kledzik <kledzik () apple ! com>
Date:       2013-07-31 20:47:03
Message-ID: 19AF1C25-8110-451A-B09E-5FB3010579B4 () apple ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Jul 27, 2013, at 3:19 AM, Chandler Carruth <chandlerc@gmail.com> wrote:

> On Tue, Jul 23, 2013 at 9:15 PM, Chandler Carruth <chandlerc@gmail.com> wrote:
> On Tue, Jul 23, 2013 at 4:23 PM, Nick Kledzik <kledzik@apple.com> wrote:
> Chandler,
> 
> This change broke one of the lld build bots.  I’m not sure why more build bots are \
> not failing.   Some of the statistics variables are only used inside #if \
> conditionals.  So when you build with those conditions false, the compiler warns \
> the variable is never used. 
> Sorry. I should have seen it in my own builds but missed it in the noise from a bad \
> warning in Clang that interacts poorly with LLD and libstdc++v4.8... I'll fix... 
> And somehow I forgot to actually commit the fix! =[ Really sorry this stayed broken \
> so long, really do feel free to complain loudly if I ever leave bots broken so \
> badly... =[ 
> Anyways, fixed in r187297.
> 
> Also, how can I configure my own build to see this? I don't even see the warnings \
> in my builds with a recent bootstrap of Clang.
I don’t know.  The built bot logs do not show what command line options are used when \
building, so I can’t tell why one bot gets the error and others don’t.

-Nick



> <http://lab.llvm.org:8011/builders/lld-x86_64-darwin11/builds/2384/steps/build_Lld/logs/stdio>
>  
> 
> 
> [ 27%] Building CXX object \
> lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/SROA.cpp.o 
> /Volumes/Macintosh_HD2/buildbots/lld-x86_64-darwin11/llvm.src/lib/Transforms/Scalar/SROA.cpp:61:11: \
> error: unused variable 'NumAllocaPartitions' [-Werror,-Wunused-variable] \
> STATISTIC(NumAllocaPartitions, "Number of alloca partitions formed"); ^
> /Volumes/Macintosh_HD2/buildbots/lld-x86_64-darwin11/llvm.src/include/llvm/ADT/Statistic.h:165:26: \
> note: expanded from macro 'STATISTIC' static llvm::Statistic VARNAME = { \
> DEBUG_TYPE, DESC, 0, 0 } ^
> /Volumes/Macintosh_HD2/buildbots/lld-x86_64-darwin11/llvm.src/lib/Transforms/Scalar/SROA.cpp:62:11: \
> error: unused variable 'MaxPartitionsPerAlloca' [-Werror,-Wunused-variable] \
> STATISTIC(MaxPartitionsPerAlloca, "Maximum number of partitions per alloca"); ^
> /Volumes/Macintosh_HD2/buildbots/lld-x86_64-darwin11/llvm.src/include/llvm/ADT/Statistic.h:165:26: \
> note: expanded from macro 'STATISTIC' static llvm::Statistic VARNAME = { \
> DEBUG_TYPE, DESC, 0, 0 } 
> 
> 
> On Jul 19, 2013, at 3:57 AM, Chandler Carruth <chandlerc@gmail.com> wrote:
> > Author: chandlerc
> > Date: Fri Jul 19 05:57:36 2013
> > New Revision: 186667
> > 
> > URL: http://llvm.org/viewvc/llvm-project?rev=186667&view=rev
> > Log:
> > Cleanup the stats counters for the new implementation. These actually
> > count the right things and have the right names.
> > 
> > Modified:
> > llvm/trunk/lib/Transforms/Scalar/SROA.cpp
> > 
> > Modified: llvm/trunk/lib/Transforms/Scalar/SROA.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SROA.cpp?rev=186667&r1=186666&r2=186667&view=diff
> >  ==============================================================================
> > --- llvm/trunk/lib/Transforms/Scalar/SROA.cpp (original)
> > +++ llvm/trunk/lib/Transforms/Scalar/SROA.cpp Fri Jul 19 05:57:36 2013
> > @@ -59,9 +59,9 @@ using namespace llvm;
> > 
> > STATISTIC(NumAllocasAnalyzed, "Number of allocas analyzed for replacement");
> > STATISTIC(NumAllocaPartitions, "Number of alloca partitions formed");
> > -STATISTIC(MaxPartitionsPerAlloca, "Maximum number of partitions");
> > -STATISTIC(NumAllocaPartitionUses, "Number of alloca partition uses found");
> > -STATISTIC(MaxPartitionUsesPerAlloca, "Maximum number of partition uses");
> > +STATISTIC(MaxPartitionsPerAlloca, "Maximum number of partitions per alloca");
> > +STATISTIC(NumAllocaPartitionUses, "Number of alloca partition uses rewritten");
> > +STATISTIC(MaxUsesPerAllocaPartition, "Maximum number of uses of a partition");
> > STATISTIC(NumNewAllocas, "Number of new, smaller allocas introduced");
> > STATISTIC(NumPromoted, "Number of allocas promoted to SSA values");
> > STATISTIC(NumLoadsSpeculated, "Number of loads speculated to allow promotion");
> > @@ -682,15 +682,6 @@ AllocaSlices::AllocaSlices(const DataLay
> > 
> > Slices.erase(std::remove_if(Slices.begin(), Slices.end(), IsSliceDead()),
> > Slices.end());
> > -
> > -  // Record how many slices we end up with.
> > -  NumAllocaPartitions += Slices.size();
> > -  MaxPartitionsPerAlloca =
> > -      std::max<unsigned>(Slices.size(), MaxPartitionsPerAlloca);
> > -
> > -  NumAllocaPartitionUses += Slices.size();
> > -  MaxPartitionUsesPerAlloca =
> > -      std::max<unsigned>(Slices.size(), MaxPartitionUsesPerAlloca);
> > }
> > 
> > #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
> > @@ -3045,6 +3036,10 @@ bool SROA::rewritePartition(AllocaInst &
> > unsigned SPOldSize = SpeculatablePHIs.size();
> > unsigned SSOldSize = SpeculatableSelects.size();
> > 
> > +#if !defined(NDEBUG) || defined(LLVM_ENABLE_STATS)
> > +  unsigned NumUses = 0;
> > +#endif
> > +
> > AllocaSliceRewriter Rewriter(*DL, S, *this, AI, *NewAI, BeginOffset,
> > EndOffset, IsVectorPromotable,
> > IsIntegerPromotable);
> > @@ -3055,13 +3050,25 @@ bool SROA::rewritePartition(AllocaInst &
> > DEBUG(dbgs() << "  rewriting split ");
> > DEBUG(S.printSlice(dbgs(), *SUI, ""));
> > Promotable &= Rewriter.visit(*SUI);
> > +#if !defined(NDEBUG) || defined(LLVM_ENABLE_STATS)
> > +    ++NumUses;
> > +#endif
> > }
> > for (AllocaSlices::iterator I = B; I != E; ++I) {
> > DEBUG(dbgs() << "  rewriting ");
> > DEBUG(S.printSlice(dbgs(), I, ""));
> > Promotable &= Rewriter.visit(I);
> > +#if !defined(NDEBUG) || defined(LLVM_ENABLE_STATS)
> > +    ++NumUses;
> > +#endif
> > }
> > 
> > +#if !defined(NDEBUG) || defined(LLVM_ENABLE_STATS)
> > +  NumAllocaPartitionUses += NumUses;
> > +  MaxUsesPerAllocaPartition =
> > +      std::max<unsigned>(NumUses, MaxUsesPerAllocaPartition);
> > +#endif
> > +
> > if (Promotable && (SpeculatablePHIs.size() > SPOldSize ||
> > SpeculatableSelects.size() > SSOldSize)) {
> > // If we have a promotable alloca except for some unspeculated loads below
> > @@ -3135,6 +3142,10 @@ bool SROA::splitAlloca(AllocaInst &AI, A
> > if (S.begin() == S.end())
> > return false;
> > 
> > +#if !defined(NDEBUG) || defined(LLVM_ENABLE_STATS)
> > +  unsigned NumPartitions = 0;
> > +#endif
> > +
> > bool Changed = false;
> > SmallVector<AllocaSlices::iterator, 4> SplitUses;
> > uint64_t MaxSplitUseEndOffset = 0;
> > @@ -3181,6 +3192,9 @@ bool SROA::splitAlloca(AllocaInst &AI, A
> > // Rewrite a sequence of overlapping slices.
> > Changed |=
> > rewritePartition(AI, S, SI, SJ, BeginOffset, MaxEndOffset, SplitUses);
> > +#if !defined(NDEBUG) || defined(LLVM_ENABLE_STATS)
> > +      ++NumPartitions;
> > +#endif
> > 
> > removeFinishedSplitUses(SplitUses, MaxSplitUseEndOffset, MaxEndOffset);
> > }
> > @@ -3220,6 +3234,10 @@ bool SROA::splitAlloca(AllocaInst &AI, A
> > 
> > Changed |= rewritePartition(AI, S, SJ, SJ, MaxEndOffset, PostSplitEndOffset,
> > SplitUses);
> > +#if !defined(NDEBUG) || defined(LLVM_ENABLE_STATS)
> > +    ++NumPartitions;
> > +#endif
> > +
> > if (SJ == SE)
> > break; // Skip the rest, we don't need to do any cleanup.
> > 
> > @@ -3230,6 +3248,12 @@ bool SROA::splitAlloca(AllocaInst &AI, A
> > BeginOffset = SJ->beginOffset();
> > }
> > 
> > +#if !defined(NDEBUG) || defined(LLVM_ENABLE_STATS)
> > +  NumAllocaPartitions += NumPartitions;
> > +  MaxPartitionsPerAlloca =
> > +      std::max<unsigned>(NumPartitions, MaxPartitionsPerAlloca);
> > +#endif
> > +
> > return Changed;
> > }
> > 
> > 
> > 
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits@cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[Attachment #5 (text/html)]

<html><head><meta http-equiv="Content-Type" content="text/html \
charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: \
space; -webkit-line-break: after-white-space;"><br><div><div>On Jul 27, 2013, at 3:19 \
AM, Chandler Carruth &lt;<a \
href="mailto:chandlerc@gmail.com">chandlerc@gmail.com</a>&gt; wrote:</div><br \
class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: \
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: \
normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: \
start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; \
word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div dir="ltr">On Tue, Jul 23, \
2013 at 9:15 PM, Chandler Carruth<span \
class="Apple-converted-space">&nbsp;</span><span dir="ltr">&lt;<a \
href="mailto:chandlerc@gmail.com" target="_blank" \
class="cremed">chandlerc@gmail.com</a>&gt;</span><span \
class="Apple-converted-space">&nbsp;</span>wrote:<br><div class="gmail_extra"><div \
class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; \
border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: \
solid; padding-left: 1ex;"><div dir="ltr"><div class="im">On Tue, Jul 23, 2013 at \
4:23 PM, Nick Kledzik<span class="Apple-converted-space">&nbsp;</span><span \
dir="ltr">&lt;<a href="mailto:kledzik@apple.com" target="_blank" \
class="cremed">kledzik@apple.com</a>&gt;</span><span \
class="Apple-converted-space">&nbsp;</span>wrote:<br></div><div \
class="gmail_extra"><div class="gmail_quote"><div class="im"><blockquote \
class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; \
border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: \
1ex;">Chandler,<br><br>This change broke one of the lld build bots. &nbsp;I’m not \
sure why more build bots are not failing. &nbsp; Some of the statistics variables are \
only used inside #if conditionals. &nbsp;So when you build with those conditions \
false, the compiler warns the variable is never \
used.<br></blockquote><div><br></div></div><div>Sorry. I should have seen it in my \
own builds but missed it in the noise from a bad warning in Clang that interacts \
poorly with LLD and libstdc++v4.8... I'll \
fix...</div></div></div></div></blockquote><div><br></div><div>And somehow I forgot \
to actually commit the fix! =[ Really sorry this stayed broken so long, really do \
feel free to complain loudly if I ever leave bots broken so badly... \
=[</div><div><br></div><div>Anyways, fixed in r187297.</div><div><br></div><div>Also, \
how can I configure my own build to see this? I don't even see the warnings in my \
builds with a recent bootstrap of \
Clang.</div></div></div></div></div></blockquote><div>I don’t know. &nbsp;The built \
bot logs do not show what command line options are used when building, so I can’t \
tell why one bot gets the error and others \
don’t.</div><div><br></div><div>-Nick</div><br><div><br></div><div><br></div><blockquote \
type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; \
font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: \
normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: \
0px;"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote \
class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; \
border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: \
1ex;"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div \
class="h5"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; \
border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: \
solid; padding-left: 1ex; position: static; z-index: auto;">&lt;<a \
href="http://lab.llvm.org:8011/builders/lld-x86_64-darwin11/builds/2384/steps/build_Lld/logs/stdio" \
target="_blank" class="cremed">http://lab.llvm.org:8011/builders/lld-x86_64-darwin11/builds/2384/steps/build_Lld/logs/stdio</a>&gt;<br><br><br><br>[ \
27%] Building CXX object \
lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/SROA.cpp.o<br><br>/Volumes/Macinto \
sh_HD2/buildbots/lld-x86_64-darwin11/llvm.src/lib/Transforms/Scalar/SROA.cpp:61:11: \
error: unused variable 'NumAllocaPartitions' \
[-Werror,-Wunused-variable]<br><div>STATISTIC(NumAllocaPartitions, "Number of alloca \
partitions formed");<br></div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span \
class="Apple-converted-space">&nbsp;</span>^<br>/Volumes/Macintosh_HD2/buildbots/lld-x86_64-darwin11/llvm.src/include/llvm/ADT/Statistic.h:165:26: \
note: expanded from macro 'STATISTIC'<br>&nbsp;<span \
class="Apple-converted-space">&nbsp;</span>static llvm::Statistic VARNAME = { \
DEBUG_TYPE, DESC, 0, 0 }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;^<br>/Volumes/Macintosh_HD2/buildbots/lld-x86_64-darwin11/llvm.src/lib/Transforms/Scalar/SROA.cpp:62:11: \
error: unused variable 'MaxPartitionsPerAlloca' \
[-Werror,-Wunused-variable]<br><div>STATISTIC(MaxPartitionsPerAlloca, "Maximum number \
of partitions per alloca");<br></div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span \
class="Apple-converted-space">&nbsp;</span>^<br>/Volumes/Macintosh_HD2/buildbots/lld-x86_64-darwin11/llvm.src/include/llvm/ADT/Statistic.h:165:26: \
note: expanded from macro 'STATISTIC'<br>&nbsp;<span \
class="Apple-converted-space">&nbsp;</span>static llvm::Statistic VARNAME = { \
DEBUG_TYPE, DESC, 0, 0 }<br><div><br><br><br>On Jul 19, 2013, at 3:57 AM, Chandler \
Carruth &lt;<a href="mailto:chandlerc@gmail.com" target="_blank" \
class="cremed">chandlerc@gmail.com</a>&gt; wrote:<br>&gt; Author: chandlerc<br>&gt; \
Date: Fri Jul 19 05:57:36 2013<br>&gt; New Revision: 186667<br>&gt;<br>&gt; URL:<span \
class="Apple-converted-space">&nbsp;</span><a \
href="http://llvm.org/viewvc/llvm-project?rev=186667&amp;view=rev" target="_blank" \
class="cremed">http://llvm.org/viewvc/llvm-project?rev=186667&amp;view=rev</a><br>&gt; \
Log:<br>&gt; Cleanup the stats counters for the new implementation. These \
actually<br>&gt; count the right things and have the right names.<br>&gt;<br>&gt; \
Modified:<br>&gt; &nbsp; \
&nbsp;llvm/trunk/lib/Transforms/Scalar/SROA.cpp<br>&gt;<br>&gt; Modified: \
llvm/trunk/lib/Transforms/Scalar/SROA.cpp<br>&gt; URL:<span \
class="Apple-converted-space">&nbsp;</span><a \
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SROA.cpp?rev=186667&amp;r1=186666&amp;r2=186667&amp;view=diff" \
target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Tran \
sforms/Scalar/SROA.cpp?rev=186667&amp;r1=186666&amp;r2=186667&amp;view=diff</a><br>&gt; \
==============================================================================<br>&gt; \
--- llvm/trunk/lib/Transforms/Scalar/SROA.cpp (original)<br>&gt; +++ \
llvm/trunk/lib/Transforms/Scalar/SROA.cpp Fri Jul 19 05:57:36 2013<br>&gt; @@ -59,9 \
+59,9 @@ using namespace llvm;<br>&gt;<br>&gt; STATISTIC(NumAllocasAnalyzed, "Number \
of allocas analyzed for replacement");<br>&gt; STATISTIC(NumAllocaPartitions, "Number \
of alloca partitions formed");<br>&gt; -STATISTIC(MaxPartitionsPerAlloca, "Maximum \
number of partitions");<br>&gt; -STATISTIC(NumAllocaPartitionUses, "Number of alloca \
partition uses found");<br>&gt; -STATISTIC(MaxPartitionUsesPerAlloca, "Maximum number \
of partition uses");<br>&gt; +STATISTIC(MaxPartitionsPerAlloca, "Maximum number of \
partitions per alloca");<br>&gt; +STATISTIC(NumAllocaPartitionUses, "Number of alloca \
partition uses rewritten");<br>&gt; +STATISTIC(MaxUsesPerAllocaPartition, "Maximum \
number of uses of a partition");<br>&gt; STATISTIC(NumNewAllocas, "Number of new, \
smaller allocas introduced");<br>&gt; STATISTIC(NumPromoted, "Number of allocas \
promoted to SSA values");<br>&gt; STATISTIC(NumLoadsSpeculated, "Number of loads \
speculated to allow promotion");<br>&gt; @@ -682,15 +682,6 @@ \
AllocaSlices::AllocaSlices(const DataLay<br>&gt;<br>&gt; &nbsp; \
Slices.erase(std::remove_if(Slices.begin(), Slices.end(), IsSliceDead()),<br>&gt; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Slices.end());<br>&gt; \
-<br>&gt; - &nbsp;// Record how many slices we end up with.<br>&gt; - \
&nbsp;NumAllocaPartitions += Slices.size();<br>&gt; - &nbsp;MaxPartitionsPerAlloca \
=<br>&gt; - &nbsp; &nbsp; &nbsp;std::max&lt;unsigned&gt;(Slices.size(), \
MaxPartitionsPerAlloca);<br>&gt; -<br>&gt; - &nbsp;NumAllocaPartitionUses += \
Slices.size();<br>&gt; - &nbsp;MaxPartitionUsesPerAlloca =<br>&gt; - &nbsp; &nbsp; \
&nbsp;std::max&lt;unsigned&gt;(Slices.size(), MaxPartitionUsesPerAlloca);<br>&gt; \
}<br>&gt;<br>&gt; #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)<br>&gt; @@ \
-3045,6 +3036,10 @@ bool SROA::rewritePartition(AllocaInst &amp;<br>&gt; &nbsp; \
unsigned SPOldSize = SpeculatablePHIs.size();<br>&gt; &nbsp; unsigned SSOldSize = \
SpeculatableSelects.size();<br>&gt;<br>&gt; +#if !defined(NDEBUG) || \
defined(LLVM_ENABLE_STATS)<br>&gt; + &nbsp;unsigned NumUses = 0;<br>&gt; \
+#endif<br>&gt; +<br>&gt; &nbsp; AllocaSliceRewriter Rewriter(*DL, S, *this, AI, \
*NewAI, BeginOffset,<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;EndOffset, \
IsVectorPromotable,<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IsIntegerPromotable);<br>&gt; \
@@ -3055,13 +3050,25 @@ bool SROA::rewritePartition(AllocaInst &amp;<br>&gt; &nbsp; \
&nbsp; DEBUG(dbgs() &lt;&lt; " &nbsp;rewriting split ");<br>&gt; &nbsp; &nbsp; \
DEBUG(S.printSlice(dbgs(), *SUI, ""));<br>&gt; &nbsp; &nbsp; Promotable &amp;= \
Rewriter.visit(*SUI);<br>&gt; +#if !defined(NDEBUG) || \
defined(LLVM_ENABLE_STATS)<br>&gt; + &nbsp; &nbsp;++NumUses;<br>&gt; +#endif<br>&gt; \
&nbsp; }<br>&gt; &nbsp; for (AllocaSlices::iterator I = B; I != E; ++I) {<br>&gt; \
&nbsp; &nbsp; DEBUG(dbgs() &lt;&lt; " &nbsp;rewriting ");<br>&gt; &nbsp; &nbsp; \
DEBUG(S.printSlice(dbgs(), I, ""));<br>&gt; &nbsp; &nbsp; Promotable &amp;= \
Rewriter.visit(I);<br>&gt; +#if !defined(NDEBUG) || \
defined(LLVM_ENABLE_STATS)<br>&gt; + &nbsp; &nbsp;++NumUses;<br>&gt; +#endif<br>&gt; \
&nbsp; }<br>&gt;<br>&gt; +#if !defined(NDEBUG) || defined(LLVM_ENABLE_STATS)<br>&gt; \
+ &nbsp;NumAllocaPartitionUses += NumUses;<br>&gt; + &nbsp;MaxUsesPerAllocaPartition \
=<br>&gt; + &nbsp; &nbsp; &nbsp;std::max&lt;unsigned&gt;(NumUses, \
MaxUsesPerAllocaPartition);<br>&gt; +#endif<br>&gt; +<br>&gt; &nbsp; if (Promotable \
&amp;&amp; (SpeculatablePHIs.size() &gt; SPOldSize ||<br>&gt; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SpeculatableSelects.size() \
&gt; SSOldSize)) {<br>&gt; &nbsp; &nbsp; // If we have a promotable alloca except for \
some unspeculated loads below<br>&gt; @@ -3135,6 +3142,10 @@ bool \
SROA::splitAlloca(AllocaInst &amp;AI, A<br>&gt; &nbsp; if (S.begin() == \
S.end())<br>&gt; &nbsp; &nbsp; return false;<br>&gt;<br>&gt; +#if !defined(NDEBUG) || \
defined(LLVM_ENABLE_STATS)<br>&gt; + &nbsp;unsigned NumPartitions = 0;<br>&gt; \
+#endif<br>&gt; +<br>&gt; &nbsp; bool Changed = false;<br>&gt; &nbsp; \
SmallVector&lt;AllocaSlices::iterator, 4&gt; SplitUses;<br>&gt; &nbsp; uint64_t \
MaxSplitUseEndOffset = 0;<br>&gt; @@ -3181,6 +3192,9 @@ bool \
SROA::splitAlloca(AllocaInst &amp;AI, A<br>&gt; &nbsp; &nbsp; &nbsp; // Rewrite a \
sequence of overlapping slices.<br>&gt; &nbsp; &nbsp; &nbsp; Changed |=<br>&gt; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rewritePartition(AI, S, SI, SJ, BeginOffset, \
MaxEndOffset, SplitUses);<br>&gt; +#if !defined(NDEBUG) || \
defined(LLVM_ENABLE_STATS)<br>&gt; + &nbsp; &nbsp; &nbsp;++NumPartitions;<br>&gt; \
+#endif<br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; removeFinishedSplitUses(SplitUses, \
MaxSplitUseEndOffset, MaxEndOffset);<br>&gt; &nbsp; &nbsp; }<br>&gt; @@ -3220,6 \
+3234,10 @@ bool SROA::splitAlloca(AllocaInst &amp;AI, A<br>&gt;<br>&gt; &nbsp; \
&nbsp; Changed |= rewritePartition(AI, S, SJ, SJ, MaxEndOffset, \
PostSplitEndOffset,<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SplitUses);<br>&gt; +#if \
!defined(NDEBUG) || defined(LLVM_ENABLE_STATS)<br>&gt; + &nbsp; \
&nbsp;++NumPartitions;<br>&gt; +#endif<br>&gt; +<br>&gt; &nbsp; &nbsp; if (SJ == \
SE)<br>&gt; &nbsp; &nbsp; &nbsp; break; // Skip the rest, we don't need to do any \
cleanup.<br>&gt;<br>&gt; @@ -3230,6 +3248,12 @@ bool SROA::splitAlloca(AllocaInst \
&amp;AI, A<br>&gt; &nbsp; &nbsp; BeginOffset = SJ-&gt;beginOffset();<br>&gt; &nbsp; \
}<br>&gt;<br>&gt; +#if !defined(NDEBUG) || defined(LLVM_ENABLE_STATS)<br>&gt; + \
&nbsp;NumAllocaPartitions += NumPartitions;<br>&gt; + &nbsp;MaxPartitionsPerAlloca \
=<br>&gt; + &nbsp; &nbsp; &nbsp;std::max&lt;unsigned&gt;(NumPartitions, \
MaxPartitionsPerAlloca);<br>&gt; +#endif<br>&gt; +<br>&gt; &nbsp; return \
Changed;<br>&gt; }<br>&gt;<br>&gt;<br>&gt;<br>&gt; \
_______________________________________________<br>&gt; llvm-commits mailing \
list<br>&gt;<span class="Apple-converted-space">&nbsp;</span><a \
href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" \
class="cremed">llvm-commits@cs.uiuc.edu</a><br>&gt;<span \
class="Apple-converted-space">&nbsp;</span><a \
href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" \
class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br><br><br>_______________________________________________<br>llvm-commits \
mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" \
class="cremed">llvm-commits@cs.uiuc.edu</a><br><a \
href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" \
class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a></div></block \
quote></div></div></div></div></blockquote></div></div></div></div></blockquote></div><br></body></html>




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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic