Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM ERROR: Don't know how to widen the operands for INSERT_SUBVECTOR #124255

Closed
abhishek-kaushik22 opened this issue Jan 24, 2025 · 1 comment · Fixed by #124420
Closed

LLVM ERROR: Don't know how to widen the operands for INSERT_SUBVECTOR #124255

abhishek-kaushik22 opened this issue Jan 24, 2025 · 1 comment · Fixed by #124420
Assignees
Labels
crash-on-valid llvm:SelectionDAG SelectionDAGISel as well

Comments

@abhishek-kaushik22
Copy link
Contributor

define <8 x i32> @foo(<8 x i32> %a, <2 x i32> %b) {
  %result = tail call <8 x i32> @llvm.vector.insert.v8i32.v2i32(<8 x i32> %a, <2 x i32> %b, i64 0)
  ret <8 x i32> %result
}

https://godbolt.org/z/x6qnfPM7W

We get a fatal error in DAGTypeLegalizer::WidenVecOp_INSERT_SUBVECTOR for this seemingly simple code.
I'm not sure how this could be fixed. Can we just replace the INSERT_SUBVECTOR with a series of INSERT_VECTOR_ELT nodes?

There's also #102016 for AArch that also looks like the same problem as this one.

@llvmbot
Copy link
Member

llvmbot commented Jan 24, 2025

@llvm/issue-subscribers-backend-x86

Author: None (abhishek-kaushik22)

```llvm define <8 x i32> @foo(<8 x i32> %a, <2 x i32> %b) { %result = tail call <8 x i32> @llvm.vector.insert.v8i32.v2i32(<8 x i32> %a, <2 x i32> %b, i64 0) ret <8 x i32> %result } ```

https://godbolt.org/z/x6qnfPM7W

We get a fatal error in DAGTypeLegalizer::WidenVecOp_INSERT_SUBVECTOR for this seemingly simple code.
I'm not sure how this could be fixed. Can we just replace the INSERT_SUBVECTOR with a series of INSERT_VECTOR_ELT nodes?

There's also #102016 for AArch that also looks like the same problem as this one.

abhishek-kaushik22 added a commit to abhishek-kaushik22/llvm-project that referenced this issue Jan 25, 2025
…OR_ELT`

If the operands to `INSERT_SUBVECTOR` can't be widened legally, just replace the `INSERT_SUBVECTOR` with a series of `INSERT_VECTOR_ELT`.

Closes llvm#124255 (and possibly llvm#102016)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash-on-valid llvm:SelectionDAG SelectionDAGISel as well
Projects
None yet
3 participants