[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.

Hal Finkel hfinkel at anl.gov
Mon Jan 27 16:32:36 PST 2014


----- 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



More information about the llvm-commits mailing list