Page MenuHomePhabricator

LoopVersioning: Use default LAA runtimeCheck, When input check not provided.
ClosedPublic

Authored by ashutosh.nema on Aug 9 2015, 10:44 PM.

Details

Reviewers
anemet
Summary

In this change enabled LoopVersioning utility to add runtime check
when input check is NULL. Earlier clients of loop versioning needs to
always pass runtime check. Now made this optional.
If user does not provide runtime check, LoopVersioning will use default
LoopAccessAnalysis runtime check.

Diff Detail

Repository
rL LLVM

Event Timeline

ashutosh.nema retitled this revision from to LoopVersioning: Use default LAA runtimeCheck, When input check not provided..
ashutosh.nema updated this object.
ashutosh.nema added a reviewer: anemet.
ashutosh.nema set the repository for this revision to rL LLVM.
ashutosh.nema added a subscriber: llvm-commits.
anemet added inline comments.Aug 10 2015, 4:40 PM
include/llvm/Transforms/Utils/LoopVersioning.h
33–44

How about adding another constructor that does not take Checks instead? Then you should be able to initialize Checks with LAI.getRuntimePointerChecking()->getChecks().

I like the fact that LoopVersioning owns the checks. That keeps things simple.

Sure Adam, will update it.

Thanks,
Ashutosh

Incorporated comments from Adam.

anemet added inline comments.Aug 11 2015, 9:53 AM
lib/Transforms/Utils/LoopVersioning.cpp
34–40

Can't we initialize Checks in the constructor initializer list, i.e. Checks(LAI.getRuntimePointerChecking()->getChecks())?

Is the reason that getChecks return SmallVectorImpl rather than SmallVector<.., 4> ?

If yes then I think we should probably change getChecks to return SmallVector rather than SmallVectorImpl.

What do you think?

ashutosh.nema marked an inline comment as done.Aug 11 2015, 7:56 PM
ashutosh.nema added inline comments.
lib/Transforms/Utils/LoopVersioning.cpp
34–40

Yes, that's the reason that getChecks return SmallVectorImpl rather than SmallVector<.., 4> ?

Will modify getChecks to return SmallVector rather than SmallVectorImpl.

Thanks,
Ashutosh

Incorporated comments from Adam.

anemet added inline comments.Aug 11 2015, 9:16 PM
lib/Transforms/Utils/LoopVersioning.cpp
25–30

Please don't change the order of the member variables. It was nice how the required analyses were grouped all together.

I understand that you can't use LAI, the member, before you initialize it but you should be able to fix that by naming the parameter to the constructor differently, e.g., LAInfo or something and then use LAInfo when calling getChecks().

Incorporated comments from Adam.

anemet accepted this revision.Aug 11 2015, 10:05 PM
anemet edited edge metadata.

LGTM, thanks for fixing this.

This revision is now accepted and ready to land.Aug 11 2015, 10:05 PM

Thanks Adam.

I don’t have check in access, if possible can you please check in this change.

Regards,
Ashutosh