mirror of
https://github.com/irmen/prog8.git
synced 2024-11-22 15:33:02 +00:00
re-introduced more aggressive binexpr splitting optimization
This commit is contained in:
parent
69ca4fe304
commit
e8faec0932
@ -53,12 +53,11 @@ X = BinExpr X = LeftExpr
|
||||
|
||||
|
||||
*/
|
||||
// TODO can be generelized a bit by allowing LEFT EXPR to be more complex
|
||||
if(binExpr.operator in augmentAssignmentOperators && isSimpleTarget(assignment.target, program.namespace)) {
|
||||
if(assignment.target isSameAs binExpr.left || assignment.target isSameAs binExpr.right)
|
||||
return noModifications
|
||||
|
||||
if(isSimpleExpression(binExpr.left) && isSimpleExpression(binExpr.right) && !assignment.isAugmentable) {
|
||||
if(isSimpleExpression(binExpr.right) && !assignment.isAugmentable) {
|
||||
val firstAssign = Assignment(assignment.target, binExpr.left, binExpr.left.position)
|
||||
val targetExpr = assignment.target.toExpression()
|
||||
val augExpr = BinaryExpression(targetExpr, binExpr.operator, binExpr.right, binExpr.right.position)
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
|
||||
; TODO this is 5 seconds slower than the previous compiled version. Caused by BinExprSplitter change?
|
||||
|
||||
main {
|
||||
const uword width = 30
|
||||
const uword height = 20
|
||||
|
Loading…
Reference in New Issue
Block a user