[PATCH] D35499: [InstCombine] Simplify pointer difference subtractions (GEP-GEP) where GEPs have other uses and one non-constant index

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 14:57:18 PDT 2017


llvm::count_if + make_range?


On Tue, Jul 18, 2017 at 2:30 PM, Hiroshi Yamauchi via Phabricator via
llvm-commits <llvm-commits at lists.llvm.org> wrote:

> yamauchi marked an inline comment as done.
> yamauchi added inline comments.
>
>
> ================
> Comment at: include/llvm/IR/Operator.h:477
> +    unsigned NumNonConstantIndices = 0;
> +    for (const_op_iterator I = idx_begin(), E = idx_end(); I != E; ++I) {
> +      if (!isa<ConstantInt>(I)) {
> ----------------
> sanjoy wrote:
> > You can use `llvm::count_if` here.
> I used std::count_if instead as llvm::count_if seems to use the standard
> begin/end instead of the idx_begin/idx_end required here.
>
>
> https://reviews.llvm.org/D35499
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170718/861cd20f/attachment.html>


More information about the llvm-commits mailing list