-
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 %arg1, ptr %arg0) {
%v0 = sub nsw i32 0, %arg1
%v1 = load i32, ptr %arg0, align 8
%v2 = sub nsw i32 %v1, %arg1
%v3 = tail call i32 @llvm.smin.i32(i32 %v0, i32 %v2)
%v4 = add nsw i32 %v3, %arg1
ret i32 %v4
}
define i32 @tgt(i32 %arg1, ptr %arg0) {
%v1 = load i32, ptr %arg0, align 8
%v3 = tail call i32 @llvm.smin.i32(i32 %v1, i32 0)
ret i32 %v3
}
alive2: https://alive2.llvm.org/ce/z/xiRFZd
godbolt: https://godbolt.org/z/Kdc8r5TPY
Pattern found in: https://github.com/dtcxzyw/llvm-opt-benchmark/blob/main/bench/ffmpeg/optimized/mpegaudiodec_fixed.ll
Metadata
Metadata
Assignees
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization