[llvm] [AMDGPU] Fix GFX1250 hazard: S_SET_VGPR_MSB dropped (PR #184904)
Yaxun Liu via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 7 10:01:08 PST 2026
yxsamliu wrote:
> I certainly do not like it in its current form. It is spaghetti code predicting what will come next. It is a layer violation. It is a downstream merge disaster. Either move mitigation into the VGPR lowering itself (easy), or change pass ordering and prove nothing will break (hard).
Rebased to Jay's PR (https://github.com/llvm/llvm-project/pull/184987).
Removed most of code for predicting MSB. Now it is mush simpler. Just find consecutive setreg and set msb insts and insert nop.
My understanding is that this patch is handling the hazard due to normal mode setting inst with size > 12 (case 2). In this case we cannot piggyback the imm since those bits are part of mode which we cannot change. So in this case, due to the first hardware bug that part of mode bits leaks into VGPR MSB and the second hardware bug that the subsequent set msb inst not working, we have to insert nop to workaround these two hardware bugs. After these two hardware bugs fixed, we can remove this workaround.
https://github.com/llvm/llvm-project/pull/184904
More information about the llvm-commits
mailing list