mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 19:06:33 +00:00
[VPlan] Add VPSingleDefRecipe::dump() to resolve ambigous lookup (NFC).
This allows calling ::dump() on various sub-classes of VPSingleDefRecipe directly, as it resolves an ambigous name lookup. Previously, calling VPWidenRecipe::dump() (and others), would result in the following errors: llvm/unittests/Transforms/Vectorize/VPlanTest.cpp:1284:19: error: member 'dump' found in multiple base classes of different types 1284 | WidenR->dump(); | ^ llvm/include/../lib/Transforms/Vectorize/VPlanValue.h:434:8: note: member found by ambiguous name lookup 434 | void dump() const; | ^ llvm/include/../lib/Transforms/Vectorize/VPlanValue.h:108:8: note: member found by ambiguous name lookup 108 | void dump() const; | ^ 1 error generated.
This commit is contained in:
parent
4512bbe746
commit
81bbe19383
@ -954,6 +954,11 @@ public:
|
||||
/// Return the cost of this VPSingleDefRecipe.
|
||||
InstructionCost computeCost(ElementCount VF,
|
||||
VPCostContext &Ctx) const override;
|
||||
|
||||
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
|
||||
/// Print this VPSingleDefRecipe to dbgs() (for debugging).
|
||||
LLVM_DUMP_METHOD void dump() const;
|
||||
#endif
|
||||
};
|
||||
|
||||
/// Class to record LLVM IR flag for a recipe along with it.
|
||||
|
@ -343,6 +343,10 @@ FastMathFlags VPRecipeWithIRFlags::getFastMathFlags() const {
|
||||
return Res;
|
||||
}
|
||||
|
||||
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
|
||||
void VPSingleDefRecipe::dump() const { VPDef::dump(); }
|
||||
#endif
|
||||
|
||||
template <unsigned PartOpIdx>
|
||||
VPValue *
|
||||
VPUnrollPartAccessor<PartOpIdx>::getUnrollPartOperand(VPUser &U) const {
|
||||
|
@ -1279,6 +1279,21 @@ TEST(VPRecipeTest, dumpRecipeInPlan) {
|
||||
},
|
||||
testing::ExitedWithCode(0), "WIDEN ir<%a> = add ir<1>, ir<2>");
|
||||
|
||||
VPDef *Def = WidenR;
|
||||
EXPECT_EXIT(
|
||||
{
|
||||
Def->dump();
|
||||
exit(0);
|
||||
},
|
||||
testing::ExitedWithCode(0), "WIDEN ir<%a> = add ir<1>, ir<2>");
|
||||
|
||||
EXPECT_EXIT(
|
||||
{
|
||||
WidenR->dump();
|
||||
exit(0);
|
||||
},
|
||||
testing::ExitedWithCode(0), "WIDEN ir<%a> = add ir<1>, ir<2>");
|
||||
|
||||
// Test VPRecipeBase::dump().
|
||||
VPRecipeBase *R = WidenR;
|
||||
EXPECT_EXIT(
|
||||
|
Loading…
x
Reference in New Issue
Block a user