This is an archive of the discontinued LLVM Phabricator instance.

[LoopVectorize] Convert scalable vectorization optimization remark to LLVM_DEBUG
AbandonedPublic

Authored by MaskRay on Aug 12 2021, 3:35 PM.

Details

Summary

After D98509,
clang --target=x86_64-linux-gnu -O2 -Rpass-analysis=loop-analysis may emit the remark,

a.cc:6:3: remark: Disabling scalable vectorization, because target does not support scalable vectors. [-Rpass-analysis]
  for (int i = 0; i < 128; i++)
  ^
a.cc:6:3: remark: vectorized loop (vectorization width: 4, interleaved count: 2) [-Rpass=loop-vectorize]

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

Diff Detail

Event Timeline

MaskRay created this revision.Aug 12 2021, 3:35 PM
MaskRay requested review of this revision.Aug 12 2021, 3:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2021, 3:35 PM
MaskRay edited the summary of this revision. (Show Details)Aug 12 2021, 3:43 PM
c-rhodes accepted this revision.Aug 13 2021, 12:15 AM
This revision is now accepted and ready to land.Aug 13 2021, 12:15 AM
fhahn added a comment.Aug 13 2021, 1:20 AM

Alternatively we could issue a positive remark when scalable vectorization is enabled?

As a counter can I offer D108028 as I'd prefer to maintain a remark for the situation where a user has specifically requested scalable vectorisation via a hint. The patch also fixes what looks like a bug in the expected output for one of the tests.

MaskRay abandoned this revision.Aug 13 2021, 9:24 AM