Go to file
Chandler Carruth 4a000883c7 [LoopSimplify] Re-instate r306081 with a bug fix w.r.t. indirectbr.
This was reverted in r306252, but I already had the bug fixed and was
just trying to form a test case.

The original commit factored the logic for forming dedicated exits
inside of LoopSimplify into a helper that could be used elsewhere and
with an approach that required fewer intermediate data structures. See
that commit for full details including the change to the statistic, etc.

The code looked fine to me and my reviewers, but in fact didn't handle
indirectbr correctly -- it left the 'InLoopPredecessors' vector dirty.

If you have code that looks *just* right, you can end up leaking these
predecessors into a subsequent rewrite, and crash deep down when trying
to update PHI nodes for predecessors that don't exist.

I've added an assert that makes the bug much more obvious, and then
changed the code to reliably clear the vector so we don't get this bug
again in some other form as the code changes.

I've also added a test case that *does* manage to catch this while also
giving some nice positive coverage in the face of indirectbr.

The real code that found this came out of what I think is CPython's
interpreter loop, but any code with really "creative" interpreter loops
mixing indirectbr and other exit paths could manage to tickle the bug.
I was hard to reduce the original test case because in addition to
having a particular pattern of IR, the whole thing depends on the order
of the predecessors which is in turn depends on use list order. The test
case added here was designed so that in multiple different predecessor
orderings it should always end up going down the same path and tripping
the same bug. I hope. At least, it tripped it for me without
manipulating the use list order which is better than anything bugpoint
could do...

llvm-svn: 306257
2017-06-25 22:45:31 +00:00
clang Add support for Ananas platform 2017-06-25 08:29:09 +00:00
clang-tools-extra [clang-tidy] doc format fix 2017-06-23 22:12:55 +00:00
compiler-rt [PGO] Implementate profile counter regiser promotion (test case) 2017-06-25 00:27:09 +00:00
debuginfo-tests Add a test for PR33166. 2017-05-25 19:33:16 +00:00
libclc generic: add missing get_work_dim include 2017-06-02 15:58:35 +00:00
libcxx Implement inclusive_scan/transform_inclusive_scan for C++17. 2017-06-23 05:12:42 +00:00
libcxxabi Add some catch(...) blocks to the tests so that if they fail, we get a good error message. No functional change. 2017-06-22 00:49:03 +00:00
libunwind Change -1LL to -1ULL to silence a gcc warning about left shifting a negative value. Fixes https://bugs.llvm.org/show_bug.cgi?id=33358 2017-06-21 16:02:53 +00:00
lld Test commit 2017-06-24 21:16:41 +00:00
lldb Fix LLDB build. 2017-06-23 23:55:32 +00:00
llgo irgen: Create functions instead of global variables for builtin hash and equal algorithms. 2017-06-04 22:11:28 +00:00
llvm [LoopSimplify] Re-instate r306081 with a bug fix w.r.t. indirectbr. 2017-06-25 22:45:31 +00:00
openmp Set affinity to none/false in child processes 2017-06-15 21:51:07 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly [PPCGCodeGeneration] Enable GPU code generation with invariant loads. 2017-06-25 14:48:24 +00:00