-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Closed
Labels
llvm:analysisIncludes value tracking, cost tables and constant foldingIncludes value tracking, cost tables and constant foldingmissed-optimization
Description
Alive2: https://alive2.llvm.org/ce/z/RN4Sch
----------------------------------------
define i1 @src(i8 %x) {
#0:
%cmp = icmp eq i8 %x, 0
%trunc = trunc nuw i8 %x to i1
%or = or i1 %cmp, %trunc
ret i1 %or
}
=>
define i1 @tgt(i8 %x) {
#0:
ret i1 1
}
Transformation seems to be correct!
It is a variant of #132678. cc @scottmcm
See also dtcxzyw/llvm-opt-benchmark#2234 (comment).
I don't know how to generalize this :(
Metadata
Metadata
Assignees
Labels
llvm:analysisIncludes value tracking, cost tables and constant foldingIncludes value tracking, cost tables and constant foldingmissed-optimization