[PATCH] D81433: AMDGPU: Restrict the number of instructions to scan for getPointerDependencyFrom

Changpeng Fang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 14:58:50 PDT 2020


cfang created this revision.
cfang added reviewers: arsen, rampitec.
Herald added subscribers: kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.

This is for getPointerDependencyFrom in  AMDGPUAnnotateUniformValues.
With the default scan limit of 100 instruction per block, we can reduce the compile time
of a special kernel from longer than 2 hours to 7 minutes.


https://reviews.llvm.org/D81433

Files:
  llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp


Index: llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp
@@ -105,11 +105,13 @@
   }
 
   DFS(Start, Checklist);
+  // Maximum number of instructions to search in a block (default 100).
+  auto Limit = MDR->getDefaultBlockScanLimit();
   for (auto &BB : Checklist) {
     BasicBlock::iterator StartIt = (!L && (BB == Load->getParent())) ?
       BasicBlock::iterator(Load) : BB->end();
     auto Q = MDR->getPointerDependencyFrom(MemoryLocation(Ptr), true,
-                                           StartIt, BB, Load);
+                                           StartIt, BB, Load, &Limit);
     if (Q.isClobber() || Q.isUnknown())
       return true;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81433.269362.patch
Type: text/x-patch
Size: 849 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200608/68c7abc1/attachment.bin>


More information about the llvm-commits mailing list