[llvm-commits] [llvm] r135471 - /llvm/trunk/test/Transforms/InstSimplify/compare.ll

Duncan Sands baldrick at free.fr
Mon Jul 25 06:01:44 PDT 2011


Hi Nick,

> Remove bogus test: for all possible inputs of %X, the 'sub nsw' is guaranteed
> to perform a signed wrap. Don't rely on any particular handling of that case.

I don't understand what you are saying.  "sub nsw" never does a signed wrap (if
it does the program performs undefined behaviour).  In the testcase, %A is
positive while %B is negative.  Thus %C is positive because there is no signed
wrap.  Thus %D is positive or zero and %E is false.

Ciao, Duncan.

>
> Modified:
>      llvm/trunk/test/Transforms/InstSimplify/compare.ll
>
> Modified: llvm/trunk/test/Transforms/InstSimplify/compare.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstSimplify/compare.ll?rev=135471&r1=135470&r2=135471&view=diff
> ==============================================================================
> --- llvm/trunk/test/Transforms/InstSimplify/compare.ll (original)
> +++ llvm/trunk/test/Transforms/InstSimplify/compare.ll Tue Jul 19 03:22:57 2011
> @@ -283,17 +283,6 @@
>     ret i1 %E
>   }
>
> -; CHECK: @srem4
> -; CHECK-NEXT: ret i1 false
> -define i1 @srem4(i16 %X, i32 %Y) {
> -  %A = zext i16 %X to i32
> -  %B = or i32 2147483648, %A
> -  %C = sub nsw i32 %A, %B
> -  %D = srem i32 %C, %Y
> -  %E = icmp slt i32 %D, 0
> -  ret i1 %E
> -}
> -
>   define i1 @udiv1(i32 %X) {
>   ; CHECK: @udiv1
>     %A = udiv i32 %X, 1000000
>
>
> _______________________________________________
> 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