File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -3192,16 +3192,24 @@ bool SIInstrInfo::verifyInstruction(const MachineInstr &MI,
3192
3192
}
3193
3193
3194
3194
if (isSOPK (MI)) {
3195
- int64_t Imm = getNamedOperand (MI, AMDGPU::OpName::simm16)-> getImm ( );
3196
- if (sopkIsZext (MI )) {
3197
- if (!isUInt< 16 >(Imm )) {
3198
- ErrInfo = " invalid immediate for SOPK instruction" ;
3195
+ auto Op = getNamedOperand (MI, AMDGPU::OpName::simm16);
3196
+ if (Desc. isBranch ( )) {
3197
+ if (!Op-> isMBB ( )) {
3198
+ ErrInfo = " invalid branch target for SOPK instruction" ;
3199
3199
return false ;
3200
3200
}
3201
3201
} else {
3202
- if (!isInt<16 >(Imm)) {
3203
- ErrInfo = " invalid immediate for SOPK instruction" ;
3204
- return false ;
3202
+ uint64_t Imm = Op->getImm ();
3203
+ if (sopkIsZext (MI)) {
3204
+ if (!isUInt<16 >(Imm)) {
3205
+ ErrInfo = " invalid immediate for SOPK instruction" ;
3206
+ return false ;
3207
+ }
3208
+ } else {
3209
+ if (!isInt<16 >(Imm)) {
3210
+ ErrInfo = " invalid immediate for SOPK instruction" ;
3211
+ return false ;
3212
+ }
3205
3213
}
3206
3214
}
3207
3215
}
You can’t perform that action at this time.
0 commit comments