mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 22:23:10 +00:00
ARM: fix peephole optimisation of TST
We were trying to look through COPY instructions, but only to the next instruction in a BB and incorrectly anyway. The cases where that would actually be a good idea are rare enough (and not even tested!) that it's not worth trying to get right. rdar://20721342 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236050 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2315,16 +2315,6 @@ static bool isSuitableForMask(MachineInstr *&MI, unsigned SrcReg,
|
||||
if (SrcReg == MI->getOperand(CommonUse ? 1 : 0).getReg())
|
||||
return true;
|
||||
break;
|
||||
case ARM::COPY: {
|
||||
// Walk down one instruction which is potentially an 'and'.
|
||||
const MachineInstr &Copy = *MI;
|
||||
MachineBasicBlock::iterator AND(
|
||||
std::next(MachineBasicBlock::iterator(MI)));
|
||||
if (AND == MI->getParent()->end()) return false;
|
||||
MI = AND;
|
||||
return isSuitableForMask(MI, Copy.getOperand(0).getReg(),
|
||||
CmpMask, true);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user