Commit Graph

3 Commits

Author SHA1 Message Date
Roman Lebedev 9ca8d0cce0 [DAGCombiner] visitShiftByConstant(): drop bogus signbit check
Summary:
That check claims that the transform is illegal otherwise.
That isn't true:
1. For `ISD::ADD`, we only process `ISD::SHL` outer shift => sign bit does not matter
   https://rise4fun.com/Alive/K4A
2. For `ISD::AND`, there is no restriction on constants:
   https://rise4fun.com/Alive/Wy3
3. For `ISD::OR`, there is no restriction on constants:
   https://rise4fun.com/Alive/GOH
3. For `ISD::XOR`, there is no restriction on constants:
   https://rise4fun.com/Alive/ml6

So, why is it there then?

This changes the testcase that was touched by @spatel in rL347478,
but i'm not sure that test tests anything particular?

Reviewers: RKSimon, spatel, craig.topper, jojo, rengolin

Reviewed By: spatel

Subscribers: javed.absar, llvm-commits, spatel

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361044 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-17 15:52:58 +00:00
Roman Lebedev ab54ff77c4 [NFC] Fixup FileCheck option name in tests added in rL360881
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360884 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-16 12:39:34 +00:00
Roman Lebedev eacd3955c7 [NFC][CodeGen] Add some more tests for pulling binops through shifts
The ashr variant may see relaxation in https://reviews.llvm.org/D61918

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360881 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-16 12:26:53 +00:00