[PATCH] D57919: [CodeExtractor] Restore outputs after creating exit stubs

Sergei Kachkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 8 00:38:25 PST 2019


kachkov98 marked 3 inline comments as done.
kachkov98 added inline comments.


================
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:1141
+      InsertPt = std::next(OutI->getIterator());
+
+    assert(OAI != newFunction->arg_end() &&
----------------
vsk wrote:
> Could you assert that the insertion point is in 'newFunction'?
At this point the extracted blocks are still in the old function, and exit stubs are created immediately in new function; so insertion point should be in newFunction or in one of extracted blocks.


================
Comment at: unittests/Transforms/Utils/CodeExtractorTest.cpp:203
+
+    define i32 @foo(i32 %x, i32 %y) personality i8* null {
+    entry:
----------------
vsk wrote:
> Are the 'entry' and 'cond.true' blocks needed to reproduce the issue?
Agree that test can be simplified.


================
Comment at: unittests/Transforms/Utils/CodeExtractorTest.cpp:231
+
+  DominatorTree DT(*Func);
+  CodeExtractor CE(Block, &DT);
----------------
vsk wrote:
> Is DT needed?
It seems that dominator tree is only used to verify that all blocks are reachable from entry, so I think it can be safely removed from all CodeExtractor tests.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D57919





More information about the llvm-commits mailing list