<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 3, 2016 at 11:01 PM, Justin Bogner <span dir="ltr"><<a href="mailto:mail@justinbogner.com" target="_blank">mail@justinbogner.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Sean Silva via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> writes:<br>
> No tests fail with the patch below, so I would say it's pretty useless. It<br>
> seems that the C bindings are the only user but we can probably just have them<br>
> return IPSCCP instead.<br>
<br>
</span>I don't necessarily think your conclusion is wrong, but the patch isn't<br>
proving what you think it's proving. In fact, the below passes all tests<br>
as well. When you call passes through `opt` they don't end up calling<br>
through the createXYZPass path.<br></blockquote><div><br></div><div>Ah, interesting! Thanks for catching this!</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff --git a/lib/Transforms/IPO/IPConstantPropagation.cpp b/lib/Transforms/IPO/IPConstantPropagation.cpp<br>
index b3ee499..8d70b98 100644<br>
--- a/lib/Transforms/IPO/IPConstantPropagation.cpp<br>
+++ b/lib/Transforms/IPO/IPConstantPropagation.cpp<br>
@@ -253,7 +253,9 @@ char IPCP::ID = 0;<br>
<span class=""> INITIALIZE_PASS(IPCP, "ipconstprop",<br>
                 "Interprocedural constant propagation", false, false)<br>
<br>
-ModulePass *llvm::createIPConstantPropagationPass() { return new IPCP(); }<br>
+ModulePass *llvm::createIPConstantPropagationPass() {<br>
</span>+  llvm_unreachable("fnord");<br>
<span class="im HOEnZb">+}<br>
<br>
 bool IPCP::runOnModule(Module &M) {<br>
   if (skipModule(M))<br>
<br>
</span><div class="HOEnZb"><div class="h5">> Any idea why this wasn't removed when IPSCCP was introduced? Probably worth<br>
> understanding that before ripping it out, but in the current state of things I<br>
> don't think removing it will be problematic.<br>
><br>
> diff --git a/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp b/llvm/lib/<br>
> Transforms/IPO/IPConstantPropagation.cpp<br>
> index a1533b3..24aea5c 100644<br>
> --- a/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp<br>
> +++ b/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp<br>
> @@ -51,7 +51,9 @@ char IPCP::ID = 0;<br>
>  INITIALIZE_PASS(IPCP, "ipconstprop",<br>
>                  "Interprocedural constant propagation", false, false)<br>
><br>
> -ModulePass *llvm::createIPConstantPropagationPass() { return new IPCP(); }<br>
> +ModulePass *llvm::createIPConstantPropagationPass() {<br>
> +  return createIPSCCPPass();<br>
> +}<br>
><br>
>  bool IPCP::runOnModule(Module &M) {<br>
>    if (skipModule(M))<br>
><br>
> -- Sean Silva<br>
><br>
> On Tue, May 3, 2016 at 3:06 PM, Davide Italiano via llvm-dev <<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
>     The pass is pretty rudimental (as the comment at the top of the file<br>
>     hints), and it seems LLVM already has IPSCCP (which should do a better<br>
>     job at interprocedural constant propagation).<br>
>     I'm also not entirely sure it's used anywhere.<br>
>     Is there any reason to keep it around?<br>
><br>
>     Thanks,<br>
><br>
>     --<br>
>     Davide<br>
><br>
>     "There are no solved problems; there are only problems that are more<br>
>     or less solved" -- Henri Poincare<br>
>     _______________________________________________<br>
>     LLVM Developers mailing list<br>
>     <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
>     <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div></div>