re-introduced more aggressive binexpr splitting optimization

This commit is contained in:
Irmen de Jong 2020-11-10 21:17:33 +01:00
parent 69ca4fe304
commit e8faec0932
2 changed files with 1 additions and 4 deletions

View File

@ -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(binExpr.operator in augmentAssignmentOperators && isSimpleTarget(assignment.target, program.namespace)) {
if(assignment.target isSameAs binExpr.left || assignment.target isSameAs binExpr.right) if(assignment.target isSameAs binExpr.left || assignment.target isSameAs binExpr.right)
return noModifications 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 firstAssign = Assignment(assignment.target, binExpr.left, binExpr.left.position)
val targetExpr = assignment.target.toExpression() val targetExpr = assignment.target.toExpression()
val augExpr = BinaryExpression(targetExpr, binExpr.operator, binExpr.right, binExpr.right.position) val augExpr = BinaryExpression(targetExpr, binExpr.operator, binExpr.right, binExpr.right.position)

View File

@ -4,8 +4,6 @@
; Note: this program is compatible with C64 and CX16. ; 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 { main {
const uword width = 30 const uword width = 30
const uword height = 20 const uword height = 20