2005-01-02 02:30:04 +00:00
|
|
|
; The register allocator can commute two-address instructions to avoid
|
|
|
|
; insertion of register-register copies.
|
|
|
|
|
2005-05-09 05:54:27 +00:00
|
|
|
; Make sure there are only 3 mov's for each testcase
|
2008-02-21 07:42:26 +00:00
|
|
|
; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \
|
2007-08-15 13:36:28 +00:00
|
|
|
; RUN: grep {\\\<mov\\\>} | count 6
|
2005-01-02 02:30:04 +00:00
|
|
|
|
2005-07-20 03:56:48 +00:00
|
|
|
|
|
|
|
target triple = "i686-pc-linux-gnu"
|
2008-02-21 07:42:26 +00:00
|
|
|
@G = external global i32 ; <i32*> [#uses=2]
|
2005-07-20 03:56:48 +00:00
|
|
|
|
2008-02-21 07:42:26 +00:00
|
|
|
declare void @ext(i32)
|
2005-01-02 02:30:04 +00:00
|
|
|
|
2008-02-21 07:42:26 +00:00
|
|
|
define i32 @add_test(i32 %X, i32 %Y) {
|
|
|
|
%Z = add i32 %X, %Y ; <i32> [#uses=1]
|
|
|
|
store i32 %Z, i32* @G
|
|
|
|
ret i32 %X
|
2005-01-02 02:30:04 +00:00
|
|
|
}
|
|
|
|
|
2008-02-21 07:42:26 +00:00
|
|
|
define i32 @xor_test(i32 %X, i32 %Y) {
|
|
|
|
%Z = xor i32 %X, %Y ; <i32> [#uses=1]
|
|
|
|
store i32 %Z, i32* @G
|
|
|
|
ret i32 %X
|
2005-01-02 02:30:04 +00:00
|
|
|
}
|
2008-02-21 07:42:26 +00:00
|
|
|
|