comparison python/mem2reg.py @ 292:534b94b40aa8

Fixup reorganize
author Windel Bouwman
date Wed, 27 Nov 2013 08:06:42 +0100
parents 444b9df2ed99
children 9417caea2eb3
comparison
equal deleted inserted replaced
290:7b38782ed496 292:534b94b40aa8
4 4
5 def isAllocPromotable(allocinst): 5 def isAllocPromotable(allocinst):
6 # Check if alloc value is only used by load and store operations. 6 # Check if alloc value is only used by load and store operations.
7 assert type(allocinst) is Alloc 7 assert type(allocinst) is Alloc
8 return all(type(use) in [Load, Store] for use in allocinst.value.used_by) 8 return all(type(use) in [Load, Store] for use in allocinst.value.used_by)
9
9 10
10 class Mem2RegPromotor(FunctionPass): 11 class Mem2RegPromotor(FunctionPass):
11 def promoteSingleBlock(self, ai): 12 def promoteSingleBlock(self, ai):
12 v = ai.value 13 v = ai.value
13 bb = ai.Block 14 bb = ai.Block