-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[TargetLowering][AMDGPU][ARM][RISCV][X86] Teach SimplifyDemandedBits to combine (srl (sra X, C1), ShAmt) -> sra(X, C1+ShAmt) #101751
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
8030bda
8f10bbf
2f7137b
75581eb
9e63221
f894a7f
8b61ba6
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 |
---|---|---|
|
@@ -209,8 +209,7 @@ define i1 @test_srem_pow2_setne(i6 %X) nounwind { | |
; ARM5: @ %bb.0: | ||
; ARM5-NEXT: lsl r1, r0, #26 | ||
; ARM5-NEXT: mov r2, #3 | ||
; ARM5-NEXT: asr r1, r1, #26 | ||
; ARM5-NEXT: and r1, r2, r1, lsr #9 | ||
; ARM5-NEXT: and r1, r2, r1, asr #31 | ||
; ARM5-NEXT: add r1, r0, r1 | ||
; ARM5-NEXT: and r1, r1, #60 | ||
; ARM5-NEXT: sub r0, r0, r1 | ||
|
@@ -222,8 +221,7 @@ define i1 @test_srem_pow2_setne(i6 %X) nounwind { | |
; ARM6: @ %bb.0: | ||
; ARM6-NEXT: lsl r1, r0, #26 | ||
; ARM6-NEXT: mov r2, #3 | ||
; ARM6-NEXT: asr r1, r1, #26 | ||
; ARM6-NEXT: and r1, r2, r1, lsr #9 | ||
; ARM6-NEXT: and r1, r2, r1, asr #31 | ||
; ARM6-NEXT: add r1, r0, r1 | ||
; ARM6-NEXT: and r1, r1, #60 | ||
; ARM6-NEXT: sub r0, r0, r1 | ||
|
@@ -233,8 +231,9 @@ define i1 @test_srem_pow2_setne(i6 %X) nounwind { | |
; | ||
; ARM7-LABEL: test_srem_pow2_setne: | ||
; ARM7: @ %bb.0: | ||
; ARM7-NEXT: sbfx r1, r0, #0, #6 | ||
; ARM7-NEXT: ubfx r1, r1, #9, #2 | ||
; ARM7-NEXT: lsl r1, r0, #26 | ||
; ARM7-NEXT: mov r2, #3 | ||
; ARM7-NEXT: and r1, r2, r1, asr #31 | ||
; ARM7-NEXT: add r1, r0, r1 | ||
; ARM7-NEXT: and r1, r1, #60 | ||
; ARM7-NEXT: sub r0, r0, r1 | ||
|
@@ -244,8 +243,9 @@ define i1 @test_srem_pow2_setne(i6 %X) nounwind { | |
; | ||
; ARM8-LABEL: test_srem_pow2_setne: | ||
; ARM8: @ %bb.0: | ||
; ARM8-NEXT: sbfx r1, r0, #0, #6 | ||
; ARM8-NEXT: ubfx r1, r1, #9, #2 | ||
; ARM8-NEXT: lsl r1, r0, #26 | ||
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. Looks like ARM prefers to fold 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. Considering these get optimized very differently by opt, and I don't see this coming up elsewhere I think it is OK. (I may look into it in the future to see if there is something we can do more generally to improve it). 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. Thanks @davemgreen |
||
; ARM8-NEXT: mov r2, #3 | ||
; ARM8-NEXT: and r1, r2, r1, asr #31 | ||
; ARM8-NEXT: add r1, r0, r1 | ||
; ARM8-NEXT: and r1, r1, #60 | ||
; ARM8-NEXT: sub r0, r0, r1 | ||
|
@@ -255,8 +255,9 @@ define i1 @test_srem_pow2_setne(i6 %X) nounwind { | |
; | ||
; NEON7-LABEL: test_srem_pow2_setne: | ||
; NEON7: @ %bb.0: | ||
; NEON7-NEXT: sbfx r1, r0, #0, #6 | ||
; NEON7-NEXT: ubfx r1, r1, #9, #2 | ||
; NEON7-NEXT: lsl r1, r0, #26 | ||
; NEON7-NEXT: mov r2, #3 | ||
; NEON7-NEXT: and r1, r2, r1, asr #31 | ||
; NEON7-NEXT: add r1, r0, r1 | ||
; NEON7-NEXT: and r1, r1, #60 | ||
; NEON7-NEXT: sub r0, r0, r1 | ||
|
@@ -266,8 +267,9 @@ define i1 @test_srem_pow2_setne(i6 %X) nounwind { | |
; | ||
; NEON8-LABEL: test_srem_pow2_setne: | ||
; NEON8: @ %bb.0: | ||
; NEON8-NEXT: sbfx r1, r0, #0, #6 | ||
; NEON8-NEXT: ubfx r1, r1, #9, #2 | ||
; NEON8-NEXT: lsl r1, r0, #26 | ||
; NEON8-NEXT: mov r2, #3 | ||
; NEON8-NEXT: and r1, r2, r1, asr #31 | ||
; NEON8-NEXT: add r1, r0, r1 | ||
; NEON8-NEXT: and r1, r1, #60 | ||
; NEON8-NEXT: sub r0, r0, r1 | ||
|
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.
Small encoding size improvement