[PATCH] D24918: [ADCE] Add code to remove dead branches
David Callahan via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 16 04:53:39 PST 2016
david2050 added a comment.
ping
================
Comment at: lib/Transforms/Scalar/ADCE.cpp:243
+ for (; Iter != End; ++Iter) {
+ auto *BB = *Iter;
+ TerminatorInst *Term = BB->getTerminator();
----------------
mehdi_amini wrote:
> I think the boilerplate can be reduced:
>
> ```
> for (auto *BB : make_range(Iterator::begin(&F.getEntryBlock(), State),
> Iterator::end(&F.getEntryBlock(), State)) {
> ....
> ```
>
> The repetition of `&F.getEntryBlock(), State` isn't great, upgrading `iterator_range<df_iterator<T>> depth_first(const T& G)` and `df_begin` and `df_end` to accept the extra `State` parameter should allow to write:
>
> ```
> for (auto *BB : depth_first(&F.getEntryBlock(), State)) {
> ....
> ```
>
Thanks, the existing depth_first_ext applies.
https://reviews.llvm.org/D24918
More information about the llvm-commits
mailing list