[PATCH] D63652: [InstCombine] (1 << (C - x)) -> ((1 << C) >> x) if C is bitwidth - 1

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 21 09:00:28 PDT 2019


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

Please precommit those 3 extra tests first though



================
Comment at: test/Transforms/InstCombine/shl-sub.ll:56
 }
 
 ; Negative tests
----------------
missing 3 tests with undef:
```
define <3 x i64> @shl_sub_i64_vec_undef0(<3 x i64> %x) {
  %s = sub <3 x i64> <i64 63, i64 undef, i64 63>, %x
  %r = shl <3 x i64> <i64 1, i64 1, i64 1>, %s
  ret <3 x i64> %r
}

define <3 x i64> @shl_sub_i64_vec_undef1(<3 x i64> %x) {
  %s = sub <3 x i64> <i64 63, undef, i64 63>, %x
  %r = shl <3 x i64> <i64 1, i64 undef, i64 1>, %s
  ret <3 x i64> %r
}

define <3 x i64> @shl_sub_i64_vec_undef2(<3 x i64> %x) {
  %s = sub <3 x i64> <i64 63, i64 undef, i64 63>, %x
  %r = shl <3 x i64> <i64 1, i64 undef, i64 1>, %s
  ret <3 x i64> %r
}

```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63652/new/

https://reviews.llvm.org/D63652





More information about the llvm-commits mailing list