diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp --- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp @@ -4261,6 +4261,13 @@ MI.eraseFromParent(); return BB; } + case AMDGPU::V_ADDC_U32_e32: + case AMDGPU::V_SUBB_U32_e32: + case AMDGPU::V_SUBBREV_U32_e32: + // These instructions have an implicit use of vcc which counts towards the + // constant bus limit. + TII->legalizeOperands(MI); + return BB; case AMDGPU::DS_GWS_INIT: case AMDGPU::DS_GWS_SEMA_BR: case AMDGPU::DS_GWS_BARRIER: diff --git a/llvm/lib/Target/AMDGPU/VOP2Instructions.td b/llvm/lib/Target/AMDGPU/VOP2Instructions.td --- a/llvm/lib/Target/AMDGPU/VOP2Instructions.td +++ b/llvm/lib/Target/AMDGPU/VOP2Instructions.td @@ -188,7 +188,7 @@ let Uses = !if(useSGPRInput, [VCC, EXEC], [EXEC]), Defs = [VCC] in { def _e32 : VOP2_Pseudo .ret>, Commutable_REV { - let usesCustomInserter = !eq(P.NumSrcArgs, 2); + let usesCustomInserter = true; } foreach _ = BoolToList.ret in