[llvm] Fix EXTEND_VECTOR_INREG widening when input > result size (PR #177095)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 20 22:00:45 PST 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
index b05e29a8f..7c9974013 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -7713,7 +7713,8 @@ SDValue DAGTypeLegalizer::WidenVecOp_EXTEND_VECTOR_INREG(SDNode *N) {
// If widening makes the input larger than the original result, widen the
// result to match, then extract back down.
if (WideInVT.getSizeInBits() > ResVT.getSizeInBits()) {
- assert(ResVT.isVector() && "Expected vector result for EXTEND_VECTOR_INREG");
+ assert(ResVT.isVector() &&
+ "Expected vector result for EXTEND_VECTOR_INREG");
EVT ResEltVT = ResVT.getVectorElementType();
unsigned EltBits = ResEltVT.getSizeInBits();
assert(EltBits && (WideInVT.getSizeInBits() % EltBits) == 0 &&
@@ -7730,7 +7731,6 @@ SDValue DAGTypeLegalizer::WidenVecOp_EXTEND_VECTOR_INREG(SDNode *N) {
return DAG.getNode(N->getOpcode(), DL, ResVT, WideInOp);
}
-
SDValue DAGTypeLegalizer::WidenVecOp_STORE(SDNode *N) {
// We have to widen the value, but we want only to store the original
// vector type.
``````````
</details>
https://github.com/llvm/llvm-project/pull/177095
More information about the llvm-commits
mailing list