[llvm] r180779 - Fix a bug in foldSelectICmpAndOr.

Eric Christopher echristo at gmail.com
Tue Apr 30 04:32:25 PDT 2013


Testcase?

-eric

On Tue, Apr 30, 2013 at 11:36 AM, David Majnemer
<david.majnemer at gmail.com> wrote:
> Author: majnemer
> Date: Tue Apr 30 05:36:33 2013
> New Revision: 180779
>
> URL: http://llvm.org/viewvc/llvm-project?rev=180779&view=rev
> Log:
> Fix a bug in foldSelectICmpAndOr.
>
> Differences in bitwidth between X and Y could exist even if C1 and C2 have
> the same Log2 representation.
>
> Modified:
>     llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
>
> Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp?rev=180779&r1=180778&r2=180779&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp (original)
> +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp Tue Apr 30 05:36:33 2013
> @@ -401,7 +401,8 @@ static Value *foldSelectICmpAndOr(const
>    } else if (C1Log > C2Log) {
>      V = Builder->CreateLShr(V, C1Log - C2Log);
>      V = Builder->CreateZExtOrTrunc(V, Y->getType());
> -  }
> +  } else
> +    V = Builder->CreateZExtOrTrunc(V, Y->getType());
>
>    ICmpInst::Predicate Pred = IC->getPredicate();
>    if ((Pred == ICmpInst::ICMP_NE && OrOnFalseVal) ||
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list