[llvm] [VPlan] Use InstSimplifyFolder in tryToConstantFold (PR #141222)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sat May 24 02:17:35 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 to a constant. Will succeed and
+/// return a non-nullptr Value for a handled \p Opcode if \p Operands are
+/// foldable.
----------------
fhahn wrote:
Yep. My understanding is that the constant folder folds instructions with constants to other constants and InstSimplifyFolder folds instructions with values (including non-constant) to other existing values, so the result is not necessarily a constant, hence the update to live-ins (which in some sense are 'constant' w.r.t. to VPlan, but not llvm::Constant)
https://github.com/llvm/llvm-project/pull/141222
More information about the llvm-commits
mailing list