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

assertion failing in multiple backends "We are expecting that A is always less than all-ones for SVT" #84830

Closed
regehr opened this issue Mar 11, 2024 · 5 comments · Fixed by #86238
Labels
crash-on-valid llvm:SelectionDAG SelectionDAGISel as well

Comments

@regehr
Copy link
Contributor

regehr commented Mar 11, 2024

both the AArch64 and x86-64 backends assert out on this input:

define i32 @f(i1 %0) {
  %new0 = srem i1 %0, true
  %last = zext i1 %new0 to i32
  %2 = icmp ne i32 %last, 0
  %3 = select i1 %2, i32 0, i32 1
  ret i32 %3
}
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 11, 2024

@llvm/issue-subscribers-backend-aarch64

Author: John Regehr (regehr)

both the AArch64 and x86-64 backends assert out on this input: ``` define i32 @f(i1 %0) { %new0 = srem i1 %0, true %last = zext i1 %new0 to i32 %2 = icmp ne i32 %last, 0 %3 = select i1 %2, i32 0, i32 1 ret i32 %3 } ```

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 11, 2024

@llvm/issue-subscribers-backend-x86

Author: John Regehr (regehr)

both the AArch64 and x86-64 backends assert out on this input: ``` define i32 @f(i1 %0) { %new0 = srem i1 %0, true %last = zext i1 %new0 to i32 %2 = icmp ne i32 %last, 0 %3 = select i1 %2, i32 0, i32 1 ret i32 %3 } ```

@RKSimon RKSimon added the llvm:SelectionDAG SelectionDAGISel as well label Mar 11, 2024
@RKSimon
Copy link
Collaborator

RKSimon commented Mar 11, 2024

They appear to be failing in llvm::TargetLowering::prepareSREMEqFold https://clang.godbolt.org/z/Pjf8bnrnE

@svs-quic
Copy link
Contributor

Bisected to #82706
cc: @resistor

@resistor
Copy link
Collaborator

Almost certainly the assertion just needs to be moved above the special case.

resistor added a commit that referenced this issue Mar 24, 2024
…non-splat vector SREM expansion when we aren't hitting the special case. (#86238)

Fixes #84830
Introduced in #82706
qihangkong pushed a commit to rvgpu/llvm that referenced this issue Apr 18, 2024
of non-splat vector SREM expansion when we aren't hitting the
special case.

Fixes llvm/llvm-project#84830
Introduced in llvm/llvm-project#82706
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
6 participants