From ee17bf3fd4189d1981a6e908b4519e600ec7b002 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 25 Jul 2014 23:02:42 +0000 Subject: [PATCH] R600/SI: Allow partial unrolling and increase thresholds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213985 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/R600/AMDGPUTargetTransformInfo.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Target/R600/AMDGPUTargetTransformInfo.cpp b/lib/Target/R600/AMDGPUTargetTransformInfo.cpp index 88934b65876..96b5a1f8684 100644 --- a/lib/Target/R600/AMDGPUTargetTransformInfo.cpp +++ b/lib/Target/R600/AMDGPUTargetTransformInfo.cpp @@ -101,6 +101,12 @@ bool AMDGPUTTI::hasBranchDivergence() const { return true; } void AMDGPUTTI::getUnrollingPreferences(Loop *L, UnrollingPreferences &UP) const { + UP.Threshold = 300; // Twice the default. + UP.Count = UINT_MAX; + UP.Partial = true; + + // TODO: Do we want runtime unrolling? + for (const BasicBlock *BB : L->getBlocks()) { for (const Instruction &I : *BB) { const GetElementPtrInst *GEP = dyn_cast(&I); @@ -120,7 +126,7 @@ void AMDGPUTTI::getUnrollingPreferences(Loop *L, // // Don't use the maximum allowed value here as it will make some // programs way too big. - UP.Threshold = 500; + UP.Threshold = 800; } } }