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

[DAG] extractShiftForRotate - Assertion `(OppShift.getOpcode() == ISD::SHL || OppShift.getOpcode() == ISD::SRL) && "Existing shift must be valid as a rotate half" #57474

Closed
RKSimon opened this issue Aug 31, 2022 · 9 comments · Fixed by llvm/llvm-project-release-prs#138
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:codegen release:backport release:merged

Comments

@RKSimon
Copy link
Collaborator

RKSimon commented Aug 31, 2022

Pulled out of #57283

define void @f() {
BB:
  br label %BB1

BB1:                                              ; preds = %BB
  %A = alloca <1 x i16>, align 2
  %L1 = load <1 x i16>, <1 x i16>* %A, align 2
  %I = insertelement <1 x i16> %L1, i16 -1, i16 0
  %B6 = add <1 x i16> %I, %I
  %B3 = srem <1 x i16> %B6, %I
  %B1 = add <1 x i16> %B3, %B3
  %B5 = sdiv <1 x i16> %B1, %I
  %B4 = udiv <1 x i16> %B3, <i16 -32768>
  %B2 = or <1 x i16> %B4, %B5
  %B = lshr <1 x i16> <i16 -32768>, %B2
  store <1 x i16> %B, <1 x i16>* %A, align 2
  ret void
}
@RKSimon RKSimon added llvm:codegen crash Prefer [crash-on-valid] or [crash-on-invalid] labels Aug 31, 2022
@RKSimon
Copy link
Collaborator Author

RKSimon commented Aug 31, 2022

CC @DataCorrupted - carrying on #57283 here in case we want to cherry pick it

@fhahn fhahn added the llvm Umbrella label for LLVM issues label Aug 31, 2022
@EugeneZelenko EugeneZelenko removed the llvm Umbrella label for LLVM issues label Aug 31, 2022
RKSimon added a commit that referenced this issue Aug 31, 2022
… an early-out

We feed the result from the first extractShiftForRotate call into the second, and that result might no longer be a shift op (usually due to constant folding).

NOTE: We REALLY need to stop creating nodes on the fly inside extractShiftForRotate!

Fixes Issue #57474
@RKSimon RKSimon added this to the LLVM 15.0.1 Release milestone Aug 31, 2022
@RKSimon
Copy link
Collaborator Author

RKSimon commented Aug 31, 2022

@tru Probably leave this until 15.0.1 - is it possible to set up the cherry pick now or do we have to wait until 15.0.0 has released?

@tru
Copy link
Collaborator

tru commented Aug 31, 2022

You can do it now. Should be fine !

@RKSimon
Copy link
Collaborator Author

RKSimon commented Aug 31, 2022

/cherry-pick eaede4b

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 31, 2022

/cherry-pick eaede4b

Error: Command failed due to missing milestone.

@tru
Copy link
Collaborator

tru commented Aug 31, 2022

Oops - my bad. I hadn't added the right metadata for that milestone- but I fixed it now so you could try again.

@RKSimon
Copy link
Collaborator Author

RKSimon commented Aug 31, 2022

/cherry-pick eaede4b

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 31, 2022

/branch llvm/llvm-project-release-prs/issue57474

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 31, 2022

/pull-request llvm/llvm-project-release-prs#138

tru pushed a commit that referenced this issue Sep 8, 2022
… an early-out

We feed the result from the first extractShiftForRotate call into the second, and that result might no longer be a shift op (usually due to constant folding).

NOTE: We REALLY need to stop creating nodes on the fly inside extractShiftForRotate!

Fixes Issue #57474

(cherry picked from commit eaede4b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:codegen release:backport release:merged
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants