<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 01/04/2015 05:46 PM, Chandler
Carruth wrote:<br>
</div>
<blockquote
cite="mid:CAGCO0KiYyk3fLon2M9w=vuGCptoQOuGQYhsf6iWZ1DYNyLNjJA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">Replying separately to the actual code
review comments, thanks for them.</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Sun, Jan 4, 2015 at 4:56 PM,
Philip Reames <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:listmail@philipreames.com" target="_blank">listmail@philipreames.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":168" class="a3s" style="overflow:hidden">A
couple of comments inline.
<div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Added:<br>
llvm/trunk/include/llvm/Analysis/AssumptionCache.h<br>
llvm/trunk/lib/Analysis/AssumptionCache.cpp<br>
Removed:<br>
llvm/trunk/include/llvm/Analysis/AssumptionTracker.h<br>
llvm/trunk/lib/Analysis/AssumptionTracker.cpp<br>
Modified:<br>
llvm/trunk/include/llvm/Analysis/CodeMetrics.h<br>
llvm/trunk/include/llvm/Analysis/InlineCost.h<br>
llvm/trunk/include/llvm/Analysis/InstructionSimplify.h<br>
llvm/trunk/include/llvm/Analysis/LazyValueInfo.h<br>
llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h<br>
llvm/trunk/include/llvm/Analysis/PHITransAddr.h<br>
llvm/trunk/include/llvm/Analysis/ScalarEvolution.h<br>
llvm/trunk/include/llvm/Analysis/ValueTracking.h<br>
llvm/trunk/include/llvm/InitializePasses.h<br>
llvm/trunk/include/llvm/Transforms/Utils/Cloning.h<br>
llvm/trunk/include/llvm/Transforms/Utils/Local.h<br>
llvm/trunk/include/llvm/Transforms/Utils/LoopUtils.h<br>
llvm/trunk/include/llvm/Transforms/Utils/PromoteMemToReg.h<br>
llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h<br>
llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp<br>
llvm/trunk/lib/Analysis/CMakeLists.txt<br>
llvm/trunk/lib/Analysis/CodeMetrics.cpp<br>
llvm/trunk/lib/Analysis/IPA/InlineCost.cpp<br>
llvm/trunk/lib/Analysis/InstructionSimplify.cpp<br>
llvm/trunk/lib/Analysis/LazyValueInfo.cpp<br>
llvm/trunk/lib/Analysis/Lint.cpp<br>
llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp<br>
llvm/trunk/lib/Analysis/PHITransAddr.cpp<br>
llvm/trunk/lib/Analysis/ScalarEvolution.cpp<br>
llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp<br>
llvm/trunk/lib/Analysis/ValueTracking.cpp<br>
llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp<br>
llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp<br>
llvm/trunk/lib/Transforms/IPO/Inliner.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombine.h<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombinePHI.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp<br>
llvm/trunk/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp<br>
llvm/trunk/lib/Transforms/Scalar/EarlyCSE.cpp<br>
llvm/trunk/lib/Transforms/Scalar/GVN.cpp<br>
llvm/trunk/lib/Transforms/Scalar/LoopInstSimplify.cpp<br>
llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp<br>
llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp<br>
llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp<br>
llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp<br>
llvm/trunk/lib/Transforms/Scalar/SROA.cpp<br>
llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp<br>
llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp<br>
llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp<br>
llvm/trunk/lib/Transforms/Utils/Local.cpp<br>
llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp<br>
llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp<br>
llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp<br>
llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp<br>
llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp<br>
llvm/trunk/lib/Transforms/Utils/SimplifyInstructions.cpp<br>
llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp<br>
llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp<br>
<br>
Added: llvm/trunk/include/llvm/Analysis/AssumptionCache.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AssumptionCache.h?rev=225131&view=auto"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AssumptionCache.h?rev=225131&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/AssumptionCache.h
(added)<br>
+++ llvm/trunk/include/llvm/Analysis/AssumptionCache.h
Sun Jan 4 06:03:27 2015<br>
@@ -0,0 +1,142 @@<br>
+//===- llvm/Analysis/AssumptionCache.h - Track
@llvm.assume ---*- C++ -*-===//<br>
+//<br>
+// The LLVM Compiler
Infrastructure<br>
+//<br>
+// This file is distributed under the University
of Illinois Open Source<br>
+// License. See LICENSE.TXT for details.<br>
+//<br>
+//===----------------------------------------------------------------------===//<br>
+//<br>
+// This file contains a pass that keeps track of
@llvm.assume intrinsics in<br>
+// the functions of a module (allowing
assumptions within any function to be<br>
+// found cheaply by other parts of the
optimizer).<br>
+//<br>
+//===----------------------------------------------------------------------===//<br>
+<br>
+#ifndef LLVM_ANALYSIS_ASSUMPTIONTRACKER_H<br>
+#define LLVM_ANALYSIS_ASSUMPTIONTRACKER_H<br>
</blockquote>
</div>
</div>
This needs updated.</div>
</blockquote>
<div><br>
</div>
<div>Gah, I knew I had missed something.</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":168" class="a3s" style="overflow:hidden">
<div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+#include "llvm/ADT/ArrayRef.h"<br>
+#include "llvm/ADT/DenseMap.h"<br>
+#include "llvm/ADT/SmallSet.h"<br>
+#include "llvm/IR/Function.h"<br>
+#include "llvm/IR/Instructions.h"<br>
+#include "llvm/IR/ValueHandle.h"<br>
+#include "llvm/Pass.h"<br>
+#include <memory><br>
+<br>
+namespace llvm {<br>
+<br>
+/// \brief A cache of @llvm.assume calls within a
function.<br>
+///<br>
+/// This cache provides fast lookup of
assumptions within a function by caching<br>
+/// them and amortizing the cost of scanning for
them across all queries. The<br>
+/// cache is also conservatively self-updating so
that it will never return<br>
+/// incorrect results about a function even as
the function is being mutated.<br>
+/// However, flushing the cache and rebuilding it
(or explicitly updating it)<br>
+/// may allow it to discover new assumptions.<br>
+class AssumptionCache {<br>
+ /// \brief The function for which this cache is
handling assumptions.<br>
+ ///<br>
+ /// We track this to lazily populate our
assumptions.<br>
+ Function &F;<br>
+<br>
+ /// \brief Vector of weak value handles to
calls of the @llvm.assume<br>
+ /// intrinsic.<br>
+ SmallVector<WeakVH, 4> AssumeHandles;<br>
</blockquote>
</div>
</div>
Why 4? Given that an assumption cache only exists if a
function has assumes, why not make this slightly larger?</div>
</blockquote>
<div><br>
</div>
<div>Primarily because an assumption cache is actually
created for most function even if there are no assume
intrinsics. See below my comments about why we don't
populate the assumption cache eagerly which should clarify
this a lot.</div>
</div>
</div>
</div>
</blockquote>
Makes sense.<br>
<blockquote
cite="mid:CAGCO0KiYyk3fLon2M9w=vuGCptoQOuGQYhsf6iWZ1DYNyLNjJA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div><br>
</div>
<div>Secondarily, I'm not sure that having more assumes is
very common. Introducing an assume intrinsic is a
reasonable high-cost thing to the rest of the optimizer,
and so I was being relatively conservative in the expected
number of them. But this is something that should be tuned
based on data if the initial guessed value isn't really
suitable.</div>
</div>
</div>
</div>
</blockquote>
One data point: I'm using them fairly heavily at the moment. I
don't plan on continuing to do so for the current use - which is
mostly to get a really nasty exception scheme to optimize reasonably
- but imagine I'll run across something else I need them for in the
future. <br>
<br>
On point worth thinking about: If we want assumes to be our
mechanism for rapid experimentation w.r.t. optimizer hints, adding
assumes can't be too much more expensive than an attribute or
metadata. Otherwise, it makes quick experimentation much harder. <br>
<blockquote
cite="mid:CAGCO0KiYyk3fLon2M9w=vuGCptoQOuGQYhsf6iWZ1DYNyLNjJA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":168" class="a3s" style="overflow:hidden">
<div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+ /// \brief Flag tracking whether we have
scanned the function yet.<br>
+ ///<br>
+ /// We want to be as lazy about this as
possible, and so we scan the function<br>
+ /// at the last moment.<br>
+ bool Scanned;<br>
+<br>
+ /// \brief Scan the function for assumptions
and add them to the cache.<br>
+ void scanFunction();<br>
+<br>
+public:<br>
+ /// \brief Construct an AssumptionCache from a
function by scanning all of<br>
+ /// its instructions.<br>
+ AssumptionCache(Function &F) : F(F),
Scanned(false) {}<br>
+<br>
+ /// \brief Add an @llvm.assume intrinsic to
this function's cache.<br>
+ ///<br>
+ /// The call passed in must be an instruction
within this fuction and must<br>
+ /// not already be in the cache.<br>
+ void registerAssumption(CallInst *CI);<br>
+<br>
+ /// \brief Clear the cache of @llvm.assume
intrinsics for a function.<br>
+ ///<br>
+ /// It will be re-scanned the next time it is
requested.<br>
+ void clear() {<br>
+ AssumeHandles.clear();<br>
+ Scanned = false;<br>
+ }<br>
+<br>
+ /// \brief Access the list of assumption
handles currently tracked for this<br>
+ /// fuction.<br>
+ ///<br>
+ /// Note that these produce weak handles that
may be null. The caller must<br>
+ /// handle that case.<br>
+ /// FIXME: We should replace this with
pointee_iterator<filter_iterator<...>><br>
+ /// when we can write that to filter out the
null values. Then caller code<br>
+ /// will become simpler.<br>
+ MutableArrayRef<WeakVH> assumptions() {<br>
+ if (!Scanned)<br>
+ scanFunction();<br>
+ return AssumeHandles;<br>
+ }<br>
+};<br>
+<br>
+/// \brief An immutable pass that tracks lazily
created \c AssumptionCache<br>
+/// objects.<br>
+///<br>
+/// This is essentially a workaround for the
legacy pass manager's weaknesses<br>
+/// which associates each assumption cache with
Function and clears it if the<br>
+/// function is deleted. The nature of the
AssumptionCache is that it is not<br>
+/// invalidated by any changes to the function
body and so this is sufficient<br>
+/// to be conservatively correct.<br>
+class AssumptionCacheTracker : public
ImmutablePass {<br>
+ /// A callback value handle applied to function
objects, which we use to<br>
+ /// delete our cache of intrinsics for a
function when it is deleted.<br>
+ class FunctionCallbackVH : public CallbackVH {<br>
+ AssumptionCacheTracker *ACT;<br>
+ void deleted() override;<br>
+<br>
+ public:<br>
+ typedef DenseMapInfo<Value *> DMI;<br>
+<br>
+ FunctionCallbackVH(Value *V,
AssumptionCacheTracker *ACT = nullptr)<br>
+ : CallbackVH(V), ACT(ACT) {}<br>
+ };<br>
+<br>
+ friend FunctionCallbackVH;<br>
+<br>
+ typedef DenseMap<FunctionCallbackVH,
std::unique_ptr<AssumptionCache>,<br>
+ FunctionCallbackVH::DMI>
FunctionCallsMap;<br>
+ FunctionCallsMap AssumptionCaches;<br>
+<br>
+public:<br>
+ /// \brief Get the cached assumptions for a
function.<br>
+ ///<br>
+ /// If no assumptions are cached, this will
scan the function. Otherwise, the<br>
+ /// existing cache will be returned.<br>
+ AssumptionCache
&getAssumptionCache(Function &F);<br>
+<br>
+ AssumptionCacheTracker();<br>
+ ~AssumptionCacheTracker();<br>
+<br>
+ void releaseMemory() override {
AssumptionCaches.shrink_and_clear(); }<br>
+<br>
+ void verifyAnalysis() const override;<br>
+ bool doFinalization(Module &) override {<br>
+ verifyAnalysis();<br>
+ return false;<br>
+ }<br>
+<br>
+ static char ID; // Pass identification,
replacement for typeid<br>
+};<br>
+<br>
+} // end namespace llvm<br>
+<br>
+#endif<br>
<br>
Removed: llvm/trunk/include/llvm/Analysis/AssumptionTracker.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AssumptionTracker.h?rev=225130&view=auto"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AssumptionTracker.h?rev=225130&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/AssumptionTracker.h
(original)<br>
+++ llvm/trunk/include/llvm/Analysis/AssumptionTracker.h
(removed)<br>
@@ -1,128 +0,0 @@<br>
-//===- llvm/Analysis/AssumptionTracker.h - Track
@llvm.assume ---*- C++ -*-===//<br>
-//<br>
-// The LLVM Compiler
Infrastructure<br>
-//<br>
-// This file is distributed under the University
of Illinois Open Source<br>
-// License. See LICENSE.TXT for details.<br>
-//<br>
-//===----------------------------------------------------------------------===//<br>
-//<br>
-// This file contains a pass that keeps track of
@llvm.assume intrinsics in<br>
-// the functions of a module (allowing
assumptions within any function to be<br>
-// found cheaply by other parts of the
optimizer).<br>
-//<br>
-//===----------------------------------------------------------------------===//<br>
-<br>
-#ifndef LLVM_ANALYSIS_ASSUMPTIONTRACKER_H<br>
-#define LLVM_ANALYSIS_ASSUMPTIONTRACKER_H<br>
-<br>
-#include "llvm/ADT/DenseMap.h"<br>
-#include "llvm/ADT/DenseSet.h"<br>
-#include "llvm/ADT/SmallSet.h"<br>
-#include "llvm/IR/Function.h"<br>
-#include "llvm/IR/Instructions.h"<br>
-#include "llvm/IR/ValueHandle.h"<br>
-#include "llvm/Pass.h"<br>
-#include <memory><br>
-<br>
-namespace llvm {<br>
-<br>
-/// An immutable pass that tracks @llvm.assume
intrinsics in a module.<br>
-class AssumptionTracker : public ImmutablePass {<br>
- /// A callback value handle applied to function
objects, which we use to<br>
- /// delete our cache of intrinsics for a
function when it is deleted.<br>
- class FunctionCallbackVH : public CallbackVH {<br>
- AssumptionTracker *AT;<br>
- void deleted() override;<br>
-<br>
- public:<br>
- typedef DenseMapInfo<Value *> DMI;<br>
-<br>
- FunctionCallbackVH(Value *V,
AssumptionTracker *AT = nullptr)<br>
- : CallbackVH(V), AT(AT) {}<br>
- };<br>
-<br>
- /// A callback value handle applied to call
instructions, which keeps<br>
- /// track of the call's parent function so that
we can remove a<br>
- /// assumption intrinsic call from our cache
when the instruction is<br>
- /// deleted.<br>
- class CallCallbackVH : public CallbackVH {<br>
- AssumptionTracker *AT;<br>
- void deleted() override;<br>
-<br>
- // We store the function here because we need
it to lookup the set<br>
- // containing this handle when the underlying
CallInst is being deleted.<br>
- Function *F;<br>
-<br>
- public:<br>
- typedef DenseMapInfo<Instruction *>
DMI;<br>
-<br>
- CallCallbackVH(Instruction *I,
AssumptionTracker *AT = nullptr)<br>
- : CallbackVH(I), AT(AT), F(nullptr) {<br>
- if (I != DMI::getEmptyKey() && I
!= DMI::getTombstoneKey())<br>
- F = I->getParent()->getParent();<br>
- }<br>
-<br>
- operator CallInst*() const {<br>
- Value *V = getValPtr();<br>
- if (V == DMI::getEmptyKey() || V ==
DMI::getTombstoneKey())<br>
- return
reinterpret_cast<CallInst*>(V);<br>
-<br>
- return cast<CallInst>(V);<br>
- }<br>
-<br>
- CallInst *operator->() const { return
cast<CallInst>(getValPtr()); }<br>
- CallInst &operator*() const { return
*cast<CallInst>(getValPtr()); }<br>
- };<br>
-<br>
- friend FunctionCallbackVH;<br>
- friend CallCallbackVH;<br>
-<br>
- // FIXME: SmallSet might be better here, but it
currently has no iterators.<br>
- typedef DenseSet<CallCallbackVH,
CallCallbackVH::DMI> CallHandleSet;<br>
- typedef DenseMap<FunctionCallbackVH,
std::unique_ptr<CallHandleSet>,<br>
- FunctionCallbackVH::DMI>
FunctionCallsMap;<br>
- FunctionCallsMap CachedAssumeCalls;<br>
-<br>
- /// Scan the provided function for @llvm.assume
intrinsic calls. Returns an<br>
- /// iterator to the set for this function in
the CachedAssumeCalls map.<br>
- FunctionCallsMap::iterator
scanFunction(Function *F);<br>
-<br>
-public:<br>
- /// Remove the cache of @llvm.assume intrinsics
for the given function.<br>
- void forgetCachedAssumptions(Function *F);<br>
-<br>
- /// Add an @llvm.assume intrinsic to the cache
for its parent function.<br>
- void registerAssumption(CallInst *CI);<br>
-<br>
- typedef CallHandleSet::iterator
assumption_iterator;<br>
- typedef iterator_range<assumption_iterator>
assumption_range;<br>
-<br>
- inline assumption_range assumptions(Function
*F) {<br>
- FunctionCallsMap::iterator I =
CachedAssumeCalls.find_as(F);<br>
- if (I == CachedAssumeCalls.end()) {<br>
- I = scanFunction(F);<br>
- }<br>
-<br>
- return assumption_range(I->second->begin(),
I->second->end());<br>
- }<br>
-<br>
- AssumptionTracker();<br>
- ~AssumptionTracker();<br>
-<br>
- void releaseMemory() override {<br>
- CachedAssumeCalls.shrink_and_clear();<br>
- }<br>
-<br>
- void verifyAnalysis() const override;<br>
- bool doFinalization(Module &) override {<br>
- verifyAnalysis();<br>
- return false;<br>
- }<br>
-<br>
- static char ID; // Pass identification,
replacement for typeid<br>
-};<br>
-<br>
-} // end namespace llvm<br>
-<br>
-#endif<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/CodeMetrics.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CodeMetrics.h?rev=225131&r1=225130&r2=225131&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CodeMetrics.h?rev=225131&r1=225130&r2=225131&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/CodeMetrics.h
(original)<br>
+++ llvm/trunk/include/llvm/Analysis/CodeMetrics.h
Sun Jan 4 06:03:27 2015<br>
@@ -20,7 +20,7 @@<br>
#include "llvm/IR/CallSite.h"<br>
namespace llvm {<br>
-class AssumptionTracker;<br>
+class AssumptionCache;<br>
class BasicBlock;<br>
class Loop;<br>
class Function;<br>
@@ -93,13 +93,13 @@ struct CodeMetrics {<br>
/// \brief Collect a loop's ephemeral values
(those used only by an assume<br>
/// or similar intrinsics in the loop).<br>
- static void collectEphemeralValues(const Loop
*L, AssumptionTracker *AT,<br>
-
SmallPtrSetImpl<const Value*>
&EphValues);<br>
+ static void collectEphemeralValues(const Loop
*L, AssumptionCache *AC,<br>
+
SmallPtrSetImpl<const Value *>
&EphValues);<br>
</blockquote>
</div>
</div>
Formatting changes (and arguably the rename involved in
the API split itself) should have been separated.</div>
</blockquote>
<div><br>
</div>
<div>It's nearly impossible to separate these kinds of
formatting changes. I didn't reformat anything by hand
here, I simply asked clang-format to re-format the lines I
had touched in the patch. In several cases this was
necessary as the correct formatting was different after
the s/AssumptionTracker/AssumptionCache/ change. For
better or worse, clang-format will also fix other
formatting issues (such as X* vs X *) in the same
"unwrapped line". It doesn't really add any noise to the
blame though as I was going to touch this code either way.</div>
</div>
</div>
</div>
</blockquote>
Honestly, this sounds like a feature request for clang-format to
me. :)<br>
<br>
The only reason I commented here is that the first time I saw this
line (scanning quickly), I didn't see the restructuring change and
did see the formatting. It wasn't until I stared at it for a second
that I saw the other. <br>
<br>
<blockquote
cite="mid:CAGCO0KiYyk3fLon2M9w=vuGCptoQOuGQYhsf6iWZ1DYNyLNjJA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":168" class="a3s" style="overflow:hidden">
<div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
/// \brief Collect a functions's ephemeral
values (those used only by an<br>
/// assume or similar intrinsics in the
function).<br>
- static void collectEphemeralValues(const
Function *L, AssumptionTracker *AT,<br>
-
SmallPtrSetImpl<const Value*>
&EphValues);<br>
+ static void collectEphemeralValues(const
Function *L, AssumptionCache *AC,<br>
+
SmallPtrSetImpl<const Value *>
&EphValues);<br>
};<br>
}<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/InlineCost.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/InlineCost.h?rev=225131&r1=225130&r2=225131&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/InlineCost.h?rev=225131&r1=225130&r2=225131&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/InlineCost.h
(original)<br>
+++ llvm/trunk/include/llvm/Analysis/InlineCost.h
Sun Jan 4 06:03:27 2015<br>
@@ -19,7 +19,7 @@<br>
#include <climits><br>
namespace llvm {<br>
-class AssumptionTracker;<br>
+class AssumptionCacheTracker;<br>
class CallSite;<br>
class DataLayout;<br>
class Function;<br>
@@ -101,7 +101,7 @@ public:<br>
/// \brief Cost analyzer used by inliner.<br>
class InlineCostAnalysis : public
CallGraphSCCPass {<br>
const TargetTransformInfo *TTI;<br>
- AssumptionTracker *AT;<br>
+ AssumptionCacheTracker *ACT;<br>
public:<br>
static char ID;<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/InstructionSimplify.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/InstructionSimplify.h?rev=225131&r1=225130&r2=225131&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/InstructionSimplify.h?rev=225131&r1=225130&r2=225131&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/InstructionSimplify.h
(original)<br>
+++ llvm/trunk/include/llvm/Analysis/InstructionSimplify.h
Sun Jan 4 06:03:27 2015<br>
@@ -37,7 +37,7 @@<br>
namespace llvm {<br>
template<typename T><br>
class ArrayRef;<br>
- class AssumptionTracker;<br>
+ class AssumptionCache;<br>
class DominatorTree;<br>
class Instruction;<br>
class DataLayout;<br>
@@ -52,7 +52,7 @@ namespace llvm {<br>
const DataLayout *TD =
nullptr,<br>
const TargetLibraryInfo
*TLI = nullptr,<br>
const DominatorTree *DT
= nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction *CxtI
= nullptr);<br>
/// SimplifySubInst - Given operands for a
Sub, see if we can<br>
@@ -61,35 +61,34 @@ namespace llvm {<br>
const DataLayout *TD =
nullptr,<br>
const TargetLibraryInfo
*TLI = nullptr,<br>
const DominatorTree *DT
= nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction *CxtI
= nullptr);<br>
/// Given operands for an FAdd, see if we
can fold the result. If not, this<br>
/// returns null.<br>
Value *SimplifyFAddInst(Value *LHS, Value
*RHS, FastMathFlags FMF,<br>
- const DataLayout *TD =
nullptr,<br>
- const TargetLibraryInfo
*TLI = nullptr,<br>
- const DominatorTree *DT
= nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
- const Instruction *CxtI
= nullptr);<br>
+ const DataLayout *TD =
nullptr,<br>
+ const TargetLibraryInfo
*TLI = nullptr,<br>
+ const DominatorTree *DT
= nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
+ const Instruction *CxtI
= nullptr);<br>
/// Given operands for an FSub, see if we
can fold the result. If not, this<br>
/// returns null.<br>
Value *SimplifyFSubInst(Value *LHS, Value
*RHS, FastMathFlags FMF,<br>
- const DataLayout *TD =
nullptr,<br>
- const TargetLibraryInfo
*TLI = nullptr,<br>
- const DominatorTree *DT
= nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
- const Instruction *CxtI
= nullptr);<br>
+ const DataLayout *TD =
nullptr,<br>
+ const TargetLibraryInfo
*TLI = nullptr,<br>
+ const DominatorTree *DT
= nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
+ const Instruction *CxtI
= nullptr);<br>
/// Given operands for an FMul, see if we
can fold the result. If not, this<br>
/// returns null.<br>
- Value *SimplifyFMulInst(Value *LHS, Value *RHS,<br>
- FastMathFlags FMF,<br>
+ Value *SimplifyFMulInst(Value *LHS, Value *RHS,
FastMathFlags FMF,<br>
const DataLayout *TD =
nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const DominatorTree
*DT = nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction
*CxtI = nullptr);<br>
/// SimplifyMulInst - Given operands for a
Mul, see if we can<br>
@@ -97,7 +96,7 @@ namespace llvm {<br>
Value *SimplifyMulInst(Value *LHS, Value *RHS,
const DataLayout *TD = nullptr,<br>
const TargetLibraryInfo
*TLI = nullptr,<br>
const DominatorTree *DT
= nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction *CxtI
= nullptr);<br>
/// SimplifySDivInst - Given operands for an
SDiv, see if we can<br>
@@ -106,7 +105,7 @@ namespace llvm {<br>
const DataLayout *TD =
nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const DominatorTree
*DT = nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction
*CxtI = nullptr);<br>
/// SimplifyUDivInst - Given operands for a
UDiv, see if we can<br>
@@ -115,7 +114,7 @@ namespace llvm {<br>
const DataLayout *TD =
nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const DominatorTree
*DT = nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction
*CxtI = nullptr);<br>
/// SimplifyFDivInst - Given operands for an
FDiv, see if we can<br>
@@ -124,7 +123,7 @@ namespace llvm {<br>
const DataLayout *TD =
nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const DominatorTree
*DT = nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction
*CxtI = nullptr);<br>
/// SimplifySRemInst - Given operands for an
SRem, see if we can<br>
@@ -133,7 +132,7 @@ namespace llvm {<br>
const DataLayout *TD =
nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const DominatorTree
*DT = nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction
*CxtI = nullptr);<br>
/// SimplifyURemInst - Given operands for a
URem, see if we can<br>
@@ -142,7 +141,7 @@ namespace llvm {<br>
const DataLayout *TD =
nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const DominatorTree
*DT = nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction
*CxtI = nullptr);<br>
/// SimplifyFRemInst - Given operands for an
FRem, see if we can<br>
@@ -151,7 +150,7 @@ namespace llvm {<br>
const DataLayout *TD =
nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const DominatorTree
*DT = nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction
*CxtI = nullptr);<br>
/// SimplifyShlInst - Given operands for a
Shl, see if we can<br>
@@ -160,7 +159,7 @@ namespace llvm {<br>
const DataLayout *TD =
nullptr,<br>
const TargetLibraryInfo
*TLI = nullptr,<br>
const DominatorTree *DT
= nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction *CxtI
= nullptr);<br>
/// SimplifyLShrInst - Given operands for a
LShr, see if we can<br>
@@ -169,7 +168,7 @@ namespace llvm {<br>
const DataLayout *TD =
nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const DominatorTree
*DT = nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction
*CxtI = nullptr);<br>
/// SimplifyAShrInst - Given operands for a
AShr, see if we can<br>
@@ -178,7 +177,7 @@ namespace llvm {<br>
const DataLayout *TD =
nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const DominatorTree
*DT = nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction
*CxtI = nullptr);<br>
/// SimplifyAndInst - Given operands for an
And, see if we can<br>
@@ -186,7 +185,7 @@ namespace llvm {<br>
Value *SimplifyAndInst(Value *LHS, Value *RHS,
const DataLayout *TD = nullptr,<br>
const TargetLibraryInfo
*TLI = nullptr,<br>
const DominatorTree *DT
= nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction *CxtI
= nullptr);<br>
/// SimplifyOrInst - Given operands for an
Or, see if we can<br>
@@ -194,7 +193,7 @@ namespace llvm {<br>
Value *SimplifyOrInst(Value *LHS, Value *RHS,
const DataLayout *TD = nullptr,<br>
const TargetLibraryInfo
*TLI = nullptr,<br>
const DominatorTree *DT
= nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction *CxtI
= nullptr);<br>
/// SimplifyXorInst - Given operands for a
Xor, see if we can<br>
@@ -202,7 +201,7 @@ namespace llvm {<br>
Value *SimplifyXorInst(Value *LHS, Value *RHS,
const DataLayout *TD = nullptr,<br>
const TargetLibraryInfo
*TLI = nullptr,<br>
const DominatorTree *DT
= nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction *CxtI
= nullptr);<br>
/// SimplifyICmpInst - Given operands for an
ICmpInst, see if we can<br>
@@ -211,7 +210,7 @@ namespace llvm {<br>
const DataLayout *TD =
nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const DominatorTree
*DT = nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
Instruction *CxtI =
nullptr);<br>
/// SimplifyFCmpInst - Given operands for an
FCmpInst, see if we can<br>
@@ -220,7 +219,7 @@ namespace llvm {<br>
const DataLayout *TD =
nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const DominatorTree
*DT = nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction
*CxtI = nullptr);<br>
/// SimplifySelectInst - Given operands for
a SelectInst, see if we can fold<br>
@@ -229,7 +228,7 @@ namespace llvm {<br>
const DataLayout *TD
= nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const DominatorTree
*DT = nullptr,<br>
- AssumptionTracker *AT
= nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction
*CxtI = nullptr);<br>
/// SimplifyGEPInst - Given operands for an
GetElementPtrInst, see if we can<br>
@@ -237,7 +236,7 @@ namespace llvm {<br>
Value *SimplifyGEPInst(ArrayRef<Value *>
Ops, const DataLayout *TD = nullptr,<br>
const TargetLibraryInfo
*TLI = nullptr,<br>
const DominatorTree *DT
= nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction *CxtI
= nullptr);<br>
/// SimplifyInsertValueInst - Given operands
for an InsertValueInst, see if we<br>
@@ -247,7 +246,7 @@ namespace llvm {<br>
const
DataLayout *TD = nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const
DominatorTree *DT = nullptr,<br>
-
AssumptionTracker *AT = nullptr,<br>
+ AssumptionCache
*AC = nullptr,<br>
const
Instruction *CxtI = nullptr);<br>
/// SimplifyTruncInst - Given operands for
an TruncInst, see if we can fold<br>
@@ -255,7 +254,7 @@ namespace llvm {<br>
Value *SimplifyTruncInst(Value *Op, Type *Ty,
const DataLayout *TD = nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const DominatorTree
*DT = nullptr,<br>
- AssumptionTracker *AT
= nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction
*CxtI = nullptr);<br>
//=== Helper functions for higher up the
class hierarchy.<br>
@@ -267,7 +266,7 @@ namespace llvm {<br>
const DataLayout *TD =
nullptr,<br>
const TargetLibraryInfo
*TLI = nullptr,<br>
const DominatorTree *DT
= nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction *CxtI
= nullptr);<br>
/// SimplifyBinOp - Given operands for a
BinaryOperator, see if we can<br>
@@ -276,7 +275,7 @@ namespace llvm {<br>
const DataLayout *TD =
nullptr,<br>
const TargetLibraryInfo
*TLI = nullptr,<br>
const DominatorTree *DT =
nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction *CxtI =
nullptr);<br>
/// \brief Given a function and iterators
over arguments, see if we can fold<br>
@@ -287,7 +286,7 @@ namespace llvm {<br>
User::op_iterator ArgEnd,
const DataLayout *TD = nullptr,<br>
const TargetLibraryInfo
*TLI = nullptr,<br>
const DominatorTree *DT =
nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction *CxtI =
nullptr);<br>
/// \brief Given a function and set of
arguments, see if we can fold the<br>
@@ -298,7 +297,7 @@ namespace llvm {<br>
const DataLayout *TD =
nullptr,<br>
const TargetLibraryInfo
*TLI = nullptr,<br>
const DominatorTree *DT =
nullptr,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction *CxtI =
nullptr);<br>
/// SimplifyInstruction - See if we can
compute a simplified version of this<br>
@@ -306,8 +305,7 @@ namespace llvm {<br>
Value *SimplifyInstruction(Instruction *I,
const DataLayout *TD = nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const DominatorTree
*DT = nullptr,<br>
- AssumptionTracker
*AT = nullptr);<br>
-<br>
+ AssumptionCache *AC
= nullptr);<br>
/// \brief Replace all uses of 'I' with
'SimpleV' and simplify the uses<br>
/// recursively.<br>
@@ -321,7 +319,7 @@ namespace llvm {<br>
const
DataLayout *TD = nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const
DominatorTree *DT = nullptr,<br>
-
AssumptionTracker *AT = nullptr);<br>
+
AssumptionCache *AC = nullptr);<br>
/// \brief Recursively attempt to simplify
an instruction.<br>
///<br>
@@ -333,7 +331,7 @@ namespace llvm {<br>
const
DataLayout *TD = nullptr,<br>
const
TargetLibraryInfo *TLI = nullptr,<br>
const
DominatorTree *DT = nullptr,<br>
-
AssumptionTracker *AT = nullptr);<br>
+
AssumptionCache *AC = nullptr);<br>
} // end namespace llvm<br>
#endif<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/LazyValueInfo.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LazyValueInfo.h?rev=225131&r1=225130&r2=225131&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LazyValueInfo.h?rev=225131&r1=225130&r2=225131&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/LazyValueInfo.h
(original)<br>
+++ llvm/trunk/include/llvm/Analysis/LazyValueInfo.h
Sun Jan 4 06:03:27 2015<br>
@@ -18,7 +18,7 @@<br>
#include "llvm/Pass.h"<br>
namespace llvm {<br>
- class AssumptionTracker;<br>
+ class AssumptionCache;<br>
class Constant;<br>
class DataLayout;<br>
class DominatorTree;<br>
@@ -29,7 +29,7 @@ namespace llvm {<br>
/// LazyValueInfo - This pass computes, caches,
and vends lazy value constraint<br>
/// information.<br>
class LazyValueInfo : public FunctionPass {<br>
- AssumptionTracker *AT;<br>
+ AssumptionCache *AC;<br>
const DataLayout *DL;<br>
class TargetLibraryInfo *TLI;<br>
DominatorTree *DT;<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h?rev=225131&r1=225130&r2=225131&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h?rev=225131&r1=225130&r2=225131&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h
(original)<br>
+++ llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h
Sun Jan 4 06:03:27 2015<br>
@@ -28,7 +28,7 @@ namespace llvm {<br>
class Instruction;<br>
class CallSite;<br>
class AliasAnalysis;<br>
- class AssumptionTracker;<br>
+ class AssumptionCache;<br>
class DataLayout;<br>
class MemoryDependenceAnalysis;<br>
class PredIteratorCache;<br>
@@ -326,7 +326,7 @@ namespace llvm {<br>
AliasAnalysis *AA;<br>
const DataLayout *DL;<br>
DominatorTree *DT;<br>
- AssumptionTracker *AT;<br>
+ AssumptionCache *AC;<br>
std::unique_ptr<PredIteratorCache>
PredCache;<br>
public:<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/PHITransAddr.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/PHITransAddr.h?rev=225131&r1=225130&r2=225131&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/PHITransAddr.h?rev=225131&r1=225130&r2=225131&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/PHITransAddr.h
(original)<br>
+++ llvm/trunk/include/llvm/Analysis/PHITransAddr.h
Sun Jan 4 06:03:27 2015<br>
@@ -18,7 +18,7 @@<br>
#include "llvm/IR/Instruction.h"<br>
namespace llvm {<br>
- class AssumptionTracker;<br>
+ class AssumptionCache;<br>
class DominatorTree;<br>
class DataLayout;<br>
class TargetLibraryInfo;<br>
@@ -44,13 +44,13 @@ class PHITransAddr {<br>
const TargetLibraryInfo *TLI;<br>
/// A cache of @llvm.assume calls used by
SimplifyInstruction.<br>
- AssumptionTracker *AT;<br>
-<br>
+ AssumptionCache *AC;<br>
+<br>
/// InstInputs - The inputs for our symbolic
address.<br>
SmallVector<Instruction*, 4> InstInputs;<br>
public:<br>
- PHITransAddr(Value *addr, const DataLayout *DL,
AssumptionTracker *AT)<br>
- : Addr(addr), DL(DL), TLI(nullptr), AT(AT)
{<br>
+ PHITransAddr(Value *addr, const DataLayout *DL,
AssumptionCache *AC)<br>
+ : Addr(addr), DL(DL), TLI(nullptr), AC(AC)
{<br>
// If the address is an instruction, the
whole thing is considered an input.<br>
if (Instruction *I =
dyn_cast<Instruction>(Addr))<br>
InstInputs.push_back(I);<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=225131&r1=225130&r2=225131&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=225131&r1=225130&r2=225131&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
(original)<br>
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
Sun Jan 4 06:03:27 2015<br>
@@ -35,7 +35,7 @@<br>
namespace llvm {<br>
class APInt;<br>
- class AssumptionTracker;<br>
+ class AssumptionCache;<br>
class Constant;<br>
class ConstantInt;<br>
class DominatorTree;<br>
@@ -225,7 +225,7 @@ namespace llvm {<br>
Function *F;<br>
/// The tracker for @llvm.assume
intrinsics in this function.<br>
- AssumptionTracker *AT;<br>
+ AssumptionCache *AC;<br>
/// LI - The loop information for the
function we are currently analyzing.<br>
///<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/ValueTracking.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ValueTracking.h?rev=225131&r1=225130&r2=225131&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ValueTracking.h?rev=225131&r1=225130&r2=225131&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/ValueTracking.h
(original)<br>
+++ llvm/trunk/include/llvm/Analysis/ValueTracking.h
Sun Jan 4 06:03:27 2015<br>
@@ -25,7 +25,7 @@ namespace llvm {<br>
class DataLayout;<br>
class StringRef;<br>
class MDNode;<br>
- class AssumptionTracker;<br>
+ class AssumptionCache;<br>
class DominatorTree;<br>
class TargetLibraryInfo;<br>
@@ -37,9 +37,9 @@ namespace llvm {<br>
/// where V is a vector, the known zero and
known one values are the<br>
/// same width as the vector element, and the
bit is set only if it is true<br>
/// for all of the elements in the vector.<br>
- void computeKnownBits(Value *V, APInt
&KnownZero, APInt &KnownOne,<br>
+ void computeKnownBits(Value *V, APInt
&KnownZero, APInt &KnownOne,<br>
const DataLayout *TD =
nullptr, unsigned Depth = 0,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction *CxtI
= nullptr,<br>
const DominatorTree *DT
= nullptr);<br>
/// Compute known bits from the range
metadata.<br>
@@ -51,7 +51,7 @@ namespace llvm {<br>
/// one. Convenience wrapper around
computeKnownBits.<br>
void ComputeSignBit(Value *V, bool
&KnownZero, bool &KnownOne,<br>
const DataLayout *TD =
nullptr, unsigned Depth = 0,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction *CxtI =
nullptr,<br>
const DominatorTree *DT =
nullptr);<br>
@@ -61,7 +61,7 @@ namespace llvm {<br>
/// integer or pointer type and vectors of
integers. If 'OrZero' is set then<br>
/// returns true if the given value is either
a power of two or zero.<br>
bool isKnownToBeAPowerOfTwo(Value *V, bool
OrZero = false, unsigned Depth = 0,<br>
- AssumptionTracker
*AT = nullptr,<br>
+ AssumptionCache *AC
= nullptr,<br>
const Instruction
*CxtI = nullptr,<br>
const
DominatorTree *DT = nullptr);<br>
@@ -70,7 +70,7 @@ namespace llvm {<br>
/// non-zero when defined. Supports values
with integer or pointer type and<br>
/// vectors of integers.<br>
bool isKnownNonZero(Value *V, const DataLayout
*TD = nullptr,<br>
- unsigned Depth = 0,
AssumptionTracker *AT = nullptr,<br>
+ unsigned Depth = 0,
AssumptionCache *AC = nullptr,<br>
const Instruction *CxtI =
nullptr,<br>
const DominatorTree *DT =
nullptr);<br>
@@ -83,13 +83,12 @@ namespace llvm {<br>
/// where V is a vector, the mask, known zero,
and known one values are the<br>
/// same width as the vector element, and the
bit is set only if it is true<br>
/// for all of the elements in the vector.<br>
- bool MaskedValueIsZero(Value *V, const APInt
&Mask,<br>
+ bool MaskedValueIsZero(Value *V, const APInt
&Mask,<br>
const DataLayout *TD =
nullptr, unsigned Depth = 0,<br>
- AssumptionTracker *AT =
nullptr,<br>
+ AssumptionCache *AC =
nullptr,<br>
const Instruction *CxtI
= nullptr,<br>
const DominatorTree *DT
= nullptr);<br>
-<br>
/// ComputeNumSignBits - Return the number of
times the sign bit of the<br>
/// register is replicated into the other
bits. We know that at least 1 bit<br>
/// is always equal to the sign bit (itself),
but other cases can give us<br>
@@ -99,8 +98,7 @@ namespace llvm {<br>
/// 'Op' must have a scalar integer type.<br>
///<br>
unsigned ComputeNumSignBits(Value *Op, const
DataLayout *TD = nullptr,<br>
- unsigned Depth = 0,<br>
- AssumptionTracker
*AT = nullptr,<br>
+ unsigned Depth = 0,
AssumptionCache *AC = nullptr,<br>
const Instruction
*CxtI = nullptr,<br>
const
DominatorTree *DT = nullptr);<br>
@@ -220,7 +218,7 @@ namespace llvm {<br>
enum class OverflowResult { AlwaysOverflows,
MayOverflow, NeverOverflows };<br>
OverflowResult computeOverflowForUnsignedMul(Value
*LHS, Value *RHS,<br>
const DataLayout *DL,<br>
-
AssumptionTracker *AT,<br>
+
AssumptionCache *AC,<br>
const Instruction *CxtI,<br>
const DominatorTree *DT);<br>
} // end namespace llvm<br>
<br>
Modified: llvm/trunk/include/llvm/InitializePasses.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=225131&r1=225130&r2=225131&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=225131&r1=225130&r2=225131&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/InitializePasses.h
(original)<br>
+++ llvm/trunk/include/llvm/InitializePasses.h Sun
Jan 4 06:03:27 2015<br>
@@ -266,7 +266,7 @@ void
initializeTargetTransformInfoAnalys<br>
void initializeFunctionTargetTransformInfoPass(PassRegistry
&);<br>
void initializeNoTTIPass(PassRegistry&);<br>
void initializeTargetLibraryInfoPass(PassRegistry&);<br>
-void initializeAssumptionTrackerPass(PassRegistry
&);<br>
+void initializeAssumptionCacheTrackerPass(PassRegistry
&);<br>
void initializeTwoAddressInstructionPassPass(PassRegistry&);<br>
void initializeTypeBasedAliasAnalysisPass(PassRegistry&);<br>
void initializeScopedNoAliasAAPass(PassRegistry&);<br>
<br>
Modified: llvm/trunk/include/llvm/Transforms/Utils/Cloning.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/Cloning.h?rev=225131&r1=225130&r2=225131&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/Cloning.h?rev=225131&r1=225130&r2=225131&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Transforms/Utils/Cloning.h
(original)<br>
+++ llvm/trunk/include/llvm/Transforms/Utils/Cloning.h
Sun Jan 4 06:03:27 2015<br>
@@ -44,7 +44,7 @@ class Loop;<br>
class LoopInfo;<br>
class AllocaInst;<br>
class AliasAnalysis;<br>
-class AssumptionTracker;<br>
+class AssumptionCacheTracker;<br>
/// CloneModule - Return an exact copy of the
specified module<br>
///<br>
@@ -162,15 +162,15 @@ public:<br>
explicit InlineFunctionInfo(CallGraph *cg =
nullptr,<br>
const DataLayout
*DL = nullptr,<br>
AliasAnalysis *AA
= nullptr,<br>
- AssumptionTracker
*AT = nullptr)<br>
- : CG(cg), DL(DL), AA(AA), AT(AT) {}<br>
+
AssumptionCacheTracker *ACT = nullptr)<br>
+ : CG(cg), DL(DL), AA(AA), ACT(ACT) {}<br>
/// CG - If non-null, InlineFunction will
update the callgraph to reflect the<br>
/// changes it makes.<br>
CallGraph *CG;<br>
const DataLayout *DL;<br>
AliasAnalysis *AA;<br>
- AssumptionTracker *AT;<br>
+ AssumptionCacheTracker *ACT;<br>
/// StaticAllocas - InlineFunction fills
this in with all static allocas that<br>
/// get copied into the caller.<br>
<br>
Modified: llvm/trunk/include/llvm/Transforms/Utils/Local.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/Local.h?rev=225131&r1=225130&r2=225131&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/Local.h?rev=225131&r1=225130&r2=225131&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Transforms/Utils/Local.h
(original)<br>
+++ llvm/trunk/include/llvm/Transforms/Utils/Local.h
Sun Jan 4 06:03:27 2015<br>
@@ -34,7 +34,7 @@ class Value;<br>
class Pass;<br>
class PHINode;<br>
class AllocaInst;<br>
-class AssumptionTracker;<br>
+class AssumptionCache;<br>
class ConstantExpr;<br>
class DataLayout;<br>
class TargetLibraryInfo;<br>
@@ -138,9 +138,8 @@ bool
EliminateDuplicatePHINodes(BasicBlo<br>
/// the basic block that was pointed to.<br>
///<br>
bool SimplifyCFG(BasicBlock *BB, const
TargetTransformInfo &TTI,<br>
- unsigned BonusInstThreshold,<br>
- const DataLayout *TD = nullptr,<br>
- AssumptionTracker *AT =
nullptr);<br>
+ unsigned BonusInstThreshold,
const DataLayout *TD = nullptr,<br>
+ AssumptionCache *AC = nullptr);<br>
/// FlatternCFG - This function is used to
flatten a CFG. For<br>
/// example, it uses parallel-and and
parallel-or mode to collapse<br>
@@ -176,17 +175,17 @@ AllocaInst
*DemotePHIToStack(PHINode *P,<br>
/// increase the alignment of the ultimate
object, making this check succeed.<br>
unsigned getOrEnforceKnownAlignment(Value *V,
unsigned PrefAlign,<br>
const
DataLayout *TD = nullptr,<br>
-
AssumptionTracker *AT = nullptr,<br>
+
AssumptionCache *AC = nullptr,<br>
const
Instruction *CxtI = nullptr,<br>
const
DominatorTree *DT = nullptr);<br>
/// getKnownAlignment - Try to infer an
alignment for the specified pointer.<br>
static inline unsigned getKnownAlignment(Value
*V,<br>
const
DataLayout *TD = nullptr,<br>
-
AssumptionTracker *AT = nullptr,<br>
+
AssumptionCache *AC = nullptr,<br>
const
Instruction *CxtI = nullptr,<br>
const
DominatorTree *DT = nullptr) {<br>
- return getOrEnforceKnownAlignment(V, 0, TD, AT,
CxtI, DT);<br>
+ return getOrEnforceKnownAlignment(V, 0, TD, AC,
CxtI, DT);<br>
}<br>
/// EmitGEPOffset - Given a getelementptr
instruction/constantexpr, emit the<br>
<br>
Modified: llvm/trunk/include/llvm/Transforms/Utils/LoopUtils.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/LoopUtils.h?rev=225131&r1=225130&r2=225131&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/LoopUtils.h?rev=225131&r1=225130&r2=225131&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Transforms/Utils/LoopUtils.h
(original)<br>
+++ llvm/trunk/include/llvm/Transforms/Utils/LoopUtils.h
Sun Jan 4 06:03:27 2015<br>
@@ -16,7 +16,7 @@<br>
namespace llvm {<br>
class AliasAnalysis;<br>
-class AssumptionTracker;<br>
+class AssumptionCache;<br>
class BasicBlock;<br>
class DataLayout;<br>
class DominatorTree;<br>
@@ -36,7 +36,7 @@ BasicBlock
*InsertPreheaderForLoop(Loop<br>
bool simplifyLoop(Loop *L, DominatorTree *DT,
LoopInfo *LI, Pass *PP,<br>
AliasAnalysis *AA = nullptr,
ScalarEvolution *SE = nullptr,<br>
const DataLayout *DL =
nullptr,<br>
- AssumptionTracker *AT =
nullptr);<br>
+ AssumptionCache *AC = nullptr);<br>
/// \brief Put loop into LCSSA form.<br>
///<br>
<br>
Modified: llvm/trunk/include/llvm/Transforms/Utils/PromoteMemToReg.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/PromoteMemToReg.h?rev=225131&r1=225130&r2=225131&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/PromoteMemToReg.h?rev=225131&r1=225130&r2=225131&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Transforms/Utils/PromoteMemToReg.h
(original)<br>
+++ llvm/trunk/include/llvm/Transforms/Utils/PromoteMemToReg.h
Sun Jan 4 06:03:27 2015<br>
@@ -22,7 +22,7 @@ namespace llvm {<br>
class AllocaInst;<br>
class DominatorTree;<br>
class AliasSetTracker;<br>
-class AssumptionTracker;<br>
+class AssumptionCache;<br>
/// \brief Return true if this alloca is legal
for promotion.<br>
///<br>
@@ -43,7 +43,7 @@ bool isAllocaPromotable(const
AllocaInst<br>
/// made to the IR.<br>
void PromoteMemToReg(ArrayRef<AllocaInst
*> Allocas, DominatorTree &DT,<br>
AliasSetTracker *AST =
nullptr,<br>
- AssumptionTracker *AT =
nullptr);<br>
+ AssumptionCache *AC =
nullptr);<br>
} // End llvm namespace<br>
<br>
Modified: llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h?rev=225131&r1=225130&r2=225131&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h?rev=225131&r1=225130&r2=225131&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h
(original)<br>
+++ llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h
Sun Jan 4 06:03:27 2015<br>
@@ -18,7 +18,7 @@<br>
namespace llvm {<br>
-class AssumptionTracker;<br>
+class AssumptionCache;<br>
class Loop;<br>
class LoopInfo;<br>
class LPPassManager;<br>
@@ -26,7 +26,7 @@ class Pass;<br>
bool UnrollLoop(Loop *L, unsigned Count,
unsigned TripCount, bool AllowRuntime,<br>
unsigned TripMultiple, LoopInfo
*LI, Pass *PP,<br>
- LPPassManager *LPM,
AssumptionTracker *AT);<br>
+ LPPassManager *LPM,
AssumptionCache *AC);<br>
bool UnrollRuntimeLoopProlog(Loop *L, unsigned
Count, LoopInfo *LI,<br>
LPPassManager*
LPM);<br>
<br>
Added: llvm/trunk/lib/Analysis/AssumptionCache.cpp<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AssumptionCache.cpp?rev=225131&view=auto"
target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AssumptionCache.cpp?rev=225131&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/AssumptionCache.cpp
(added)<br>
+++ llvm/trunk/lib/Analysis/AssumptionCache.cpp
Sun Jan 4 06:03:27 2015<br>
@@ -0,0 +1,125 @@<br>
+//===- AssumptionCache.cpp - Cache finding
@llvm.assume calls -------------===//<br>
+//<br>
+// The LLVM Compiler
Infrastructure<br>
+//<br>
+// This file is distributed under the University
of Illinois Open Source<br>
+// License. See LICENSE.TXT for details.<br>
+//<br>
+//===----------------------------------------------------------------------===//<br>
+//<br>
+// This file contains a pass that keeps track of
@llvm.assume intrinsics in<br>
+// the functions of a module.<br>
+//<br>
+//===----------------------------------------------------------------------===//<br>
+<br>
+#include "llvm/Analysis/AssumptionCache.h"<br>
+#include "llvm/IR/CallSite.h"<br>
+#include "llvm/IR/Dominators.h"<br>
+#include "llvm/IR/Function.h"<br>
+#include "llvm/IR/Instructions.h"<br>
+#include "llvm/IR/IntrinsicInst.h"<br>
+#include "llvm/IR/PatternMatch.h"<br>
+#include "llvm/Support/Debug.h"<br>
+using namespace llvm;<br>
+using namespace llvm::PatternMatch;<br>
+<br>
+void AssumptionCache::scanFunction() {<br>
+ assert(!Scanned && "Tried to scan the
function twice!");<br>
+ assert(AssumeHandles.empty() &&
"Already have assumes when scanning!");<br>
+<br>
+ // Go through all instructions in all blocks,
add all calls to @llvm.assume<br>
+ // to this cache.<br>
+ for (BasicBlock &B : F)<br>
+ for (Instruction &II : B)<br>
</blockquote>
</div>
</div>
Why not use inst_iterator? (Which we really need a
range form of btw.)</div>
</blockquote>
<div><br>
</div>
<div>The original code didn't, and I didn't actually change
this loop at all. Sadly, the mailer doesn't show the
with-history diff, and the movement of the code probably
would have ruined it anyways.</div>
<div><br>
</div>
<div>I'd really love to switch a bunch of the double-loops
like this to use a range-based InstIterator pattern,
completely agree there. But a separate change.</div>
</div>
</div>
</div>
</blockquote>
Makes perfect sense. Yep, the move history got completely lost.<br>
<blockquote
cite="mid:CAGCO0KiYyk3fLon2M9w=vuGCptoQOuGQYhsf6iWZ1DYNyLNjJA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":168" class="a3s" style="overflow:hidden">
<div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
+ if (match(&II,
m_Intrinsic<Intrinsic::assume>()))<br>
+ AssumeHandles.push_back(&II);<br>
+<br>
+ // Mark the scan as complete.<br>
+ Scanned = true;<br>
+}<br>
+<br>
+void AssumptionCache::registerAssumption(CallInst
*CI) {<br>
+ assert(match(CI,
m_Intrinsic<Intrinsic::assume>()) &&<br>
+ "Registered call does not call
@llvm.assume");<br>
+<br>
+ // If we haven't scanned the function yet, just
drop this assumption. It will<br>
+ // be found when we scan later.<br>
+ if (!Scanned)<br>
+ return;<br>
+<br>
+ AssumeHandles.push_back(CI);<br>
+<br>
+#ifndef NDEBUG<br>
+ assert(CI->getParent() &&<br>
+ "Cannot register @llvm.assume call not
in a basic block");<br>
+ assert(&F ==
CI->getParent()->getParent() &&<br>
+ "Cannot register @llvm.assume call not
in this function");<br>
+<br>
+ // We expect the number of assumptions to be
small, so in an asserts build<br>
+ // check that we don't accumulate duplicates
and that all assumptions point<br>
+ // to the same function.<br>
+ SmallPtrSet<Value *, 16> AssumptionSet;<br>
+ for (auto &VH : AssumeHandles) {<br>
+ if (!VH)<br>
+ continue;<br>
+<br>
+ assert(&F ==
cast<Instruction>(VH)->getParent()->getParent()
&&<br>
+ "Cached assumption not inside this
function!");<br>
+ assert(match(cast<CallInst>(VH),
m_Intrinsic<Intrinsic::assume>()) &&<br>
+ "Cached something other than a call to
@llvm.assume!");<br>
+ assert(AssumptionSet.insert(VH).second
&&<br>
+ "Cache contains multiple copies of a
call!");<br>
+ }<br>
</blockquote>
</div>
</div>
This seems like an odd place for this logic. Arguably
it should be in the getter? Or at least called from the
scanFunction code too?<span class=""><br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
+#endif<br>
+}<br>
+<br>
+void AssumptionCacheTracker::FunctionCallbackVH::deleted()
{<br>
+ auto I = ACT->AssumptionCaches.find_as(cast<Function>(getValPtr()));<br>
+ if (I != ACT->AssumptionCaches.end())<br>
+ ACT->AssumptionCaches.erase(I);<br>
+ // 'this' now dangles!<br>
+}<br>
+<br>
+AssumptionCache &AssumptionCacheTracker::getAssumptionCache(Function
&F) {<br>
+ // We probe the function map twice to try and
avoid creating a value handle<br>
+ // around the function in common cases. This
makes insertion a bit slower,<br>
+ // but if we have to insert we're going to scan
the whole function so that<br>
+ // shouldn't matter.<br>
+ auto I = AssumptionCaches.find_as(&F);<br>
+ if (I != AssumptionCaches.end())<br>
+ return *I->second;<br>
+<br>
+ // Ok, build a new cache by scanning the
function, insert it and the value<br>
+ // handle into our map, and return the newly
populated cache.<br>
+ auto IP = AssumptionCaches.insert(std::make_pair(<br>
+ FunctionCallbackVH(&F, this),
llvm::make_unique<AssumptionCache>(F)));<br>
</blockquote>
</span>
Why does creating a new AssumptionCache imply populating
it?</div>
</blockquote>
</div>
<br>
</div>
<div class="gmail_extra">The original assumption tracker is
maximally lazy. Until you try to find an assumption in a
function, no work is done. In switching to a separate object,
I could have changed that to eagerly scan the function when
requesting the separate object, but that actually hurts the
performance that the original tracker design was trying to
achieve.</div>
</div>
</blockquote>
This makes sense and is clearly what the code is doing. I think
this comment was based on my misreading of the code in question. <br>
<blockquote
cite="mid:CAGCO0KiYyk3fLon2M9w=vuGCptoQOuGQYhsf6iWZ1DYNyLNjJA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">One goal of the separate object is to
have all of the layers of utility code work (almost)
exclusively with the per-function cache. Without this, it
won't be possible to use the same cache produced both with the
new pass manager and the old pass manager in the shared
utility code. The utility code is also where looking at
assumptions has the highest cost to compile time because we
don't want to scan the entire function every time we reach
into value tracking unless an assume would actually be
relevant to the particular value tracking taking place.</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">The end result is that to have
comparable performance to the original pass, the per-function
cache needs to be lazily populated as well. I'd be really
interested if at some point (maybe the new pass manage?
unsure) we could switch this to be the simpler, eager form.
But again, I actually wanted to change as little in this patch
as I could, and so I kept the design very similar.</div>
</div>
</blockquote>
I'm more than fine with leaving it entirely lazy. That's actually
what I was trying to suggest. (Again, I misread the current code.)<br>
<br>
<br>
<br>
</body>
</html>