When machine instructions are in the form of
%0 = CONST_I32 @str %1 = ADD_I32 %stack.0, %0 %2 = LOAD 0, 0, %1
In the ADD_I32 instruction, it is possible to fold it if %0 is a
CONST_I32 from an immediate number. But in this case it is a global
address, so we shouldn't do that. But we haven't checked if the operand
of ADD is an immediate so far. This fixes the problem. (The case
applies the same for ADD_I64 and CONST_I64 instructions.)
Fixes https://bugs.llvm.org/show_bug.cgi?id=47944.
Patch by Julien Jorge (jjorge@quarkslab.com)