[PATCH] D71910: [Attributor] Add helper to change an instruction to `unreachable` inst
Stefanos Baziotis via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 26 10:15:32 PST 2019
baziotis added inline comments.
================
Comment at: llvm/include/llvm/Transforms/IPO/Attributor.h:1040-1041
+ /// Instructions we replace with `unreachable` insts after manifest is done.
+ SmallPtrSet<Instruction *, 8> ToBeChangedToUnreachableInsts;
+
----------------
uenoku wrote:
> baziotis wrote:
> > baziotis wrote:
> > > How about a `SmallVector` here? I think it makes sense since we never lookup values on this set (which is I guess the primary reason to make a set), it should have amortized O(1) and it is easier to loop over.
> > Oh my bad, I just saw it was committed.
> I think `SmallVector` isn't a set. We don't want to change the same instruction to unreachable twice so `SmallPtrSet` seems good to me.
Yes, that's a safer way.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71910/new/
https://reviews.llvm.org/D71910
More information about the llvm-commits
mailing list