[llvm] [VPlan] Refine the debug location passing for VPWidenIntrinsicRecipe (PR #113887)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 00:01:31 PDT 2024


================
@@ -8430,8 +8430,7 @@ VPSingleDefRecipe *VPRecipeBuilder::tryToWidenCall(CallInst *CI,
                 },
                 Range);
   if (ShouldUseVectorIntrinsic)
-    return new VPWidenIntrinsicRecipe(*CI, ID, Ops, CI->getType(),
-                                      CI->getDebugLoc());
----------------
Mel-Chen wrote:

Actually we didn't lose the debug locations.
Constructor `VPWidenIntrinsicRecipe(CallInst &, Intrinsic::ID, ArrayRef<VPValue *>, Type *)` will call constructor `VPRecipeWithIRFlags(const unsigned char, ArrayRef<VPValue *>,  Instruction &)`.
```
  template <typename IterT>
  VPRecipeWithIRFlags(const unsigned char SC, IterT Operands, Instruction &I)
      : VPSingleDefRecipe(SC, Operands, &I, I.getDebugLoc()) {
    if (auto *Op = dyn_cast<CmpInst>(&I)) {
    ...
```
The debug locations can be get from underlying instruction. That is why we can drop it.

https://github.com/llvm/llvm-project/pull/113887


More information about the llvm-commits mailing list