-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization
Description
https://alive2.llvm.org/ce/z/e4RhjY
define i32 @src(i32 %0) {
%1:
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
%4 = and i32 %3, %0
ret i32 %4
}
=>
define i32 @tgt(i32 %0) {
%1:
ret i32 0
}
Transformation seems to be correct!Simple reproducer:
https://godbolt.org/z/YP7nEofeo
int foo (int a)
{
return (a & !a);
}Metadata
Metadata
Assignees
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization