return new LDSReadInstr(dests, srcs);
}
+bool LDSReadInstr::replace_dest(PRegister new_dest, AluInstr *move_instr)
+{
+ if (new_dest->pin() == pin_array)
+ return false;
+
+ auto old_dest = move_instr->psrc(0);
+
+ bool success = false;
+
+ for (unsigned i = 0; i < m_dest_value.size(); ++i) {
+ auto& dest = m_dest_value[i];
+
+ if (!dest->equal_to(*old_dest))
+ continue;
+
+ if (dest->equal_to(*new_dest))
+ continue;
+
+ if (dest->uses().size() > 1)
+ continue;
+
+ if (dest->pin() == pin_fully)
+ continue;
+
+ if (dest->pin() == pin_group)
+ continue;
+
+ if (dest->pin() == pin_chan && new_dest->chan() != dest->chan())
+ continue;
+
+ if (dest->pin() == pin_chan) {
+ if (new_dest->pin() == pin_group)
+ new_dest->set_pin(pin_chgr);
+ else
+ new_dest->set_pin(pin_chan);
+ }
+ m_dest_value[i] = new_dest;
+ success = true;
+ }
+ return success;
+}
+
LDSAtomicInstr::LDSAtomicInstr(ESDOp op,
PRegister dest,
PVirtualValue address,
void accept(ConstInstrVisitor& visitor) const override;
void accept(InstrVisitor& visitor) override;
+ bool replace_dest(PRegister new_dest, AluInstr *move_instr) override;
AluInstr *split(std::vector<AluInstr *>& out_block, AluInstr *last_lds_instr);
+
bool is_equal_to(const LDSReadInstr& lhs) const;
static auto from_string(std::istream& is, ValueFactory& value_factory) -> Pointer;