[PATCH] D30612: [APInt] Add rvalue reference support to and, or, xor operations to allow their memory allocation to be reused when possible

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 4 17:29:48 PST 2017


craig.topper created this revision.

This extends an earlier change that did similar for add and sub operations.

With this first patch we lose the fastpath for the single word case as operator&= and friends don't support it. This can be added there if we think that's important.

I had to change some functions in the APInt class since the operator overloads were moved out of the class and can't be used inside the class now. The getBitsSet change collides with another outstanding patch to implement it with setBits. But I didn't want to make this patch dependent on that series.

I've also removed the Or, And, Xor functions which were rarely or never used. I already commited two changes to remove the only uses of Or that existed.


https://reviews.llvm.org/D30612

Files:
  include/llvm/ADT/APInt.h
  lib/Support/APInt.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30612.90596.patch
Type: text/x-patch
Size: 5690 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170305/8ce4b1c0/attachment.bin>


More information about the llvm-commits mailing list