1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes='require<profile-summary>,function(codegenprepare)' -mtriple=x86_64-unknown-unknown -force-split-store -S < %s | FileCheck %s
4 target 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"
5 target triple = "i686-w64-windows-gnu"
7 define void @split_store_align1(float %x, ptr %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: store i32 [[B]], ptr [[P:%.*]], align 1
15 ; CHECK-NEXT: [[TMP3:%.*]] = getelementptr i32, ptr [[P]], i32 1
16 ; CHECK-NEXT: store i32 0, ptr [[TMP3]], align 1
17 ; CHECK-NEXT: ret void
19 %b = bitcast float %x to i32
20 %z = zext i32 0 to i64
21 %s = shl nuw nsw i64 %z, 32
22 %z2 = zext i32 %b to i64
24 store i64 %o, ptr %p, align 1
28 define void @split_store_align2(float %x, ptr %p) {
29 ; CHECK-LABEL: @split_store_align2(
30 ; CHECK-NEXT: [[B:%.*]] = bitcast float [[X:%.*]] to i32
31 ; CHECK-NEXT: [[Z:%.*]] = zext i32 0 to i64
32 ; CHECK-NEXT: [[S:%.*]] = shl nuw nsw i64 [[Z]], 32
33 ; CHECK-NEXT: [[Z2:%.*]] = zext i32 [[B]] to i64
34 ; CHECK-NEXT: [[O:%.*]] = or i64 [[S]], [[Z2]]
35 ; CHECK-NEXT: store i32 [[B]], ptr [[P:%.*]], align 2
36 ; CHECK-NEXT: [[TMP3:%.*]] = getelementptr i32, ptr [[P]], i32 1
37 ; CHECK-NEXT: store i32 0, ptr [[TMP3]], align 2
38 ; CHECK-NEXT: ret void
40 %b = bitcast float %x to i32
41 %z = zext i32 0 to i64
42 %s = shl nuw nsw i64 %z, 32
43 %z2 = zext i32 %b to i64
45 store i64 %o, ptr %p, align 2
49 define void @split_store_align8(float %x, ptr %p) {
50 ; CHECK-LABEL: @split_store_align8(
51 ; CHECK-NEXT: [[B:%.*]] = bitcast float [[X:%.*]] to i32
52 ; CHECK-NEXT: [[Z:%.*]] = zext i32 0 to i64
53 ; CHECK-NEXT: [[S:%.*]] = shl nuw nsw i64 [[Z]], 32
54 ; CHECK-NEXT: [[Z2:%.*]] = zext i32 [[B]] to i64
55 ; CHECK-NEXT: [[O:%.*]] = or i64 [[S]], [[Z2]]
56 ; CHECK-NEXT: store i32 [[B]], ptr [[P:%.*]], align 8
57 ; CHECK-NEXT: [[TMP3:%.*]] = getelementptr i32, ptr [[P]], i32 1
58 ; CHECK-NEXT: store i32 0, ptr [[TMP3]], align 4
59 ; CHECK-NEXT: ret void
61 %b = bitcast float %x to i32
62 %z = zext i32 0 to i64
63 %s = shl nuw nsw i64 %z, 32
64 %z2 = zext i32 %b to i64
66 store i64 %o, ptr %p, align 8