This is an archive of the discontinued LLVM Phabricator instance.

[flang] Reduced CHECKs for transpose_opt.f90
ClosedPublic

Authored by vzakhari on Jul 21 2022, 1:19 PM.

Details

Summary

This commit addresses concerns raised in D129497.

Diff Detail

Event Timeline

vzakhari created this revision.Jul 21 2022, 1:19 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 21 2022, 1:19 PM
vzakhari requested review of this revision.Jul 21 2022, 1:19 PM
Leporacanthicus accepted this revision.Jul 22 2022, 8:20 AM

That's more like it. I personally would rename VAL_nn to something meaningful, but I understand why others don't... ;)

This revision is now accepted and ready to land.Jul 22 2022, 8:20 AM

That's more like it. I personally would rename VAL_nn to something meaningful, but I understand why others don't... ;)

Thanks for the review!

This revision was automatically updated to reflect the committed changes.

Thanks, looks much better! Could you introduce some more descriptive names for LIT variables?

flang/test/Lower/Intrinsics/transpose_opt.f90
24

You may prefer something like:

! CHECK-DAG: <first check>
! CHECK-NOT: @_FortranATranspose
! CHECK-DAG: <last check>

Otherwise, this will only verify that there's no @_FortranATranspose after the final CHECK. More on this idiom here.

Argh, Mats beat me to it :) Consider my comments as "nits" (feel free to ignore)

Thanks, looks much better! Could you introduce some more descriptive names for LIT variables?

I could, but I really do not want to spend time on this :) I think this is why we have the script for generating the checks - to save us some time :)

vzakhari added inline comments.Jul 22 2022, 10:03 AM
flang/test/Lower/Intrinsics/transpose_opt.f90
24

Ah, good catch! I will fix it.

I am going to be unavailable for a week, so I am not sure if I will be able to merge it, but I will upload it for review today.

vzakhari added inline comments.Jul 22 2022, 10:09 AM
flang/test/Lower/Intrinsics/transpose_opt.f90
24

Actually, I think it should be okay, since there will be @_FortranATranspose declaration in case of a call to the runtime function. Since all declarations usually follow the user function, having CHECK-NOT: @_FortranATranspose after all the checks should be enough.

I think this is why we have the script for generating the checks - to save us some time :)

Well, that too (from the script):

The script is designed to make adding checks to a test case fast, it is *not* designed to be authoritative about what constitutes a good test!

More meaningful variable names make reviewing and triaging much easier. And can easily be introduce with sed (or alternatives available in your favorite editor). It really helps when tests are reduced like you did in this patch, too. Anyway, case closed!