[PATCH] D32715: shrink-wrap: fix shrink-wrapping for no-return paths

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 12 11:35:10 PDT 2017


MatzeB requested changes to this revision.
MatzeB added a comment.
This revision now requires changes to proceed.

Good find Francis. I am not convinced however the fix is save (see below). And for that matter the existing `if (!Save)` code path in `FindIDom()` seems to suffer the same problem.



================
Comment at: lib/CodeGen/ShrinkWrap.cpp:292
+  else
+    Restore = nullptr;
 
----------------
Setting this to `nullptr` seems incorrect to me. From my understanding that resets us to a state where it seems like we haven't looked at any part of the function and will just pick the next block that comes along, which seems really sketchy to me. Shouldn't we rather abort the whole shrinkwrapping process at this point?


https://reviews.llvm.org/D32715





More information about the llvm-commits mailing list