]> granicus.if.org Git - llvm/commitdiff
[mips][msa] copyPhysReg() should not set RegState::Define on result of CTCMSA.
authorDaniel Sanders <daniel.sanders@imgtec.com>
Tue, 14 Jun 2016 09:11:33 +0000 (09:11 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Tue, 14 Jun 2016 09:11:33 +0000 (09:11 +0000)
Summary:
The machine verifier reports 'Explicit operand marked as def' when it is
manually specified even though it agrees with the operand info.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

Differential Revision: http://reviews.llvm.org/D21065

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272646 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/MipsSEInstrInfo.cpp
test/CodeGen/Mips/msa/elm_cxcmsa.ll

index 270a95a87a9b131a1c9fb8bbf318723eabf2862f..5c8f6cd1ab1d99ca229760ddfdf7c31b05cf6df1 100644 (file)
@@ -129,9 +129,12 @@ void MipsSEInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
         .addReg(SrcReg, getKillRegState(KillSrc)).addImm(1 << 4)
         .addReg(DestReg, RegState::ImplicitDefine);
       return;
+    } else if (Mips::MSACtrlRegClass.contains(DestReg)) {
+      BuildMI(MBB, I, DL, get(Mips::CTCMSA))
+          .addReg(DestReg)
+          .addReg(SrcReg, getKillRegState(KillSrc));
+      return;
     }
-    else if (Mips::MSACtrlRegClass.contains(DestReg))
-      Opc = Mips::CTCMSA;
   }
   else if (Mips::FGR32RegClass.contains(DestReg, SrcReg))
     Opc = Mips::FMOV_S;
index 8d6b0ee20ab846eb8fdeaa4044e0f55a1f93a188..b96499c1523599baddf0fbb9cec34638537c9316 100644 (file)
@@ -1,8 +1,8 @@
 ; Test the MSA ctcmsa and cfcmsa intrinsics (which are encoded with the ELM
 ; instruction format).
 
-; RUN: llc -march=mips -mattr=+msa,+fp64 < %s | FileCheck %s
-; RUN: llc -march=mipsel -mattr=+msa,+fp64 < %s | FileCheck %s
+; RUN: llc -march=mips -mattr=+msa,+fp64 -verify-machineinstrs < %s | FileCheck %s
+; RUN: llc -march=mipsel -mattr=+msa,+fp64 -verify-machineinstrs < %s | FileCheck %s
 
 define i32 @msa_ir_cfcmsa_test() nounwind {
 entry: