Skip to content

Commit 9e253cc

Browse files
committed
Add zero-idiom test
1 parent f10db27 commit 9e253cc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2+
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2 | FileCheck %s
3+
4+
; Test that zero-idiom instructions (like xor %eax, %eax) are rematerialized
5+
; instead of being copied when used as return values. Rematerialization produces
6+
; independent zero-latency instructions which is better than copying.
7+
8+
define { i64, i64 } @test_xor_int_two_returns() {
9+
; CHECK-LABEL: test_xor_int_two_returns:
10+
; CHECK: # %bb.0:
11+
; CHECK-NEXT: xorl %eax, %eax
12+
; CHECK-NEXT: xorl %edx, %edx
13+
; CHECK-NEXT: retq
14+
ret { i64, i64 } { i64 0, i64 0 }
15+
}

0 commit comments

Comments
 (0)