[PATCH] D33839: Prevent outlining of basicblock that uses BlockAddress
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 27 12:01:11 PDT 2017
efriedma added inline comments.
================
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:79
+ if (isa<BlockAddress const>(Curr))
+ return false; // even a reference to self is likely to be not compatible
+
----------------
I'm not sure I follow this check.
You can't extract a basic block whose terminator is an indirectbr; in general, you can't efficiently break the relevant CFG edges. Similarly, you can't extract a block with an indirectbr predecessor. And extracting a block whose address is taken is likely to lead to unexpected results in other cases for code which abuses block addresses for other uses (like the Linux kernel).
But I can't see why you would want to block extracting a basic block just because it refers to a blockaddress, or a global variable which contains a blockaddress.
Repository:
rL LLVM
https://reviews.llvm.org/D33839
More information about the llvm-commits
mailing list