Interpreter and arithmetic overflow intrinsics

Hi all,

I am trying to run LLI on an optimized bitcode file in interpreted
mode, and I get the following error message:

LLVM ERROR: Code generator does not support intrinsic function
'llvm.usub.with.overflow.i32'!

As the error message indicates, this intrinsic is not supported
(lib/CodeGen/IntrinsicLowering.cpp). Is there any way that I can get
the interpreter to work across this intrinsic? I am happy to dig into
the LLVM source code to fix this if required, but want to understand
if there are some fundamental difficulties in supporting something
like this or not. If not, what is the easiest way of adding this
support?

thanks,

Sorav

To my knowledge, the IR interpeter has not been actively maintained for several years. Fixing this particular issue would be straight forward, and your certainly welcome to contribute a patch, but I'd suggest taking a step back and asking why you want to use the IR interpreter at all. What use case are you solving? There may be a better option available.

Philip

Thanks Philip for your response!

To my knowledge, the IR interpeter has not been actively maintained for
several years. Fixing this particular issue would be straight forward,
and your certainly welcome to contribute a patch, but I'd suggest taking
a step back and asking why you want to use the IR interpreter at all.
What use case are you solving? There may be a better option available.

I am interested in running a 32-bit bitcode file (target triple
i386-unknown-linux-gnu) with custom instrumentation that tracks the
computed values (e.g., it logs them to a file) and also compares them
to an existing log. I have already implemented the instrumentation
logic as a part of the LLI interpreter, but am now facing this issue
with unsupported intrinsics. Do you have any suggestions on how to do
this better?

thanks!

Sorav