This is an archive of the discontinued LLVM Phabricator instance.

Fix range-loop-analysis warning
ClosedPublic

Authored by keith on Jun 9 2021, 9:10 AM.

Details

Summary
llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8024:19: warning: loop variable 'VF' of type 'const llvm::ElementCount' creates a copy from type 'const llvm::ElementCount' [-Wrange-loop-analysis]
  for (const auto VF : VFCandidates) {
                  ^
llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8024:8: note: use reference type 'const llvm::ElementCount &' to prevent copying
  for (const auto VF : VFCandidates) {
       ^~~~~~~~~~~~~~~
                  &
1 warning generated.

Diff Detail

Event Timeline

keith created this revision.Jun 9 2021, 9:10 AM
keith requested review of this revision.Jun 9 2021, 9:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2021, 9:10 AM
sdesmalen accepted this revision.Jun 10 2021, 5:14 AM

Thanks for fixing, seems I previously missed the ref (&) and corresponding warning!

This revision is now accepted and ready to land.Jun 10 2021, 5:14 AM
This revision was landed with ongoing or failed builds.Jun 10 2021, 8:49 AM
This revision was automatically updated to reflect the committed changes.