-
Notifications
You must be signed in to change notification settings - Fork 13.6k
AMDGPU: Delete seemingly dead s_fmaak_f32/s_fmamk_f32 folding code #140580
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: Delete seemingly dead s_fmaak_f32/s_fmamk_f32 folding code #140580
Conversation
@llvm/pr-subscribers-backend-amdgpu Author: Matt Arsenault (arsenm) ChangesNo tests fail with this. I'm not sure I understand the comment, Full diff: https://github.com/llvm/llvm-project/pull/140580.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
index 92937e33fd500..d94c2d8b03dff 100644
--- a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
@@ -767,17 +767,6 @@ bool SIFoldOperandsImpl::tryAddToFoldList(
return true;
}
- // Inlineable constant might have been folded into Imm operand of fmaak or
- // fmamk and we are trying to fold a non-inlinable constant.
- if ((Opc == AMDGPU::S_FMAAK_F32 || Opc == AMDGPU::S_FMAMK_F32) &&
- !OpToFold->isReg() && !TII->isInlineConstant(*OpToFold)) {
- unsigned ImmIdx = Opc == AMDGPU::S_FMAAK_F32 ? 3 : 2;
- MachineOperand &OpImm = MI->getOperand(ImmIdx);
- if (!OpImm.isReg() &&
- TII->isInlineConstant(*MI, MI->getOperand(OpNo), OpImm))
- return tryToFoldAsFMAAKorMK();
- }
-
// Special case for s_fmac_f32 if we are trying to fold into Src0 or Src1.
// By changing into fmamk we can untie Src2.
// If folding for Src0 happens first and it is identical operand to Src1 we
|
667ed2e
to
5681ced
Compare
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.
My interpretation of the comment is: some immediates are inlinable and some are not. So if we had an inlinable constant in the mandatory literal operand slot of the instruction, we want to commute the operands so the one that is inlinable is in the inlinable slot.
As to whether it's for some reason dead code, I can't say.
5681ced
to
3a748a7
Compare
That's because the three cases that were supposed to exercise this code in |
We used to prefer s_fmamk and s_fmamk over s_fmac with inlinable constants because they had untied src2 from dst. Either way due to other changes this can no longer be used in the same way. |
81a1b9f
to
024b6d6
Compare
Merge activity
|
024b6d6
to
5e1ede7
Compare
No tests fail with this. I'm not sure I understand the comment, there can't be any folding into an operand that had to already be a constant. I tried different combinations of immediates to these instructions but never hit the condition.
5e1ede7
to
62c750f
Compare
…140580) No tests fail with this. I'm not sure I understand the comment, there can't be any folding into an operand that had to already be a constant. I tried different combinations of immediates to these instructions but never hit the condition.
…lvm#140580) No tests fail with this. I'm not sure I understand the comment, there can't be any folding into an operand that had to already be a constant. I tried different combinations of immediates to these instructions but never hit the condition.
…lvm#140580) No tests fail with this. I'm not sure I understand the comment, there can't be any folding into an operand that had to already be a constant. I tried different combinations of immediates to these instructions but never hit the condition.
No tests fail with this. I'm not sure I understand the comment,
there can't be any folding into an operand that had to already
be a constant. I tried different combinations of immediates to these
instructions but never hit the condition.