This is an archive of the discontinued LLVM Phabricator instance.

[LAA] Move CheckingPtrGroup/PointerCheck outside class (NFC).
ClosedPublic

Authored by fhahn on Apr 19 2020, 12:24 PM.

Details

Summary

This allows forward declarations of PointerCheck, which in turn reduce
the number of times LoopAccessAnalysis needs to be included.

Ultimately this helps with moving runtime check generation to
Transforms/Utils/LoopUtils.h, without having to include it there.

Diff Detail

Event Timeline

fhahn created this revision.Apr 19 2020, 12:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2020, 12:24 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
Ayal added a comment.Apr 26 2020, 1:53 PM

Given that CheckingPtrGroup and PointerCheck are taken out of RuntimePointerChecking to become externally visible, would it make sense to rename them RuntimeCheckingPtrGroup and RuntimePointerCheck?

llvm/include/llvm/Analysis/LoopAccessAnalysis.h
416

The const's are not dropped, but the comment is?

fhahn updated this revision to Diff 260380.Apr 27 2020, 10:54 AM
fhahn marked an inline comment as done.

Given that CheckingPtrGroup and PointerCheck are taken out of RuntimePointerChecking to become externally visible, would it make sense to rename them RuntimeCheckingPtrGroup and RuntimePointerCheck?

Thanks Ayal, I renamed it.

llvm/include/llvm/Analysis/LoopAccessAnalysis.h
416

Unfortunately I am not really sure if there's a benefit from dropping the const, unless there is a need to have them non-const.

I did not spot any const_casts or similar related to that pair and thought we can just drop the FIXME all together. If there's a benefit for them to not be const I am missing, I'll drop it.

Ayal added inline comments.Apr 27 2020, 3:41 PM
llvm/include/llvm/Analysis/LoopAccessAnalysis.h
330

Ah, suggested this struct be renamed RuntimeCheckingPtrGroup instead of RuntimePointerChecking::CheckingPtrGroup, rather than RuntimePointerCheck,

358

and this typedef be renamed RuntimePointerCheck instead of RuntimePointerChecking::PointerCheck, rather than only PointerCheck.

416

Not sure either; the "since checks are generated from CheckingPtrGroups in LAI::addRuntimeChecks which is a const member function" - still holds. This traces back to D11205; @anemet - do you recall this FIXME and/or agree it is now obsolete?

fhahn updated this revision to Diff 260619.Apr 28 2020, 6:38 AM

Update renaming, PointerCheck -> RuntimePointerCheck, CheckingPtrGroup -> RuntimeCheckingPtrGroup.

fhahn marked 2 inline comments as done.Apr 28 2020, 6:39 AM
fhahn added inline comments.
llvm/include/llvm/Analysis/LoopAccessAnalysis.h
358

Ah, I didn't read your comment carefully enough it seems, sorry about that. Updated the names as suggested.

Ayal accepted this revision.Apr 28 2020, 7:33 AM
Ayal added inline comments.
llvm/lib/Transforms/Utils/LoopVersioning.cpp
48

Unrelated, while we're here: better use SmallVectorImpl or ArrayRef instead of returning, constructing and moving SmallVector<4>'s?

This revision is now accepted and ready to land.Apr 28 2020, 7:33 AM
anemet added inline comments.Apr 28 2020, 9:22 AM
llvm/include/llvm/Analysis/LoopAccessAnalysis.h
416

Yes, that looks like a stale comment now, please kill it.

This revision was automatically updated to reflect the committed changes.
fhahn marked an inline comment as done.Apr 28 2020, 2:07 PM

Thanks Ayal & Adam!

llvm/lib/Transforms/Utils/LoopVersioning.cpp
48

Will do in a follow up, thanks!

fhahn marked an inline comment as done.Apr 30 2020, 2:37 PM
fhahn added inline comments.
llvm/lib/Transforms/Utils/LoopVersioning.cpp
48

pushed fix in 19ab53f1e2c3