[PATCH] D128657: [VPlan] Move setDebugLocFromInst to VPTransformState (NFC).

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 4 01:28:37 PDT 2022


fhahn marked an inline comment as done.
fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:251
+void VPTransformState::setDebugLocFromInst(const Value *V) {
+  if (const Instruction *Inst = dyn_cast_or_null<Instruction>(V)) {
+    const DILocation *DIL = Inst->getDebugLoc();
----------------
Ayal wrote:
> nit: while we're here, this function could use an early-exit or two, potentially via `return Builder.SetCurrentDebugLocation()`'s, possibly in a separate patch.
I added an early exit for the cast that `V` isn't an instruction in b4694229aa9d7a09d58a8e59339d14570437daf2


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.h:321
+  /// Set the debug location in the builder \p Ptr using the debug location in
+  /// \p V. If \p Ptr is None then it uses the class member's Builder.
+  void setDebugLocFromInst(const Value *V);
----------------
Ayal wrote:
> \p Ptr?
> Note that the original version uses ILV's Builder, this one uses State's Builder, but it's fine.
Thanks, I removed it from the reference to to dead `Ptr` argument in the committed version.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128657



More information about the llvm-commits mailing list