<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Hal,<div><br></div><div>currently the “getIntImmCost" hook is only used in SelectionDAG (getMemsetStringVal) for simplifying a load of a string constant to a constant during memset optimization.</div><div>There is already a TTI hook to calculate the cost of an memory operation, but that mostly counts the number of memory operations and can’t be directly compared to the cost of an immediate.</div><div><br></div><div>I guess a new target hook might still be the easiest solution here. What about “bool shouldConvertConstantLoadToIntImm(const APInt &Imm, Type *Ty) const”?</div><div><br></div><div>-Juergen</div><div><br></div><div><div><div>On Jan 23, 2014, at 4:12 PM, Juergen Ributzka <<a href="mailto:juergen@apple.com">juergen@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Great! I will try to add that feature in a followup patch in this case.<div><br></div><div>Cheers,</div><div>Juergen<br><div><br><div><div>On Jan 23, 2014, at 4:06 PM, Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</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;">----- Original Message -----<br><blockquote type="cite">From: "Juergen Ributzka" <<a href="mailto:juergen@apple.com">juergen@apple.com</a>><br>To: "Hal Finkel" <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>><br>Cc: "LLVM Commits" <<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>>, "Owen Anderson" <<a href="mailto:owen@apple.com">owen@apple.com</a>><br>Sent: Thursday, January 23, 2014 5:58:47 PM<br>Subject: Re: [PATCH] Constant Hoisting Pass<br><br><br>That would be great.<br><br><br>Yes, the TCC_LOAD part was and is still a little bit flaky. I think<br>the only place where this is actually used is in the SelectionDAG.<br>A targets definition of how expensive a load is also not well defined<br>in this context, so maybe it would be better if we have a<br>separate target hook to model this better?<br><br></blockquote><br>Makes sense to me.<br><br>Thanks again,<br>Hal<br><br><blockquote type="cite"><br>-Juergen<br><br><br>On Jan 23, 2014, at 3:44 PM, Hal Finkel < <a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a> > wrote:<br><br><br>Hi Juergen,<br><br>I think this looks useful, and I'd like to take advantage of this for<br>PowerPC when it lands. One small request: I'd like to have some cost<br>level in between "basic" and "load". There are constants on PPC that<br>take a few add-cost instructions to materialize... hoisting these is<br>likely useful, but loads of these constants should still be<br>transformed into immediates (because the several integer<br>instructions necessary are still cheaper than a load).<br><br>Thanks,<br>Hal<br><br></blockquote><br>--<span class="Apple-converted-space"> </span><br>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory</div></blockquote></div><br></div></div></div>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br></blockquote></div><br></div></body></html>