<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="">Hey Tobias<div class=""><br class=""></div><div class="">Sorry for the late reply.<br class=""><div><blockquote type="cite" class=""><div class="">On Apr 24, 2015, at 10:49 AM, Tobias Edler von Koch <<a href="mailto:tobias@codeaurora.org" class="">tobias@codeaurora.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Hi Pete,<br class=""><br class="">I have a downstream pass using this, but it's not a big deal because<br class="">it's possible to replicate the old behavior by creating a new<br class="">function yourself and then using CloneFunctionInto, which lets you remap<br class="">the arguments.<br class=""></div></blockquote>So it took a look at the callers of CloneFunctionInto and none of them are using this functionality either.  I’d love to remove all of the attribute set hacking at the top of CloneFunctionInto, but that’ll break your out-of-tree code.  Specifically, its this code, and the loop under it:</div><div><br class=""></div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class="">  // Copy all attributes other than those stored in the AttributeSet.  We need</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">  </span>// to remap the parameter indices of the AttributeSet.</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">  <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">AttributeSet</span> NewAttrs = NewFunc-><span style="font-variant-ligatures: no-common-ligatures; color: #31595d" class="">getAttributes</span>();</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">  NewFunc-><span style="font-variant-ligatures: no-common-ligatures; color: #31595d" class="">copyAttributesFrom</span>(OldFunc);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">  NewFunc-><span style="font-variant-ligatures: no-common-ligatures; color: #31595d" class="">setAttributes</span>(NewAttrs);</div></div><div><br class=""></div><div>If this code is particularly useful to you then i’m happy to leave it as is.  Otherwise, if there’s some way I can delete the unused code in CloneFunctionInto then that would be great.</div><div><br class=""></div><div>What do you think?</div><div><blockquote type="cite" class=""><div class=""><br class="">Perhaps it might make sense to add something like "Use<br class="">CloneFunctionInto if remapping of arguments is required" to the<br class="">comment to make it easier for people to figure this out?<br class=""></div></blockquote>Also thanks for this piece of feedback.  I’ve added this comment to the patch.<br class=""><br class="">Cheers,<br class="">Pete<br class=""><blockquote type="cite" class=""><div class=""><br class="">Tobias<br class=""><br class="">On Fri, 24 Apr 2015 10:13:42 -0700 Pete Cooper<br class=""><<a href="mailto:peter_cooper@apple.com" class="">peter_cooper@apple.com</a>> wrote:<br class=""><br class=""><blockquote type="cite" class="">Hi Rafael<br class=""><br class="">The method llvm::CloneFunction takes a VMap in which "any references specified in the VMap are changed to refer to their mapped value instead of the original one".<br class=""><br class="">However, all callers of this function (AMDGPUAlwaysInlinePass, clang’s CGVTables, and PartialInlining) never make use of this functionality.  That is, they always pass an empty map.<br class=""><br class="">Attached is a patch which removes the ability for this method to rewrite arguments, and asserts that no-one tries to.  The function comment has been updated to state this.<br class=""><br class="">This also exposed some code cleanup due to the function types of the old and new functions being the same.<br class=""><br class="">Cheers,<br class="">Pete<br class=""></blockquote><br class=""><br class=""><br class="">-- <br class="">Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a<br class="">Linux Foundation Collaborative Project.<br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@cs.uiuc.edu" class="">llvm-commits@cs.uiuc.edu</a><br class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br class=""></div></blockquote></div><br class=""></div></body></html>