<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 17, 2009, at 10:27 PM, Keun Soo Yim wrote:</div><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="text-indent: -0.25in; margin-top: 0in; margin-right: 0in; margin-left: 0.5in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span>1.<span style="font: normal normal normal 7pt/normal 'Times New Roman'; ">      <span class="Apple-converted-space"> </span></span></span>How to move a virtual register data to another new virtual register?<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">It seems like that there is no LLVM instruction similar to mov machine instruction.<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Arithmetic or logical operators could be used for integer variables<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">but what about pointer variables?</div></div></div></span></blockquote><div><br></div>Why do you need to copy a value?  Virtual registers are immutable (SSA form), so you don't need to worry about the value getting overwritten.<span class="Apple-style-span" style="font-family: Calibri; font-size: 15px; "></span></div><div><span class="Apple-style-span" style="font-family: Calibri; font-size: 15px; "> </span></div><div><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="text-indent: -0.25in; margin-top: 0in; margin-right: 0in; margin-left: 0.5in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span>2.<span style="font: normal normal normal 7pt/normal 'Times New Roman'; ">      <span class="Apple-converted-space"> </span></span></span>What is typically IR-level pass execution order? Especially when we separately execute<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0.5in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">the front-end, IR optimizer, and back-end, this information seems to be needed.</div></div></div></span></blockquote><div><br></div><div>Take a look at tools/opt/opt.cpp.  You can see what the "-std-compile-opts" sequence does in there.  You can also look at tools/llvm-ld/Optimize.cpp for a standard set of link-time optimizations.</div><div><br></div><div>--Owen</div></div><br></body></html>