• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt -codegenprepare -mtriple=x86_64-unknown-unknown -force-split-store -S < %s | FileCheck %s
3
4target datalayout = "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:32-n8:16:32-a:0:32-S32"
5target triple = "i686-w64-windows-gnu"
6
7define void @split_store_align1(float %x, i64* %p) {
8; CHECK-LABEL: @split_store_align1(
9; CHECK-NEXT:    [[B:%.*]] = bitcast float [[X:%.*]] to i32
10; CHECK-NEXT:    [[Z:%.*]] = zext i32 0 to i64
11; CHECK-NEXT:    [[S:%.*]] = shl nuw nsw i64 [[Z]], 32
12; CHECK-NEXT:    [[Z2:%.*]] = zext i32 [[B]] to i64
13; CHECK-NEXT:    [[O:%.*]] = or i64 [[S]], [[Z2]]
14; CHECK-NEXT:    [[TMP1:%.*]] = bitcast i64* [[P:%.*]] to i32*
15; CHECK-NEXT:    store i32 [[B]], i32* [[TMP1]], align 1
16; CHECK-NEXT:    [[TMP2:%.*]] = bitcast i64* [[P]] to i32*
17; CHECK-NEXT:    [[TMP3:%.*]] = getelementptr i32, i32* [[TMP2]], i32 1
18; CHECK-NEXT:    store i32 0, i32* [[TMP3]], align 1
19; CHECK-NEXT:    ret void
20;
21  %b = bitcast float %x to i32
22  %z = zext i32 0 to i64
23  %s = shl nuw nsw i64 %z, 32
24  %z2 = zext i32 %b to i64
25  %o = or i64 %s, %z2
26  store i64 %o, i64* %p, align 1
27  ret void
28}
29
30define void @split_store_align2(float %x, i64* %p) {
31; CHECK-LABEL: @split_store_align2(
32; CHECK-NEXT:    [[B:%.*]] = bitcast float [[X:%.*]] to i32
33; CHECK-NEXT:    [[Z:%.*]] = zext i32 0 to i64
34; CHECK-NEXT:    [[S:%.*]] = shl nuw nsw i64 [[Z]], 32
35; CHECK-NEXT:    [[Z2:%.*]] = zext i32 [[B]] to i64
36; CHECK-NEXT:    [[O:%.*]] = or i64 [[S]], [[Z2]]
37; CHECK-NEXT:    [[TMP1:%.*]] = bitcast i64* [[P:%.*]] to i32*
38; CHECK-NEXT:    store i32 [[B]], i32* [[TMP1]], align 2
39; CHECK-NEXT:    [[TMP2:%.*]] = bitcast i64* [[P]] to i32*
40; CHECK-NEXT:    [[TMP3:%.*]] = getelementptr i32, i32* [[TMP2]], i32 1
41; CHECK-NEXT:    store i32 0, i32* [[TMP3]], align 2
42; CHECK-NEXT:    ret void
43;
44  %b = bitcast float %x to i32
45  %z = zext i32 0 to i64
46  %s = shl nuw nsw i64 %z, 32
47  %z2 = zext i32 %b to i64
48  %o = or i64 %s, %z2
49  store i64 %o, i64* %p, align 2
50  ret void
51}
52
53define void @split_store_align8(float %x, i64* %p) {
54; CHECK-LABEL: @split_store_align8(
55; CHECK-NEXT:    [[B:%.*]] = bitcast float [[X:%.*]] to i32
56; CHECK-NEXT:    [[Z:%.*]] = zext i32 0 to i64
57; CHECK-NEXT:    [[S:%.*]] = shl nuw nsw i64 [[Z]], 32
58; CHECK-NEXT:    [[Z2:%.*]] = zext i32 [[B]] to i64
59; CHECK-NEXT:    [[O:%.*]] = or i64 [[S]], [[Z2]]
60; CHECK-NEXT:    [[TMP1:%.*]] = bitcast i64* [[P:%.*]] to i32*
61; CHECK-NEXT:    store i32 [[B]], i32* [[TMP1]], align 8
62; CHECK-NEXT:    [[TMP2:%.*]] = bitcast i64* [[P]] to i32*
63; CHECK-NEXT:    [[TMP3:%.*]] = getelementptr i32, i32* [[TMP2]], i32 1
64; CHECK-NEXT:    store i32 0, i32* [[TMP3]], align 4
65; CHECK-NEXT:    ret void
66;
67  %b = bitcast float %x to i32
68  %z = zext i32 0 to i64
69  %s = shl nuw nsw i64 %z, 32
70  %z2 = zext i32 %b to i64
71  %o = or i64 %s, %z2
72  store i64 %o, i64* %p, align 8
73  ret void
74}
75