<p dir="ltr">Hi Quentin,</p>
<p dir="ltr">That's an interesting idea.</p>
<p dir="ltr">I wonder how that will interoperate with vectorization.</p>
<p dir="ltr">Cheers,<br>
Renato</p>
<div class="gmail_quote">On 27 Feb 2013 01:36, "Quentin Colombet" <<a href="mailto:qcolombet@apple.com">qcolombet@apple.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Hi all,<div><br></div><div>You will find enclosed a patch that adds the support of constant variables for the generic global merge pass.</div><div>I've also attached a motivating example, test.c.</div>
<div><br></div><div>In that file there are several global variables accessed within the same function.</div><div>If all the variables are non-const, global merge generates one unique variable, which translates into one unique load in the assembly file.</div>
<div><br></div><div>clang -arch arm -O3 test.c -o - -S</div><div><br></div><div>If some are const (the example is very stupid), global merge does not merge anything and one load for each variable is issued, i.e., 3</div><div>
clang -arch arm -O3 test.c -o - -S -DWITHCONST</div><div><br></div><div>If global merge had merged the constant globals, only 2 loads would have been issued. The patch allows to do that.</div><div><br></div><div>Although the patch is fairly simple, it was not done before because it seems it was breaking the EH processing (see comment in the original code).</div>
<div>Is it still true?</div><div><br></div><div>If yes, how could I reproduce that?</div><div><br></div><div>Note: that the patch disables by default the handling of global constants because the current heuristic may generate worse code. A tuning may be necessary, but it would be done as a second step</div>
<div><br><div>
<div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-wrap:break-word;word-spacing:0px">
-Quentin</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-wrap:break-word;word-spacing:0px">
</div></div></div></div><br><div style="word-wrap:break-word"><div><div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-wrap:break-word;word-spacing:0px">
</div></div></div></div>
<br><div style="word-wrap:break-word"><div><div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-wrap:break-word;word-spacing:0px">
</div>

</div>
<br></div></div>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div>