<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font size="-1">Neat!</font><br>
</p>
<pre class="moz-signature" cols="72">--
Evandro Menezes
</pre>
<div class="moz-cite-prefix">On 10/9/19 6:07 PM, Craig Topper wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAF7ks-M8EocXnc64HxE9_ta4wHdxx5hNbkiDsNObEzSt9KHqzw@mail.gmail.com">
<div dir="ltr">You could just use the CallInst version of
getIntrinsicID() which already does the right thing
<div><br>
<div>
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature">~Craig</div>
</div>
<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Oct 9, 2019 at 3:01 PM
Evandro Menezes via llvm-commits <<a
href="mailto:llvm-commits@lists.llvm.org"
moz-do-not-send="true">llvm-commits@lists.llvm.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote">Author: evandro<br>
Date: Wed Oct 9 15:03:23 2019<br>
New Revision: 374243<br>
<br>
URL: <a
href="http://llvm.org/viewvc/llvm-project?rev=374243&view=rev"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://llvm.org/viewvc/llvm-project?rev=374243&view=rev</a><br>
Log:<br>
[InstCombine] Fix PR43617<br>
<br>
Check for `nullptr` before inspecting composite function.<br>
<br>
Modified:<br>
llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp<br>
<br>
Modified: llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp<br>
URL: <a
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp?rev=374243&r1=374242&r2=374243&view=diff"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp?rev=374243&r1=374242&r2=374243&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp
(original)<br>
+++ llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp Wed
Oct 9 15:03:23 2019<br>
@@ -1916,10 +1916,10 @@ Value
*LibCallSimplifier::optimizeLog(Ca<br>
B.setFastMathFlags(FastMathFlags::getFast());<br>
<br>
Function *ArgFn = Arg->getCalledFunction();<br>
- StringRef ArgNm = ArgFn->getName();<br>
- Intrinsic::ID ArgID = ArgFn->getIntrinsicID();<br>
+ Intrinsic::ID ArgID =<br>
+ ArgFn ? ArgFn->getIntrinsicID() :
Intrinsic::not_intrinsic;<br>
LibFunc ArgLb = NotLibFunc;<br>
- TLI->getLibFunc(ArgNm, ArgLb);<br>
+ TLI->getLibFunc(Arg, ArgLb);<br>
<br>
// log(pow(x,y)) -> y*log(x)<br>
if (ArgLb == PowLb || ArgID == Intrinsic::pow) {<br>
@@ -1934,9 +1934,10 @@ Value
*LibCallSimplifier::optimizeLog(Ca<br>
substituteInParent(Arg, MulY);<br>
return MulY;<br>
}<br>
+<br>
// log(exp{,2,10}(y)) -> y*log({e,2,10})<br>
// TODO: There is no exp10() intrinsic yet.<br>
- else if (ArgLb == ExpLb || ArgLb == Exp2Lb || ArgLb ==
Exp10Lb ||<br>
+ if (ArgLb == ExpLb || ArgLb == Exp2Lb || ArgLb == Exp10Lb
||<br>
ArgID == Intrinsic::exp || ArgID ==
Intrinsic::exp2) {<br>
Constant *Eul;<br>
if (ArgLb == ExpLb || ArgID == Intrinsic::exp)<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank"
moz-do-not-send="true">llvm-commits@lists.llvm.org</a><br>
<a
href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote>
</div>
</blockquote>
</body>
</html>