[PATCH] D32155: [APInt] Use lshrInPlace to replace lshr where possible

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 18 00:11:34 PDT 2017


craig.topper created this revision.
Herald added subscribers: mzolotukhin, jholewinski.

This patch uses lshrInPlace to replace code where the object that lshr is called on is being overwritten with the result.

This adds an lshrInPlace(const APInt &) version as well.

This also makes lshrInPlace return a reference to *this so it can be used in some other special cases.

For example:

Elt = Elt.lshr(Index).zextOrTrunc(Length);

to

Elt = Elt.lshrInPlace(Index).zextOrTrunc(Length);


https://reviews.llvm.org/D32155

Files:
  include/llvm/ADT/APInt.h
  lib/Analysis/ScalarEvolution.cpp
  lib/Analysis/ValueTracking.cpp
  lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  lib/CodeGen/CodeGenPrepare.cpp
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  lib/CodeGen/SelectionDAG/TargetLowering.cpp
  lib/ExecutionEngine/Interpreter/Execution.cpp
  lib/IR/ConstantFold.cpp
  lib/Support/APFloat.cpp
  lib/Support/APInt.cpp
  lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
  lib/Target/NVPTX/NVPTXAsmPrinter.cpp
  lib/Target/X86/X86ISelLowering.cpp
  lib/Transforms/InstCombine/InstCombineCalls.cpp
  lib/Transforms/InstCombine/InstCombineShifts.cpp
  lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32155.95531.patch
Type: text/x-patch
Size: 19129 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170418/45b076f7/attachment.bin>


More information about the llvm-commits mailing list