<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On May 14, 2008, at 10:43 AM, <a href="mailto:Alireza.Moshtaghi@microchip.com">Alireza.Moshtaghi@microchip.com</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div lang="EN-US" link="blue" vlink="purple"><div class="Section1"><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; ">In this thread I’m trying to merge two email threads into one, because both discuss the same problem that’s troubling us and I would like to reach a conclusion on what would be the best approach.</span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; ">To minimize the size of this thread I only mention the subject of the other two threads:</span></font></div><div style="text-indent: -24pt; margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; ">(1)<font size="1" face="Times New Roman"><span style="font: normal normal normal 7pt/normal 'Times New Roman'; ">   <span class="Apple-converted-space"> </span></span></font></span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; ">[LLVMdev] Integer promotion of return node operand        (initiated by Sachin)</span></font></div><div style="text-indent: -24pt; margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; ">(2)<font size="1" face="Times New Roman"><span style="font: normal normal normal 7pt/normal 'Times New Roman'; ">   <span class="Apple-converted-space"> </span></span></font></span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; ">[LLVMdev] trouble with 32-bit promotion of return value   (initiated by myself)</span></font></div><p class="MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "> </span></font></p><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; ">To summarize:</span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; ">Evan has replied to thread (1) and suggested to add a calling convention and check for it in visitRet</span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; ">Dan replied to thread (2) and suggested to add a new field to the TargetLowering class, and then let each target specify the minimum integer type to promote return types to</span></font></div><p class="MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "> </span></font></p><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; ">Either way, I think we all agree that the root of the problem is the FIXME in SelectionDAGLowering::visitRet()</span></font></div><p class="MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "> </span></font></p><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; ">But what is the preferred method?</span></font></div></div></div></span></blockquote><div><br></div>Both. :-)</div><div><br></div><div>If you are using a non-C ABI, then you may not need to do the promotion at all. However, if you do need to do the promotion, you need to know the type of "int". It's not entirely clear to me what is the best way to accomplish. To me, I don't think TargetLowering is the right place to add the hook. How about TargetData.h ? There is a getIntPtrType(), perhaps we need a getIntType()?</div><div><br></div><div>Evan</div><div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div lang="EN-US" link="blue" vlink="purple"><div class="Section1"><p class="MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; "> </span></font></p><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; ">Thanks</span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; ">Ali</span></font></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" style="color: blue; text-decoration: underline; ">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" style="color: blue; text-decoration: underline; ">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></span></blockquote></div><br></body></html>