I am not sure if I understand the method well. In my imagination, it still can’t solve the case that the value %cond
are only used by the assumption like the reproducer did.
I mean something like:
%0 = ptr
...
%4 = tail call i1 @whatever(ptr %3, ptr %2, ptr %1, ptr %0)
tail call void @llvm.assume(i1 %4)
Given %0
~%4
are only used by @llvm.assume
, can we eliminate all of them now?
Or only if %4
is only used by @llvm.assume
but %4
provides some information, so that eliminating %4
may affect the optimizer too. Then how should we make a decision here?
IIUC, is it possible to solve the question by an @llvm.assume()
without i1 %cond
? I feel the edge cases will be much less in this way.