<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 27 Apr 2016, at 17:33, David Majnemer <<a href="mailto:david.majnemer@gmail.com" class="">david.majnemer@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class=""><br class="">
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Wed, Apr 27, 2016 at 6:48 AM, Artur Pilipenko <span dir="ltr" class="">
<<a href="mailto:apilipenko@azulsystems.com" target="_blank" class="">apilipenko@azulsystems.com</a>></span> wrote:<br class="">
<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">
apilipenko added inline comments.<br class="">
<span class=""><br class="">
================<br class="">
Comment at: lib/IR/Value.cpp:556<br class="">
@@ -555,1 +555,3 @@<br class="">
<br class="">
</span><span class="">+bool Value::isPointerDereferenceable(bool &CanBeNull) const {<br class="">
+  assert(getType()->isPointerTy() && "must be pointer");<br class="">
</span>----------------<br class="">
<span class="">majnemer wrote:<br class="">
> I'd expect this to call isDereferenceableFromAttribute.<br class="">
</span>Can you elaborate? isDereferenceableFromAttribute is an internal function in Loads.cpp, while this is a public API to get inherent property of the value.<br class="">
</blockquote>
<div class=""><br class="">
</div>
<div class="">There is no inherent reason why isPointerDereferenceable _must_ be a member of Value, it is quite reasonable for it to be exposed in Loads.h seeing as how it seems quite similar to isSafeToLoadUnconditionally.</div>
</div>
</div>
</div>
</div>
</blockquote>
Loads.h provides isDereferenceableAndAligned API which looks through casts/relocations, performs context sensitive nullness analysis, verifies alignment. The function I introduce provides base facts for isDereferenceableAndAligned analysis.</div>
<div>
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class="gmail_extra">
<div class="gmail_quote">
<div class=""> </div>
<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">
<br class="">
<br class="">
<a href="http://reviews.llvm.org/D17611" rel="noreferrer" target="_blank" class="">http://reviews.llvm.org/D17611</a><br class="">
<br class="">
<br class="">
<br class="">
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</body>
</html>