<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Create a new alloca instruction, insert it into the IR right before (or after) the old one, RAUW the value, then delete the old instruction. You should be able to find a variety of examples of this sort of thing in most of the IR level optimization passes. I’d look at InstCombine in particular.</div><div><br></div><div>-Jim</div><div><br><div><div>On Dec 4, 2013, at 1:40 PM, Shivam Bhagi <<a href="mailto:shivam.bhagi@outlook.com">shivam.bhagi@outlook.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="font-family: Calibri; font-size: 16px;">Hi,</div><div style="font-family: Calibri; font-size: 16px;"><div><br></div><div>While looking over the IR generated by my source code, I came across the following:</div><div><br></div><div>%arr = alloca [30 x i8], align 1</div><div><br></div><div>In the source code this particular line of code is represented by:</div><div><br></div><div>int arr[30];</div><div><br></div><div>I was wondering how I could change the capacity of arr from 30 to any other integral value via a function-pass. I know that 'alloca' can be used for reserving space on stack; further, 'store' can be used for writing to memory. I was wondering how that would work for an array though?</div><div><br></div><div>Thanks,</div><div>Shivam</div></div></div>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></div></body></html>