Elovikov, Andrei via llvm-dev
2017-Apr-07 10:09 UTC
[llvm-dev] How to test that GlobalsAA is non unintentionally invalidated
Hello, During the last month we've faced two cases where some performance degradations were observed due to GlobalsAA not being preserved till the LICM: 1) New pass pgo-memop-opt (fixed in http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170403/443360.html) 2) GVNHoist (when it was moved to the simplification part of the pipeline) So it would be good to guard against such issues. However, this highly depends on the particular structure of the optimization pipeline. LIT test like this seems to work: ; RUN: opt < %s -O3 -debug-pass=Details -disable-output 2>&1 | FileCheck %s ; CHECK-NOT: is not preserving 'Globals Alias Analysis' ; CHECK: 'Loop Invariant Code Motion' is not preserving 'Rotate Loops' <some IR with simple loop> but looks too hard-coded. Are there ways to do it in a cleaner manner? Thanks, Andrei -------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
Daniel Berlin via llvm-dev
2017-Apr-07 15:36 UTC
[llvm-dev] How to test that GlobalsAA is non unintentionally invalidated
On Fri, Apr 7, 2017 at 3:09 AM, Elovikov, Andrei via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hello, > > During the last month we've faced two cases where some performance > degradations were observed due to GlobalsAA not being preserved till the > LICM: >Do you mean "compile time" or "generated code performance"?> 1) New pass pgo-memop-opt (fixed in http://lists.llvm.org/ > pipermail/llvm-commits/Week-of-Mon-20170403/443360.html) > 2) GVNHoist (when it was moved to the simplification part of the > pipeline) > So it would be good to guard against such issues. However, this highly > depends on the particular structure of the optimization pipeline. > LIT test like this seems to work: > > ; RUN: opt < %s -O3 -debug-pass=Details -disable-output 2>&1 | FileCheck %s > ; CHECK-NOT: is not preserving 'Globals Alias Analysis' > ; CHECK: 'Loop Invariant Code Motion' is not preserving 'Rotate Loops' > <some IR with simple loop> > > but looks too hard-coded. Are there ways to do it in a cleaner manner? > > Yes. Add a flag explicitly to output the state of preserved analysis, forthe specific goal of being used in tests, and use that. But note: I'm not sure it's entirely reasonable to expect everything in between here and there to preserve something you want preserved. These are tradeoffs, and adding a test so you can see when it's not true seems reasonable, but so would xfailing that test if we add something in between :) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170407/0d672b8f/attachment.html>
Kristof Beyls via llvm-dev
2017-Apr-07 18:34 UTC
[llvm-dev] How to test that GlobalsAA is non unintentionally invalidated
On 7 Apr 2017, at 12:09, Elovikov, Andrei via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote: Hello, During the last month we've faced two cases where some performance degradations were observed due to GlobalsAA not being preserved till the LICM: 1) New pass pgo-memop-opt (fixed in http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170403/443360.html) 2) GVNHoist (when it was moved to the simplification part of the pipeline) So it would be good to guard against such issues. However, this highly depends on the particular structure of the optimization pipeline. LIT test like this seems to work: ; RUN: opt < %s -O3 -debug-pass=Details -disable-output 2>&1 | FileCheck %s ; CHECK-NOT: is not preserving 'Globals Alias Analysis' ; CHECK: 'Loop Invariant Code Motion' is not preserving 'Rotate Loops' <some IR with simple loop> but looks too hard-coded. Are there ways to do it in a cleaner manner? Thanks, Andrei I added a somewhat similar test, with similar intentions as part of https://reviews.llvm.org/D19806, committed in http://llvm.org/viewvc/llvm-project?view=revision&revision=268370. 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? Thanks, Kristof -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170407/244801ca/attachment.html>