File: multiple-uses-load-bitcast-select.ll

package info (click to toggle)
llvm-toolchain-6.0 1:6.0-1~bpo9+1
  • links: PTS, VCS
  • area: main
  • in suites: stretch-backports
  • size: 594,652 kB
  • sloc: cpp: 3,044,500; ansic: 595,051; asm: 271,890; python: 128,923; objc: 106,554; sh: 21,854; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,214; cs: 2,027; xml: 686; php: 212; csh: 117
file content (30 lines) | stat: -rw-r--r-- 1,283 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instcombine -S -data-layout="E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64" | FileCheck %s

define void @PR35618(i64* %st1, double* %st2) {
; CHECK-LABEL: @PR35618(
; CHECK-NEXT:    [[Y1:%.*]] = alloca double, align 8
; CHECK-NEXT:    [[Z1:%.*]] = alloca double, align 8
; CHECK-NEXT:    [[LD1:%.*]] = load double, double* [[Y1]], align 8
; CHECK-NEXT:    [[LD2:%.*]] = load double, double* [[Z1]], align 8
; CHECK-NEXT:    [[TMP10:%.*]] = fcmp olt double [[LD1]], [[LD2]]
; CHECK-NEXT:    [[TMP121:%.*]] = select i1 [[TMP10]], double [[LD1]], double [[LD2]]
; CHECK-NEXT:    [[TMP1:%.*]] = bitcast i64* [[ST1:%.*]] to double*
; CHECK-NEXT:    store double [[TMP121]], double* [[TMP1]], align 8
; CHECK-NEXT:    store double [[TMP121]], double* [[ST2:%.*]], align 8
; CHECK-NEXT:    ret void
;
  %y1 = alloca double
  %z1 = alloca double
  %ld1 = load double, double* %y1
  %ld2 = load double, double* %z1
  %tmp10 = fcmp olt double %ld1, %ld2
  %sel = select i1 %tmp10, double* %y1, double* %z1
  %tmp11 = bitcast double* %sel to i64*
  %tmp12 = load i64, i64* %tmp11
  store i64 %tmp12, i64* %st1
  %bc = bitcast double* %st2 to i64*
  store i64 %tmp12, i64* %bc
  ret void
}