<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><base href="x-msg://200/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 16, 2012, at 10:38 AM, "Gurd, Preston" <<a href="mailto:preston.gurd@intel.com">preston.gurd@intel.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Optima; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">If possible, it would be appreciated if this patch could be reviewed in time for inclusion in the llvm 3.1 release. We would have proposed this patch sooner, were it not for the fact that we have only just discovered the problem.<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">This patch fixes a problem which arose when using the Post-RA scheduler on X86 Atom. Some of our tests failed because the tail merging part of the BranchFolding pass was creating new basic blocks which did not contain live-in information. When the anti-dependency code in the Post-RA scheduler ran, it would sometimes rename the register containing the function return value because the fact that the return value was live-in to the subsequent block had been lost. To fix this, it is necessary to run the RegisterScavenging code in the BranchFolding pass.</div></div></div></blockquote><div><br></div><div>Hi Preston,</div><div><br></div><div>Please add an assertion to the PostRA scheduler that catches this problem. You can use the MRI->tracksLiveness() function to determine if live-ins are accurate.</div><div><br></div><div>Please enable this only for Atom. Other x86 sub-targets don't need the extra compile time and risk of scavenger assertions.</div><div><br></div><div>Please remove the call to TRI->requiresRegisterScavenging(), and fix the other targets to use your new hook instead.</div><div><br></div><div>Please rename the hook to something less specific to branch folding. For example, shouldTrackLivenessAfterRegAlloc().</div><div><br></div></div>/jakob<div><br></div></body></html>