[PATCH] D22023: AMDGPU: Cleanup. Use definesRegister instead of manual loop

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 5 16:05:36 PDT 2016


arsenm created this revision.
arsenm added a reviewer: tstellarAMD.
arsenm added a subscriber: llvm-commits.
Herald added subscribers: kzhuravl, arsenm.

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

http://reviews.llvm.org/D22023

Files:
  lib/Target/AMDGPU/SILowerControlFlow.cpp

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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22023.62798.patch
Type: text/x-patch
Size: 611 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160705/314195d9/attachment.bin>


More information about the llvm-commits mailing list