[PATCH] Disable indvar widening if arithmetics on the wider type are more expensive

Tom Stellard tom at stellard.net
Mon Nov 10 08:28:18 PST 2014


On Mon, Nov 10, 2014 at 12:41:49AM +0000, Jingyue Wu wrote:
> Hi atrick, jholewinski, eliben, meheff,
> 
> We should not widen an indvar if arithmetics on the wider indvar are more
> expensive than those on the narrower indvar. For instance, although
> NVPTX64 treats i64 as a legal type, an ADD on i64 is twice as expensive
> as that on i32, because the hardware needs to simulate a 64-bit integer
> using two 32-bit integers.
> 
> This patch
> 1. adds a NVPTX-specific TargetTransformInfo with specialized computing
> of cost of arithmetic instructions;
> 2. compares the cost of arithmetics on the wider type and that on the
> narrower type before widening an indvar.

Can you split the indvar changes and NVPTX changes into separate patches.

Thanks,
Tom



More information about the llvm-commits mailing list