-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[InstCombine] Regard zext nneg
as sext
when folding add(zext neg(add))
#88348
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
Comments
zext nneg
into sext
when an optimization opportunity is identifiedzext nneg
as sext
when folding add(zext neg(add))
Hi! This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below. |
@llvm/issue-subscribers-good-first-issue Author: Quentin Dian (DianQK)
The following transformation is legal after adding `nneg`:
define i32 @<!-- -->src(i8 %v) {
%switch.tableidx = add nsw i8 %v, 1
%switch.idx.cast = zext nneg i8 %switch.tableidx to i32
%switch.offset = add nsw i32 %switch.idx.cast, -1
ret i32 %switch.offset
}
define i32 @<!-- -->tgt(i8 %v) {
%ext = sext i8 %v to i32
ret i32 %ext
} Alive2: https://alive2.llvm.org/ce/z/2iCmDs |
Should be easy to fix in:
|
Can I work on this issue? I'm glad to try it :) |
#88887) fixes #88348 proof: https://alive2.llvm.org/ce/z/fJnM7t test will be added later --------- Signed-off-by: ZelinMa557 <[email protected]>
llvm#88887) fixes llvm#88348 proof: https://alive2.llvm.org/ce/z/fJnM7t test will be added later --------- Signed-off-by: ZelinMa557 <[email protected]>
The following transformation is legal after adding
nneg
:Alive2: https://alive2.llvm.org/ce/z/2iCmDs
From: rust-lang/rust#106459 (comment)
The text was updated successfully, but these errors were encountered: