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

Hiroshi Yamauchi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 17:04:58 PDT 2017


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)) {
----------------
yamauchi wrote:
> 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.
Now using llvm::count_if + make_range.


https://reviews.llvm.org/D35499





More information about the llvm-commits mailing list