The two patches also don't compile when applied together.<br><br><div class="gmail_quote">On Sat, Nov 24, 2012 at 7:05 PM, Craig Topper <span dir="ltr"><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Should probably add a bitsGT to MVT for this part of the second patch. The trip through EVT will add checks for handling Extended types.<br>
<br> LVT = (MVT::SimpleValueType)(LVT.SimpleTy - 1);<br> assert(LVT.isInteger());<br>
<br>- if (VT.bitsGT(LVT))<br>+ if (EVT(VT).bitsGT(LVT))<br> VT = LVT;<br> }<br><br>I don't realy like the intialization of VTSize being in the for loop header. It makes it confusing since VTSize isn't the variable being used for iteration. I'm also not sure that's even safe to pull out of the loop since VT can change inside the loop. For the same reason, I dont' think you can subtract VTSize.<br>
<br>- unsigned NumMemOps = 0;<br>- while (Size != 0) {<br>- unsigned VTSize = VT.getSizeInBits() / 8;<br>+ for (unsigned VTSize = VT.getSizeInBits() / 8; Size != 0; Size -= VTSize) {<br><br><br>I'm pretty sure this change isn't equivalent either because it allows MemOps to grow past the limit which it didn't previously do.<br>
<br>- if (++NumMemOps > Limit)<br>- return false;<br> MemOps.push_back(VT);<br>- Size -= VTSize;<br>+ if (MemOps.size() > Limit)<br>+ return false;<br><br><div class="gmail_quote"><div><div class="h5">
On Fri, Nov 23, 2012 at 3:44 AM, Patrik Hägglund H <span dir="ltr"><<a href="mailto:patrik.h.hagglund@ericsson.com" target="_blank">patrik.h.hagglund@ericsson.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5">
Here are two small patches that change the return type of getOptimalMemOpType()<br>
from EVT to MVT. In the second patch there is also some other minor cleanups.<br>
<br>
Let me know if you have any objections. Otherwise, I will commit them.<br>
<br>
Regards,<br>
Patrik Hägglund<br>
<br>
[PATCH 1/2] Cleanup: Change return type of getOptimalMemOpType()<br>
from EVT to MVT.<br>
<br>
The user of this function (FindOptimalMemOpLowering) asserts if not<br>
receiving an MVT. Therefore, it makes no sense to use EVT.<br>
---<br>
include/llvm/Target/TargetLowering.h | 4 ++--<br>
lib/Target/ARM/ARMISelLowering.cpp | 2 +-<br>
lib/Target/ARM/ARMISelLowering.h | 2 +-<br>
lib/Target/Mips/MipsISelLowering.cpp | 2 +-<br>
lib/Target/Mips/MipsISelLowering.h | 2 +-<br>
lib/Target/PowerPC/PPCISelLowering.cpp | 4 ++--<br>
lib/Target/PowerPC/PPCISelLowering.h | 4 ++--<br>
lib/Target/X86/X86ISelLowering.cpp | 4 ++--<br>
lib/Target/X86/X86ISelLowering.h | 4 ++--<br>
<br>
<br>
[PATCH 2/2] Cleanup: Use an MVT instead of EVT. Clean up loop logic.<br>
<br>
The code asserts at VT.getSimpleVT() if VT isn't an MVT.<br>
---<br>
lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 19 ++++++++-----------<br>
<br></div></div>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br>~Craig<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>~Craig<br>