C++: Fix join order

This commit is contained in:
Jonas Jensen
2020-01-03 15:21:12 +01:00
committed by Robert Marsh
parent 838720bef0
commit 5072201b7e

View File

@@ -569,17 +569,18 @@ module DefUse {
) {
exists(OldInstruction oldInstr, int oldOffset |
oldInstr = defBlock.getInstruction(oldOffset) and
hasNonPhiDefinition(_, defLocation, defBlock, defOffset) and
oldOffset >= 0
|
// An odd offset corresponds to the `Chi` instruction.
defOffset = oldOffset * 2 + 1 and
result = Chi(oldInstr) and
hasNonPhiDefinition(_, defLocation, defBlock, defOffset) and
actualDefLocation = defLocation.getVirtualVariable()
or
// An even offset corresponds to the original instruction.
defOffset = oldOffset * 2 and
result = getNewInstruction(oldInstr) and
hasNonPhiDefinition(_, defLocation, defBlock, defOffset) and
actualDefLocation = defLocation
)
or