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

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 11:22:01 PST 2017


vsk added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopStrengthReduce.cpp:4940
+  DebugLoc Loc;
+  if (auto *I = dyn_cast<Instruction>(LF.OperandValToReplace))
+    Loc = I->getDebugLoc();
----------------
aprantl wrote:
> 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?
If we use a cast<>, test/Transforms/LoopStrengthReduce/illegal-addr-modes.ll fails because the operand val is an i8*.


https://reviews.llvm.org/D39986





More information about the llvm-commits mailing list