-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization
Description
define i64 @src(i64 %0) {
%2 = call i64 @llvm.umax.i64(i64 %0, i64 1)
%3 = add nsw i64 %2, %0
%4 = icmp ult i64 %3, %0
%5 = call i64 @llvm.umin.i64(i64 %3, i64 329406144173384850)
%6 = select i1 %4, i64 329406144173384850, i64 %5
ret i64 %5
}
define i64 @tgt(i64 %0) {
%2 = call i64 @llvm.umax.i64(i64 %0, i64 1)
%3 = add nsw i64 %2, %0
%4 = call i64 @llvm.umin.i64(i64 %3, i64 329406144173384850)
ret i64 %4
}
Alive2: https://alive2.llvm.org/ce/z/ajmtVW
godbolt: https://godbolt.org/z/oMxExWGcd
Found this pattern in opencv/samples/cpp/tutorial_code/features2D/AKAZE_match.cpp
Metadata
Metadata
Assignees
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization