blob: c75e1beb2356efe40ab46adf46253b007a1a14f6 [file] [log] [blame]
Chris Lattnerdd030702010-03-02 22:20:06 +00001; RUN: llc -march=msp430 -combiner-alias-analysis < %s | FileCheck %s
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +00002target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
3target triple = "msp430-generic-generic"
4@foo = common global i16 0, align 2
5@bar = common global i16 0, align 2
6
Anton Korobeynikov4b38ce92009-10-11 23:03:53 +00007define void @mov() nounwind {
Stephen Lind24ab202013-07-14 06:24:09 +00008; CHECK-LABEL: mov:
Anton Korobeynikov4b38ce92009-10-11 23:03:53 +00009; CHECK: mov.w &bar, &foo
David Blaikiea79ac142015-02-27 21:17:42 +000010 %1 = load i16, i16* @bar
Anton Korobeynikov4b38ce92009-10-11 23:03:53 +000011 store i16 %1, i16* @foo
12 ret void
13}
14
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000015define void @add() nounwind {
Stephen Lind24ab202013-07-14 06:24:09 +000016; CHECK-LABEL: add:
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000017; CHECK: add.w &bar, &foo
David Blaikiea79ac142015-02-27 21:17:42 +000018 %1 = load i16, i16* @bar
19 %2 = load i16, i16* @foo
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000020 %3 = add i16 %2, %1
21 store i16 %3, i16* @foo
22 ret void
23}
24
25define void @and() nounwind {
Stephen Lind24ab202013-07-14 06:24:09 +000026; CHECK-LABEL: and:
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000027; CHECK: and.w &bar, &foo
David Blaikiea79ac142015-02-27 21:17:42 +000028 %1 = load i16, i16* @bar
29 %2 = load i16, i16* @foo
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000030 %3 = and i16 %2, %1
31 store i16 %3, i16* @foo
32 ret void
33}
34
35define void @bis() nounwind {
Stephen Lind24ab202013-07-14 06:24:09 +000036; CHECK-LABEL: bis:
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000037; CHECK: bis.w &bar, &foo
David Blaikiea79ac142015-02-27 21:17:42 +000038 %1 = load i16, i16* @bar
39 %2 = load i16, i16* @foo
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000040 %3 = or i16 %2, %1
41 store i16 %3, i16* @foo
42 ret void
43}
44
45define void @xor() nounwind {
Stephen Lind24ab202013-07-14 06:24:09 +000046; CHECK-LABEL: xor:
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000047; CHECK: xor.w &bar, &foo
David Blaikiea79ac142015-02-27 21:17:42 +000048 %1 = load i16, i16* @bar
49 %2 = load i16, i16* @foo
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000050 %3 = xor i16 %2, %1
51 store i16 %3, i16* @foo
52 ret void
53}
54
Chris Lattnerdd030702010-03-02 22:20:06 +000055define i16 @mov2() nounwind {
56entry:
57 %retval = alloca i16 ; <i16*> [#uses=3]
58 %x = alloca i32, align 2 ; <i32*> [#uses=1]
59 %y = alloca i32, align 2 ; <i32*> [#uses=1]
60 store i16 0, i16* %retval
David Blaikiea79ac142015-02-27 21:17:42 +000061 %tmp = load i32, i32* %y ; <i32> [#uses=1]
Chris Lattnerdd030702010-03-02 22:20:06 +000062 store i32 %tmp, i32* %x
63 store i16 0, i16* %retval
David Blaikiea79ac142015-02-27 21:17:42 +000064 %0 = load i16, i16* %retval ; <i16> [#uses=1]
Chris Lattnerdd030702010-03-02 22:20:06 +000065 ret i16 %0
Stephen Lind24ab202013-07-14 06:24:09 +000066; CHECK-LABEL: mov2:
Chris Lattner46c01a32011-02-13 22:25:43 +000067; CHECK: mov.w 2(r1), 6(r1)
Dan Gohman2c9bda12011-10-24 17:53:16 +000068; CHECK: mov.w 0(r1), 4(r1)
Chris Lattnerdd030702010-03-02 22:20:06 +000069}