-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Open
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillallvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passes
Description
| Bugzilla Link | 42466 |
| Version | trunk |
| OS | Linux |
| CC | @topperc,@davidbolvansky,@efriedma-quic,@RKSimon,@nikic,@rotateright |
Extended Description
As discussed in https://reviews.llvm.org/D63829
These two patterns are identical:
define i1 @v0(i32 %x, i32 %y, i32 %z) {
%t0 = lshr i32 %x, %y
%t2 = and i32 %t0, %z
%t3 = icmp ne i32 %t2, 0
ret i1 %t3
}
define i1 @v1(i32 %x, i32 %y, i32 %z) {
%t0 = shl i32 %y, %y
%t2 = and i32 %t0, %x
%t3 = icmp ne i32 %t2, 0
ret i1 %t3
}
We should canonicalize to one of them.
Probably to @v0.
With one obvious exception of (1 << y) & x.
https://godbolt.org/z/KPgPPQ
https://rise4fun.com/Alive/0avd
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillallvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passes