xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/2011-10-11-SpillDead.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -verify-regalloc -no-integrated-as
2*9880d681SAndroid Build Coastguard Worker; PR11125
3*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
4*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-apple-macosx10.7"
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker; The inline asm takes %x as a GR32_ABCD virtual register.
7*9880d681SAndroid Build Coastguard Worker; The call to @g forces a spill of that register.
8*9880d681SAndroid Build Coastguard Worker;
9*9880d681SAndroid Build Coastguard Worker; The asm has a dead output tied to %x.
10*9880d681SAndroid Build Coastguard Worker; Verify that the spiller creates a value number for that dead def.
11*9880d681SAndroid Build Coastguard Worker;
12*9880d681SAndroid Build Coastguard Workerdefine void @f(i32 %x) nounwind uwtable ssp {
13*9880d681SAndroid Build Coastguard Workerentry:
14*9880d681SAndroid Build Coastguard Worker  tail call void @g() nounwind
15*9880d681SAndroid Build Coastguard Worker  %0 = tail call i32 asm sideeffect "foo $0", "=Q,0,~{ebx},~{dirflag},~{fpsr},~{flags}"(i32 %x) nounwind
16*9880d681SAndroid Build Coastguard Worker  ret void
17*9880d681SAndroid Build Coastguard Worker}
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Workerdeclare void @g()
20