[AMDGPU] Speedup GCNDownwardRPTracker::advanceBeforeNext
authorValery Pykhtin <valery.pykhtin@gmail.com>
Tue, 28 Feb 2023 18:00:48 +0000 (19:00 +0100)
committerValery Pykhtin <valery.pykhtin@gmail.com>
Thu, 9 Mar 2023 14:18:02 +0000 (15:18 +0100)
commit8f6c47b7a42cedffc1f2ec7d391385a34d1d5569
tree21f72970e109346d4577f0fcc4e8b4e68dbd84ba
parent460c2eaa4ad5dd2b19339d65affa25b00782dcb0
[AMDGPU] Speedup GCNDownwardRPTracker::advanceBeforeNext

The function makes liveness tests for the entire live register set for every instruction it passes by.
This becomes very slow on high RP regions such as ASAN enabled code.

Instead only uses of last tracked instruction should be tested and this greatly improves compilation time.

This patch revealed few bugs in SIFormMemoryClauses and PreRARematStage::sinkTriviallyRematInsts which should
be fixed first.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D136267
llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
llvm/test/CodeGen/AMDGPU/scheduler-rp-calc-one-successor-two-predecessors-bug.ll [new file with mode: 0644]