[PATCH] D111998: [ADT] Add APInt::isNegatedPowerOf2() helper

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 19 05:15:55 PDT 2021


RKSimon updated this revision to Diff 380653.
RKSimon edited the summary of this revision.
RKSimon added a reviewer: lebedev.ri.
RKSimon added a comment.
Herald added subscribers: pengfei, kbarton, nemanjai.

Improved the implementation - we're looking for a shifted mask in the top bits of a non-zero value.

Converted some additional uses of the (-Value).isPowerOf2() pattern


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111998/new/

https://reviews.llvm.org/D111998

Files:
  llvm/include/llvm/ADT/APInt.h
  llvm/include/llvm/IR/PatternMatch.h
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/lib/Target/AArch64/AArch64FastISel.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp
  llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
  llvm/unittests/ADT/APIntTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111998.380653.patch
Type: text/x-patch
Size: 9252 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211019/7b7ece8b/attachment.bin>


More information about the llvm-commits mailing list