mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 20:26:07 +00:00
Do not model all INLINEASM instructions as having unmodelled side effects.
Instead encode llvm IR level property "HasSideEffects" in an operand (shared with IsAlignStack). Added MachineInstrs::hasUnmodeledSideEffects() to check the operand when the instruction is an INLINEASM. This allows memory instructions to be moved around INLINEASM instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123044 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -54,6 +54,12 @@ FunctionPass *llvm::createDeadMachineInstructionElimPass() {
|
||||
}
|
||||
|
||||
bool DeadMachineInstructionElim::isDead(const MachineInstr *MI) const {
|
||||
// Technically speaking inline asm without side effects and no defs can still
|
||||
// be deleted. But there is so much bad inline asm code out there, we should
|
||||
// let them be.
|
||||
if (MI->isInlineAsm())
|
||||
return false;
|
||||
|
||||
// Don't delete instructions with side effects.
|
||||
bool SawStore = false;
|
||||
if (!MI->isSafeToMove(TII, 0, SawStore) && !MI->isPHI())
|
||||
|
Reference in New Issue
Block a user