<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<pre class="moz-signature" cols="72">-------------
Best regards,
Alexey Bataev</pre>
<div class="moz-cite-prefix">26.06.2019 11:09, Doerfert, Johannes
via llvm-dev пишет:<br>
</div>
<blockquote type="cite"
cite="mid:%3C20190626150953.GC1378@arch-linux-jd%3E">
<div class="moz-text-plain" wrap="true" graphical-quote="true"
style="font-family: -moz-fixed; font-size: 14px;"
lang="x-unicode">
<pre class="moz-quote-pre" wrap="">Hi Rajasekhar,
thanks for reporting this.
On 06/26, Raja Sekhar Bhetala via llvm-dev wrote:
</pre>
<blockquote type="cite" style="color: #000000;">
<pre class="moz-quote-pre" wrap="">The specification on this loop is incorrect as the parallel_accesses
metadata indicate that there is no loop carried memory dependence, which is
not true in this case.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">First, I think the lowering is actually broken if a simdlen is given.
Since we use parallel_accesses metadata it indicates the loop is free of
dependences but #pragma simd simdlen(4) means we are allowed to assume
there are no loop carried dependences of length smaller than 4.
</pre>
<blockquote type="cite" style="color: #000000;">
<pre class="moz-quote-pre" wrap="">Shouldn't the compiler not Vectorize if it can prove that there is a loop
carried dependence and the Vectorizer will generate an incorrect code ?
Or Should it blindly follow the user directive (without a warning) ?
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">I'm always on the fence when it comes to these questions. I think we
should blindly follow the directives but offer a flag that globally
turns on warning for such odd situations.
</pre>
</div>
</blockquote>
<br>
<p>Currently, there could be some problems. Vectorizer has only 3
modes: no vectorization, analysis+vectorization and unconditional
vectorization, as I understand. If we want to add the mode where
we could emit at least warnings for possible incorrect
vectorization, we need a new mode: analysis+unconditional
vectorization.</p>
As an alternative, we can add an option (disabled by default,
because the behavior does not meet the standard) to emit the OpenMP
simd loops in analysis+vectorization (hint) mode.
<blockquote type="cite"
cite="mid:%3C20190626150953.GC1378@arch-linux-jd%3E">
<div class="moz-text-plain" wrap="true" graphical-quote="true"
style="font-family: -moz-fixed; font-size: 14px;"
lang="x-unicode">
<pre class="moz-quote-pre" wrap="">
</pre>
<blockquote type="cite" style="color: #000000;">
<pre class="moz-quote-pre" wrap="">It is very difficult for the user to identify the real source of the
problem if the compiler vectorizes the loop silently. I agree its hard to
detect incorrect specifications. But for cases, where it is easy to detect
we should atleast dump a warning.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">No default warning, that will clutter the output. On second though,
maybe if the we determine the given information is plain wrong.
Cheers,
Johannes
<div class="moz-txt-sig">--
Johannes Doerfert
Researcher
Argonne National Laboratory
Lemont, IL 60439, USA
<a class="moz-txt-link-abbreviated" href="mailto:jdoerfert@anl.gov" moz-do-not-send="true">jdoerfert@anl.gov</a>
</div></pre>
</div>
</blockquote>
</body>
</html>