<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 25, 2019 at 12:57 AM Jason Thomas via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div>Hi all,<div><br></div><div>This question may sound stupid, but every time I look at the IR, I take some time to convince myself the following:</div><div><br></div><div>The following C source code:</div><div><br>1 int x ;<br>2 int * p ;<br>3 p = & x ;</div><div><br></div><div>when compiled to LLVM IR using clang generates the following instructions:</div><div><br>1 % x = alloca i32 , align 4<br>2 % p = alloca i32 * , align 8<br>3 store i32 * %x , i32 ** %p , align 8</div><div><br></div><div>All the local variables in the C source code, i.e. 'x' and 'p' are pointers now, in fact they are pointers with one level deeper nesting level. What I mean is, 'x' is an 'int' in the C source, but '%x' is 'i32*'. 'p' is 'int*' in the C source, but '%p' is 'i32**'. Doesn't it make the IR naming convention a misnoer compared to their C counterpart? Shouldn't '%x.addr' or '%p.addr' a better naming convention? Is there anything that I am missing?</div></div></blockquote><div><br></div><div>You're right that the name isn't the most accurate from a clang point of view, redirecting to cfe-dev@ if anyone has an opinion from the clang side.<br></div><div><br></div><div>Note though that in LLVM the SSA value names are just for debugging, they are even stripped entirely by default in a Release clang "normal" path.</div><div><br></div><div>-- </div><div>Mehdi</div><div><br></div></div></div>