[PATCH] D32614: [GVNHoist] Fix: PR32821, add check for anticipability in case of infinite loops

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 30 18:36:08 PDT 2017


chandlerc added a comment.

Regardless of what you do with the code (I'm not an expert on this pass or the stuff Danny is already discussing there), please simplify this test case to a more readable and clear test case for the fundamental issue you're hitting. Having tons of Clang-specific bits in here really opacifies what scenario you're trying to test.

Relatedly, there are many different ways to arrive at an infinite loop, I would really hope to see a reasonable *collection* of test cases that thoroughly exercise the kinds of CFGs that can interefere with reachability analyses due to infinite loops. For example, irreducible control flows that infinitely cycle seem usefully different from regular infinite loops.

There is also the problem brought up in http://lists.llvm.org/pipermail/llvm-dev/2015-July/088095.html now almost two years ago which we still haven't made sense of yet. We really should be able to hoist across an infinite loop without side-effects but not across one with side-effects in C++-modeling LLVM IR, and we shouldn't be able to do so in Java-modeling LLVM IR. =/ You should at least leave test cases that exercise both paths (whichever behavior you choose) and clear comments in the test cases describing how they should be updated and expanded when we have a real answer here.


https://reviews.llvm.org/D32614





More information about the llvm-commits mailing list