<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 7 Apr 2017, at 12:09, Elovikov, Andrei via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">Hello,<br class="">
<br class="">
During the last month we've faced two cases where some performance degradations were observed due to GlobalsAA not being preserved till the LICM:<br class="">
 1) New pass pgo-memop-opt (fixed in <a href="http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170403/443360.html" class="">
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170403/443360.html</a>)<br class="">
 2) GVNHoist (when it was moved to the simplification part of the pipeline)<br class="">
So it would be good to guard against such issues. However, this highly depends on the particular structure of the optimization pipeline.
<br class="">
LIT test like this seems to work:<br class="">
<br class="">
; RUN: opt < %s -O3 -debug-pass=Details -disable-output 2>&1 | FileCheck %s<br class="">
; CHECK-NOT: is not preserving 'Globals Alias Analysis'<br class="">
; CHECK: 'Loop Invariant Code Motion' is not preserving 'Rotate Loops'<br class="">
<some IR with simple loop><br class="">
<br class="">
but looks too hard-coded. Are there ways to do it in a cleaner manner?<br class="">
<br class="">
Thanks,<br class="">
Andrei<br class="">
</div>
</blockquote>
<div><br class="">
</div>
<div>I added a somewhat similar test, with similar intentions as part of <a href="https://reviews.llvm.org/D19806" class="">https://reviews.llvm.org/D19806</a>, committed in <a href="http://llvm.org/viewvc/llvm-project?view=revision&revision=268370" class="">http://llvm.org/viewvc/llvm-project?view=revision&revision=268370</a>.
 That test didn't get touched in the 10 months it has been in tree, so it seems to me that testing it like this has a reasonable chance of highlighting accidentally dropping GlobalsAA. Maybe just adding a simple loop that should be optimized by LICM to the
 same test file (test/Transforms/PhaseOrdering/globalaa-retained.ll) might be all what's needed?</div>
<div><br class="">
</div>
<div>Thanks,</div>
<div><br class="">
</div>
<div>Kristof</div>
<div><br class="">
</div>
<div><br class="">
</div>
</div>
</body>
</html>