[PATCH] D92281: [VPlan] Add getLiveInIRValue accessor to VPValue.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 6 02:57:30 PST 2021


fhahn updated this revision to Diff 314836.
fhahn added a comment.

Thanks Ayal! I landed the VPPredInstPHIRecipe changes separately in f73c09caa2a8 <https://reviews.llvm.org/rGf73c09caa2a86fa9fe6f88b4a4c438c005fea32c>.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92281

Files:
  llvm/lib/Transforms/Vectorize/VPlanValue.h


Index: llvm/lib/Transforms/Vectorize/VPlanValue.h
===================================================================
--- llvm/lib/Transforms/Vectorize/VPlanValue.h
+++ llvm/lib/Transforms/Vectorize/VPlanValue.h
@@ -166,6 +166,15 @@
   void replaceAllUsesWith(VPValue *New);
 
   VPDef *getDef() { return Def; }
+
+  /// Returns the underlying IR value, if this VPValue is defined outside the
+  /// scope of VPlan. Returns nullptr if the VPValue is defined by a VPDef
+  /// inside a VPlan.
+  Value *getLiveInIRValue() {
+    assert(!getDef() &&
+           "VPValue is not a live-in; it is defined by a VPDef inside a VPlan");
+    return getUnderlyingValue();
+  }
 };
 
 typedef DenseMap<Value *, VPValue *> Value2VPValueTy;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92281.314836.patch
Type: text/x-patch
Size: 730 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210106/99555a15/attachment.bin>


More information about the llvm-commits mailing list