[LLVMdev] Assert on Large Zeroinitializer Store

Eli Friedman eli.friedman at gmail.com
Wed Aug 24 11:51:59 PDT 2011


On Wed, Aug 24, 2011 at 11:41 AM, John Criswell <criswell at illinois.edu> wrote:
> Dear All,
>
> I currently have one of my transforms creating the following store
> instruction:
>
> store [65536 x i8] zeroinitializer, [65536 x i8]* %buf.i, align 16
>
> ... which causes the SelectionDAG code to assert out:
>
> Assertion failed: (ResNo < NumValues && "Illegal result number!"),
> function getValueType, file
> /Users/criswell/src/llvm/include/llvm/CodeGen/SelectionDAGNodes.h, line 589.
>
> Should LLVM be able to code generate the above store instruction?  If
> not, how large a value can a store instruction store to memory without
> triggering problems in the code generator?

I don't know the exact limit, but if you're storing an array or struct
with more that 10 elements with a store instruction, you're doing
something wrong.  Use memcpy and/or memset instead.

-Eli




More information about the llvm-dev mailing list