From 5dbcc7e0c9c12f4a4042fb4a226654aee927999c Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 9 Jul 2012 10:52:46 -0700 Subject: LOCALMODs from hg 0b098ca44de7 against r158408 (hg 90a87d6bfe45) (only non-new files; new files in git 4f429c8b) Change-Id: Ia39f818088485bd90e4d048db404f8d6ba5f836b --- lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'lib/Target/ARM/ARMLoadStoreOptimizer.cpp') diff --git a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp index cb1b2a2172..6f055c53a9 100644 --- a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp +++ b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp @@ -546,6 +546,12 @@ static bool isMatchingDecrement(MachineInstr *MI, unsigned Base, break; } + // @LOCALMOD-BEGIN + // BUG= http://code.google.com/p/nativeclient/issues/detail?id=2575 + if (MI->hasOptionalDef()) + return false; + // @LOCALMOD-END + // Make sure the offset fits in 8 bits. if (Bytes == 0 || (Limit && Bytes >= Limit)) return false; @@ -579,6 +585,12 @@ static bool isMatchingIncrement(MachineInstr *MI, unsigned Base, break; } + // @LOCALMOD-BEGIN + // BUG= http://code.google.com/p/nativeclient/issues/detail?id=2575 + if (MI->hasOptionalDef()) + return false; + // @LOCALMOD-END + if (Bytes == 0 || (Limit && Bytes >= Limit)) // Make sure the offset fits in 8 bits. return false; @@ -709,6 +721,7 @@ static unsigned getUpdatingLSMultipleOpcode(unsigned Opc, /// ldmia rn, /// => /// ldmdb rn!, +/// @LOCALMOD This is especially useful for rn == sp bool ARMLoadStoreOpt::MergeBaseUpdateLSMultiple(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, bool &Advance, @@ -1389,7 +1402,16 @@ bool ARMLoadStoreOpt::LoadStoreMultipleOpti(MachineBasicBlock &MBB) { /// mov pc, lr /// => /// ldmfd sp!, {..., pc} +// @LOCALMOD for sfi we do not want this to happen bool ARMLoadStoreOpt::MergeReturnIntoLDM(MachineBasicBlock &MBB) { + // @LOCALMOD-START + // For NaCl, do not load into PC directly for a return, since NaCl requires + // masking the address first. + if (STI->isTargetNaCl()) { + return false; + } + // @LOCALMOD-END + if (MBB.empty()) return false; MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr(); -- cgit v1.2.3-18-g5258