xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/pr23103.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -verify-machineinstrs -mtriple=x86_64-unknown-unknown -mcpu=generic -mattr=+avx < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; When commuting a VADDSDrr instruction, verify that the 'IsUndef' flag is
4*9880d681SAndroid Build Coastguard Worker; correctly propagated to the operands of the resulting instruction.
5*9880d681SAndroid Build Coastguard Worker; Test for PR23103;
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workerdeclare zeroext i1 @foo(<1 x double>)
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Workerdefine <1 x double> @pr23103(<1 x double>* align 8 %Vp) {
10*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: pr23103:
11*9880d681SAndroid Build Coastguard Worker; CHECK:         vmovsd (%rdi), %xmm0
12*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:    vmovsd %xmm0, {{.*}}(%rsp) {{.*#+}} 8-byte Spill
13*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:    callq foo
14*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:    vaddsd {{.*}}(%rsp), %xmm0, %xmm0 {{.*#+}} 8-byte Folded Reload
15*9880d681SAndroid Build Coastguard Worker; CHECK:         retq
16*9880d681SAndroid Build Coastguard Workerentry:
17*9880d681SAndroid Build Coastguard Worker  %V = load <1 x double>, <1 x double>* %Vp, align 8
18*9880d681SAndroid Build Coastguard Worker  %call = call zeroext i1 @foo(<1 x double> %V)
19*9880d681SAndroid Build Coastguard Worker  %fadd = fadd <1 x double> %V, undef
20*9880d681SAndroid Build Coastguard Worker  ret <1 x double> %fadd
21*9880d681SAndroid Build Coastguard Worker}
22