This is an archive of the discontinued LLVM Phabricator instance.

[llvm-mca][RISCV] Fix checking if data valid in createInstrument
ClosedPublic

Authored by michaelmaitland on Apr 24 2023, 7:57 AM.

Details

Summary

Fixes createInstrument to return instrument when LMUL data is valid, and
return nullptr when LMUL data is not valid for RISCV target.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2023, 7:57 AM
michaelmaitland requested review of this revision.Apr 24 2023, 7:57 AM
myhsu accepted this revision.Apr 24 2023, 9:04 AM

LGTM
Though I'm a little surprised it doesn't print a warning or even error for invalid instruments. Is there any reason behind this?

This revision is now accepted and ready to land.Apr 24 2023, 9:04 AM
myhsu added a comment.Apr 24 2023, 9:10 AM

Also I'm curious if there is any need to update existing LMUL tests as the instrument didn't even kick in previously? It will be great if you can add a test that checks against invalid LMUL instruments as well.

Though I'm a little surprised it doesn't print a warning or even error for invalid instruments. Is there any reason behind this?

Debug warning is printed on line 85 of RISCVCustomBehaviour.cpp. We print an actual error and exit from MCA here

Though I'm a little surprised it doesn't print a warning or even error for invalid instruments. Is there any reason behind this?

Debug warning is printed on line 85 of RISCVCustomBehaviour.cpp. We print an actual error and exit from MCA here

It would be better if all this custom behaviour logic was properly tested. If I remember it correctly, the plan was to contribute a generic scheduling model as a follow-up to test all of this. Is that still a plan?

Though I'm a little surprised it doesn't print a warning or even error for invalid instruments. Is there any reason behind this?

Debug warning is printed on line 85 of RISCVCustomBehaviour.cpp. We print an actual error and exit from MCA here

It would be better if all this custom behaviour logic was properly tested. If I remember it correctly, the plan was to contribute a generic scheduling model as a follow-up to test all of this. Is that still a plan?

It's not clear how to define a "generic" scheduling model. An in order CPU and an out of order CPU might have very different implementations for the RISC-V vector extension. Creating "generic" scheduler starts becoming equivalent to architecting a CPU.

We're hoping to upstream a scheduler based on a real hardware implementation soon.

andreadb accepted this revision.Apr 25 2023, 7:38 PM

Though I'm a little surprised it doesn't print a warning or even error for invalid instruments. Is there any reason behind this?

Debug warning is printed on line 85 of RISCVCustomBehaviour.cpp. We print an actual error and exit from MCA here

It would be better if all this custom behaviour logic was properly tested. If I remember it correctly, the plan was to contribute a generic scheduling model as a follow-up to test all of this. Is that still a plan?

It's not clear how to define a "generic" scheduling model. An in order CPU and an out of order CPU might have very different implementations for the RISC-V vector extension. Creating "generic" scheduler starts becoming equivalent to architecting a CPU.

We're hoping to upstream a scheduler based on a real hardware implementation soon.

Sounds good. Thanks for the info.