[llvm-commits] [PATCH] - Instcombine vector code optimizations

Dan Gohman gohman at apple.com
Thu Apr 7 08:53:43 PDT 2011


On Apr 7, 2011, at 4:24 AM, Rotem, Nadav wrote:

> Hi, 
> 
> Please review the attached patch. I implemented two main optimizations:
> 
> 1. Getelementptr (PTR, extract (vcast)))  -> Getelementptr (PTR, cast (extract)))  scalarize the casting of pointer index. 
>   This generates much better code in cases where the gep index comes from a vector. 

This seems unrelated to getelementptr.  Isn't cast(extract(x)) better than
extract(vcast(x)) on its own?

> 2. Extend the EvaluateInDifferentType and CanEvaluateXXX to support Extract/Insert/ShuffleElement instructions.

This seems a bit precarious since LLVM doesn't know what vector types
and operations are "legal", and since Codegen's "legalizer" only works
locally, so it can't fully recover if expression trees cross basic block
boundaries.

Dan




More information about the llvm-commits mailing list