nhaehnle added inline comments. ================ Comment at: lib/Target/AMDGPU/SIInsertWaits.cpp:626-627 + + if (I->getOpcode() == AMDGPU::S_ENDPGM) + EndPgmBlocks.push_back(&MBB); } ---------------- Please also handle the SI_RETURN case here and below. https://reviews.llvm.org/D25551