mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Optimize across MLOAD if MSIZE is not used.
This commit is contained in:
@@ -28,7 +28,7 @@ using namespace std;
|
||||
using namespace dev;
|
||||
using namespace dev::eth;
|
||||
|
||||
bool SemanticInformation::breaksCSEAnalysisBlock(AssemblyItem const& _item)
|
||||
bool SemanticInformation::breaksCSEAnalysisBlock(AssemblyItem const& _item, bool _msizeImportant)
|
||||
{
|
||||
switch (_item.type())
|
||||
{
|
||||
@@ -59,6 +59,11 @@ bool SemanticInformation::breaksCSEAnalysisBlock(AssemblyItem const& _item)
|
||||
return false;
|
||||
if (_item.instruction() == Instruction::MSTORE)
|
||||
return false;
|
||||
if (!_msizeImportant && (
|
||||
_item.instruction() == Instruction::MLOAD ||
|
||||
_item.instruction() == Instruction::KECCAK256
|
||||
))
|
||||
return false;
|
||||
//@todo: We do not handle the following memory instructions for now:
|
||||
// calldatacopy, codecopy, extcodecopy, mstore8,
|
||||
// msize (note that msize also depends on memory read access)
|
||||
|
||||
Reference in New Issue
Block a user