[PATCH] D136169: [AMDGPU] Avoid SCC clobbering before S_CSELECT_B32
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 22 00:06:02 PDT 2022
rampitec added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp:2219
+ while (I != MBB->end()) {
+ if ((*I != MI && I->readsRegister(AMDGPU::SCC)) ||
+ (++Depth == getSCCLivenessScanMaxLength())) {
----------------
I think you need to skip debug instructions without counting so that debug build does not differ from release.
================
Comment at: llvm/lib/Target/AMDGPU/SIRegisterInfo.h:96
+ unsigned getSCCLivenessScanMaxLength() const {
+ return 100;
+ }
----------------
100 seems to large number to me. Compiling with spills is already sufficiently and painfully slow. I would not go more than 10 here. In a worst case you are now burning just 2 instructions and probably 8 cycles.
Besides I do not think it deserves a special function, just a constant threshold right inside the code. Just because it is only used once.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136169/new/
https://reviews.llvm.org/D136169
More information about the llvm-commits
mailing list