This is an archive of the discontinued LLVM Phabricator instance.

[LoopVersion] Pass RuntimePointerChecking directly.
Needs ReviewPublic

Authored by fhahn on Jul 23 2020, 7:37 AM.

Details

Summary

This refactoring was suggested as follow up by @Ayal in D78460.

This requires changing the way some clients filter runtime checks.

Clients who want to filter out some runtime checks now have to create a
copy of RuntimePointerChecking and apply the filter to the runtime
checks. This seems reasonable to me, as it makes explicit that we
effectively create a subset of the pointer checking.

Passing RuntimePointerChecking also makes changes to addRuntimeChecks
easier, as RuntimePointerChecking should contain all information about
the checks.

Diff Detail

Event Timeline

fhahn created this revision.Jul 23 2020, 7:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 23 2020, 7:37 AM
fhahn updated this revision to Diff 292182.Sep 16 2020, 4:19 AM

rebase & ping

Meinersbur added inline comments.Dec 22 2020, 1:11 PM
llvm/include/llvm/Analysis/LoopAccessAnalysis.h
342

Did you consider documenting the RtCheck parameter?

llvm/include/llvm/Transforms/Utils/LoopUtils.h
444

\p PointerChecks: needs to be updated

llvm/include/llvm/Transforms/Utils/LoopVersioning.h
48

Did you consider documenting what the RtPTrCheck argument is used for?

llvm/lib/Analysis/LoopAccessAnalysis.cpp
467

Is this any different to llvm::erase_if(Checks, Predicate)? This also looks like a dangerous game of iterator invalidation by the assignment-operator.

llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
403

[style] Unnecessary auto. At least I would not have expected it to be a SmallVectorImpl.

525

[style] Unnecessary auto.

what is the status of this?