[PATCH] D155940: [SimplifyCFG] Transform for redirecting phis between unmergeable BB and SuccBB
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 20 00:12:14 PDT 2023
nikic added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:1179
// To avoid processing the same predecessor more than once.
- SmallPtrSet<BasicBlock *, 8> SeenPreds;
- // All predecessors of BB will be moved to Succ.
----------------
XChy wrote:
> nikic wrote:
> > Why is this set no longer needed? Can no predecessors appear multiple times in this code?
> BBPreds is a SmallPtrSet, on which we would not iterate the same predecessor multiple times.
Oh, I missed that this does the updates based on SmallPtrSet now. This is not allowed, because it makes the updates non-deterministic (order matters here). You should replace SmallPtrSet with SmallSetVector to keep order deterministic.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155940/new/
https://reviews.llvm.org/D155940
More information about the llvm-commits
mailing list