[llvm] [VPlanTransform] Rename and narrow simplifyRecipe to VPSingleDefRecipe. nfc (PR #165568)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 29 17:02:42 PDT 2025
================
@@ -1057,54 +1057,51 @@ static VPValue *tryToFoldLiveIns(VPSingleDefRecipe &R,
return nullptr;
}
-/// Try to simplify recipe \p R.
-static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
- VPlan *Plan = R.getParent()->getPlan();
-
- auto *Def = dyn_cast<VPSingleDefRecipe>(&R);
- if (!Def)
- return;
+/// Try to simplify VPSingleDefRecipe \p Def.
+static void simplifySingleDefRecipe(VPSingleDefRecipe &Def,
+ VPTypeAnalysis &TypeInfo) {
+ VPlan *Plan = Def.getParent()->getPlan();
// Simplification of live-in IR values for SingleDef recipes using
// InstSimplifyFolder.
const DataLayout &DL =
Plan->getScalarHeader()->getIRBasicBlock()->getDataLayout();
- if (VPValue *V = tryToFoldLiveIns(*Def, Def->operands(), DL, TypeInfo))
- return Def->replaceAllUsesWith(V);
+ if (VPValue *V = tryToFoldLiveIns(Def, Def.operands(), DL, TypeInfo))
+ return Def.replaceAllUsesWith(V);
----------------
fhahn wrote:
Could we change `Def` to `VPSingleDefRecipe *Def`, which would help to reduce the diff quite a bit?
https://github.com/llvm/llvm-project/pull/165568
More information about the llvm-commits
mailing list