[LLVMdev] how to avoid llvm to optimize variable

John Criswell criswell at illinois.edu
Wed Nov 6 06:27:20 PST 2013


On 11/6/13 7:05 AM, sebastien deldon (PGI) wrote:
>
> Hi all,
>
> For debugging purpose, I would like to create temporary local 
> variables that I want to keep 'live' for a routine execution. They 
> will be set to a value at routine entrance and I they will never be used.
>
> Is there a way to avoid llvm to optimize them away when mem2reg is 
> performed ?
>

If you access the alloca'ed variables with volatile loads and stores, 
then I think mem2reg will be unable to promote them to SSA registers.

-- John T.

> Thanks for your answer
>
> Seb
>
> ------------------------------------------------------------------------
> This email message is for the sole use of the intended recipient(s) 
> and may contain confidential information.  Any unauthorized review, 
> use, disclosure or distribution is prohibited.  If you are not the 
> intended recipient, please contact the sender by reply email and 
> destroy all copies of the original message.
> ------------------------------------------------------------------------
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131106/45f09d4f/attachment.html>


More information about the llvm-dev mailing list