xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/remat-mov-0.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; CodeGen should remat the zero instead of spilling it.
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdeclare void @foo(i64 %p)
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: bar:
9*9880d681SAndroid Build Coastguard Worker; CHECK: xorl %e[[A0:di|cx]], %e
10*9880d681SAndroid Build Coastguard Worker; CHECK: xorl %e[[A0]], %e[[A0]]
11*9880d681SAndroid Build Coastguard Workerdefine void @bar() nounwind {
12*9880d681SAndroid Build Coastguard Worker  call void @foo(i64 0)
13*9880d681SAndroid Build Coastguard Worker  call void @foo(i64 0)
14*9880d681SAndroid Build Coastguard Worker  ret void
15*9880d681SAndroid Build Coastguard Worker}
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: bat:
18*9880d681SAndroid Build Coastguard Worker; CHECK: movq $-1, %r[[A0]]
19*9880d681SAndroid Build Coastguard Worker; CHECK: movq $-1, %r[[A0]]
20*9880d681SAndroid Build Coastguard Workerdefine void @bat() nounwind {
21*9880d681SAndroid Build Coastguard Worker  call void @foo(i64 -1)
22*9880d681SAndroid Build Coastguard Worker  call void @foo(i64 -1)
23*9880d681SAndroid Build Coastguard Worker  ret void
24*9880d681SAndroid Build Coastguard Worker}
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: bau:
27*9880d681SAndroid Build Coastguard Worker; CHECK: movl $1, %e[[A0]]
28*9880d681SAndroid Build Coastguard Worker; CHECK: movl $1, %e[[A0]]
29*9880d681SAndroid Build Coastguard Workerdefine void @bau() nounwind {
30*9880d681SAndroid Build Coastguard Worker  call void @foo(i64 1)
31*9880d681SAndroid Build Coastguard Worker  call void @foo(i64 1)
32*9880d681SAndroid Build Coastguard Worker  ret void
33*9880d681SAndroid Build Coastguard Worker}
34*9880d681SAndroid Build Coastguard Worker
35