From 785d1f76449b050fe4b0bd0788cf4b6f35c98281 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Mon, 22 Apr 2019 14:54:39 +0000 Subject: [PATCH] AMDGPU: Fix not checking for copy when looking at copy src Effectively reverts r356956. The check for isFullCopy was excessive, but there still needs to be a check that this is a copy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358890 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp b/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp index 7e843e83780..c8a146741ec 100644 --- a/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp +++ b/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp @@ -88,7 +88,12 @@ static bool isEndCF(const MachineInstr& MI, const SIRegisterInfo* TRI) { } static bool isFullExecCopy(const MachineInstr& MI) { - return MI.getOperand(1).getReg() == AMDGPU::EXEC; + if (MI.isCopy() && MI.getOperand(1).getReg() == AMDGPU::EXEC) { + assert(MI.isFullCopy()); + return true; + } + + return false; } static unsigned getOrNonExecReg(const MachineInstr &MI, -- 2.50.1