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

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 5 01:14:33 PDT 2022


Ayal 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();
----------------
fhahn wrote:
> 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
Thanks! Another early exit can be added for the case when FSDiscriminator is enabled...


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