[PATCH] D18124: ConstantFoldInstruction: avoid wasted calls to ConstantFoldConstantExpression

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 12 20:04:08 PST 2016


majnemer added a subscriber: majnemer.
majnemer accepted this revision.
majnemer added a reviewer: majnemer.
majnemer added a comment.
This revision is now accepted and ready to land.

LGTM with nits.


================
Comment at: lib/Analysis/ConstantFolding.cpp:986
@@ -985,1 +985,3 @@
   // hand off to ConstantFoldInstOperandsImpl.
+  if (!llvm::all_of(I->operands(), [] (Use &U) { return isa<Constant>(U); }))
+    return nullptr;
----------------
I don't think you need the `llvm::` qualifier.
Also, I think clang-format would not have a space between the capture and the parameter.


Repository:
  rL LLVM

http://reviews.llvm.org/D18124





More information about the llvm-commits mailing list