search for: ty_is_i16

Displaying 2 results from an estimated 2 matches for "ty_is_i16".

2013 Aug 15
1
[LLVMdev] Clarification between <type> and <ty> for alloca instruction
Hi, This is quite a simple question so hopefully it's easy to answer. I was looking at the documentation for the alloca instruction ( http://llvm.org/docs/LangRef.html#alloca-instruction ) and something is unclear to me. The given syntax is... <result> = alloca <type>[, <ty> <NumElements>][, align <alignment>] ; yields {type*}:result And the documentation
2013 Aug 15
2
[LLVMdev] Clarification between <type> and <ty> for alloca instruction
...refers to the type of NumElements. > It doesn't really affect the output at all. If NumElements doesn't > overflow <ty> then the semantics don't depend on it at all. > > In C-like code it's sort of the difference between these two > functions: > > void ty_is_i16(unsigned short NumElements) { int arr[NumElements]; > use_array(arr); } > > void ty_is_i32(unsigned int NumElements) { int arr[NumElements]; > use_array(arr); } > > you might compile them to > > define void @ty_is_i16(i16 %NumElements) { %arr = alloca i32, i16 > %Num...