blob: 406053bee27ffb6d0ee350e77ec1f94886735584 [file] [log] [blame]
Nate Begeman8ec18172006-02-17 06:24:31 +00001; All of these should be codegen'd without loading immediates
Tanya Lattner6f729d62008-03-25 04:26:08 +00002; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f
Dan Gohman28beeea2007-08-15 13:36:28 +00003; RUN: grep addc %t | count 1
4; RUN: grep adde %t | count 1
5; RUN: grep addze %t | count 1
6; RUN: grep addme %t | count 1
7; RUN: grep addic %t | count 2
Nate Begemanb5fefc72006-02-17 06:16:56 +00008
Tanya Lattner6f729d62008-03-25 04:26:08 +00009define i64 @add_ll(i64 %a, i64 %b) {
Nate Begemanb5fefc72006-02-17 06:16:56 +000010entry:
Tanya Lattner6f729d62008-03-25 04:26:08 +000011 %tmp.2 = add i64 %b, %a ; <i64> [#uses=1]
12 ret i64 %tmp.2
Nate Begemanb5fefc72006-02-17 06:16:56 +000013}
14
Tanya Lattner6f729d62008-03-25 04:26:08 +000015define i64 @add_l_5(i64 %a) {
Nate Begemanb5fefc72006-02-17 06:16:56 +000016entry:
Tanya Lattner6f729d62008-03-25 04:26:08 +000017 %tmp.1 = add i64 %a, 5 ; <i64> [#uses=1]
18 ret i64 %tmp.1
Nate Begemanb5fefc72006-02-17 06:16:56 +000019}
20
Tanya Lattner6f729d62008-03-25 04:26:08 +000021define i64 @add_l_m5(i64 %a) {
Nate Begemanb5fefc72006-02-17 06:16:56 +000022entry:
Tanya Lattner6f729d62008-03-25 04:26:08 +000023 %tmp.1 = add i64 %a, -5 ; <i64> [#uses=1]
24 ret i64 %tmp.1
Nate Begemanb5fefc72006-02-17 06:16:56 +000025}
Tanya Lattner6f729d62008-03-25 04:26:08 +000026