[PATCH] D108004: [LoopVectorize] Convert scalable vectorization optimization remark to LLVM_DEBUG

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 12 15:35:20 PDT 2021


MaskRay created this revision.
MaskRay added reviewers: c-rhodes, fhahn, sdesmalen.
Herald added subscribers: ctetreau, CarolineConcatto, pengfei, hiraditya, kristof.beyls.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

After D98509 <https://reviews.llvm.org/D98509>,
`clang --target=x86_64-linux-gnu -O2 -Rpass-analysis` may emit the remark, which
is inappropriate for targets which don't support scalable vectorization.
Arguably it is also inappropriate on AArch64 when SVE is disabled.

LLVM_DEBUG should be sufficient.
I simplify the remark and use the preferred style
https://llvm.org/docs/CodingStandards.html#error-and-warning-messages


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108004

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/AArch64/scalable-vf-hint.ll
  llvm/test/Transforms/LoopVectorize/scalable-vf-hint.ll


Index: llvm/test/Transforms/LoopVectorize/scalable-vf-hint.ll
===================================================================
--- llvm/test/Transforms/LoopVectorize/scalable-vf-hint.ll
+++ llvm/test/Transforms/LoopVectorize/scalable-vf-hint.ll
@@ -3,8 +3,7 @@
 
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
 
-; CHECK: LV: Disabling scalable vectorization, because target does not support scalable vectors.
-; CHECK: remark: <unknown>:0:0: Disabling scalable vectorization, because target does not support scalable vectors.
+; CHECK: LV: disable scalable vectorization which is unsupported
 ; CHECK: LV: The Widest register safe to use is: 32 bits.
 define void @test1(i32* %a, i32* %b) {
 entry:
Index: llvm/test/Transforms/LoopVectorize/AArch64/scalable-vf-hint.ll
===================================================================
--- llvm/test/Transforms/LoopVectorize/AArch64/scalable-vf-hint.ll
+++ llvm/test/Transforms/LoopVectorize/AArch64/scalable-vf-hint.ll
@@ -310,8 +310,7 @@
 !17 = !{!"llvm.loop.vectorize.scalable.enable", i1 true}
 
 ; CHECK-NO-SVE-REMARKS-LABEL: LV: Checking a loop in "test_no_sve"
-; CHECK-NO-SVE-REMARKS: LV: Disabling scalable vectorization, because target does not support scalable vectors.
-; CHECK-NO-SVE-REMARKS: remark: <unknown>:0:0: Disabling scalable vectorization, because target does not support scalable vectors.
+; CHECK-NO-SVE-REMARKS: LV: disable scalable vectorization which is unsupported
 ; CHECK-NO-SVE-REMARKS: LV: User VF=vscale x 4 is unsafe. Ignoring scalable UserVF.
 ; CHECK-NO-SVE-REMARKS: LV: Selecting VF: 4.
 ; CHECK-NO-SVE-LABEL: @test_no_sve
Index: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
===================================================================
--- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -5592,10 +5592,8 @@
 ElementCount
 LoopVectorizationCostModel::getMaxLegalScalableVF(unsigned MaxSafeElements) {
   if (!TTI.supportsScalableVectors() && !ForceTargetSupportsScalableVectors) {
-    reportVectorizationInfo(
-        "Disabling scalable vectorization, because target does not "
-        "support scalable vectors.",
-        "ScalableVectorsUnsupported", ORE, TheLoop);
+    LLVM_DEBUG(
+        dbgs() << "LV: disable scalable vectorization which is unsupported\n");
     return ElementCount::getScalable(0);
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108004.366134.patch
Type: text/x-patch
Size: 2500 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210812/c43fe7cc/attachment-0001.bin>


More information about the llvm-commits mailing list