[llvm] r274817 - AMDGPU: Cleanup. Use definesRegister instead of manual loop

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 17:55:40 PDT 2016


Author: arsenm
Date: Thu Jul  7 19:55:39 2016
New Revision: 274817

URL: http://llvm.org/viewvc/llvm-project?rev=274817&view=rev
Log:
AMDGPU: Cleanup. Use definesRegister instead of manual loop

Also this will be more precise since it will check
exec_lo/exec_hi writes.

Modified:
    llvm/trunk/lib/Target/AMDGPU/SILowerControlFlow.cpp

Modified: llvm/trunk/lib/Target/AMDGPU/SILowerControlFlow.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SILowerControlFlow.cpp?rev=274817&r1=274816&r2=274817&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SILowerControlFlow.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SILowerControlFlow.cpp Thu Jul  7 19:55:39 2016
@@ -642,12 +642,8 @@ bool SILowerControlFlow::runOnMachineFun
       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;




More information about the llvm-commits mailing list