<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Sep 30, 2008, at 4:02 PM, Villmow, Micah 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"><o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"><o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="Street"><o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="address"><o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"><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="Arial"><span style="font-size: 10pt; font-family: Arial; ">I am running into an issue where phi nodes are generating move instructions that are outside of the location where I want them to be generated. The default generation method seems to be to put the move instruction at the end of the preceding basic block related to that specific phi node, but I need it to place the move before some pseudo instructions that must be at the end of certain flow control basic blocks. I’m looking at copyRegToReg as a possible location on where to implement this modification, but I can’t figure out how to determine if the origination of the move instruction to be generated is from a PHI node or a normal move operation. Any help would be useful in figuring this out.<o:p></o:p></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'; "><br></div></div></o:smarttagtype></o:smarttagtype></o:smarttagtype></o:smarttagtype></div></span></blockquote><div><br></div></div><div>What you're seeing is the standard naive approach to eliminating PHI nodes.  There isn't a way to detect where the copy came from, unless you're planning to replace the PHI elimination pass.  As an alternative suggestion:  how about having a pass that inserts you special instructions, which is run _after_ PHI elimination?</div><div><br></div><div>--Owen</div></body></html>