-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[RISCV][GISel] Remove s32 support for G_CTPOP/CTLZ/CTTZ on RV64. #115101
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -752,8 +752,6 @@ define i1 @ctpop_i32_ult_two(i32 signext %a) nounwind { | |
; RV64ZBB-LABEL: ctpop_i32_ult_two: | ||
; RV64ZBB: # %bb.0: | ||
; RV64ZBB-NEXT: cpopw a0, a0 | ||
; RV64ZBB-NEXT: slli a0, a0, 32 | ||
; RV64ZBB-NEXT: srli a0, a0, 32 | ||
; RV64ZBB-NEXT: sltiu a0, a0, 2 | ||
; RV64ZBB-NEXT: ret | ||
%1 = call i32 @llvm.ctpop.i32(i32 %a) | ||
|
@@ -794,6 +792,8 @@ define signext i32 @ctpop_i32_load(ptr %p) nounwind { | |
; RV64ZBB-LABEL: ctpop_i32_load: | ||
; RV64ZBB: # %bb.0: | ||
; RV64ZBB-NEXT: lw a0, 0(a0) | ||
; RV64ZBB-NEXT: slli a0, a0, 32 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this needed or was this incorrect previously? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not needed. The two shifts are a zero_extend from s32 to s64. We need to enable load+zext combine post legalization to get rid of the zext. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is a fallout from making i32 illegal There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @topperc are you planning on working on the load+zext combine too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
; RV64ZBB-NEXT: srli a0, a0, 32 | ||
; RV64ZBB-NEXT: cpopw a0, a0 | ||
; RV64ZBB-NEXT: ret | ||
%a = load i32, ptr %p | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a test here for AND+CPOP but it is covered by the IR testing.