Index: lib/Target/AMDGPU/SILowerControlFlow.cpp =================================================================== --- lib/Target/AMDGPU/SILowerControlFlow.cpp +++ lib/Target/AMDGPU/SILowerControlFlow.cpp @@ -660,12 +660,8 @@ if (TII->isFLAT(MI)) NeedFlat = true; - for (const auto &Def : I->defs()) { - if (Def.isReg() && Def.isDef() && Def.getReg() == AMDGPU::EXEC) { - ExecModified = true; - break; - } - } + if (I->definesRegister(AMDGPU::EXEC, TRI)) + ExecModified = true; switch (MI.getOpcode()) { default: break;