<div dir="ltr"><div>Thank you for ur reply. <br></div><div>Here is a simple testcase:</div><div></div><div><br>    int a1,a2,a3,a4,a5,a6,a7,a8,a9,a10;<br>    int a11,a12,a13,a14,a15,a16,a17,a18,a19,a20;<br><br>    a1=a2=a3=a4=a5=a6=a7=a8=a9=a10=10;<br>    a11=a12=a13=a14=a15=a16=a17=a18=a19=a20=20;<br>    <br>    if(a1==a2==a3==a4==a5==a6==a7==a8==a9==a10==a11==a12==a13==a14==a15==a16==a17==a18==a19==a20)<br>    {<br>        printf("equal \n");<br>    }<br>    else<br>    {<br>        printf("not equal \n");<br>    }<br></div><div><br></div><div>All the variables are stored in the stack.</div><div><br></div><div>I have already tried the option <b>-debug-only=regalloc, </b>but I am not able to understand the mapping and live variable analysis properly. <br></div><div><br></div><div>I want to analyze, how spilling takes place.</div><div><br></div><div>Thank you for your time.</div><div><br></div><div>Regards,</div><div>Priyanka<br></div><div>    <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 28, 2019 at 12:48 PM Dangeti Tharun kumar <<a href="mailto:cs15mtech11002@iith.ac.in">cs15mtech11002@iith.ac.in</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 25, 2019 at 11:40 AM Priyanka Panigrahi via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello,</div><div><br></div><div>I have studied register allocation in theoretical aspects and exploring the same in the implementation level.<br></div><div><br></div><div>I need a minimal testcase for register spilling to analyze spilling procedure in llvm. I tried with a testcase taking 20 variables but all the 20 variables are getting stored in the stack using %rbp. Maybe my live variable analysis is wrong. Please help me with a minimal testcase to explore register spilling in llvm, <br></div></div></blockquote><div><br></div><div>You can share your testcase, people can have a look at it </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div><br></div><div>Is there any way to print the maximum live variables in source code. So that we can find out the minimum registers required for execution. Also, is it possible to print the register map of each variable in source code.<br></div></div></blockquote><div><br></div><div><b>-debug-only=regalloc </b>will dump a lot of information including live intervals and register maps.</div><div>Something like this.</div><div><pre style="color:rgb(0,0,0)">********** REWRITE VIRTUAL REGISTERS **********                                                           
********** Function: main                                                                                                               
********** REGISTER MAP **********                                                  
[%0 -> $r12] GR64_with_sub_8bit                                                                                        
[%1 -> $r15] GR64_with_sub_8bit                                                                                                 
[%9 -> $rsi] GR64_with_sub_8bit                                                                                                      
[%10 -> $rdx] GR64_with_sub_8bit                          
[%14 -> $xmm1] FR32                  
[%17 -> $xmm1] FR32                                      
[%20 -> $xmm1] FR32                                                                       
[%27 -> $r15] GR64                                           
[%35 -> $rdi] GR64                                                                                                                                                                                                                        
[%38 -> $xmm0] FR64                                                                                                                                                  
[%39 -> $xmm0] FR32                                                                                                             
[%44 -> $xmm0] FR32                                                                                                              
[%45 -> $xmm0] FR64                                                                                                                                                                                                                       
[%56 -> $rcx] GR64_with_sub_8bit                                                                                           
[%60 -> $rdi] GR64_with_sub_8bit                                                                                                         
[%66 -> $rax] GR64_with_sub_8bit                                                                      
[%73 -> $xmm0] FR32                                                                                                                            
[%74 -> $xmm0] FR64                                                                                                                     
[%82 -> $rbx] GR64_NOSP                                                                                               
[%83 -> $rbx] GR64_NOSP                                                                                                                      
[%87 -> $rdi] GR64_NOSP                                                                     
[%88 -> $xmm0] FR32                                                                                                                                                                                                                       
[%90 -> $rbx] GR64_NOSP                                                                                                       
[%91 -> $rbx] GR64_NOSP                                                                                                                 
[%93 -> $r14] GR64_with_sub_8bit</pre></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div><br></div><div>Any help would be appreciated.</div><div>Thank you in advance.<br></div><div><br></div><div>Regards,</div><div>Priyanka<br></div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Regards,</div><div>DTharun</div></div></div></div></div></div></div></div></div>
</blockquote></div>