<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 5/13/20 3:31 PM, David Blaikie via
llvm-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAENS6EtVpGWhdyBStACEq3Rmi5s-y7FPJQskCUrPZStYg9ZsXA@mail.gmail.com">
<pre class="moz-quote-pre" wrap="">I believe it's meant to run after /some/ optimizations to make it a bit
more efficient, while not so optimized that it misses opportunities to
detect bugs - but I could be wrong there. I'll leave it up to other folks
to chime in.
</pre>
</blockquote>
<p>I think that is right. The more transformations you run the more
UB you can also "loose" as it is defined to something by the
transformation.<br>
</p>
<p>Lifetime markers are an example. Once removed, which is generally
legal in IR, you cannot argue accesses after the end are UB.<br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:CAENS6EtVpGWhdyBStACEq3Rmi5s-y7FPJQskCUrPZStYg9ZsXA@mail.gmail.com">
<pre class="moz-quote-pre" wrap="">
On Wed, May 13, 2020 at 1:04 PM Arthur Eubanks <a class="moz-txt-link-rfc2396E" href="mailto:aeubanks@google.com"><aeubanks@google.com></a> wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Just tested it out, that test does indeed fail under the old PM at -O3 and
even at -O2.
If the ASan pass runs after optimizations and is designed to detect
undefined behavior at runtime, I don't see how it can be super reliable at
higher optimization levels.
On Wed, May 13, 2020 at 12:39 PM David Blaikie <a class="moz-txt-link-rfc2396E" href="mailto:dblaikie@gmail.com"><dblaikie@gmail.com></a> wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">+some sanitizer/new pass manager folks
On Wed, May 13, 2020 at 12:22 PM Arthur Eubanks via llvm-dev <
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Hi,
I've been trying to burn down the remaining sanitizer failures under the
new pass manager. Right now I'm stuck on some ASan tests.
Some ASan tests run under -O1. There are a couple differences between
the old and new pass managers under -O1, e.g. the old PM doesn't inline
whereas the new PM does. The differences seem to cause some lifetime
intrinsics to get stripped out (e.g. via SROA, InstCombine). It might be
due to ASan specifically testing undefined behavior, and different
optimizations run means different behavior. For a specific example,
use-after-scope-dtor-order.cpp runs under -O1 and fails under the new PM
because SROA strips out the lifetime intrinsics and by the time the ASan
pass runs it doesn't find the lifetime intrinsics to add its own
instrumentation.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
That, to me, sounds like a real bug in the optimizations/asan
implementation if this choice fo optimizations makes the diagnosis go away.
(is ASan able to diagnose the problem at -O3 (where I guess SROA and other
things run) with the legacy pass manager?)
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
What's the proper way to resolve this? Run the tests under -O0? Change
the passes pipeline under the new PM when ASan (and maybe other sanitizers)
is detected?
_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
</blockquote>
<pre class="moz-quote-pre" wrap="">
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
</body>
</html>