Before this patch, we determine whether a value escapes the SCoP by checking whether it the instruction itself is within the scop. This is wrong for PHINodes because the value must be available in the incoming block instead of of where the PHI is.
To fix this, we introduce a function "getUseBlock" to determine the location of a value's use for PHIs and other instructions. It will also be used in subsequent patches.
I could not produce a test case because of region simplification and loop versioning which adds additional block between the PHIs and the SCoP region. Nonetheless, it happend during debugging of preliminary code and is in general the correct way.