-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[Loop Vectorize] Crash: Assertion `CastInst::castIsValid(opc, C, Ty) && "Invalid constantexpr cast!"' #137185
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
Labels
Comments
As far as I can see, we are trying to truncate an i32 value to i64 type, which is illegal, here:
|
I have also noticed the assertion as a result of commit 783a846 for invalid truncation. @fhahn , Does the following fix make sense?
|
@fhahn , Sure I do. Both tests need target triple to fail. |
llvm-sync bot
pushed a commit
to arm/arm-toolchain
that referenced
this issue
May 7, 2025
…e (#137832) Replace CreateTrunc with CreateSExtOrTrunc in VPScalarIVStepsRecipe to safely handle type conversion. This prevents assertion failures from invalid truncation when StartIdx0 has a smaller integer type than IntStepTy. The assertion was introduced by commit 783a846. Fixes llvm/llvm-project#137185
GeorgeARM
pushed a commit
to GeorgeARM/llvm-project
that referenced
this issue
May 7, 2025
) Replace CreateTrunc with CreateSExtOrTrunc in VPScalarIVStepsRecipe to safely handle type conversion. This prevents assertion failures from invalid truncation when StartIdx0 has a smaller integer type than IntStepTy. The assertion was introduced by commit 783a846. Fixes llvm#137185
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is the godbolt link to the reproducer: https://godbolt.org/z/354qYx43T
For the record here is the IR:
which fails when running:
opt -passes=loop-vectorize -slp-threshold=-99999 -force-vector-width=4
with the backtrace:The text was updated successfully, but these errors were encountered: