More aggressive constant propagation pass.
This commit is contained in:
@@ -48,7 +48,10 @@ void Instr::set_src3(Value* value) {
|
||||
src3_use = value ? value->AddUse(block->arena, this) : NULL;
|
||||
}
|
||||
|
||||
void Instr::Remove() {
|
||||
void Instr::Replace(const OpcodeInfo* opcode, uint16_t flags) {
|
||||
this->opcode = opcode;
|
||||
this->flags = flags;
|
||||
|
||||
if (dest) {
|
||||
dest->def = NULL;
|
||||
}
|
||||
@@ -64,6 +67,11 @@ void Instr::Remove() {
|
||||
src3.value->RemoveUse(src3_use);
|
||||
src3_use = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void Instr::Remove() {
|
||||
// Remove all srcs/dest.
|
||||
Replace(&OPCODE_NOP_info, 0);
|
||||
|
||||
if (prev) {
|
||||
prev->next = next;
|
||||
|
||||
@@ -54,6 +54,7 @@ public:
|
||||
void set_src2(Value* value);
|
||||
void set_src3(Value* value);
|
||||
|
||||
void Replace(const OpcodeInfo* opcode, uint16_t flags);
|
||||
void Remove();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user