<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I don't believe we have much in this area currently. <br>
<br>
Generally, something like this would existing in InstCombine and
ValueTracking.<br>
<br>
Take a look at ComputeSignBit in ValueTracking.cpp. This doesn't
apply (?) to floating point numbers, but we'd need something
equivalent for them. It looks like there may already be a start in
the form of:<br>
CannotBeNegativeZero<br>
<br>
Other places to look would be SimplifyFAdd and
InstCombine::visitFAdd.<br>
<br>
For this particular example, you're probably going to want a pattern
in SimplifyFCmp of the form:<br>
matcher: sqrt_call( fadd(Value(X), SpecificValue(X)), fadd(Value(Y),
SpecificValue(Y))) <br>
&& CannotBeNegativeZero(X) &&
CannotBeNegativeZero(Y)<br>
<br>
You might also look at LazyValueInfo, but that's probably of
secondary interest. It's purely in terms of constant integer ranges
currently. <br>
<br>
Philip<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 01/07/2015 02:13 PM, Robison, Arch
wrote:<br>
</div>
<blockquote
cite="mid:51C2718BFE68DA4698E41A5C59B2BB69580F98A0@fmsmsx116.amr.corp.intel.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
<font face="Calibri" size="2"><span style="font-size:11pt;">
<div>The Julia language implements sqrt(x) with conditional
branch taken if x<0. Alas this prevents vectorization of
loops with sqrt. Often the argument can be proven to be
non-negative. E.g., sqrt(x*x+y*y). Is there an existing
LLVM pass or analysis that
does floating-point range propagation to eliminate such
unnecessary checks?</div>
<div> </div>
<div>Arch D. Robison</div>
<div>Intel Corporation</div>
<div> </div>
<div> </div>
<div> </div>
</span></font>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</body>
</html>