RegInfo->Kind == VRegInfo::REGBANK)
return error("generic virtual registers must have a type");
}
+
+ if (Flags & RegState::Define) {
+ if (Flags & RegState::Kill)
+ return error("cannot have a killed def operand");
+ } else {
+ if (Flags & RegState::Dead)
+ return error("cannot have a dead use operand");
+ }
+
Dest = MachineOperand::CreateReg(
Reg, Flags & RegState::Define, Flags & RegState::Implicit,
Flags & RegState::Kill, Flags & RegState::Dead, Flags & RegState::Undef,
--- /dev/null
+# RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -run-pass=none %s -o /dev/null 2>&1 | FileCheck %s
+---
+name: foo
+tracksRegLiveness: true
+body: |
+ bb.0:
+
+ %0:sgpr_32 = S_MOV_B32 0
+ ; CHECK: [[@LINE+1]]:24: cannot have a dead use operand
+ S_ENDPGM 0, dead %0
+
+...
--- /dev/null
+# RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -run-pass=none %s -o /dev/null 2>&1 | FileCheck %s
+---
+name: foo
+tracksRegLiveness: true
+body: |
+ bb.0:
+
+ ; CHECK: [[@LINE+1]]:23: cannot have a killed def operand
+ killed %0:sgpr_32 = S_MOV_B32 0
+ S_ENDPGM 0
+
+...