[PATCH] [TTI] Add a new hook to TargetTransformInfo to query the target if a load of a constant should be converted to simply the constant itself.

Juergen Ributzka juergen at apple.com
Mon Jan 27 17:26:50 PST 2014


Committed in r200271.

Cheers,
Juergen


On Jan 27, 2014, at 5:19 PM, Hal Finkel <hfinkel at anl.gov> wrote:

> ----- Original Message -----
>> From: "Juergen Ributzka" <juergen at apple.com>
>> To: "Hal J. Finkel" <hfinkel at anl.gov>
>> Cc: "Chandler Carruth" <chandlerc at google.com>, "LLVM Commits" <llvm-commits at cs.uiuc.edu>
>> Sent: Monday, January 27, 2014 7:11:29 PM
>> Subject: Re: [PATCH] [TTI] Add a new hook to TargetTransformInfo to query the target if a load of a constant should
>> be converted to simply the	constant itself.
>> 
>> 
>> Here is the updated patch.
> 
> Looks good, thanks! Removing the TTI dependence seems like a nice cleanup.
> 
> -Hal
> 
>> -Juergen
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> On Jan 27, 2014, at 4:32 PM, Hal Finkel < hfinkel at anl.gov > wrote:
>> 
>> 
>> 
>> ----- Original Message -----
>> 
>> 
>> From: "Chandler Carruth" < chandlerc at google.com >
>> To: "Juergen Ributzka" < juergen at apple.com >
>> Cc: "LLVM Commits" < llvm-commits at cs.uiuc.edu >
>> Sent: Monday, January 27, 2014 6:26:27 PM
>> Subject: Re: [PATCH] [TTI] Add a new hook to TargetTransformInfo to
>> query the target if a load of a constant should
>> be converted to simply the constant itself.
>> 
>> 
>> 
>> Why is this going into the TargetTransformInfo which is for use by
>> IR-level analysis routines when its only caller is in the
>> SelectionDAG? The SelectionDAG can query TargetLowering directly.
>> 
>> 
>> I agree, this should be in TargetLowering. Otherwise, this seems
>> reasonable to me.
>> 
>> -Hal
>> 
>> 
>> 
>> 
>> 
>> On Mon, Jan 27, 2014 at 4:20 PM, Juergen Ributzka < juergen at apple.com
>> 
>> 
>> wrote:
>> 
>> 
>> Hi Hal
>> 
>> this is the new target hook we talked about before. I also added Evan
>> and Nadav, because I had to modify the ARM and X86 backend.
>> 
>> Before this patch we used getIntImmCost to determine if a load of a
>> constant should be converted to just a constant, but the threshold
>> for this was set to an arbitrary value. This value works well for
>> the two targets (ARM and X86) that implement this target-hook, but
>> it isn't target-independent at all.
>> 
>> Now targets have the possibility to decide directly if this
>> optimization should be performed. The default value is set to false
>> to preserve the current behavior.
>> 
>> Please review.
>> 
>> Thanks
>> 
>> -Juergen
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> 
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> 
>> 
>> --
>> Hal Finkel
>> Assistant Computational Scientist
>> Leadership Computing Facility
>> Argonne National Laboratory
>> 
> 
> -- 
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140127/8386e11a/attachment.html>


More information about the llvm-commits mailing list