17std::optional<std::tuple<int, const Operator*>> CanBePaired(
18 Node* node1, Node* node2, MachineOperatorBuilder* machine,
20 DCHECK(node1->opcode() == IrOpcode::kStore &&
21 node1->opcode() == IrOpcode::kStore);
23 Node* base1 = node1->InputAt(0);
24 Node* base2 = node2->InputAt(0);
25 if (base1 != base2)
return {};
29 auto combo = machine->TryStorePair(rep1, rep2);
30 if (!combo)
return {};
32 Node* index1 = node1->InputAt(1);
33 Node* index2 = node2->InputAt(1);
36 if (index1->opcode() == IrOpcode::kInt64Constant) {
41 if (index2->opcode() == IrOpcode::kInt64Constant) {
48 int diff = idx2 - idx1;
49 if (diff != bytesize && diff != -bytesize) {
53 return {{diff, *combo}};
64 if (cur->
opcode() != IrOpcode::kStore) {
69 if (prev->
opcode() != IrOpcode::kStore) {
80 if (std::get<int>(*pairing) > 0) {
MachineOperatorBuilder * machine() const
static void ChangeOp(Node *node, const Operator *new_op)
static Node * GetEffectInput(Node *node, int index=0)
static void ReplaceValueInput(Node *node, Node *value, int index)
constexpr IrOpcode::Value opcode() const
Node * InputAt(int index) const
bool OwnedBy(Node const *owner) const
void InsertInput(Zone *zone, int index, Node *new_to)
Reduction Reduce(Node *node) override
PairLoadStoreReducer(Editor *editor, MachineGraph *mcgraph, Isolate *isolate_)
StoreRepresentation const & StoreRepresentationOf(Operator const *op)
T const & OpParameter(const Operator *op)
V8_EXPORT_PRIVATE constexpr int ElementSizeLog2Of(MachineRepresentation)
#define DCHECK(condition)