<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">LGTM. <div><br><div><div>On Aug 6, 2013, at 7:50 AM, Jessome, Marc <<a href="mailto:marc.jessome@intel.com">marc.jessome@intel.com</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;">I've expanded the test, and taught the cost model about lifetime intrinsics. The call itself is scalarized, rather than reconstructed and output.<br><br>Marc<br><br>From: Nadav Rotem [<a href="mailto:nrotem@apple.com">mailto:nrotem@apple.com</a>]<span class="Apple-converted-space"> </span><br>Sent: Friday, August 02, 2013 2:54 PM<br>To: Jessome, Marc<br>Cc: <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>; Arnold Schwaighofer<br>Subject: Re: [PATCH] Allow loop vectorization with llvm.lifetime calls<br><br>The lifetime marker sequence below is legal and the stack-coloring code should not have a problem handling it.  <br><br>Thanks for working on this!<br><br>Nadav<br><br>On Aug 2, 2013, at 7:05 AM, Jessome, Marc <<a href="mailto:marc.jessome@intel.com">marc.jessome@intel.com</a>> wrote:<br><br><br>Hi Nadav,<br><br>I'd like to continue with this patch before it falls through the cracks; Would you be able to give any insight on this remaining question?<br><br><br>The question then remains whether to subsequent calls to a lifetime intrinsic are legal. I don't see anything in "<a href="http://llvm.org/docs/LangRef.html#llvm-lifetime-start-intrinsic">http://llvm.org/docs/LangRef.html#llvm-lifetime-start-intrinsic</a>" that leads me to believe it would not be.<br><br>+  %0 = bitcast [1024 x i32]* % arr to i8*<br>+  call void @llvm.lifetime.start(i64 4, i8* %0) #1<br>+  call void @llvm.lifetime.start(i64 4, i8* %0) #1<br><br>Maybe Nadav knows?<br><br>Thanks,<br> Marc<br>________________________________________<br>From: Arnold Schwaighofer [<a href="mailto:aschwaighofer@apple.com">aschwaighofer@apple.com</a>]<br>Sent: Wednesday, July 31, 2013 3:08 PM<br>To: Jessome, Marc<br>Cc: <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>; Nadav Rotem<br>Subject: Re: [PATCH] Allow loop vectorization with llvm.lifetime calls<br><br>On Jul 31, 2013, at 1:34 PM, Jessome, Marc <<a href="mailto:marc.jessome@intel.com">marc.jessome@intel.com</a>> wrote:<br><br><br>Hi Arnold,<br><br>I've attached an updated patch, however I do have a quick question about one of your comments.<br><br>Your comment about the need to use getVectorValue() rather than getArgOperand() is spot on. I am wondering, however, if we want to do this only for the first element of the vector, or if it should be done for each element?<br>In the latter case, a simple scalarizeInstruction() would suffice, rather than manually extracting the arguments and rebuilding lifetime.* calls.<br><br>I was (probably mistakenly) assuming that we cannot have loop variant pointers as argument to lifetime intrinsic calls. For example:<br><br>+for.body:<br>+  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]<br>+  %0 = getelementptr [1024 x i32]* %arr, 0, indvars.iv<br>+  %1 = bitcast [1024 x i32]* %0 to i8*<br>+  call void @llvm.lifetime.start(i64 4, i8* %1) #1<br><br><br>If we can have a construct like the one above (which I don't see why we shouldn't) then yes you need to scalarize the elements of getVectorValue() individually like done by scalarizeInstruction.<br><br>The question then remains whether to subsequent calls to a lifetime intrinsic are legal. I don't see anything in "<a href="http://llvm.org/docs/LangRef.html#llvm-lifetime-start-intrinsic">http://llvm.org/docs/LangRef.html#llvm-lifetime-start-intrinsic</a>" that leads me to believe it would not be.<br><br>+  %0 = bitcast [1024 x i32]* % arr to i8*<br>+  call void @llvm.lifetime.start(i64 4, i8* %0) #1<br>+  call void @llvm.lifetime.start(i64 4, i8* %0) #1<br><br>Maybe Nadav knows?<br><br><span><vectorize_lifetime.4.patch></span></div></blockquote></div><br></div></body></html>