[PPC] Move the combine "a << (b % (sizeof(a) * 8)) -> (PPCshl a, b)" to the backend...
authorTim Shen <timshen91@gmail.com>
Fri, 12 May 2017 19:25:37 +0000 (19:25 +0000)
committerTim Shen <timshen91@gmail.com>
Fri, 12 May 2017 19:25:37 +0000 (19:25 +0000)
commit10c64e6aea87a75da6dff41a95ede1935282d71d
treecdde3ab1b1dfd24c74ba82c51ebed9368f1fb83a
parentdd3a739d52ddb9ec2c79cc5cef1b57750f48d85d
[PPC] Move the combine "a << (b % (sizeof(a) * 8)) -> (PPCshl a, b)" to the backend. NFC.

Summary:
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.

Reviewers: echristo, hfinkel, efriedma, iteratee

Subscribers: nemanjai, llvm-commits

Differential Revision: https://reviews.llvm.org/D33076

llvm-svn: 302937
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