[PATCH] D138027: Clean up CFG on JumpThreading
Pedro Olsen Ferreira via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 15 05:19:59 PST 2022
arkangath added a comment.
In D138027#3927365 <https://reviews.llvm.org/D138027#3927365>, @lebedev.ri wrote:
> Note that for unreachable IR, self-referencing, and other forms of invalidity of IR, is legal.
Yup, I'm aware :)
Nevertheless, it's probably good form to clean up after a pass.
================
Comment at: llvm/lib/Transforms/Scalar/JumpThreading.cpp:451
LoopHeaders.erase(&BB);
LVI->eraseBlock(&BB);
+ // If the removed block is a predecessor of a loop block
----------------
lebedev.ri wrote:
> Would it not be sufficient to just add the block into `Unreachable` set?
>
I don't know - the code I copied it from already did this, so I just kept it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138027/new/
https://reviews.llvm.org/D138027
More information about the llvm-commits
mailing list