1 ; RUN: opt -inline -preserve-alignment-assumptions-during-inlining -S < %s | FileCheck %s
2 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
3 target triple = "x86_64-unknown-linux-gnu"
5 define void @hello(float* align 128 nocapture %a, float* nocapture readonly %c) #0 {
7 %0 = load float, float* %c, align 4
8 %arrayidx = getelementptr inbounds float, float* %a, i64 5
9 store float %0, float* %arrayidx, align 4
13 define void @foo(float* nocapture %a, float* nocapture readonly %c) #0 {
15 tail call void @hello(float* %a, float* %c)
16 %0 = load float, float* %c, align 4
17 %arrayidx = getelementptr inbounds float, float* %a, i64 7
18 store float %0, float* %arrayidx, align 4
22 ; CHECK: define void @foo(float* nocapture %a, float* nocapture readonly %c) #0 {
24 ; CHECK: %ptrint = ptrtoint float* %a to i64
25 ; CHECK: %maskedptr = and i64 %ptrint, 127
26 ; CHECK: %maskcond = icmp eq i64 %maskedptr, 0
27 ; CHECK: call void @llvm.assume(i1 %maskcond)
28 ; CHECK: %0 = load float, float* %c, align 4
29 ; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5
30 ; CHECK: store float %0, float* %arrayidx.i, align 4
31 ; CHECK: %1 = load float, float* %c, align 4
32 ; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7
33 ; CHECK: store float %1, float* %arrayidx, align 4
37 define void @fooa(float* nocapture align 128 %a, float* nocapture readonly %c) #0 {
39 tail call void @hello(float* %a, float* %c)
40 %0 = load float, float* %c, align 4
41 %arrayidx = getelementptr inbounds float, float* %a, i64 7
42 store float %0, float* %arrayidx, align 4
46 ; CHECK: define void @fooa(float* nocapture align 128 %a, float* nocapture readonly %c) #0 {
48 ; CHECK: %0 = load float, float* %c, align 4
49 ; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5
50 ; CHECK: store float %0, float* %arrayidx.i, align 4
51 ; CHECK: %1 = load float, float* %c, align 4
52 ; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7
53 ; CHECK: store float %1, float* %arrayidx, align 4
57 define void @hello2(float* align 128 nocapture %a, float* align 128 nocapture %b, float* nocapture readonly %c) #0 {
59 %0 = load float, float* %c, align 4
60 %arrayidx = getelementptr inbounds float, float* %a, i64 5
61 store float %0, float* %arrayidx, align 4
62 %arrayidx1 = getelementptr inbounds float, float* %b, i64 8
63 store float %0, float* %arrayidx1, align 4
67 define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 {
69 tail call void @hello2(float* %a, float* %b, float* %c)
70 %0 = load float, float* %c, align 4
71 %arrayidx = getelementptr inbounds float, float* %a, i64 7
72 store float %0, float* %arrayidx, align 4
76 ; CHECK: define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 {
78 ; CHECK: %ptrint = ptrtoint float* %a to i64
79 ; CHECK: %maskedptr = and i64 %ptrint, 127
80 ; CHECK: %maskcond = icmp eq i64 %maskedptr, 0
81 ; CHECK: call void @llvm.assume(i1 %maskcond)
82 ; CHECK: %ptrint1 = ptrtoint float* %b to i64
83 ; CHECK: %maskedptr2 = and i64 %ptrint1, 127
84 ; CHECK: %maskcond3 = icmp eq i64 %maskedptr2, 0
85 ; CHECK: call void @llvm.assume(i1 %maskcond3)
86 ; CHECK: %0 = load float, float* %c, align 4
87 ; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5
88 ; CHECK: store float %0, float* %arrayidx.i, align 4
89 ; CHECK: %arrayidx1.i = getelementptr inbounds float, float* %b, i64 8
90 ; CHECK: store float %0, float* %arrayidx1.i, align 4
91 ; CHECK: %1 = load float, float* %c, align 4
92 ; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7
93 ; CHECK: store float %1, float* %arrayidx, align 4
97 attributes #0 = { nounwind uwtable }