Open
Description
https://llvm.godbolt.org/z/z3E6641E1
; RUN: opt -S -passes=instsimplify < %s
define i1 @foo(i32 %x) {
%ctpop = call i32 @llvm.ctpop.i32(i32 %x)
%cond = icmp eq i32 %ctpop, 1
%ext = zext i1 %cond to i8
call void @llvm.assume(i1 %cond)
%res = icmp eq i32 %x, 0
ret i1 %res
}
Results in:
define i1 @foo(i32 %x) {
%res = icmp eq i32 %x, 0
ret i1 %res
}
Note that the dead %ext
is relevant.
Without looking into it, I assume that the problem is that we're using
llvm-project/llvm/lib/Analysis/InstructionSimplify.cpp
Lines 6307 to 6310 in aad74dc
%ext
is what makes use currently think it is non-ephemeral.