This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] SILowerControlFlow: fix preservation of LiveIntervals
ClosedPublic

Authored by critson on Aug 16 2023, 10:03 PM.

Details

Summary

In emitElse live interval for SI_ELSE source must be recalculated
as SI_ELSE is removed, and new user is placed at block start.
In emitIfBreak live interval for new created AndReg must be
computed.

Diff Detail

Event Timeline

critson created this revision.Aug 16 2023, 10:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 16 2023, 10:03 PM
critson requested review of this revision.Aug 16 2023, 10:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 16 2023, 10:03 PM
critson updated this revision to Diff 551411.Aug 18 2023, 12:34 AM
  • Defer recomputation of live intervals for existing register to after other lowering.
  • Add missing recomputation of some source registers which have moved instructions.
  • Add missing map insertion for initial exec = S_MOV -1.
  • Add missing map insertion for new branch instruction.
  • Remove splicing of entire fall through blocks, its impossible to preserve SlotIndexes if we do this.

Needs tests?

Needs tests?

Thanks for the reminder -- I am planning to rework some existing tests to cover this, but currently preoccupied so will be a few more days.

arsenm requested changes to this revision.Aug 24 2023, 8:00 AM
This revision now requires changes to proceed.Aug 24 2023, 8:00 AM
critson updated this revision to Diff 556359.Sep 10 2023, 12:45 AM
  • Rebase
  • Add MIR tests based on reduced shader failures
  • Fix issue redundant MBB removal and update collapse-endcf.mir
arsenm accepted this revision.Sep 10 2023, 12:57 AM
arsenm added inline comments.
llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp
835–840

This doesn't sound right but I guess it will be cleaned up later anyway

This revision is now accepted and ready to land.Sep 10 2023, 12:57 AM