-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Allow more dead AND operations to be eliminated #123686
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 |
|---|---|---|
|
|
@@ -311,10 +311,12 @@ define i32 @ctpop16(i16 %x) nounwind readnone { | |
| ; CHECK-NEXT: and r2, r0, r1 | ||
| ; CHECK-NEXT: and r0, r1, r0, lsr #2 | ||
| ; CHECK-NEXT: add r0, r2, r0 | ||
| ; CHECK-NEXT: mov r1, #15 | ||
| ; CHECK-NEXT: orr r1, r1, #3840 | ||
| ; CHECK-NEXT: add r0, r0, r0, lsr #4 | ||
| ; CHECK-NEXT: and r1, r0, #3840 | ||
| ; CHECK-NEXT: and r0, r0, #15 | ||
| ; CHECK-NEXT: add r0, r0, r1, lsr #8 | ||
| ; CHECK-NEXT: and r0, r0, r1 | ||
|
Contributor
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. Regression |
||
| ; CHECK-NEXT: add r0, r0, r0, lsr #8 | ||
| ; CHECK-NEXT: and r0, r0, #255 | ||
| ; CHECK-NEXT: mov pc, lr | ||
| %count = tail call i16 @llvm.ctpop.i16(i16 %x) | ||
| %conv = zext i16 %count to i32 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -201,9 +201,10 @@ define i16 @test_ctpop_i16(i16 %a) nounwind { | |
| ; LA32-NEXT: add.w $a0, $a2, $a0 | ||
| ; LA32-NEXT: srli.w $a1, $a0, 4 | ||
| ; LA32-NEXT: add.w $a0, $a0, $a1 | ||
| ; LA32-NEXT: bstrpick.w $a1, $a0, 11, 8 | ||
| ; LA32-NEXT: andi $a0, $a0, 15 | ||
| ; LA32-NEXT: andi $a0, $a0, 3855 | ||
| ; LA32-NEXT: srli.w $a1, $a0, 8 | ||
|
Contributor
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. Regression |
||
| ; LA32-NEXT: add.w $a0, $a0, $a1 | ||
| ; LA32-NEXT: andi $a0, $a0, 31 | ||
| ; LA32-NEXT: ret | ||
| ; | ||
| ; LA64-LABEL: test_ctpop_i16: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,8 +24,9 @@ define i16 @zpop_i8_i16(i8 %x) { | |
| ; SLOW-NEXT: srwi 4, 3, 4 | ||
| ; SLOW-NEXT: add 3, 3, 4 | ||
| ; SLOW-NEXT: rlwinm 4, 3, 24, 28, 31 | ||
| ; SLOW-NEXT: clrlwi 3, 3, 28 | ||
| ; SLOW-NEXT: andi. 3, 3, 3855 | ||
| ; SLOW-NEXT: add 3, 3, 4 | ||
| ; SLOW-NEXT: clrlwi 3, 3, 27 | ||
|
Contributor
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. Regression |
||
| ; SLOW-NEXT: blr | ||
| %z = zext i8 %x to i16 | ||
| %pop = tail call i16 @llvm.ctpop.i16(i16 %z) | ||
|
|
@@ -173,9 +174,9 @@ define i32 @popz_i16_32(i16 %x) { | |
| ; SLOW-NEXT: srwi 4, 3, 4 | ||
| ; SLOW-NEXT: add 3, 3, 4 | ||
| ; SLOW-NEXT: rlwinm 4, 3, 24, 28, 31 | ||
| ; SLOW-NEXT: clrlwi 3, 3, 28 | ||
| ; SLOW-NEXT: andi. 3, 3, 3855 | ||
| ; SLOW-NEXT: add 3, 3, 4 | ||
| ; SLOW-NEXT: clrldi 3, 3, 32 | ||
| ; SLOW-NEXT: clrlwi 3, 3, 27 | ||
| ; SLOW-NEXT: blr | ||
| %pop = tail call i16 @llvm.ctpop.i16(i16 %x) | ||
| %z = zext i16 %pop to i32 | ||
|
|
@@ -278,7 +279,7 @@ define i64 @popa_i16_i64(i16 %x) { | |
| ; SLOW-NEXT: srwi 4, 3, 4 | ||
| ; SLOW-NEXT: add 3, 3, 4 | ||
| ; SLOW-NEXT: rlwinm 4, 3, 24, 28, 31 | ||
| ; SLOW-NEXT: clrlwi 3, 3, 28 | ||
| ; SLOW-NEXT: andi. 3, 3, 3855 | ||
| ; SLOW-NEXT: add 3, 3, 4 | ||
| ; SLOW-NEXT: rlwinm 3, 3, 0, 27, 27 | ||
| ; SLOW-NEXT: blr | ||
|
|
||
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.
Technically no worse but now we're emitting a messier constant