[llvm] [AMDGPU] Correctly insert s_nops for implicit read of SDWA (PR #100276)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 2 09:12:49 PDT 2024
================
@@ -1040,6 +1096,37 @@ int GCNHazardRecognizer::checkInlineAsmHazards(MachineInstr *IA) {
if (Op.isReg() && Op.isDef()) {
WaitStatesNeeded =
std::max(WaitStatesNeeded, checkVALUHazardsHelper(Op, MRI));
+
+ if (!TRI.isVectorRegister(MRI, Op.getReg()))
+ continue;
+
+ if (ST.hasDstSelForwardingHazard()) {
+ const int Shift16DefWaitstates = 1;
+
+ auto IsShift16BitDefFn = [this, &IA](const MachineInstr &MI) {
+ const MachineOperand *Dst = getDstSelForwardingOperand(MI, ST);
+ // Assume inline asm reads the dst
+ if (Dst)
+ return true;
+
+ if (MI.isInlineAsm()) {
----------------
arsenm wrote:
I'm confused by the variable naming. IA is inline Asm, and MI is different inline asm?
https://github.com/llvm/llvm-project/pull/100276
More information about the llvm-commits
mailing list