-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[AMDGPU][MachineVerifier] test failures in SIFoldOperands #166600
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
[AMDGPU][MachineVerifier] test failures in SIFoldOperands #166600
Conversation
After PR:llvm#151421 merged following fails in SIFoldOperands showed up. LLVM :: CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.mfma.gfx90a.ll LLVM :: CodeGen/AMDGPU/llvm.amdgcn.mfma.gfx90a.ll LLVM :: CodeGen/AMDGPU/llvm.amdgcn.mfma.ll LLVM :: CodeGen/AMDGPU/mfma-loop.ll LLVM :: CodeGen/AMDGPU/rewrite-vgpr-mfma-to-agpr.ll In Folding code, if folded operand is register ensure earlyClobber is set.
|
@llvm/pr-subscribers-llvm-globalisel @llvm/pr-subscribers-backend-amdgpu Author: Abhay Kanhere (AbhayKanhere) ChangesAfter PR:#151421 merged following fails in SIFoldOperands showed up. LLVM :: CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.mfma.gfx90a.ll In Folding code, if folded operand is register ensure earlyClobber is set. Full diff: https://github.com/llvm/llvm-project/pull/166600.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
index 6616b30410590..cf9a6f021fd9b 100644
--- a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
@@ -689,6 +689,10 @@ bool SIFoldOperandsImpl::updateOperand(FoldCandidate &Fold) const {
if (!TII->isOperandLegal(*MI, OpNo, &New))
return false;
+ const MCInstrDesc &MCID = MI->getDesc();
+ if (MCID.getOperandConstraint(OpNo, MCOI::EARLY_CLOBBER) != -1) {
+ MI->getOperand(OpNo).setIsEarlyClobber(true);
+ }
Old.ChangeToImmediate(*ImmVal);
return true;
}
|
|
@arsenm please review. |
|
Looks like this can only be reproduced with expensive checkes. |
shiltian
left a comment
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.
The fix looks reasonable to me, but I'm not sure if we want to add a test case w/o need of expensive checks.
Co-authored-by: Shilei Tian <i@tianshilei.me>
Fixed tests - added -verify-machineinstrs so fails are visible sooner. This resolves all fails so far.
removed change in MachineVerifier
|
I would like to merge this ASAP once approved to unblock the fails in nightly runs. thanks! |
bcdef72 to
2047ef6
Compare
After PR:llvm#151421 merged following fails in SIFoldOperands showed up. LLVM :: CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.mfma.gfx90a.ll LLVM :: CodeGen/AMDGPU/llvm.amdgcn.mfma.gfx90a.ll LLVM :: CodeGen/AMDGPU/llvm.amdgcn.mfma.ll LLVM :: CodeGen/AMDGPU/mfma-loop.ll LLVM :: CodeGen/AMDGPU/rewrite-vgpr-mfma-to-agpr.ll In Folding code, if folded operand is register ensure earlyClobber is set. --------- Co-authored-by: Matt Arsenault <arsenm2@gmail.com> Co-authored-by: Shilei Tian <i@tianshilei.me>
After PR:#151421 merged following fails in SIFoldOperands showed up.
LLVM :: CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.mfma.gfx90a.ll
LLVM :: CodeGen/AMDGPU/llvm.amdgcn.mfma.gfx90a.ll
LLVM :: CodeGen/AMDGPU/llvm.amdgcn.mfma.ll
LLVM :: CodeGen/AMDGPU/mfma-loop.ll
LLVM :: CodeGen/AMDGPU/rewrite-vgpr-mfma-to-agpr.ll
In Folding code, if folded operand is register ensure earlyClobber is set.