Closed vgene closed 1 year ago
The current code logic is actually not a bug but being bold in determining the dependence result between two calls. Below is the reason.
According to the definition of getModRefInfo from LLVM here. getModRefInfo returns Mod
if call A writes to a memory location read or written by call B. Therefore, assuming the original result is sound, from call B's perspective, there are only three cases
Ref
resultMod
resultModRef
resultHowever, if getModRefInfo(call B, call A) returns NoModRef
result, this contradicts the above three cases and the only reason to that is because of the original Mod result is incorrect. As one should always being bold in interpreting the alias analysis result, there should be no dependence between these two calls.
Let me know if you're seeing a missing dependence between two calls due to this logic and I'd be happy to take a look.
The last branch on line 611 is MakeModRefEdge not NoModRef. Just think what happens if callA modref callB and callB modref callA. There should be all deps between them. In the current logic, there won't be a RAW edge.
Any NoModRef in any direction will remove all deps, which is handled earlier.
Can we have a testable example highlighting the significance of this missing RAW dependence with the existence of both WAR and WAW dependence between two calls? From what I can tell, the existence of WAR and WAW dependencies are stronger restrictions that are already blocking most of the transformations (including privatization).
It depends on the client and CPF currently discards all false dependences in planning with the assumption of privatization.
PDG is supposed to be conservative. Any missing dependence at this level is a problem.
This has been fixed by last Yian's pull request.
Serious bug when generating function DG!
NOELLE does not construct most RAW memory dependences function call A to function call B in function DG. For now, I'm guessing the WAR deps stop mis-transformation from happening. But this has significant implications once full privatization support rolls out.