This is not allowed for indirect accesses because the source
GPR might be erased by a subsequent instruction (WaR hazard)
if we don't emit a read dep bar.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
i->setSrc(1, NULL);
}
+void
+GM107LegalizeSSA::handleLOAD(Instruction *i)
+{
+ if (i->src(0).getFile() != FILE_MEMORY_CONST)
+ return;
+ if (i->src(0).isIndirect(0))
+ return;
+ if (typeSizeof(i->dType) != 4)
+ return;
+
+ i->op = OP_MOV;
+}
+
bool
GM107LegalizeSSA::visit(Instruction *i)
{
case OP_PFETCH:
handlePFETCH(i);
break;
+ case OP_LOAD:
+ handleLOAD(i);
+ break;
default:
break;
}
virtual bool visit(Instruction *);
void handlePFETCH(Instruction *);
+ void handleLOAD(Instruction *);
};
} // namespace nv50_ir