-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
[PowerPC] Backend crash due to index out of bound when lshr
/ shl
i128 vector after sub
#59074
Labels
Comments
@llvm/issue-subscribers-backend-powerpc |
It looks like BitPermutationSelector.getValueBits doesn't account for PPCISD shift opcodes handling of out of bounds shift amounts (or ISD::ROTL by the looks of it).
|
I posted https://reviews.llvm.org/D138551 for review. |
andrewrk
added a commit
to ziglang/www.ziglang.org
that referenced
this issue
Feb 1, 2024
Blocked by this bug in LLVM: llvm/llvm-project#59074
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Description
When targeting
ppc64
,ppc32
, orppc32le
, the following code containing i128 vector shift crashes backend due to index being out of bound duringPowerPC DAG->DAG Pattern Instruction Selection
.The problem occurs for
lshr
andshl
but not forashr
.The problem occurs for
sub
but not foradd
and the result ofsub
must be used as the shift amount operand.The problem doesn't occur for i64 vectors.
The problem doesn't occur when targeting
ppc64le
,aarch64
,x86_64
, orriscv64
.Minimal Reproduction
https://godbolt.org/z/vW4YT3Ga7
Code
Stack Trace
Cause
The following line returns the shift amount
4294967232
(-64
represented inunsigned
) which is wrong and caused out-of-bound access to vector in the following code.llvm-project/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
Line 1502 in af029d3
The text was updated successfully, but these errors were encountered: