llvm.org GIT mirror llvm / 99c7e3c
[AMDGPU] gfx1010 verifier changes Differential Revision: https://reviews.llvm.org/D61521 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360095 91177308-0d34-0410-b5e6-96231b3b80d8 Stanislav Mekhanoshin 1 year, 5 months ago
1 changed file(s) with 15 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
31913191 }
31923192
31933193 if (isSOPK(MI)) {
3194 int64_t Imm = getNamedOperand(MI, AMDGPU::OpName::simm16)->getImm();
3195 if (sopkIsZext(MI)) {
3196 if (!isUInt<16>(Imm)) {
3197 ErrInfo = "invalid immediate for SOPK instruction";
3194 auto Op = getNamedOperand(MI, AMDGPU::OpName::simm16);
3195 if (Desc.isBranch()) {
3196 if (!Op->isMBB()) {
3197 ErrInfo = "invalid branch target for SOPK instruction";
31983198 return false;
31993199 }
32003200 } else {
3201 if (!isInt<16>(Imm)) {
3202 ErrInfo = "invalid immediate for SOPK instruction";
3203 return false;
3201 uint64_t Imm = Op->getImm();
3202 if (sopkIsZext(MI)) {
3203 if (!isUInt<16>(Imm)) {
3204 ErrInfo = "invalid immediate for SOPK instruction";
3205 return false;
3206 }
3207 } else {
3208 if (!isInt<16>(Imm)) {
3209 ErrInfo = "invalid immediate for SOPK instruction";
3210 return false;
3211 }
32043212 }
32053213 }
32063214 }