[LLVMdev] Structure Returns

kapil anand kapilanand2 at gmail.com
Thu Jun 25 10:49:36 PDT 2009


In my LLVM IR I am returning a structure from a function but it gave me an
assertion failure when I was trying to compile the resulting bitcode.

Specifically, I had following function definition

define {i32,i32,i32} @func(i32 a)
ret {i32,i32,i32} %retStruct

llc gave me following assertion failure:

Return operand#2 has unhandled type i32  in AnalyzeReturn function

On digging out from LLVM website, I found

"Note that the code generator does not yet fully support large return
values. The specific sizes that are currently supported are dependent on the
target. For integers, on 32-bit targets the limit is often 64 bits, and on
64-bit targets the limit is often 128 bits. For aggregate types, the current
limits are dependent on the element types; for example targets are often
limited to 2 total integer elements and 2 total floating-point elements."

So, does this mean that I can't have a return type with more than two
integers? Is there any other way to support longer return structure?

-- Kapil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090625/3ba55e74/attachment.html>

More information about the llvm-dev mailing list