[PATCH] D55967: [CodeExtractor] Do not extract unsafe lifetime markers

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 21 11:28:28 PST 2018


davidxl added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/CodeExtractor.cpp:1189
+eraseLifetimeMarkersOnInputs(const SetVector<BasicBlock *> &Blocks,
+                             const SetVector<Value *> &SunkDefs) {
+  SetVector<Value *> InputObjectsWithLifetime;
----------------
document the second parameter?


================
Comment at: llvm/lib/Transforms/Utils/CodeExtractor.cpp:1199
+      if (ID != Intrinsic::lifetime_start && ID != Intrinsic::lifetime_end)
+        continue;
+      Value *Mem = II->getOperand(1)->stripInBoundsOffsets();
----------------
Is there a common utility function to detect lifetime marker intrinsics?


================
Comment at: llvm/lib/Transforms/Utils/CodeExtractor.cpp:1200
+        continue;
+      Value *Mem = II->getOperand(1)->stripInBoundsOffsets();
+      if (SunkDefs.count(Mem) || definedInRegion(Blocks, Mem))
----------------
Is there a better API to access the mem operand instead of using hard coded operand number?


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

https://reviews.llvm.org/D55967





More information about the llvm-commits mailing list