-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AIEX] Bail out from waw rewriter for spilled register #361
Conversation
@@ -33,6 +33,7 @@ | |||
#include "llvm/CodeGen/TargetSubtargetInfo.h" | |||
#include "llvm/MC/MCRegister.h" | |||
#include "llvm/Support/Debug.h" | |||
#include "llvm/Support/ErrorHandling.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this include necessary?
801220a
to
498f52c
Compare
# | ||
# (c) Copyright 2025 Advanced Micro Devices, Inc. or its affiliates | ||
|
||
# Workaround WAW register renaming pass for llvm bug #48911. We must not crash here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Add a comment which register is now skipped due to being a spill register
81a5d18
to
486a896
Compare
LGTM |
@@ -253,7 +253,12 @@ bool AIEWawRegRewriter::renameMBBPhysRegs(const MachineBasicBlock *MBB) { | |||
// WAW dependency resolution | |||
if (LastVRegDef[Reg] != &MI) | |||
continue; | |||
|
|||
// See llvm bug #48911. | |||
// Skip reassign if a register has originated from such split. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would appreciate a brief inline explanation of 'such split' if possible/feasible.
486a896
to
65c2416
Compare
// FIXME: Remove the workaround when bug #48911 is fixed. | ||
if (VRM->getPreSplitReg(Reg)) { | ||
continue; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we shouldn't abort altogether? It seems dangerous to do further manipulations to the LiveRegMatrix if isn't up to date. Or is this really safe to just skip this register, but continue with the other ones?
There is an upstream bug which stop us from unassigning the spilled register after greedy. So we bail out for such cases from aie-waw-rewriter pass.
llvm/llvm-project#48255