AMDGPU/SI: Fix read2 merging into a super register.
[oota-llvm.git] / lib / Target / AMDGPU / SIInstrInfo.cpp
index 8775a1f69cabf2dab20e27004b18f9dccf46199f..18910615bebeaf31e2eb970398747dfdbc8fc7f4 100644 (file)
@@ -227,9 +227,8 @@ bool SIInstrInfo::getMemOpBaseRegImmOfs(MachineInstr *LdSt, unsigned &BaseReg,
 
     uint8_t Offset0 = Offset0Imm->getImm();
     uint8_t Offset1 = Offset1Imm->getImm();
-    assert(Offset1 > Offset0);
 
-    if (Offset1 - Offset0 == 1) {
+    if (Offset1 > Offset0 && Offset1 - Offset0 == 1) {
       // Each of these offsets is in element sized units, so we need to convert
       // to bytes of the individual reads.