-
Notifications
You must be signed in to change notification settings - Fork 15k
Closed
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization
Description
GCC recognises all these functions as equivalent, but LLVM doesn't:
int32_t smin(int32_t x, int32_t y) { return x < y ? x : y; }
int32_t smax(int32_t x, int32_t y) { return x < y ? x : y; }
bool smin_or_bitwise(int32_t x) { return (x < 0) | (smin(x, 1) < 0); }
bool smin_or_logical(int32_t x) { return (x < 0) || (smin(x, 1) < 0); }
bool smin_and_bitwise(int32_t x) { return (x < 0) & (smin(x, 1) < 0); }
bool smin_and_logical(int32_t x) { return (x < 0) && (smin(x, 1) < 0); }
bool smax_or_bitwise(int32_t x) { return (x < 0) | (smax(x, 1) < 0); }
bool smax_or_logical(int32_t x) { return (x < 0) || (smax(x, 1) < 0); }
bool smax_and_bitwise(int32_t x) { return (x < 0) & (smax(x, 1) < 0); }
bool smax_and_logical(int32_t x) { return (x < 0) && (smax(x, 1) < 0); }
Metadata
Metadata
Assignees
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization