1
0
mirror of https://github.com/c64scene-ar/llvm-6502.git synced 2025-04-11 00:39:36 +00:00

R600/SI: Fix verifier error when producing v_madmk_f32

Copy the kill flags when swapping the operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235687 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matt Arsenault 2015-04-24 01:57:58 +00:00
parent d32beab637
commit 9dd5b1fbd8
2 changed files with 27 additions and 0 deletions
lib/Target/R600
test/CodeGen/R600

@ -970,8 +970,11 @@ bool SIInstrInfo::FoldImmediate(MachineInstr *UseMI, MachineInstr *DefMI,
unsigned Src2SubReg = Src2->getSubReg();
Src0->setReg(Src1Reg);
Src0->setSubReg(Src1SubReg);
Src0->setIsKill(Src1->isKill());
Src1->setReg(Src2Reg);
Src1->setSubReg(Src2SubReg);
Src1->setIsKill(Src2->isKill());
Src2->ChangeToImmediate(Imm);

@ -179,3 +179,27 @@ define void @madmk_add_inline_imm_f32(float addrspace(1)* noalias %out, float ad
store float %madmk, float addrspace(1)* %out.gep, align 4
ret void
}
; SI-LABEL: {{^}}kill_madmk_verifier_error:
; SI: s_xor_b64
; SI: v_madmk_f32_e32 {{v[0-9]+}}, {{v[0-9]+}}, {{v[0-9]+}}, 0x472aee8c
; SI: s_or_b64
define void @kill_madmk_verifier_error() nounwind {
bb:
br label %bb2
bb1: ; preds = %bb2
ret void
bb2: ; preds = %bb6, %bb
%tmp = phi float [ undef, %bb ], [ %tmp8, %bb6 ]
%tmp3 = fsub float undef, %tmp
%tmp5 = fcmp oeq float %tmp3, 1.000000e+04
br i1 %tmp5, label %bb1, label %bb6
bb6: ; preds = %bb2
%tmp4 = fmul float %tmp, undef
%tmp7 = fmul float %tmp4, 0x40E55DD180000000
%tmp8 = fadd float %tmp7, undef
br label %bb2
}