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

[GISel] unable to legalize instruction: %4:_(<2 x s16>) = G_INSERT_VECTOR_ELT #63826

Closed
vfdff opened this issue Jul 12, 2023 · 3 comments · Fixed by #65830
Closed

[GISel] unable to legalize instruction: %4:_(<2 x s16>) = G_INSERT_VECTOR_ELT #63826

vfdff opened this issue Jul 12, 2023 · 3 comments · Fixed by #65830

Comments

@vfdff
Copy link
Contributor

vfdff commented Jul 12, 2023

test: https://gcc.godbolt.org/z/e3Wq9Mdar

define <2 x i16> @f(i16 %a, <2 x i16> %vec) {
  %vec1 = insertelement <2 x i16> %vec, i16 1, i32 0 
  ret <2 x i16> %vec1
}
  • reproduce command: llc -mtriple=aarch64-eabi -global-isel=1 test_val1.ll -debug-only=instruction-select -stop-before=regbankselect -o - -debug-only=legalizer
Legalize Machine IR for: f
=== New Iteration ===
Legalizing: %4:_(<2 x s16>) = G_INSERT_VECTOR_ELT %1:_, %5:_(s16), %6:_(s32)
.. Unable to legalize
LLVM ERROR: unable to legalize instruction: %4:_(<2 x s16>) = G_INSERT_VECTOR_ELT %1:_, %5:_(s16), %6:_(s32) (in function: f)
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
@llvmbot
Copy link
Collaborator

llvmbot commented Jul 12, 2023

@llvm/issue-subscribers-backend-aarch64

@tschuett
Copy link
Member

@vfdff
Copy link
Contributor Author

vfdff commented Sep 8, 2023

I find this case is crashed with new fail:https://gcc.godbolt.org/z/e3Wq9Mdar

LLVM ERROR: unable to legalize instruction: %7:_(<2 x s32>) = G_ANYEXT %17:_(<2 x s16>) (in function: f)

@vfdff vfdff reopened this Sep 8, 2023
vfdff added a commit to vfdff/llvm-project that referenced this issue Sep 12, 2023
Widen the vector elements to 64 bits to make sure it legal instead by
clamping the number of elements. refer to commit ccffc27.

Fixes llvm#63826
vfdff added a commit that referenced this issue Sep 12, 2023
Widen the vector elements to 64 bits to make sure it legal instead by
clamping the number of elements. Depend on D153394.

Fixes #63826
ZijunZhaoCCK pushed a commit to ZijunZhaoCCK/llvm-project that referenced this issue Sep 19, 2023
Widen the vector elements to 64 bits to make sure it legal instead by
clamping the number of elements. Depend on D153394.

Fixes llvm#63826
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants