This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add opt-pipeline test for NewPM.
Needs RevisionPublic

Authored by pravinjagtap on Jun 21 2023, 11:45 PM.

Details

Diff Detail

Event Timeline

pravinjagtap created this revision.Jun 21 2023, 11:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2023, 11:45 PM
pravinjagtap requested review of this revision.Jun 21 2023, 11:45 PM
Herald added a project: Restricted Project. · View Herald Transcript
pravinjagtap edited reviewers, added: Restricted Project, foad, arsenm, b-sumner, cdevadas, rampitec, sameerds, nhaehnle, Pierre-vh; removed: jdoerfert.Jun 21 2023, 11:48 PM
foad added a subscriber: aeubanks.

@aeubanks I think you previously suggested adding an AMDGPU RUN line to llvm/test/Other/new-pm-defaults.ll instead of doing this?

@aeubanks I think you previously suggested adding an AMDGPU RUN line to llvm/test/Other/new-pm-defaults.ll instead of doing this?

I'm somewhat against covering all targets in a single test like this. I think it just makes it more difficult to maintain. e.g. I hate touching tests like clang/test/Preprocessor/predefined-arch-macros.c, there's no real value shared by the common dummy code and now you have to sort out which run line failed

arsenm added inline comments.Jun 22 2023, 3:25 AM
llvm/test/CodeGen/AMDGPU/opt-pipeline-newpm.ll
531

The generic test does have a loop, is that relevant to testing loop passes?

chaged test to have loop

nikic added a subscriber: nikic.Jun 22 2023, 5:40 AM

Please at least put this in llvm/test/Other next to the other pipeline tests. These tests are incredibly annoying, so lets at least avoid spreading them out across different places, if we really, really do need to have target-specific variants of them.

do we really need to test every pass when it's almost identical to the existing tests? can we just test that the specific passes that AMDGPU adds are in the pipeline?

do we really need to test every pass when it's almost identical to the existing tests? can we just test that the specific passes that AMDGPU adds are in the pipeline?

I think, then, we will not be able to capture changes required in pipeline when someone updates AMDGPU Pass which depends on non-target specific pass. For example, in D153349, the AMDGPUAtomicOptimizer uses dom-tree but updating the dom-tree in the pass and preserving the analysis did not ask for updating the any of the pipeline tests.

do we really need to test every pass when it's almost identical to the existing tests? can we just test that the specific passes that AMDGPU adds are in the pipeline?

I think, then, we will not be able to capture changes required in pipeline when someone updates AMDGPU Pass which depends on non-target specific pass. For example, in D153349, the AMDGPUAtomicOptimizer uses dom-tree but updating the dom-tree in the pass and preserving the analysis did not ask for updating the any of the pipeline tests.

Unfortunately, NewPM pipeline tests will not help you find missing pass invalidations, because it depends on on the specific IR and whether the pass ended up changing something or not. The pipeline tests are generally designed to avoid any invalidations (that are not part of the pass pipeline itself).

I don't think there is any good way to find NewPM invalidation issues right now, apart from directly tracking compile-time.

you could check Invalidating analysis: DominatorTree with some IR that previously invalidated dom-tree and now doesn't for your pass, but as nikic said, ultimately that's for compile time reasons and you should have a AMDGPU compile time tracker

arsenm added a comment.Jul 7 2023, 3:54 AM

ping, we at least need testing of the extension points

checking that the AMDGPU-specific passes are in the pipeline is fine, but I don't want this test to duplicate testing the rest of the pipeline

arsenm requested changes to this revision.Aug 17 2023, 3:16 PM

merge with other test I suppose

This revision now requires changes to proceed.Aug 17 2023, 3:16 PM