[llvm] [VPlan] Use InstSimplifyFolder in tryToConstantFold (PR #141222)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue May 27 09:24:23 PDT 2025


================
@@ -939,8 +939,9 @@ static void recursivelyDeleteDeadRecipes(VPValue *V) {
   }
 }
 
-/// Try to fold \p R using TargetFolder to a constant. Will succeed and return a
-/// non-nullptr Value for a handled \p Opcode if all \p Operands are constant.
+/// Try to fold \p R using InstSimplifyFolder. Will succeed and return a
+/// non-nullptr Value for a handled \p Opcode if corresponding \p Operands are
+/// foldable.
----------------
fhahn wrote:

```suggestion
/// Try to fold \p R using InstSimplifyFolder. Will succeed and return a
/// non-nullptr Value for a handled \p Opcode if corresponding \p Operands are
/// foldable live-ins.
static Value *tryToFoldLiveIns(const VPRecipeBase &R, unsigned Opcode,
```

might be worth also updating the name here Constant -> LiveIns

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


More information about the llvm-commits mailing list