<html><body style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 12px;"><div>Hi Quentin,</div><div><br /></div><div>Thank you for the peace of mind, it was really hard to know I hadn't missed an "EnableConstantFolding=1" line somewhere.<br /></div><div><br /></div><div>I'll apply a dirty hack at my end to make it work - there's quite a bit of legalization on this target.</div><div><br /></div><div>Another quick one if I may. Is there a better Legalizer-like pass for reducing constant ranges? I find if I have a call at the top of a single-basic-block function, the register allocator will use every single callee-saved reg to store constants across the function call necessitating a heap of spilling. I note the Legalizer is described as only really being useful on allocators that do not rematerialize, but none of the register allocators I've tried seem to attempt to reduce callee-saved-spilling by narrowing constant ranges. The Legalizer itself also does not move within the same basic block, so it does nothing to prevent this problem either<br /></div><div><br />Missing a pass/setting, or is this for future improvement?</div><div><br /></div><div><div style="color:rgb(0,0,0);font-size:12px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;word-spacing:0px;">Cheers!<br /></div></div><div><b></b><i></i><u></u><sub></sub><sup></sup><strike></strike><br /></div><div>----- Original Message -----<br /></div><blockquote><div style="width:100%;background:rgb(228,228,228);"><div style="font-weight:bold;">From:</div> "Quentin Colombet" <qcolombet@apple.com></div><br /><div style="font-weight:bold;">To:</div><alex.davies@iinet.net.au><br /><div style="font-weight:bold;">Cc:</div>"llvm-dev" <llvm-dev@listsllvm.org>, "Daniel Sanders" <daniel_l_sanders@apple.com>, "Amara Emerson" <aemerson@apple.com>, "Matt Arsenault" <arsenm2@gmail.com>, "Aditya Nandakumar" <aditya_nandakumar@apple.com>, "Volkan Keles" <vkeles@apple.com>, "Jessica Paquette" <jpaquette@apple.com><br /><div style="font-weight:bold;">Sent:</div>Mon, 20 May 2019 10:04:56 -0700<br /><div style="font-weight:bold;">Subject:</div>Re: [llvm-dev] GlobalISel: Very limited pattern matching?<br /><br /><br />

+gisel folks<div><br /></div><div>Hi Alex,</div><div><br /></div><div>You’re doing the right thing.</div><div>That’s a known limitation that we’ve discussed in <a href="https://reviews.llvm.org/D59227">https://reviews.llvm.org/D59227</a> but we didn’t really reach a conclusion back them.</div><div>Short term, I believe you’re right, we should patch up the GISel emitter to use <span style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;">getConstantVRegVal instead of looking directly for G_CONSTANT.</span></div><div><font face="Helvetica Neue, Helvetica, Arial, sans-serif"><br /></font></div><div><font face="Helvetica Neue, Helvetica, Arial, sans-serif">Long term, this is something we need to discuss I personally think that we shouldn’t consider G_CONSTANT as true instructions and we should always extend them in place, but this is not a generally belief.</font></div><div><font face="Helvetica Neue, Helvetica, Arial, sans-serif"><br /></font></div><div><font face="Helvetica Neue, Helvetica, Arial, sans-serif">Cheers,</font></div><div><font face="Helvetica Neue, Helvetica, Arial, sans-serif">-Quentin<br /></font><div><br /><blockquote><div>On May 20, 2019, at 5:49 AM, via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvmorg</a>> wrote:</div><br class="Apple-interchange-newline" /><div><div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:12px;">Hi all,<br /><br /><div>I'm trying to get GlobalISel up and running on an off-tree architecture and am thinking I must be doing something wrong, given by how few things actually work.</div><div><br /></div><div>Namely, any ImmLeaf<> pattern will fail to match if there is a (TRUNC/ZEXT/SEXT) applied to the constant operand, all of which are commonly created through Legalization. This is due to G_CONSTANT being explicitly looked for by the tablegened code, rather than code that makes use of getConstantVRegVal.<br /></div><br /><div>Is there supposed to be a constant folding pass before Instruction Selection? CSE does not fold past unaries applied to operands, I'm surely missing a pass somewhere...</div><div><br />Thanks,<br /></div><div>- Alex Davies</div></div>
_______________________________________________<br />LLVM Developers mailing list<br /><a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br />https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br /></div></blockquote></div><br /></div>

</blockquote></body></html>