[llvm] 7e95a56 - Remove scalable vector assert from InnerLoopVectorizer::setDebugLocFromInst

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Wed May 19 05:33:56 PDT 2021


Author: David Sherwood
Date: 2021-05-19T13:33:10+01:00
New Revision: 7e95a563c89dc158217e2032b716e5be77677846

URL: https://github.com/llvm/llvm-project/commit/7e95a563c89dc158217e2032b716e5be77677846
DIFF: https://github.com/llvm/llvm-project/commit/7e95a563c89dc158217e2032b716e5be77677846.diff

LOG: Remove scalable vector assert from InnerLoopVectorizer::setDebugLocFromInst

In InnerLoopVectorizer::setDebugLocFromInst we were previously
asserting that the VF is not scalable. This is because we want to
use the number of elements to create a duplication factor for the
debug profiling data. However, for scalable vectors we only know the
minimum number of elements. I've simply removed the assert for now
and added a FIXME saying that we assume vscale is always 1. When
vscale is not 1 it just means that the profiling data isn't as
accurate, but shouldn't cause any functional problems.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index a4edca3008de..d5f71c7496c6 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -1052,7 +1052,7 @@ void InnerLoopVectorizer::setDebugLocFromInst(IRBuilder<> &B, const Value *Ptr)
     // factors to the discriminators.
     if (DIL && Inst->getFunction()->isDebugInfoForProfiling() &&
         !isa<DbgInfoIntrinsic>(Inst) && !EnableFSDiscriminator) {
-      assert(!VF.isScalable() && "scalable vectors not yet supported.");
+      // FIXME: For scalable vectors, assume vscale=1.
       auto NewDIL =
           DIL->cloneByMultiplyingDuplicationFactor(UF * VF.getKnownMinValue());
       if (NewDIL)


        


More information about the llvm-commits mailing list