[llvm-dev] Preserving Call to Intrinsic function

Kumail Ahmed via llvm-dev llvm-dev at lists.llvm.org
Fri Jan 27 08:33:54 PST 2017

Hello everyone,

Consider we have this following set of code:

int foo() {

int a,b;
a = __builtin_XX(0x11);
b = __builtin_XX(0x11);
return a+b;

The problem currently is that LLVM eliminated the second call and copied
the result from the first call into a new set of registers. Is there is a
way to force LLVM to generate two explicit calls to a builtin function. The
builtin takes in an integer type, and also returns back an integer type:

  def int_XX : GCCBuiltin<"__builtin_XX">, Intrinsic<[llvm_i32_ty],

Is there some flag that I'm missing? Your help will be really appreciated.

Best Regards,
Kumail Ahmed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170127/4335399b/attachment.html>

More information about the llvm-dev mailing list