-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Open
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization
Description
define i1 @src(ptr %0) {
%v0 = getelementptr inbounds nuw i8, ptr %0, i64 4
%v1 = load i32, ptr %v0, align 4
%v2 = zext i32 %v1 to i64
%v3 = ptrtoint ptr %v0 to i64
%v4 = add i64 %v2, %v3
%v5 = and i64 %v4, 2
%v6 = icmp eq i64 %v5, 0
ret i1 %v6
}
define i1 @tgt(ptr %0) {
%v0 = getelementptr inbounds nuw i8, ptr %0, i64 4
%v1 = load i32, ptr %v0, align 4
%v2 = and i32 %v1, 2
%v3 = icmp eq i32 %v2, 0
ret i1 %v3
}
alive2: https://alive2.llvm.org/ce/z/h8HYTo
godbolt: https://godbolt.org/z/Mqzs9W8q4
Found this pattern in https://github.com/dtcxzyw/llvm-opt-benchmark/blob/main/bench/linux/optimized/static_call_inline.ll
Metadata
Metadata
Assignees
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization