similar to: Identify c-style pointer to array

Displaying 20 results from an estimated 10000 matches similar to: "Identify c-style pointer to array"

2015 May 26
2
[LLVMdev] convert GetElemtPtr result to pointer on element?
Hi all, I'm still struggling with getElementPtr. I have a global variable (array of doubles). I can use ConstantExpr::getGetElementPtr(myGlobalVariable, indices) and use the result as argument of e.g. a function. I read the GEP docu and know that I need anextra leading '0' index to dereference the global's pointer. So far so good. But I can not succeed in using the
2018 Feb 28
1
Missed opportunity in the midend, unsigned comparison
Hi everybody, I see a missed optimization opportunity in LLVM that GCC catches and I'd love to hear community's input. Here's the original C code: 1 char arr[2]; 2 char *get(unsigned ind) { 3 if (ind >= 1) { 4 return 0; 5 } 6 return &(arr[ind]); 7 } The variable `ind` is unsigned so, based on the comparison, if it is not greater or equals to one, than it is
2015 May 27
2
[LLVMdev] convert GetElemtPtr result to pointer on element?
Hi Tim, I forgot to say that I try to do all this in the LLVM API, not IR. I read in a bc'ed program and try to edit it using the API. Alex Tim Northover wrote: >> But I can not succeed in using the getGetElementPtr result in >> constructing an initalizer for another global value (which expects a >> ConstantFP* and not a ConstantExpr*). > > The result of a
2012 Nov 09
1
[LLVMdev] Loop carried dependence analysis?
Hi, The DependenceAnalysis pass will find loop-carried dependences. However, it is a conservative analysis and will sometimes suggest there may be more dependences than actually exist. In your example, I expect the analysis is confused for some reason and is returning the default confused response. You could test it using the isConfused() method. Note that the DVEntry::ALL direction is always
2008 Apr 20
0
[LLVMdev] Global variable-length array
On Apr 19, 2008, at 22:45, Talin wrote: > Suppose I have a global variable which points to a constant, > variable length array. This is somewhat contradictory. Do you want an 'vla *g;' in C? If so, your global will be of type %vla** (you'll load a pointer to the array from the global). Its initializer would be a bitcast of a global which has some type similar to %vla.
2020 Mar 22
2
Legalized selection DAG differs for the same code and flags
Hello, LLVM Devs. I'm compiling following code using my own backend: int foo() { char arr[4]; arr[0] = 0xAA; arr[1] = 0xBB; arr[2] = 0xCC; arr[3] = 0xDD; return *(int*)&arr[0]; } The memory operation in "return" statement ends up transformed into 4-byte load in the initial DAG: load<(dereferenceable load 4 from %ir.7, align 1, addrspace 1)> t31,
2008 Apr 20
4
[LLVMdev] Global variable-length array
Question about "Pascal-style" arrays as mentioned in the reference guide. Suppose I have a global variable which points to a constant, variable length array. The question is, how can I assign an array of type "{ i32, [5 x float]}" to a global of type "{ i32, [0 x float]}"? From my experimentation, it appears you can't bitcast or call GEP on a constant
2016 Sep 29
1
No Sound On Centos 7 VM
Try running amixer set Master 100% (which I found on linuxquestions.org at the 4th result down using google.com/search?q=centos+7+sound+not+working+in+vm ) Sent from my Samsung Galaxy S5
2016 Sep 28
1
CentOS 7 32-bit WiFi Hardware Switch
Not exactly linux-dependent. According to the docs for the Latitude 620 (available on dell dot com), the wireless switch is on the left side. Slide it towards the front, until its raised position indicator is aligned with the I ("off" is aligned with the O). The WiFi power indicator is on the front panel, in a group with about 4 LEDs... the WiFi indicator appears to actually *say*
2013 Feb 01
2
[LLVMdev] Question about compilation result - taking address of input array member
Hello, I'm playing around with some LEA-related code generation on x86-64 (trunk LLVM & Clang), and I run into a case I don't understand: $ cat takeaddr.c int* bar(int table[10]) { return &table[2]; } $ clang -cc1 -emit-llvm takeaddr.c $ cat takeaddr.ll ; ModuleID = 'takeaddr.c' target datalayout =
2012 Sep 12
2
[LLVMdev] SPIR Portability Discussion
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Richard Smith Sent: Wednesday, September 12, 2012 1:55 PM To: Ouriel, Boaz Cc: cfe-dev at cs.uiuc.edu; llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] SPIR Portability Discussion On Wed, Sep 12, 2012 at 12:27 PM, Ouriel, Boaz <boaz.ouriel at intel.com<mailto:boaz.ouriel at intel.com>> wrote: Hey
2007 Aug 17
1
[BioC] function to find coodinates in an array
The arr.ind in the which function does the job very nicely!!! Thank you everyone for the suggestions! Ana > > >---- Mensaje Original ---- >De: marc_schwartz at comcast.net >Para: m_olshansky at yahoo.com >Asunto: Re: [BioC] [R] function to find coodinates in an array >Fecha: Thu, 16 Aug 2007 21:53:44 -0500 > >>If I am correctly understanding the problem, I think
2006 Aug 11
2
Array#chunk method, maybe someone will find this useful
class Array # break an array up into <size> chunks def chunk(size=1) return self if self.empty? raise ArgumentError if !size.kind_of? Integer y = self.length.divmod(size) rows = (y[1] > 0) ? y[0] + 1 : y[0] arr = Array.new(rows) (0...rows).each do |i| arr[i] = self.slice(size*i, size) end (arr.last.length...size).each { |i| arr.last[i] = nil }
2013 Feb 01
0
[LLVMdev] Question about compilation result - taking address of input array member
On Fri, Feb 1, 2013 at 12:11 PM, Eli Bendersky <eliben at google.com> wrote: > Hello, > > I'm playing around with some LEA-related code generation on x86-64 > (trunk LLVM & Clang), and I run into a case I don't understand: > > $ cat takeaddr.c > int* bar(int table[10]) { > return &table[2]; > } > > $ clang -cc1 -emit-llvm takeaddr.c > $
2015 Mar 26
2
[LLVMdev] Moving towards a singular pointer type
Hi David, On 18 Feb 2015, at 06:47, David Blaikie <dblaikie at gmail.com> wrote: > > 1) add explicit types where required in IR instructions - gep, load, byval, anything else I can find... > a) Provide the mechanism to specify it (in textual IR, bitcode, and LLVM IR APIs) > b) Update callers to Clang, LLVM, and Polly, to pass that information (initially just asserting that
2011 Mar 08
1
repeat matrix column within each array third dimension
Hello all, I'm working with a matrix that will have varying dimensions. It will populate an array such that the number of matrix columns will determine the number of 3rd dimension levels of the array. Rows will be the same for both. For this example lets say the array will have 2 columns, but that's not fixed. dim(arr)<-c(dim(mat)[1],2,dim(mat)[2]) I wish to repeat each matrix
2011 May 26
2
summing array elements
Hi to everybody I have an array with dimensions 2,4,3,3. Wanting to sum the matrices in the first two dimensions, I'm trying to use the "apply" function, but with no results. Have to say I'm quite new with R syntax. tx in advance marco [[alternative HTML version deleted]]
2006 Aug 09
2
Speeding indexing and sub-sectioning of 3d array
Hi, I am having a problem with a very slow indexing and sub-sectioning of a 3d array: > dim(arr) [1] 245 175 150 For each point in the array, I am trying to calculate the mean of the values in its surrounding: mean( arr[ (i - radius):(i + radius), (j - radius):(j + radius), (k - radius):(k + radius)] ) Putting that code in 3
2019 Jun 30
2
Information Loss of Array Type in Function Interface in IR Generated by Clang
Dear all, Hi! Recently, I notice a situation where I cannot infer the size of the outermost dimension of array in the function interface. To concretely depict the problem, I show the C source code and the generated IR code at the end. The array size of A[] is 51 but this information is lost in the generated IR. How can I maintain such information in IR? Should I set some argument for
2011 Jun 18
3
Array
Hi, Can someone advise why the followind did not produce the array, given the condition specified? s <- 1 a1 <- array(dim=c(1,4)) a2 <- array(dim=c(2,4)) arr <- ifelse(s==0,a1,a2) Thanks. Muhammad