<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Reed, <div><br></div><div>We will need to reconstruct the target machine and the TTI chain when the function attributes change. We currently don't have code for doing that but I suggest that you talk with Bill Wendling about the best way to implement this. </div><div><br></div><div>Thanks,</div><div>Nadav</div><div><br><div><div>On Mar 22, 2013, at 11:30 AM, Reed Kotler <<a href="mailto:rkotler@mips.com">rkotler@mips.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: 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;">Just realized that BasicTransformInfoClass is an immutable pass.<br><br>Not sure how to reconcile this with fact that there will be different answers needed depending on the subtarget.<br><br>Seems like BasicTansformInfoClass should become a function pass that does not modify anything.<br><br>On 03/22/2013 09:43 AM, Reed Kotler wrote:<br><blockquote type="cite">Another way to do this would to be to have a reset virtual function<br>which is passed the Function, and the address of TLI so that it could be<br>modified.<br><br>This seems somewhat cleaner.<br><br>The reset virtual function would be added to base class TargetLoweringBase.<br><br><br>On 03/22/2013 09:22 AM, reed kotler wrote:<br><blockquote type="cite">For being able to change subtargets within a compilation unit, among<br>other things, I need to be able to change the target lowering class that<br>is used by BasicTTI<br><br>For example we have a mips16 and non mips16 version.<br><br>On the original call that creates this class, I'd like to pass the<br>address of the address of the TargetLoweringBase class.<br><br>That way I can insert a function pass before this pass which examines<br>the function attributes and changes the pointer.<br><br>So we would get:<br><br>ImmutablePass *<br>llvm::createBasicTargetTransformInfoPass(const TargetLoweringBase<br>**TLI_) {<br> return new BasicTTI(TLI);<br>}<br><br>we would add the variable<br><br>TargetLoweringBase **TLI_<br><br>and at the beginning of each pass<br><br>TLI = *TLI_;<br><br>Maybe there is a more elegant way to do this but this is essentially<br>what I need to do.<br></blockquote></blockquote><br><br>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a></div></blockquote></div><br></div></body></html>