[PATCH] D84873: AMDGPU: In determining load clobbering in AnnotateUniform, don't scan if there are too many blocks.
Changpeng Fang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 30 14:51:35 PDT 2020
cfang updated this revision to Diff 282054.
cfang added a comment.
Rebase after https://reviews.llvm.org/D84890
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84873/new/
https://reviews.llvm.org/D84873
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
@@ -21,6 +21,7 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstVisitor.h"
#include "llvm/InitializePasses.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
@@ -28,6 +29,10 @@
using namespace llvm;
+static cl::opt<size_t> BasicBlockScanLimit("amdgpu-annotate-uniform-bb-limit",
+ cl::Hidden, cl::init(2500),
+ cl::desc("Max num BBs to scan in uniform annotation"));
+
namespace {
class AMDGPUAnnotateUniformValues : public FunctionPass,
@@ -105,6 +110,11 @@
}
DFS(Start, Checklist);
+
+ // To impove compilation, don't scan if there are too many BBS.
+ if (Checklist.size() > BasicBlockScanLimit)
+ return true;
+
for (auto &BB : Checklist) {
BasicBlock::iterator StartIt = (!L && (BB == Load->getParent())) ?
BasicBlock::iterator(Load) : BB->end();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84873.282054.patch
Type: text/x-patch
Size: 1149 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200730/29683815/attachment.bin>
More information about the llvm-commits
mailing list