1 ; RUN: opt < %s -instcombine -S | FileCheck %s 2 3 define i32 @t1(i16 zeroext %x, i32 %y) nounwind { 4 entry: 5 ; CHECK: t1 6 ; CHECK-NOT: sdiv 7 ; CHECK: lshr i32 %conv 8 %conv = zext i16 %x to i32 9 %s = shl i32 2, %y 10 %d = sdiv i32 %conv, %s 11 ret i32 %d 12 } 13 14 ; rdar://11721329 15 define i64 @t2(i64 %x, i32 %y) nounwind { 16 ; CHECK: t2 17 ; CHECK-NOT: udiv 18 ; CHECK: lshr i64 %x 19 %1 = shl i32 1, %y 20 %2 = zext i32 %1 to i64 21 %3 = udiv i64 %x, %2 22 ret i64 %3 23 } 24