-
Notifications
You must be signed in to change notification settings - Fork 15k
Open
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization
Description
void* test1(char* first, char val) {
return __builtin_memchr(first, val, 2);
}
always generates a call to memchr
, even though it could just check the two chars. I can't really see a case where calling memchr
is faster than just checking the two chars. For larger N it would also be interesting to use vector comparisons for this instead of calling a function.
frederick-vs-ja
Metadata
Metadata
Assignees
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization