]> granicus.if.org Git - llvm/commitdiff
AMDGPU: Don't hardcode num defs for MUBUF instructions
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 27 Mar 2019 16:12:29 +0000 (16:12 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 27 Mar 2019 16:12:29 +0000 (16:12 +0000)
This shouldn't change anything since the no-ret atomics are selected
later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357084 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AMDGPU/SIInstrInfo.cpp

index 6155ad72f4c4060bf35619e6adfe2f815653a2e4..7639a3fe13801b3da807b6aecbc6599fe1d2107d 100644 (file)
@@ -226,8 +226,8 @@ bool SIInstrInfo::areLoadsFromSameBasePtr(SDNode *Load0, SDNode *Load1,
     // getNamedOperandIdx returns the index for MachineInstrs.  Since they
     // include the output in the operand list, but SDNodes don't, we need to
     // subtract the index by one.
-    --OffIdx0;
-    --OffIdx1;
+    OffIdx0 -= get(Opc0).NumDefs;
+    OffIdx1 -= get(Opc1).NumDefs;
 
     SDValue Off0 = Load0->getOperand(OffIdx0);
     SDValue Off1 = Load1->getOperand(OffIdx1);