[llvm-commits] [llvm] r155136 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineShifts.cpp test/Transforms/InstCombine/2010-11-01-lshr-mask.ll test/Transforms/InstCombine/apint-shift.ll test/Transforms/InstCombine/cast.ll test/Transforms/In

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Apr 19 14:08:25 PDT 2012


On Apr 19, 2012, at 11:40 AM, Nick Lewycky <nlewycky at google.com> wrote:

> On 19 April 2012 09:46, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:
> Author: stoklund
> Date: Thu Apr 19 11:46:26 2012
> New Revision: 155136
> 
> These transformations are deferred:
> 
>  (X >>? C) << C   --> X & (-1 << C)  (When X >> C has multiple uses)
>  (X >>? C1) << C2 --> X << (C2-C1) & (-1 << C2)   (When C2 > C1)
>  (X >>? C1) << C2 --> X >>? (C1-C2) & (-1 << C2)  (When C1 > C2)
> 
> If the form on the left is better, please make sure that we turn the code on the right into the code on the left.

I don't think we should do that.

InstCombine doesn't actually have a way of knowing which expression is better, so it will just leave them alone so it at least doesn't break anything.

DAGCombine is better equipped to decide that.

/jakob

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


More information about the llvm-commits mailing list