Mercurial > lcfOS
comparison python/transform.py @ 235:ff40407c0240
Fix ALabel to Label
author | Windel Bouwman |
---|---|
date | Mon, 15 Jul 2013 17:20:37 +0200 |
parents | 1c7364bd74c7 |
children | 81752b0f85a5 |
comparison
equal
deleted
inserted
replaced
234:83781bd10fdb | 235:ff40407c0240 |
---|---|
68 | 68 |
69 def isAllocPromotable(allocinst): | 69 def isAllocPromotable(allocinst): |
70 # Check if alloc value is only used by load and store operations. | 70 # Check if alloc value is only used by load and store operations. |
71 assert type(allocinst) is Alloc | 71 assert type(allocinst) is Alloc |
72 for use in ai.value.used_by: | 72 for use in ai.value.used_by: |
73 print(use.user, use) | |
74 if not type(use.user) in [Load, Store]: | 73 if not type(use.user) in [Load, Store]: |
75 # TODO: check volatile | 74 # TODO: check volatile |
76 return False | 75 return False |
77 otherUse = True | 76 otherUse = True |
78 return True | 77 return True |
99 f.removeBasicBlock(bb) | 98 f.removeBasicBlock(bb) |
100 | 99 |
101 class Mem2RegPromotor(FunctionPass): | 100 class Mem2RegPromotor(FunctionPass): |
102 def onFunction(self, f): | 101 def onFunction(self, f): |
103 # TODO | 102 # TODO |
104 print(f) | 103 pass |
105 | 104 |