<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Andrea,<div class=""><br class=""></div><div class="">The general direction looks good, just a couple of questions:</div><div class="">Since we are matching integer types, shouldn’t we use the integer variant: <span style="font-family: Menlo; font-size: 11px;" class="">MOVNTD</span>?</div><div class=""><br class=""></div><div class="">Moreover, wouldn’t it make sense to have a more general pattern for this?</div><div class="">I.e., we could use VR128 instead of immAllZerosV, couldn’t we?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">-Quentin</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 16, 2014, at 10:41 AM, Andrea Di Biagio <<a href="mailto:andrea.dibiagio@gmail.com" class="">andrea.dibiagio@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Hi,<br class=""><br class="">This is a fix for PR19370.<br class="">Currently the x86 backend wrongly selects a a normal vector store<br class="">instead of a non-temporal store if the value to store is a vector of<br class="">all zeros.<br class=""><br class="">Small reproducible:<br class=""><br class="">;;<br class="">define void @test(<4 x float>* %dst) {<br class="">  store <4 x float> zeroinitializer, <4 x float>* %dst, align 16,<br class="">!nontemporal !1<br class="">  ret void<br class="">}<br class=""><br class="">!1 = metadata !{i32 1}<br class="">;;<br class=""><br class="">llc (-mtriple=x86_64-unknown-unknown -mcpu=corei7-avx) generates:<br class="">  vxorps  %xmm0, %xmm0, %xmm0<br class="">  vmovaps %xmm0, (%rdi)<br class="">  retq<br class=""><br class="">Instead, llc should generate:<br class="">  vxorps  %xmm0, %xmm0, %xmm0<br class="">  vmovntps  %xmm0, (%rdi)<br class="">  retq<br class=""><br class="">In this example, the vector of all zeros is legalized to a zero vector<br class="">of type v4i32.<br class="">However, ISel doesn't have a rule to select a MOVNTPSmr when the<br class="">source is not a vector of float elements. So, it eventually (wrongly)<br class="">falls back to selecting a normal store.<br class=""><br class="">This patch fixes the problem adding extra ISel patterns to cover that<br class="">particular corner case.<br class=""><br class="">Please let me know if ok to commit.<br class=""><br class="">Thanks!<br class="">Andrea<br class=""><span id="cid:B4EDEC2A-6402-4A58-96ED-5C6B73A442AF"><patch-nontemporal.diff></span></div></blockquote></div><br class=""></div></body></html>