Skip to content

Commit a2b6f6f

Browse files
committed
f
1 parent 0627bb5 commit a2b6f6f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

libyul/backends/evm/ssa/OperationForwardShuffler.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,13 +396,14 @@ class OperationForwardShuffler
396396
// todo i came until here
397397
// if the top is out of position and required in args
398398
if (
399-
!_stack.empty() &&
400-
!ops.isArgsCompatible(0, 0) &&
401-
ops.stackStats.argsCount(_stack.top()) <= ops.targetArgsCount(_stack.top())
399+
!_stack.empty() && // if we have an empty stack, we don't need to go down this branch any further
400+
!ops.isArgsCompatible(_stack.size() - 1, _stack.size() - 1) && // the stack top is not in the args region or inside but out of position
401+
ops.stackStats.argsCount(_stack.top()) <= ops.targetArgsCount(_stack.top()) // the stack top is needed in args at least as often as is the case right now
402402
)
403403
{
404404
// shortcut
405-
{
405+
// todo see if this still works w/ fixed target size
406+
/*{
406407
// if the top is required in the second slot position and we require something at the top that isn’t
407408
// already sufficiently often in the args section and (we can introduce junk or the target top is also
408409
// required for the tail), try duping a deeper element
@@ -430,7 +431,7 @@ class OperationForwardShuffler
430431
}
431432
}
432433
}
433-
}
434+
}*/
434435

435436
// if we can introduce junk, just try to dup it up
436437
if (_generateJunk && dupDeepSlotIfRequired(ops, _stack, _generateJunk))

0 commit comments

Comments
 (0)