<div dir="ltr">I'm very unclear and why you think a generic black box intrinsic will have any different performance impact ;-)<div><br></div><div><br></div><div>I'm also unclear on what the goal with this intrinsic is.</div><div>I understand the symptoms you are trying to solve - what exactly is the disease.</div><div><br></div><div>IE you say "</div><br class=""><span style="font-size:12.8px">I'd like to propose a new intrinsic for use in preventing optimizations from deleting IR due to constant propagation, dead code elimination, etc."</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">But why are you trying to achieve this goal?</span></div><div><span style="font-size:12.8px">Benchmarks that can be const prop'd/etc away are often meaningless.  Past that, if you want to ensure a particular optimization does a particular thing on a benchmark, ISTM it would be better to generate the IR, run opt (or build your own pass-by-pass harness), and then run "the passes you want on it" instead of "trying to stop certain passes from doing things to it".</span></div><div><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 2, 2015 at 5:23 PM, Richard Diamond via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Mon, Nov 2, 2015 at 7:19 PM, Sanjoy Das <span dir="ltr"><<a href="mailto:sanjoy@playingwithpointers.com" target="_blank">sanjoy@playingwithpointers.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Why does this need to be an intrinsic (as opposed to generic "unknown function" to llvm)?<br>
<br>
Secondly, have you looked into a volatile store / load to an alloca? That should work with PNaCl and WebAssembly.<br>
<br>
E.g.<br>
<br>
define i32 @blackbox(i32 %arg) {<br>
 entry:<br>
  %p = alloca i32<br>
  store volatile i32 10, i32* %p  ;; or store %arg<br>
  %v = load volatile i32, i32* %p<br>
  ret i32 %v<br>
}</blockquote><div><br></div></span><div>That volatility would have a negative performance impact.</div></div><span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra">Richard Diamond</div></font></span></div>
<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></blockquote></div><br></div>