<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">Hi.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">
I found that, in all the LLVM IR I get from the source C file. the unnamed values all created by the "load" instruction. eg:</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">
</div><div class="gmail_default"><font face="tahoma, sans-serif"><br></font></div><div class="gmail_default"><font face="tahoma, sans-serif">; Function Attrs: nounwind uwtable</font></div><div class="gmail_default"><font face="tahoma, sans-serif">define i32 @add(i32 %x, i32 %y) #0 {</font></div>
<div class="gmail_default"><font face="tahoma, sans-serif">entry:</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> %x.addr = alloca i32, align 4</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> %y.addr = alloca i32, align 4</font></div>
<div class="gmail_default"><font face="tahoma, sans-serif"> %c = alloca i32, align 4</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> store i32 %x, i32* %x.addr, align 4</font></div><div class="gmail_default">
<font face="tahoma, sans-serif"> store i32 %y, i32* %y.addr, align 4</font></div><div class="gmail_default"><font face="tahoma, sans-serif"><b> %0 = load i32* %x.addr, align 4</b></font></div><div class="gmail_default">
<font face="tahoma, sans-serif"><b> %1 = load i32* %y.addr, align 4</b></font></div><div class="gmail_default"><font face="tahoma, sans-serif"> %add = add nsw i32 %0, %1</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> store i32 %add, i32* %c, align 4</font></div>
<div class="gmail_default"><font face="tahoma, sans-serif"> %2 = load i32* %c, align 4</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> ret i32 %2</font></div><div class="gmail_default"><font face="tahoma, sans-serif">}</font></div>
<div class="gmail_default"><font face="tahoma, sans-serif"><br></font></div><div class="gmail_default"><font face="tahoma, sans-serif">; Function Attrs: nounwind uwtable</font></div><div class="gmail_default"><font face="tahoma, sans-serif">define i32 @main() #0 {</font></div>
<div class="gmail_default"><font face="tahoma, sans-serif">entry:</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> %retval = alloca i32, align 4</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> %a = alloca i32, align 4</font></div>
<div class="gmail_default"><font face="tahoma, sans-serif"> %b = alloca i32, align 4</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> %d = alloca i32, align 4</font></div><div class="gmail_default">
<font face="tahoma, sans-serif"> %f = alloca i32, align 4</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> %g = alloca i32, align 4</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> %e = alloca i32, align 4</font></div>
<div class="gmail_default"><font face="tahoma, sans-serif"> store i32 0, i32* %retval</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> store i32 8, i32* %a, align 4</font></div><div class="gmail_default">
<font face="tahoma, sans-serif"> store i32 9, i32* %b, align 4</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> <b> %0 = load i32* %a, align 4</b></font></div><div class="gmail_default"><font face="tahoma, sans-serif"><b> %1 = load i32* %b, align 4</b></font></div>
<div class="gmail_default"><font face="tahoma, sans-serif"> %add = add nsw i32 %0, %1</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> store i32 %add, i32* %d, align 4</font></div><div class="gmail_default">
<font face="tahoma, sans-serif"><b> %2 = load i32* %a, align 4</b></font></div><div class="gmail_default"><font face="tahoma, sans-serif"><b> %3 = load i32* %d, align 4</b></font></div><div class="gmail_default"><font face="tahoma, sans-serif"> %add1 = add nsw i32 %2, %3</font></div>
<div class="gmail_default"><font face="tahoma, sans-serif"> store i32 %add1, i32* %f, align 4</font></div><div class="gmail_default"><font face="tahoma, sans-serif"><b> %4 = load i32* %f, align 4</b></font></div><div class="gmail_default">
<font face="tahoma, sans-serif"><b> %5 = load i32* %b, align 4</b></font></div><div class="gmail_default"><font face="tahoma, sans-serif"> %add2 = add nsw i32 %4, %5</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> store i32 %add2, i32* %g, align 4</font></div>
<div class="gmail_default"><font face="tahoma, sans-serif"><b> %6 = load i32* %d, align 4</b></font></div><div class="gmail_default"><font face="tahoma, sans-serif"><b> %7 = load i32* %b, align 4</b></font></div><div class="gmail_default">
<font face="tahoma, sans-serif"> %call = call i32 @add(i32 %6, i32 %7)</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> store i32 %call, i32* %e, align 4</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> %call3 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0), i32* %a)</font></div>
<div class="gmail_default"><font face="tahoma, sans-serif"> %call4 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str1, i32 0, i32 0), i32* %b)</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> %call5 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32* %e)</font></div>
<div class="gmail_default"><font face="tahoma, sans-serif"> %call6 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0), i32* %d)</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> %call7 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0), i32* %g)</font></div>
<div class="gmail_default"><font face="tahoma, sans-serif"> %call8 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0), i32* %f)</font></div><div class="gmail_default"><font face="tahoma, sans-serif"> ret i32 0</font></div>
<div class="gmail_default"><font face="tahoma, sans-serif">}</font><span style="font-family:tahoma,sans-serif"> </span></div><div><div class="gmail_default" style="font-family:tahoma,sans-serif"></div><div class="gmail_default" style="font-family:tahoma,sans-serif">
the "add" instructions all have names like "%add", "%add1",etc.But the "load" instruction all use "%n". </div><br></div><div><div class="gmail_default" style="font-family:tahoma,sans-serif">
is that means the unnamed instructions like "%0 %1" all created by the "load" instructions? is there any other type instructions can create unnamed values?</div><div class="gmail_default" style="font-family:tahoma,sans-serif">
<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Thanks!</div><br></div><div><br></div>-- <br><div dir="ltr">Kind Regards!<div>-Jin Huang</div></div>
</div>