[PATCH] D31565: [APInt] Move isMask and isShiftedMask out of APIntOps and into the APInt class. Implement them without memory allocation for multiword

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 20:50:18 PDT 2017


craig.topper created this revision.
Herald added a subscriber: mzolotukhin.

This moves the isMask and isShiftedMask functions to be class methods. They now use the MathExtras.h function for single word size and leading/trailing zeros/ones or countPopulation for the multiword size. The previous implementation made multiple temorary memory allocations to do the bitwise arithmetic operations to match the MathExtras.h implementation.


https://reviews.llvm.org/D31565

Files:
  include/llvm/ADT/APInt.h
  lib/Analysis/ScalarEvolution.cpp
  lib/CodeGen/CodeGenPrepare.cpp
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/Target/Hexagon/HexagonGenExtract.cpp
  lib/Target/X86/X86ISelLowering.cpp
  lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
  unittests/ADT/APIntTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31565.93740.patch
Type: text/x-patch
Size: 10011 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170401/c69e6cae/attachment.bin>


More information about the llvm-commits mailing list