• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by update_test_checks.py
2; RUN: opt < %s -S -instsimplify | FileCheck %s
3
4declare i16 @llvm.bswap.i16(i16)
5
6define i1 @test1(i16 %arg) {
7; CHECK-LABEL: @test1(
8; CHECK:         ret i1 false
9;
10  %a = or i16 %arg, 1
11  %b = call i16 @llvm.bswap.i16(i16 %a)
12  %res = icmp eq i16 %b, 0
13  ret i1 %res
14}
15
16define i1 @test2(i16 %arg) {
17; CHECK-LABEL: @test2(
18; CHECK:         ret i1 false
19;
20  %a = or i16 %arg, 1024
21  %b = call i16 @llvm.bswap.i16(i16 %a)
22  %res = icmp eq i16 %b, 0
23  ret i1 %res
24}
25
26define i1 @test3(i16 %arg) {
27; CHECK-LABEL: @test3(
28; CHECK:         ret i1 false
29;
30  %a = and i16 %arg, 1
31  %b = call i16 @llvm.bswap.i16(i16 %a)
32  %and = and i16 %b, 1
33  %res = icmp eq i16 %and, 1
34  ret i1 %res
35}
36
37define i1 @test4(i16 %arg) {
38; CHECK-LABEL: @test4(
39; CHECK:         ret i1 false
40;
41  %a = and i16 %arg, 511
42  %b = call i16 @llvm.bswap.i16(i16 %a)
43  %and = and i16 %b, 256
44  %res = icmp eq i16 %and, 1
45  ret i1 %res
46}
47