1 ; RUN: opt < %s -instcombine -S | FileCheck %s
3 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-apple-macosx10.10.0"
6 define zeroext i8 @f_u8(i8 zeroext %a) {
8 ; CHECK-NEXT: %[[A:.*]] = call i8 @llvm.bitreverse.i8(i8 %a)
9 ; CHECK-NEXT: ret i8 %[[A]]
34 ; The ANDs with 32 and 64 have been swapped here, so the sequence does not
35 ; completely match a bitreverse.
36 define zeroext i8 @f_u8_fail(i8 zeroext %a) {
37 ; CHECK-LABEL: @f_u8_fail
64 define zeroext i16 @f_u16(i16 zeroext %a) {
66 ; CHECK-NEXT: %[[A:.*]] = call i16 @llvm.bitreverse.i16(i16 %a)
67 ; CHECK-NEXT: ret i16 %[[A]]
70 %3 = and i16 %2, 16384
78 %11 = and i16 %10, 1024
80 %13 = and i16 %12, 512
82 %15 = and i16 %14, 256
84 %17 = and i16 %16, 128
103 %36 = or i16 %35, %11
104 %37 = or i16 %36, %13
105 %38 = or i16 %37, %15
106 %39 = or i16 %38, %17
107 %40 = or i16 %39, %19
108 %41 = or i16 %40, %21
109 %42 = or i16 %41, %23
110 %43 = or i16 %42, %25
111 %44 = or i16 %43, %27
112 %45 = or i16 %44, %29