This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][Scheduler] Avoid initializing Register pressure tracker when tracking is disabled
ClosedPublic

Authored by gandhi21299 on Jul 7 2022, 12:53 PM.

Details

Summary

When register pressure tracking is disabled, the scheduler attempts to load
pressures at SReg_32 and VGPR_32. This causes an index out of bounds error.
This patch fixes this issue by inserting checks for RPTracking when pressure values
are loaded and candidates are initialized. NFC

Diff Detail

Event Timeline

gandhi21299 created this revision.Jul 7 2022, 12:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2022, 12:53 PM
gandhi21299 requested review of this revision.Jul 7 2022, 12:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2022, 12:53 PM
gandhi21299 added a subscriber: Restricted Project.

Needs test.

Can we not rename initCandidate since it is mimicking GenericScheduler::initCandidate?

  • reverted the function name back to initCandidate
  • added testing for the option -misched-regpressure=false

Why did extractelement.ll change? It wasn't suppose to happen.

@rampitec Agreed, I have been examining the code around the changes I have made. I am not sure why that test was affected.

  • Use DAG to check if RPTracking is enabled.
  • Eliminate diffs in extract-element.ll as this patch should not have altered that test.
  • Use DAG to check if RPTracking is enabled.
  • Eliminate diffs in extract-element.ll as this patch should not have altered that test.

What exactly was the problem with extract-element.ll?

@rampitec I was loading the pressure values at every candidate. initCandidate clears the values in Pressure so the array becomes empty for the next iteration.

rampitec accepted this revision.Jul 28 2022, 1:00 PM
This revision is now accepted and ready to land.Jul 28 2022, 1:00 PM
gandhi21299 edited the summary of this revision. (Show Details)Jul 28 2022, 1:26 PM
This revision was landed with ongoing or failed builds.Jul 28 2022, 2:40 PM
This revision was automatically updated to reflect the committed changes.