[PATCH] D69865: [IR] PR27065: Part2. Fix BasicBlock::removePredecessor to not break SSA form.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 7 09:32:41 PST 2019
efriedma added a comment.
The general problem here is, how do you define dominance for unreachable code? LLVM makes the choice that every basic block dominates an unreachable basic block. This leads to the slightly strange result that an instruction can use itself... but there isn't really any good alternative given we allow unreachable basic blocks.
In that context, trying to avoid generating instructions that use themselves isn't really productive; you can get equally confusing results in other ways.
We could consider just saying that unreachable blocks aren't valid. Last time I looked, that didn't really seem feasible because there were a bunch of transforms that could leave around unreachable code, without any easy way to check. But there's been a bunch of work to preserve the dominator tree in more places, so maybe it's easier now.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69865/new/
https://reviews.llvm.org/D69865
More information about the llvm-commits
mailing list