[llvm] [LV] Align debug location of the widen-phi to the original phi. (PR #120338)
Mel Chen via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 18 23:06:33 PST 2024
================
@@ -2291,9 +2291,10 @@ class VPWidenPHIRecipe : public VPSingleDefRecipe {
SmallVector<VPBasicBlock *, 2> IncomingBlocks;
public:
- /// Create a new VPWidenPHIRecipe for \p Phi with start value \p Start.
- VPWidenPHIRecipe(PHINode *Phi, VPValue *Start = nullptr)
- : VPSingleDefRecipe(VPDef::VPWidenPHISC, ArrayRef<VPValue *>(), Phi) {
+ /// Create a new VPWidenPHIRecipe for \p Phi with start value \p Start and
+ /// debug location \p DL.
+ VPWidenPHIRecipe(PHINode *Phi, VPValue *Start = nullptr, DebugLoc DL = {})
+ : VPSingleDefRecipe(VPDef::VPWidenPHISC, ArrayRef<VPValue *>(), Phi, DL) {
----------------
Mel-Chen wrote:
Why not pass debug info by this way? Could Phi be nullptr, or other reasons?
```suggestion
/// Create a new VPWidenPHIRecipe for \p Phi with start value \p Start.
VPWidenPHIRecipe(PHINode *Phi, VPValue *Start = nullptr)
: VPSingleDefRecipe(VPDef::VPWidenPHISC, ArrayRef<VPValue *>(), Phi, Phi->getDebugLoc()) {
```
https://github.com/llvm/llvm-project/pull/120338
More information about the llvm-commits
mailing list