[llvm] r217040 - R600/SI: Fix typos in SIInstrInfo::areLoadsFromSameBasePtr()

Tom Stellard thomas.stellard at amd.com
Wed Sep 3 08:22:39 PDT 2014


Author: tstellar
Date: Wed Sep  3 10:22:39 2014
New Revision: 217040

URL: http://llvm.org/viewvc/llvm-project?rev=217040&view=rev
Log:
R600/SI: Fix typos in SIInstrInfo::areLoadsFromSameBasePtr()

This fixes a crash in the OpenCV test:
ImgprocWarpResizeArea/Resize.Mat/16

There is no test case for this, because this failure depends on a
specific ordering of the loads, which could easily change.

Modified:
    llvm/trunk/lib/Target/R600/SIInstrInfo.cpp

Modified: llvm/trunk/lib/Target/R600/SIInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIInstrInfo.cpp?rev=217040&r1=217039&r2=217040&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/R600/SIInstrInfo.cpp Wed Sep  3 10:22:39 2014
@@ -70,7 +70,7 @@ static bool nodesHaveSameOperandValue(SD
   --Op0Idx;
   --Op1Idx;
 
-  return N0->getOperand(Op0Idx) == N0->getOperand(Op1Idx);
+  return N0->getOperand(Op0Idx) == N1->getOperand(Op1Idx);
 }
 
 bool SIInstrInfo::areLoadsFromSameBasePtr(SDNode *Load0, SDNode *Load1,
@@ -131,7 +131,7 @@ bool SIInstrInfo::areLoadsFromSameBasePt
     if (!nodesHaveSameOperandValue(Load0, Load1, AMDGPU::OpName::soffset) ||
         findChainOperand(Load0) != findChainOperand(Load1) ||
         !nodesHaveSameOperandValue(Load0, Load1, AMDGPU::OpName::vaddr) ||
-        !nodesHaveSameOperandValue(Load1, Load1, AMDGPU::OpName::srsrc))
+        !nodesHaveSameOperandValue(Load0, Load1, AMDGPU::OpName::srsrc))
       return false;
 
     int OffIdx0 = AMDGPU::getNamedOperandIdx(Opc0, AMDGPU::OpName::offset);





More information about the llvm-commits mailing list