[llvm] r235687 - R600/SI: Fix verifier error when producing v_madmk_f32
Matt Arsenault
Matthew.Arsenault at amd.com
Thu Apr 23 18:57:58 PDT 2015
Author: arsenm
Date: Thu Apr 23 20:57:58 2015
New Revision: 235687
URL: http://llvm.org/viewvc/llvm-project?rev=235687&view=rev
Log:
R600/SI: Fix verifier error when producing v_madmk_f32
Copy the kill flags when swapping the operands.
Modified:
llvm/trunk/lib/Target/R600/SIInstrInfo.cpp
llvm/trunk/test/CodeGen/R600/madmk.ll
Modified: llvm/trunk/lib/Target/R600/SIInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIInstrInfo.cpp?rev=235687&r1=235686&r2=235687&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/R600/SIInstrInfo.cpp Thu Apr 23 20:57:58 2015
@@ -970,8 +970,11 @@ bool SIInstrInfo::FoldImmediate(MachineI
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);
Modified: llvm/trunk/test/CodeGen/R600/madmk.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/R600/madmk.ll?rev=235687&r1=235686&r2=235687&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/R600/madmk.ll (original)
+++ llvm/trunk/test/CodeGen/R600/madmk.ll Thu Apr 23 20:57:58 2015
@@ -179,3 +179,27 @@ define void @madmk_add_inline_imm_f32(fl
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
+}
More information about the llvm-commits
mailing list