-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[VPlan] Refine the debug location passing for VPWidenIntrinsicRecipe #113887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1678,8 +1678,7 @@ class VPWidenIntrinsicRecipe : public VPRecipeWithIRFlags { | |
|
||
public: | ||
VPWidenIntrinsicRecipe(CallInst &CI, Intrinsic::ID VectorIntrinsicID, | ||
ArrayRef<VPValue *> CallArguments, Type *Ty, | ||
DebugLoc DL = {}) | ||
ArrayRef<VPValue *> CallArguments, Type *Ty) | ||
: VPRecipeWithIRFlags(VPDef::VPWidenIntrinsicSC, CallArguments, CI), | ||
VectorIntrinsicID(VectorIntrinsicID), ResultTy(Ty), | ||
MayReadFromMemory(CI.mayReadFromMemory()), | ||
|
@@ -1689,7 +1688,7 @@ class VPWidenIntrinsicRecipe : public VPRecipeWithIRFlags { | |
VPWidenIntrinsicRecipe(Intrinsic::ID VectorIntrinsicID, | ||
ArrayRef<VPValue *> CallArguments, Type *Ty, | ||
DebugLoc DL = {}) | ||
: VPRecipeWithIRFlags(VPDef::VPWidenIntrinsicSC, CallArguments), | ||
: VPRecipeWithIRFlags(VPDef::VPWidenIntrinsicSC, CallArguments, DL), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this fixe cases where the debug location wasn't passed before? Does this mean a test is missing? |
||
VectorIntrinsicID(VectorIntrinsicID), ResultTy(Ty) { | ||
LLVMContext &Ctx = Ty->getContext(); | ||
AttributeList Attrs = Intrinsic::getAttributes(Ctx, VectorIntrinsicID); | ||
|
@@ -1706,7 +1705,7 @@ class VPWidenIntrinsicRecipe : public VPRecipeWithIRFlags { | |
VPWidenIntrinsicRecipe *clone() override { | ||
return new VPWidenIntrinsicRecipe(*cast<CallInst>(getUnderlyingValue()), | ||
VectorIntrinsicID, {op_begin(), op_end()}, | ||
ResultTy, getDebugLoc()); | ||
ResultTy); | ||
} | ||
|
||
VP_CLASSOF_IMPL(VPDef::VPWidenIntrinsicSC) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,8 +84,7 @@ void VPlanTransforms::VPInstructionsToVPRecipes( | |
} else if (CallInst *CI = dyn_cast<CallInst>(Inst)) { | ||
NewRecipe = new VPWidenIntrinsicRecipe( | ||
*CI, getVectorIntrinsicIDForCall(CI, &TLI), | ||
{Ingredient.op_begin(), Ingredient.op_end() - 1}, CI->getType(), | ||
CI->getDebugLoc()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not directly related to this PR, but across the function we should probably use the debug loc of the VPInstruction |
||
{Ingredient.op_begin(), Ingredient.op_end() - 1}, CI->getType()); | ||
} else if (SelectInst *SI = dyn_cast<SelectInst>(Inst)) { | ||
NewRecipe = new VPWidenSelectRecipe(*SI, Ingredient.operands()); | ||
} else if (auto *CI = dyn_cast<CastInst>(Inst)) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you decide to drop debug locations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually we didn't lose the debug locations.
Constructor
VPWidenIntrinsicRecipe(CallInst &, Intrinsic::ID, ArrayRef<VPValue *>, Type *)
will call constructorVPRecipeWithIRFlags(const unsigned char, ArrayRef<VPValue *>, Instruction &)
.The debug locations can be get from underlying instruction. That is why we can drop it.