[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:22:23 PDT 2017


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;
+
----------------
davide wrote:
> Shouldn't just `pVal[i] & RHS.pVal[i]` suffice?
> 
> Then at that point you can just rewrite it as :
> return `llvm::all_of` etc..
Nevermind, you probably can't use `any_of` as you need the index.


https://reviews.llvm.org/D32253





More information about the llvm-commits mailing list