[PATCH] D33076: [PPC] Move the combine "a << (b % (sizeof(a) * 8)) -> (PPCshl a, b)" to the backend. NFC.

Tim Shen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 15:23:11 PDT 2017


timshen created this revision.
Herald added a subscriber: nemanjai.

Eli pointed out that it's unsafe to combine the shifts to ISD::SHL etc.,
because those are not defined for b > sizeof(a) * 8, even after some of
the combiners run.

However, PPCISD::SHL defines that behavior (as the instructions themselves).
Move the combination to the backend.

The tests in shift_mask.ll still pass.


https://reviews.llvm.org/D33076

Files:
  llvm/include/llvm/Target/TargetLowering.h
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp
  llvm/lib/Target/PowerPC/PPCISelLowering.h
  llvm/lib/Target/PowerPC/PPCInstrAltivec.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33076.98544.patch
Type: text/x-patch
Size: 10608 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170510/bd49fbc7/attachment.bin>


More information about the llvm-commits mailing list