On Thu, Nov 21, 2013 at 10:36 PM, Wei Mi <w...@google.com> wrote: > On Thu, Nov 21, 2013 at 1:01 PM, Richard Biener > <richard.guent...@gmail.com> wrote: >> Wei Mi <w...@google.com> wrote: >>>On Thu, Nov 21, 2013 at 11:36 AM, Richard Biener >>><richard.guent...@gmail.com> wrote: >>>> Wei Mi <w...@google.com> wrote: >>>>>> So what you are doing is basically not only rewriting memory >>>>>references >>>>>> to possibly use TARGET_MEM_REF but also address uses to use >>>>>> &TARGET_MEM_REF. I think this is a good thing in general >>>>>> (given instructions like x86 lea) and I would not bother >>>>>distinguishing >>>>>> the different kind of uses. >>>>>> >>>>>> Richard. >>>>>> >>>>> >>>>>You mean to change normal expr to &TMR(expr) form in order to utilize >>>>>x86 lea type instructions as much as possible. It is interesting. I >>>>>can experiment that idea later. I am not sure if it could simply >>>work. >>>>>My concern is x86 lea still has some limitation (such as three >>>>>operands lea will have longer latency and can only be issued to >>>>>port1), if we change some expr to &TMR(expr), will it inhitbit cse >>>>>opportunity if codegen find out it is not good to use lea? >>>> >>>> That needs to be determined. Over all it might be because ivopts >>>runs so early. At rtl level there should not be big differences apart >>>from better initial address computations. >>>> >>>> Did I misunderstand what your patch does? >>>> >>>> Richard. >>>> >>> >>>My patch wants to address the issue that iv uses using as memory >>>reference actuals for load/store/prefetch builtins are treated as >>>non-linear iv uses instead of address iv uses, and the result of >>>determine_use_iv_cost is wrong. After we change those uses to address >>>uses, less ivs may be used, TMR will be generated for those iv uses >>>and efficent addressing mode could be utilized. >> >> But are not all pointer typed uses address uses?! >> >> Richard. >> > > If a pointer typed use is plainly value passed to a func call, it is > not an address use, right? But as you said, x86 lea may help here.
But that's what you are matching ... (well, for builtins you know will expand that to a memory reference). What I dislike in the patch is the special-casing of some builtins via a target hook. I'd rather say treat all internal functions and all target builtins that way. Or simply all addresses. Thanks, Richard. > Thanks, > Wei.