]> granicus.if.org Git - llvm/commit
[InstCombine][NFC] Add test to show missing fold for icmp ult/uge (shl %x, C2), C1.
authorHuihui Zhang <huihuiz@quicinc.com>
Tue, 25 Jun 2019 00:14:02 +0000 (00:14 +0000)
committerHuihui Zhang <huihuiz@quicinc.com>
Tue, 25 Jun 2019 00:14:02 +0000 (00:14 +0000)
commit52325a3618db5730ca869a154afe512cf2dec2d9
tree11af93853281a9df48ebfc255e89d58b1e61e487
parente4223f994bed2a45ea8b4d9994ba85d21cb78b4b
[InstCombine][NFC] Add test to show missing fold for icmp ult/uge (shl %x, C2), C1.

Summary:
'shl' inequality test

```
  icmp ult/uge (shl %x, C2), C1 iff C1 is power of two
```

can be simplified as 'and' equality test

```
  icmp eq/ne (and %x, (lshr -C1, C2)), 0.
```

Reviewers: lebedev.ri, efriedma

Reviewed By: lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364256 91177308-0d34-0410-b5e6-96231b3b80d8
test/Transforms/InstCombine/shl-unsigned-cmp-const.ll [new file with mode: 0644]