<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Yes it does!<div class=""><br class=""></div><div class="">Thanks,</div><div class="">-Quentin<br class=""><div style=""><blockquote type="cite" class=""><div class="">On May 19, 2015, at 10:56 AM, Matthias Braun <<a href="mailto:matze@braunis.de" class="">matze@braunis.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I hope r237706 addresses the concerns.</div><div class=""><br class=""></div><div class="">- Matthias</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On May 19, 2015, at 10:04 AM, Quentin Colombet <<a href="mailto:qcolombet@apple.com" class="">qcolombet@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Ping!<div class=""><br class=""><div style="" class=""><blockquote type="cite" class=""><div class="">On Apr 23, 2015, at 4:35 PM, Quentin Colombet <<a href="mailto:qcolombet@apple.com" class="">qcolombet@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Hi Matthias,</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Nice catch!</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">A small nitpick.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">On Apr 23, 2015, at 4:24 PM, Matthias Braun <<a href="mailto:matze@braunis.de" class="">matze@braunis.de</a>> wrote:<br class=""><br class="">Author: matze<br class="">Date: Thu Apr 23 18:24:36 2015<br class="">New Revision: 235668<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=235668&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=235668&view=rev</a><br class="">Log:<br class="">RegisterCoalescer: Avoid unnecessary register class widening for some rematerializations<br class=""><br class="">I couldn't provide a testcase as none of the public targets has wide<br class="">register classes with alot of subregisters and at the same time an<br class="">instruction which "ReMaterializable" and "AsCheapAsAMove" (could<br class="">probably be added for R600).<br class=""><br class="">Modified:<br class="">  llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp<br class=""><br class="">Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=235668&r1=235667&r2=235668&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=235668&r1=235667&r2=235668&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original)<br class="">+++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Thu Apr 23 18:24:36 2015<br class="">@@ -194,7 +194,7 @@ namespace {<br class=""><br class="">   /// If the source of a copy is defined by a<br class="">   /// trivial computation, replace the copy by rematerialize the definition.<br class="">-    bool reMaterializeTrivialDef(CoalescerPair &CP, MachineInstr *CopyMI,<br class="">+    bool reMaterializeTrivialDef(const CoalescerPair &CP, MachineInstr *CopyMI,<br class="">                                bool &IsDefCopy);<br class=""><br class="">   /// Return true if a copy involving a physreg should be joined.<br class="">@@ -851,7 +851,7 @@ static bool definesFullReg(const Machine<br class=""> return false;<br class="">}<br class=""><br class="">-bool RegisterCoalescer::reMaterializeTrivialDef(CoalescerPair &CP,<br class="">+bool RegisterCoalescer::reMaterializeTrivialDef(const CoalescerPair &CP,<br class="">                                               MachineInstr *CopyMI,<br class="">                                               bool &IsDefCopy) {<br class=""> IsDefCopy = false;<br class="">@@ -929,6 +929,29 @@ bool RegisterCoalescer::reMaterializeTri<br class=""> TII->reMaterialize(*MBB, MII, DstReg, SrcIdx, DefMI, *TRI);<br class=""> MachineInstr *NewMI = std::prev(MII);<br class=""><br class="">+  // A situation like the following:<br class="">+  //     %vreg0:subX = instr           ; DefMI<br class="">+  //     %vregY      = copy %vreg:subX ; CopyMI<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">To make the comment (or code) more readable, please use the same name for the comment and the code for subX.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Cheers,</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">-Quentin</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">+  // does not need subregisters/regclass widening after rematerialization, just<br class="">+  // do:<br class="">+  //     %vregY = instr<br class="">+  const TargetRegisterClass *NewRC = CP.getNewRC();<br class="">+  if (DstIdx != 0) {<br class="">+    MachineOperand &DefMO = NewMI->getOperand(0);<br class="">+    if (DefMO.getSubReg() == DstIdx) {<br class="">+      assert(SrcIdx == 0 && CP.isFlipped()<br class="">+             && "Shouldn't have SrcIdx+DstIdx at this point");<br class="">+      const TargetRegisterClass *DstRC = MRI->getRegClass(DstReg);<br class="">+      const TargetRegisterClass *CommonRC =<br class="">+        TRI->getCommonSubClass(DefRC, DstRC);<br class="">+      if (CommonRC != nullptr) {<br class="">+        NewRC = CommonRC;<br class="">+        DstIdx = 0;<br class="">+        DefMO.setSubReg(0);<br class="">+      }<br class="">+    }<br class="">+  }<br class="">+<br class=""> LIS->ReplaceMachineInstrInMaps(CopyMI, NewMI);<br class=""> CopyMI->eraseFromParent();<br class=""> ErasedInstrs.insert(CopyMI);<br class="">@@ -948,7 +971,6 @@ bool RegisterCoalescer::reMaterializeTri<br class=""> }<br class=""><br class=""> if (TargetRegisterInfo::isVirtualRegister(DstReg)) {<br class="">-    const TargetRegisterClass *NewRC = CP.getNewRC();<br class="">   unsigned NewIdx = NewMI->getOperand(0).getSubReg();<br class=""><br class="">   if (DefRC != nullptr) {<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@cs.uiuc.edu" class="">llvm-commits@cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a></blockquote></div></blockquote></div><br class=""></div></div>_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@cs.uiuc.edu" class="">llvm-commits@cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></body></html>