summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/add-sitofp.ll
blob: 2abfa436f6d33a9fbee0b4e1afecf88a506003f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instcombine -S | FileCheck %s

define double @x(i32 %a, i32 %b) {
; CHECK-LABEL: @x(
; CHECK-NEXT:    [[M:%.*]] = lshr i32 [[A:%.*]], 24
; CHECK-NEXT:    [[N:%.*]] = and i32 [[M]], [[B:%.*]]
; CHECK-NEXT:    [[ADDCONV:%.*]] = add nuw nsw i32 [[N]], 1
; CHECK-NEXT:    [[P:%.*]] = sitofp i32 [[ADDCONV]] to double
; CHECK-NEXT:    ret double [[P]]
;
  %m = lshr i32 %a, 24
  %n = and i32 %m, %b
  %o = sitofp i32 %n to double
  %p = fadd double %o, 1.0
  ret double %p
}
OpenPOWER on IntegriCloud