[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 14:30:44 PDT 2017


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





More information about the llvm-commits mailing list