[PATCH] D123669: [ArgPromotion] Use SmallVector to traverse values
Pavel Samolysov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 28 07:28:14 PDT 2022
psamolysov added a comment.
@nikic
> So, I think it's safe to drop this Visited set in this case, but I would usually consider it good practice to have one, in the interest of defensiveness.
I agree, the code may be changed in the future and the change can be unsafe if the developer won't take into account the idea why the Visited set is not used *now*. I see two ways: to add a comment why using a `SmallVector` to store the worklist and not using of the Visited set is safe in our case, or to add the Visited set into dead instruction collecting loop in the `doPromotion` function too, for consistency. What could be better from your point of view?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123669/new/
https://reviews.llvm.org/D123669
More information about the llvm-commits
mailing list