blob: 98951306fd8e9ff1418266f4390af2a495d75938 [file] [log] [blame]
Hal Finkel0fcdd8b2012-06-20 15:43:03 +00001target 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-v128:128:128-n32:64"
2target triple = "powerpc64-unknown-linux-gnu"
Hal Finkel2d37f7b2013-03-15 15:27:13 +00003; RUN: llc -disable-ppc-unaligned < %s | FileCheck %s
Hal Finkel0fcdd8b2012-06-20 15:43:03 +00004
Nadav Rotem3e883732012-08-14 05:19:07 +00005define fastcc void @allocateSpace(i1 %cond1, i1 %cond2) nounwind {
Hal Finkel0fcdd8b2012-06-20 15:43:03 +00006entry:
7 %0 = load i8** undef, align 8, !tbaa !0
8 br i1 undef, label %return, label %lor.lhs.false
9
10lor.lhs.false: ; preds = %entry
11 br i1 undef, label %if.end7, label %return
12
13if.end7: ; preds = %lor.lhs.false
14 br i1 undef, label %if.then15, label %if.end71
15
16if.then15: ; preds = %if.end7
17 br label %while.cond
18
19while.cond: ; preds = %while.body, %if.then15
20 %idxprom17 = sext i32 0 to i64
21 %arrayidx18 = getelementptr inbounds i8* %0, i64 %idxprom17
22 %or = or i32 undef, undef
Nadav Rotem3e883732012-08-14 05:19:07 +000023 br i1 %cond1, label %if.end71, label %while.body
Hal Finkel0fcdd8b2012-06-20 15:43:03 +000024
25while.body: ; preds = %while.cond
Nadav Rotem3e883732012-08-14 05:19:07 +000026 br i1 %cond2, label %while.cond, label %if.then45
Hal Finkel0fcdd8b2012-06-20 15:43:03 +000027
28if.then45: ; preds = %while.body
29 %idxprom48139 = zext i32 %or to i64
30 %arrayidx49 = getelementptr inbounds i8* %0, i64 %idxprom48139
31 %1 = bitcast i8* %arrayidx49 to i16*
32 %2 = bitcast i8* %arrayidx18 to i16*
33 %3 = load i16* %1, align 1
34 store i16 %3, i16* %2, align 1
35 br label %return
36
37if.end71: ; preds = %while.cond, %if.end7
38 unreachable
39
40return: ; preds = %if.then45, %lor.lhs.false, %entry
41 ret void
42
43; CHECK: @allocateSpace
44; CHECK: lbzux
45}
46
47!0 = metadata !{metadata !"any pointer", metadata !1}
48!1 = metadata !{metadata !"omnipotent char", metadata !2}
49!2 = metadata !{metadata !"Simple C/C++ TBAA"}