- Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization
Description
The following two functions can be simplified, and this is motivated from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109878.
#include<iostream> unsigned foo(unsigned a, unsigned c0, unsigned c1) { return ((c0 & c1) == c1) ? std::max(a & c0, a & c1) : (a & c0); } unsigned bar(unsigned a, unsigned c0, unsigned c1) { return ((c0 & c1) == c0) ? std::min(a & c0, a & c1) : (a & c0); }Alive2:
https://alive2.llvm.org/ce/z/kQrReA
https://alive2.llvm.org/ce/z/UQay5M
Metadata
Metadata
Assignees
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization