]> granicus.if.org Git - llvm/commitdiff
AMDGPU: Fix not checking for copy when looking at copy src
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 22 Apr 2019 14:54:39 +0000 (14:54 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 22 Apr 2019 14:54:39 +0000 (14:54 +0000)
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

index 7e843e83780b9de4b855f7e65cb9f7ce4a0aa524..c8a146741ec57b2f35e84de277a14f7b64abe488 100644 (file)
@@ -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,