<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Dec 18, 2014, at 2:36 PM, Matthias Braun <<a href="mailto:matze@braunis.de">matze@braunis.de</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="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;">Hi Quentin,<br><br><blockquote type="cite">On Dec 18, 2014, at 9:34 AM, Quentin Colombet <<a href="mailto:qcolombet@apple.com">qcolombet@apple.com</a>> wrote:<br><br>Hi Matthias,<br><br>On Dec 16, 2014, at 6:18 PM, Matthias Braun <<a href="mailto:matze@braunis.de">matze@braunis.de</a>> wrote:<br><br><blockquote type="cite">Author: matze<br>Date: Tue Dec 16 20:18:13 2014<br>New Revision: 224409<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=224409&view=rev">http://llvm.org/viewvc/llvm-project?rev=224409&view=rev</a><br>Log:<br>RegisterCoalescer: Sprinkle some const modifiers.<br><br>Modified:<br> llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp<br><br>Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=224409&r1=224408&r2=224409&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=224409&r1=224408&r2=224409&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original)<br>+++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Tue Dec 16 20:18:13 2014<br>@@ -1501,17 +1501,17 @@ class JoinVals {<br>/// Live range we work on.<br>LiveRange &LR;<br>/// (Main) register we work on.<br>-  unsigned Reg;<br>+  const unsigned Reg;<br><br>/// This is true when joining sub register ranges, false when joining main<br>/// ranges.<br>-  bool SubRangeJoin;<br>+  const bool SubRangeJoin;<br>/// Whether the current LiveInterval tracks subregister liveness.<br>-  bool TrackSubRegLiveness;<br>+  const bool TrackSubRegLiveness;<br><br>// Location of this register in the final joined register.<br>// Either CP.DstIdx or CP.SrcIdx.<br>-  unsigned SubIdx;<br>+  const unsigned SubIdx;<br><br>// Values that will be present in the final live range.<br>SmallVectorImpl<VNInfo*> &NewVNInfo;<br>@@ -1602,13 +1602,13 @@ class JoinVals {<br>// One entry per value number in LI.<br>SmallVector<Val, 8> Vals;<br><br>-  unsigned computeWriteLanes(const MachineInstr *DefMI, bool &Redef);<br>-  VNInfo *stripCopies(VNInfo *VNI);<br>+  unsigned computeWriteLanes(const MachineInstr *DefMI, bool &Redef) const;<br>+  VNInfo *stripCopies(VNInfo *VNI) const;<br>ConflictResolution analyzeValue(unsigned ValNo, JoinVals &Other);<br>void computeAssignment(unsigned ValNo, JoinVals &Other);<br>bool taintExtent(unsigned, unsigned, JoinVals&,<br>                 SmallVectorImpl<std::pair<SlotIndex, unsigned> >&);<br>-  bool usesLanes(MachineInstr *MI, unsigned, unsigned, unsigned);<br>+  bool usesLanes(const MachineInstr *MI, unsigned, unsigned, unsigned) const;<br>bool isPrunedValue(unsigned ValNo, JoinVals &Other);<br><br>public:<br>@@ -1658,7 +1658,8 @@ public:<br>/// Compute the bitmask of lanes actually written by DefMI.<br>/// Set Redef if there are any partial register definitions that depend on the<br>/// previous value of the register.<br>-unsigned JoinVals::computeWriteLanes(const MachineInstr *DefMI, bool &Redef) {<br>+unsigned JoinVals::computeWriteLanes(const MachineInstr *DefMI, bool &Redef)<br>+  const {<br></blockquote><br>This formatting looks strange to me. Was it clang-formatted?<br></blockquote>No it was not. However running clang-format on RegisterCoalescer.cpp produces countless changes, should I just format it all?<br></div></blockquote><div><br></div><div>No, we usually do not do that :).</div><div>Generally speaking, you should be able to run clang format on the patch itself with clang-format.py.</div><div>For now, that’s not a big deal, you may just fix that line.</div><div><br></div><div>Thanks,</div><div>-Quentin</div><br><blockquote type="cite"><div style="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;"><br>Greetings<br><span class="Apple-tab-span" style="white-space: pre;">       </span>Matthias<br><br><blockquote type="cite"><br>Thanks,<br>-Quentin<br><br><blockquote type="cite">unsigned L = 0;<br>for (ConstMIOperands MO(DefMI); MO.isValid(); ++MO) {<br>  if (!MO->isReg() || MO->getReg() != Reg || !MO->isDef())<br>@@ -1672,7 +1673,7 @@ unsigned JoinVals::computeWriteLanes(con<br>}<br><br>/// Find the ultimate value that VNI was copied from.<br>-VNInfo *JoinVals::stripCopies(VNInfo *VNI) {<br>+VNInfo *JoinVals::stripCopies(VNInfo *VNI) const {<br>while (!VNI->isPHIDef()) {<br>  MachineInstr *MI = Indexes->getInstructionFromIndex(VNI->def);<br>  assert(MI && "No defining instruction");<br>@@ -2035,8 +2036,8 @@ taintExtent(unsigned ValNo, unsigned Tai<br><br>/// Return true if MI uses any of the given Lanes from Reg.<br>/// This does not include partial redefinitions of Reg.<br>-bool JoinVals::usesLanes(MachineInstr *MI, unsigned Reg, unsigned SubIdx,<br>-                         unsigned Lanes) {<br>+bool JoinVals::usesLanes(const MachineInstr *MI, unsigned Reg, unsigned SubIdx,<br>+                         unsigned Lanes) const {<br>if (MI->isDebugValue())<br>  return false;<br>for (ConstMIOperands MO(MI); MO.isValid(); ++MO) {<br><br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br></blockquote><br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</blockquote></div></blockquote></div><br></body></html>