[PATCH] D55018: [CodeExtractor] Split PHI nodes with incoming values from outlined region (PR39433)

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 28 13:58:45 PST 2018


vsk added reviewers: fhahn, davidxl, sebpop, brzycki.
vsk added a comment.

Thank you (very much!) for working on this.



================
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:619
+    for (PHINode &PN : ExitBB->phis()) {
+      // find all incoming blocks from region
+      SmallVector<unsigned, 2> IncomingVals;
----------------
Nit: please capitalize sentences in comments. Also, maybe "incoming values from the outlining region" would be clearer?


================
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:625
+
+      // do not process PHI if there is one (or fewer) predecessor from region
+      if (IncomingVals.size() <= 1)
----------------
Why should PHIs with exactly one predecessor from the outlining region be skipped? What if there's a second exit block with another, different predecessor from the outlining region?

```
   Out1   ->  Out2
     \          \ 
      Exit1      Exit2
```


================
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:1301
-        } else {
-          assert(IncomingCodeReplacerVal == PN.getIncomingValue(I) &&
-                 "PHI has two incompatbile incoming values from codeRepl");
----------------
Why delete this assertion? ISTM that's it's still useful to have around.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55018/new/

https://reviews.llvm.org/D55018





More information about the llvm-commits mailing list