-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization
Description
define i32 @src(i32 %0) {
%1:
%2 = icmp eq i32 %0, 0
%3 = lshr i32 %0, 31
%4 = select i1 %2, i32 1, i32 %3
ret i32 %4
}
=>
define i32 @tgt(i32 %0) {
%1:
%2 = icmp slt i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
Transformation seems to be correct!
https://godbolt.org/z/evaE94d7o
https://alive2.llvm.org/ce/z/6ra3nj
Metadata
Metadata
Assignees
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization