This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][MachineScheduler] Set no side effect for movprfx
ClosedPublic

Authored by Allen on Dec 26 2022, 7:17 PM.

Details

Summary

The movprfx is a vector copy, so it doesn't access memory. Set the
value of hasSideEffects 0 to avoid return true for the hasUnmodeledSideEffects(),
which will block the machine scheduler which load/store instructions.

Diff Detail

Event Timeline

Allen created this revision.Dec 26 2022, 7:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 26 2022, 7:17 PM
Allen requested review of this revision.Dec 26 2022, 7:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 26 2022, 7:17 PM
Allen updated this revision to Diff 485342.Dec 26 2022, 8:49 PM

update testcase

Patch looks good to me but it looks like we're missing this information for all SVE instructions. Not sure if it used to default to 0 and we missed the switch to ? but the information is missing regardless. @Allen Is this something you plan to follow up on? or should I add it to my list?

llvm/test/CodeGen/AArch64/sched-movprfx.ll
11–12

Not sure you need this test given the llvm-mca explicitly emits this bit and based on my general comment do we really want tests like this for every instruction?

paulwalker-arm accepted this revision.Dec 27 2022, 2:16 AM
This revision is now accepted and ready to land.Dec 27 2022, 2:16 AM
Allen marked an inline comment as done.Dec 27 2022, 4:44 AM

Patch looks good to me but it looks like we're missing this information for all SVE instructions. Not sure if it used to default to 0 and we missed the switch to ? but the information is missing regardless. @Allen Is this something you plan to follow up on? or should I add it to my list?

Thanks, If you have time to complete, I am very welcome, I am not skilled in the function of instructions, need to query documents one by one, so it may be too slow to finish that.

llvm/test/CodeGen/AArch64/sched-movprfx.ll
11–12

Thanks, I think this case can be saved as demo for the improvement of schedule.
Yes, it is not needed for every instruction in the following batch modifying.

Matt added a subscriber: Matt.Dec 27 2022, 8:14 AM
This revision was landed with ongoing or failed builds.Dec 27 2022, 9:20 AM
This revision was automatically updated to reflect the committed changes.
Allen marked an inline comment as done.
dewen added a subscriber: dewen.Jan 5 2023, 7:16 PM
dewen added inline comments.
llvm/test/tools/llvm-mca/AArch64/Neoverse/N2-sve-instructions.s
5039 ↗(On Diff #485385)

I think this place also needs to be corrected. I'm going to put up a patch to fix