<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Dec 27, 2016 at 10:20 AM Davide Italiano <<a href="mailto:davide@freebsd.org">davide@freebsd.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Dec 27, 2016 at 10:04 AM, Chandler Carruth via llvm-commits<br class="gmail_msg">
<<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br class="gmail_msg">
> Author: chandlerc<br class="gmail_msg">
> Date: Tue Dec 27 12:04:11 2016<br class="gmail_msg">
> New Revision: 290614<br class="gmail_msg">
><br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=290614&view=rev" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=290614&view=rev</a><br class="gmail_msg">
> Log:<br class="gmail_msg">
> [PM] Remove a pointless optimization.<br class="gmail_msg">
><br class="gmail_msg">
> There is no need to do this within an analysis. That method shouldn't<br class="gmail_msg">
> even be reached if this predicate holds as the actual useful<br class="gmail_msg">
> optimization is in the analysis manager itself.<br class="gmail_msg">
><br class="gmail_msg">
> Modified:<br class="gmail_msg">
>     llvm/trunk/lib/Analysis/AliasAnalysis.cpp<br class="gmail_msg">
>     llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp<br class="gmail_msg">
><br class="gmail_msg">
> Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=290614&r1=290613&r2=290614&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=290614&r1=290613&r2=290614&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original)<br class="gmail_msg">
> +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Tue Dec 27 12:04:11 2016<br class="gmail_msg">
> @@ -72,9 +72,6 @@ AAResults::~AAResults() {<br class="gmail_msg">
><br class="gmail_msg">
>  bool AAResults::invalidate(Function &F, const PreservedAnalyses &PA,<br class="gmail_msg">
>                             FunctionAnalysisManager::Invalidator &Inv) {<br class="gmail_msg">
> -  if (PA.areAllPreserved())<br class="gmail_msg">
> -    return false; // Nothing to do, everything is still valid.<br class="gmail_msg">
> -<br class="gmail_msg">
<br class="gmail_msg">
Random thought: if you enforce the invariant that<br class="gmail_msg">
AAResult::invalidate() is never called when all the analysis have been<br class="gmail_msg">
preserved maybe the check can be turned into an assertion?<br class="gmail_msg"></blockquote><div><br></div><div>My thought is that it is more of an optimization than an invariant... but I'm open to suggestions here. It just seems a bit weird to assert it as nothing about the function fails to get the correct result either way...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
--<br class="gmail_msg">
Davide<br class="gmail_msg">
<br class="gmail_msg">
"There are no solved problems; there are only problems that are more<br class="gmail_msg">
or less solved" -- Henri Poincare<br class="gmail_msg">
</blockquote></div></div>