C#: Filter away phi (read) input steps from a node into itself

This commit is contained in:
Tom Hvitved
2023-05-08 09:25:04 +02:00
parent 75dd4c8653
commit 165dc0b9bf

View File

@@ -335,7 +335,8 @@ module LocalFlow {
exists(ControlFlow::BasicBlock bb, int i |
SsaImpl::lastRefBeforeRedefExt(def, bb, i, next.getDefinitionExt()) and
def.definesAt(_, bb, i, _) and
def = getSsaDefinitionExt(nodeFrom)
def = getSsaDefinitionExt(nodeFrom) and
nodeFrom != next
)
}
@@ -414,7 +415,8 @@ module LocalFlow {
) {
exists(CIL::BasicBlock bb, int i | CilSsaImpl::lastRefBeforeRedefExt(def, bb, i, next) |
def.definesAt(_, bb, i, _) and
def = nodeFrom.(CilSsaDefinitionExtNode).getDefinition()
def = nodeFrom.(CilSsaDefinitionExtNode).getDefinition() and
def != next
or
nodeFrom = TCilExprNode(bb.getNode(i).(CIL::ReadAccess))
)