[llvm] a40f971 - [VPlan] Refine VPValue types in tryToFoldLiveIns (NFC) (#178183)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 27 05:23:10 PST 2026
Author: Ramkumar Ramachandra
Date: 2026-01-27T13:23:06Z
New Revision: a40f9710b7493df743557f2d2dd53e3e4d3a1cb7
URL: https://github.com/llvm/llvm-project/commit/a40f9710b7493df743557f2d2dd53e3e4d3a1cb7
DIFF: https://github.com/llvm/llvm-project/commit/a40f9710b7493df743557f2d2dd53e3e4d3a1cb7.diff
LOG: [VPlan] Refine VPValue types in tryToFoldLiveIns (NFC) (#178183)
tryToFoldLiveIns operates on live-ins (that is, both VPIRValues and
VPSymbolicValues), and returns a VPIRValue. Clarify this.
Added:
Modified:
llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
index d1d5870d78a03..90e32b9e1ce1d 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -1128,17 +1128,17 @@ getOpcodeOrIntrinsicID(const VPSingleDefRecipe *R) {
/// Try to fold \p R using InstSimplifyFolder. Will succeed and return a
/// non-nullptr VPValue for a handled opcode or intrinsic ID if corresponding \p
/// Operands are foldable live-ins.
-static VPValue *tryToFoldLiveIns(VPSingleDefRecipe &R,
- ArrayRef<VPValue *> Operands,
- const DataLayout &DL,
- VPTypeAnalysis &TypeInfo) {
+static VPIRValue *tryToFoldLiveIns(VPSingleDefRecipe &R,
+ ArrayRef<VPValue *> Operands,
+ const DataLayout &DL,
+ VPTypeAnalysis &TypeInfo) {
auto OpcodeOrIID = getOpcodeOrIntrinsicID(&R);
if (!OpcodeOrIID)
return nullptr;
SmallVector<Value *, 4> Ops;
for (VPValue *Op : Operands) {
- if (!isa<VPIRValue, VPSymbolicValue>(Op))
+ if (!match(Op, m_LiveIn()))
return nullptr;
Value *V = Op->getUnderlyingValue();
if (!V)
More information about the llvm-commits
mailing list