[llvm] 17ad848 - [VPlan] Convert redundant isSingleScalar check into assert (NFC).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 7 12:04:38 PST 2025
Author: Florian Hahn
Date: 2025-11-07T20:04:25Z
New Revision: 17ad8480f8e67d902d85817275cee0158d1c85e5
URL: https://github.com/llvm/llvm-project/commit/17ad8480f8e67d902d85817275cee0158d1c85e5
DIFF: https://github.com/llvm/llvm-project/commit/17ad8480f8e67d902d85817275cee0158d1c85e5.diff
LOG: [VPlan] Convert redundant isSingleScalar check into assert (NFC).
Follow-up to post-commit suggestion in
https://github.com/llvm/llvm-project/pull/165506.
C must be a single-scalar, turn check into assert.
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 48bd697397f41..634df51a12965 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -1288,8 +1288,9 @@ static void simplifyRecipe(VPSingleDefRecipe *Def, VPTypeAnalysis &TypeInfo) {
// Look through broadcast of single-scalar when used as select conditions; in
// that case the scalar condition can be used directly.
if (match(Def,
- m_Select(m_Broadcast(m_VPValue(C)), m_VPValue(), m_VPValue())) &&
- vputils::isSingleScalar(C)) {
+ m_Select(m_Broadcast(m_VPValue(C)), m_VPValue(), m_VPValue()))) {
+ assert(vputils::isSingleScalar(C) &&
+ "broadcast operand must be single-scalar");
Def->setOperand(0, C);
return;
}
More information about the llvm-commits
mailing list