aboutsummaryrefslogtreecommitdiff
path: root/CodeGen.hs
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-12-01 22:42:19 +0100
committertomsmeding <tom.smeding@gmail.com>2017-12-01 22:42:19 +0100
commitc0078e855880df91896ed0953bb5c07441dbc72f (patch)
tree1ee24323826855de6836bd9ba6e3e610e16a4a60 /CodeGen.hs
parentbe8e209956b3f93b181eb730c743a6d72ddfbbb3 (diff)
STUFF
This was lying around and I didn't want to not back this up to the server. Was apparently in the middle of testing the lifetime analysis module. I believe the terminal output for many input programs indicates that the two lifetime analysis modules do not agree.....
Diffstat (limited to 'CodeGen.hs')
-rw-r--r--CodeGen.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/CodeGen.hs b/CodeGen.hs
index 5ab991b..c837bdc 100644
--- a/CodeGen.hs
+++ b/CodeGen.hs
@@ -16,6 +16,7 @@ import AST
import Defs
import Intermediate
import qualified LifetimeAnalysis as LA
+import qualified LifetimeAnalysisOld as LAO
import RegAlloc
import ReplaceRefs
import Utils
@@ -106,7 +107,10 @@ codegenFunc (IRFunc _ name al bbs sid) = do
alltemprefs = uniq $ sort $ map LA.unAccess $ concat $ concat $ map fst temprefsperbb
lifespans = map (\r -> (findLifeSpan r, r)) alltemprefs
where findLifeSpan ref =
- fromJust $ findFirstLast id $ concat $ LA.lifetimeAnalysis ref temprefsperbb
+ let la = LA.lifetimeAnalysis ref temprefsperbb
+ lao = LAO.lifetimeAnalysis ref temprefsperbb
+ in (if la == lao then id else traceShow (ref,bbs,la,lao)) $
+ fromJust $ findFirstLast id $ concat $ LA.lifetimeAnalysis ref temprefsperbb
aliascandidates = findAliasCandidates bbs :: [(Ref, Ref)]