[LLVMdev] Which transform passes to apply?

Duncan Sands baldrick at free.fr
Mon Dec 3 18:01:30 PST 2012


Hi Josh,

On 03/12/12 02:58, Josh Klontz wrote:
> Hello, I'm a new LLVM user working on a C++ EDSL for image processing. I have
> a function, which after applying createInstructionCombiningPass() and
> createDeadCodeEliminationPass() looks like:
>

...
>    *%dst_yRem = urem i32 %i, %dst_columns
>    %dst_y = urem i32 %i, %dst_columns
>    %1 = sub i32 %i, %dst_y
>    %2 = add i32 %1, %dst_yRem*
...

> My question is which optimization pass(es) are needed to simplify the
> instructions in bold. I've tried running the same passes again and also
> tried createInstructionSimplifierPass() with no luck.

GVN or EarlyCSE.

Ciao, Duncan.




More information about the llvm-dev mailing list