mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Implement "AsCheapAsAMove" for some obviously cheap instructions: xor and the
like. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51662 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -330,10 +330,13 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
|
||||
InstructionRearranged:
|
||||
const TargetRegisterClass* rc = MF.getRegInfo().getRegClass(regA);
|
||||
MachineInstr *Orig = MRI->getVRegDef(regB);
|
||||
const TargetInstrDesc &OrigTID = Orig->getDesc();
|
||||
bool SawStore = false;
|
||||
|
||||
if (EnableReMat && Orig && Orig->isSafeToMove(TII, SawStore) &&
|
||||
TII->isTriviallyReMaterializable(Orig)) {
|
||||
OrigTID.isAsCheapAsAMove() && !OrigTID.mayLoad() &&
|
||||
!OrigTID.isSimpleLoad()) {
|
||||
DEBUG(cerr << "2addr: REMATTING : " << *Orig << "\n");
|
||||
TII->reMaterialize(*mbbi, mi, regA, Orig);
|
||||
ReMattedInstrs.insert(Orig);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user