[PATCH] D23896: [InstCombine] Try to resubmit the combine of A->B->A BitCast and fix for pr27996

Guozhi Wei via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 24 10:15:42 PDT 2016


Carrot added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:1767-1771
+  for (User *U : CI.users()) {
+    if (!isa<StoreInst>(U))
+      return false;
+  }
+  return true;
----------------
majnemer wrote:
> I think this can be simplified to `llvm::all_of(CI.users(), [](User *U) { return isa<StoreInst>(U); });`
It is also used by following assert statement, so it's better to just leave it here.


https://reviews.llvm.org/D23896





More information about the llvm-commits mailing list