• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -S -instcombine | FileCheck %s
3
4define i32 @__isnan(float %x) alwaysinline nounwind optsize {
5; CHECK-LABEL: @__isnan(
6; CHECK-NEXT:  entry:
7; CHECK-NEXT:    [[DOTCAST:%.*]] = bitcast float [[X:%.*]] to i32
8; CHECK-NEXT:    [[SHL:%.*]] = shl i32 [[DOTCAST]], 1
9; CHECK-NEXT:    [[CMP:%.*]] = icmp ugt i32 [[SHL]], -16777216
10; CHECK-NEXT:    [[CONV:%.*]] = zext i1 [[CMP]] to i32
11; CHECK-NEXT:    ret i32 [[CONV]]
12;
13entry:
14  %x.addr = alloca float, align 4
15  store float %x, float* %x.addr, align 4
16  %0 = load float, float* %x.addr, align 4
17  %1 = bitcast float %0 to i32
18  %shl = shl i32 %1, 1
19  %cmp = icmp ugt i32 %shl, -16777216
20  %conv = zext i1 %cmp to i32
21  ret i32 %conv
22}
23
24define i1 @icmp_shl7(i32 %x) {
25; CHECK-LABEL: @icmp_shl7(
26; CHECK-NEXT:    [[SHL:%.*]] = shl i32 [[X:%.*]], 7
27; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i32 [[SHL]], 4608
28; CHECK-NEXT:    ret i1 [[CMP]]
29;
30  %shl = shl i32 %x, 7
31  %cmp = icmp slt i32 %shl, 4608
32  ret i1 %cmp
33}
34