[PATCH] D39986: [LSR] Expand: Use the replaced value's debug loc (PR25630)

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 07:03:31 PST 2017


aprantl accepted this revision.
aprantl added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopStrengthReduce.cpp:4940
+  DebugLoc Loc;
+  if (auto *I = dyn_cast<Instruction>(LF.OperandValToReplace))
+    Loc = I->getDebugLoc();
----------------
vsk wrote:
> aprantl wrote:
> > What besides an instruction could this be? An Argument?
> I'm not sure, but I haven't been able to prove that this is always an Instruction.
Might as well use a cast<> then, it will assert and we'll find out :-)
Hm.. it could be a constant, perhaps?


https://reviews.llvm.org/D39986





More information about the llvm-commits mailing list