/** * Attempt to rewrite a move instruction to a NOP. * * @param s the instruction to rewrite * @return {@code true} if and only if the transformation applies */ private boolean mutateMoveToNop(Instruction s) { Operand result = MIR_Move.getResult(s); Operand val = MIR_Move.getValue(s); if (result.isStackLocation() && val.isStackLocation()) { if (result.similar(val)) { Empty.mutate(s, NOP); return true; } } return false; }
/** * Mutate FMOVs that end live ranges * * @param live The live interval for a basic block/reg pair * @param register The register for this live interval * @param dfnbegin The (adjusted) begin for this interval * @param dfnend The (adjusted) end for this interval */ @Override public boolean mutateFMOVs( OPT_LiveIntervalElement live, OPT_Register register, int dfnbegin, int dfnend) { OPT_Instruction end = live.getEnd(); if (end != null && end.operator == IA32_FMOV) { if (dfnend == dfnbegin) { // if end, an FMOV, both begins and ends the live range, // then end is dead. Change it to a NOP and return null. Empty.mutate(end, NOP); return false; } else { if (!end.isPEI()) { if (VM.VerifyAssertions) { OPT_Operand value = MIR_Move.getValue(end); VM._assert(value.isRegister()); VM._assert(MIR_Move.getValue(end).asRegister().getRegister() == register); } end.operator = IA32_FMOV_ENDING_LIVE_RANGE; } } } return true; }