-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Closed
Labels
good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributellvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization
Description
From rust-lang/rust#138497:
define i8 @src(i8 %x) {
%cttz = call i8 @llvm.cttz.i8(i8 %x, i1 false)
%lshr = lshr i8 %x, %cttz
ret i8 %lshr
}
define i8 @tgt(i8 %x) {
%cttz = call i8 @llvm.cttz.i8(i8 %x, i1 false)
%lshr = lshr exact i8 %x, %cttz
ret i8 %lshr
}https://alive2.llvm.org/ce/z/KFemjy
This then allows folding icmp eq %lshr, 0.
leonardo-m
Metadata
Metadata
Assignees
Labels
good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributellvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization