[flang-commits] [flang] [flang] Record the evaluations that branch to each evaluation (PR #225755)

Kareem Ergawy via flang-commits flang-commits at lists.llvm.org
Thu Sep 24 01:54:30 PDT 2026


================
@@ -920,6 +924,8 @@ class PFTBuilder {
                         &targetEvaluation) ==
                  sourceEvaluation.extraControlSuccessors.end())
       sourceEvaluation.extraControlSuccessors.push_back(&targetEvaluation);
+    // Record the reverse edge beside the forward one.
+    (*incomingBranches)[&targetEvaluation].insert(&sourceEvaluation);
----------------
ergawy wrote:

I think it is not necessary to record reverse edges in these case because they are all intra-construct. The goal is the capture incoming branches from outside a construct for better PFT analysis. Recording all these cases would make things more expensive without apparent benefit for our purpose. 

https://github.com/llvm/llvm-project/pull/225755


More information about the flang-commits mailing list