[PATCH] D32253: [APInt] Implement APInt::intersects without creating a temporary APInt in the multiword case

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 16:21:13 PDT 2017


davide accepted this revision.
davide added inline comments.


================
Comment at: lib/Support/APInt.cpp:727-728
+  for (unsigned i = 0, e = getNumWords(); i != e; ++i)
+    if ((pVal[i] & RHS.pVal[i]) != 0)
+      return true;
+
----------------
Shouldn't just `pVal[i] & RHS.pVal[i]` suffice?

Then at that point you can just rewrite it as :
return `llvm::all_of` etc..


https://reviews.llvm.org/D32253





More information about the llvm-commits mailing list