From 7e5b2caa3783072b2c2b62b26d1d643f7014eca3 Mon Sep 17 00:00:00 2001 From: Flight_Control Date: Sat, 1 Apr 2023 07:00:58 +0200 Subject: [PATCH] Optimized logic for speed --- .../java/dk/camelot64/kickc/passes/Pass4MemoryCoalesce.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass4MemoryCoalesce.java b/src/main/java/dk/camelot64/kickc/passes/Pass4MemoryCoalesce.java index 64d60f35f..29163d077 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass4MemoryCoalesce.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass4MemoryCoalesce.java @@ -143,9 +143,7 @@ public abstract class Pass4MemoryCoalesce extends Pass2Base { // Check the both registers have the same type if(!register1.getType().equals(register2.getType())) return false; - if(register1.toString().startsWith("mem")) - return false; - if(register2.toString().startsWith("mem")) + if(register1.getType() == Registers.RegisterType.MAIN_MEM) return false; // Check the both registers have the same size if(register1.getBytes() != register2.getBytes())