diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2016-06-29 23:58:39 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2016-06-29 23:58:39 +0000 |
| commit | c3701e8b9252498e2ed27a99238f71cb07dd43a4 (patch) | |
| tree | ba1d01be034b7633a9d7fdf9597c6125e9ca8eb9 | |
| parent | 14cdab6492e31f03405c73c113f615f7a4277134 (diff) | |
| download | bcm5719-llvm-c3701e8b9252498e2ed27a99238f71cb07dd43a4.tar.gz bcm5719-llvm-c3701e8b9252498e2ed27a99238f71cb07dd43a4.zip | |
regenerate checks
llvm-svn: 274188
| -rw-r--r-- | llvm/test/Transforms/InstCombine/apint-select.ll | 102 |
1 files changed, 75 insertions, 27 deletions
diff --git a/llvm/test/Transforms/InstCombine/apint-select.ll b/llvm/test/Transforms/InstCombine/apint-select.ll index cf24a44d628..fe9766b2a5e 100644 --- a/llvm/test/Transforms/InstCombine/apint-select.ll +++ b/llvm/test/Transforms/InstCombine/apint-select.ll @@ -1,45 +1,93 @@ -; This test makes sure that these instructions are properly eliminated. - +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -instcombine -S | FileCheck %s -; CHECK-NOT: select +; No selects should remain. + +define i41 @zext(i1 %C) { +; CHECK-LABEL: @zext( +; CHECK-NEXT: [[V:%.*]] = zext i1 %C to i41 +; CHECK-NEXT: ret i41 [[V]] +; + %V = select i1 %C, i41 1, i41 0 + ret i41 %V +} + +define i41 @sext(i1 %C) { +; CHECK-LABEL: @sext( +; CHECK-NEXT: [[V:%.*]] = sext i1 %C to i41 +; CHECK-NEXT: ret i41 [[V]] +; + %V = select i1 %C, i41 -1, i41 0 + ret i41 %V +} -define i41 @test1(i1 %C) { - %V = select i1 %C, i41 1, i41 0 ; V = C - ret i41 %V +define i999 @not_zext(i1 %C) { +; CHECK-LABEL: @not_zext( +; CHECK-NEXT: [[TMP1:%.*]] = zext i1 %C to i999 +; CHECK-NEXT: [[V:%.*]] = xor i999 [[TMP1]], 1 +; CHECK-NEXT: ret i999 [[V]] +; + %V = select i1 %C, i999 0, i999 1 + ret i999 %V } -define i999 @test2(i1 %C) { - %V = select i1 %C, i999 0, i999 1 ; V = C - ret i999 %V +define i999 @not_sext(i1 %C) { +; CHECK-LABEL: @not_sext( +; CHECK-NEXT: [[NOT_C:%.*]] = xor i1 %C, true +; CHECK-NEXT: [[V:%.*]] = sext i1 [[NOT_C]] to i999 +; CHECK-NEXT: ret i999 [[V]] +; + %V = select i1 %C, i999 0, i999 -1 + ret i999 %V } +;; (x <s 0) ? -1 : 0 -> ashr x, 31 + define i41 @test3(i41 %X) { - ;; (x <s 0) ? -1 : 0 -> ashr x, 31 - %t = icmp slt i41 %X, 0 - %V = select i1 %t, i41 -1, i41 0 - ret i41 %V +; CHECK-LABEL: @test3( +; CHECK-NEXT: [[X_LOBIT:%.*]] = ashr i41 %X, 40 +; CHECK-NEXT: ret i41 [[X_LOBIT]] +; + %t = icmp slt i41 %X, 0 + %V = select i1 %t, i41 -1, i41 0 + ret i41 %V } +;; (x <s 0) ? -1 : 0 -> ashr x, 31 + define i1023 @test4(i1023 %X) { - ;; (x <s 0) ? -1 : 0 -> ashr x, 31 - %t = icmp slt i1023 %X, 0 - %V = select i1 %t, i1023 -1, i1023 0 - ret i1023 %V +; CHECK-LABEL: @test4( +; CHECK-NEXT: [[X_LOBIT:%.*]] = ashr i1023 %X, 1022 +; CHECK-NEXT: ret i1023 [[X_LOBIT]] +; + %t = icmp slt i1023 %X, 0 + %V = select i1 %t, i1023 -1, i1023 0 + ret i1023 %V } +;; ((X & 27) ? 27 : 0) + define i41 @test5(i41 %X) { - ;; ((X & 27) ? 27 : 0) - %Y = and i41 %X, 32 - %t = icmp ne i41 %Y, 0 - %V = select i1 %t, i41 32, i41 0 - ret i41 %V +; CHECK-LABEL: @test5( +; CHECK-NEXT: [[Y:%.*]] = and i41 %X, 32 +; CHECK-NEXT: ret i41 [[Y]] +; + %Y = and i41 %X, 32 + %t = icmp ne i41 %Y, 0 + %V = select i1 %t, i41 32, i41 0 + ret i41 %V } +;; ((X & 27) ? 27 : 0) + define i1023 @test6(i1023 %X) { - ;; ((X & 27) ? 27 : 0) - %Y = and i1023 %X, 64 - %t = icmp ne i1023 %Y, 0 - %V = select i1 %t, i1023 64, i1023 0 - ret i1023 %V +; CHECK-LABEL: @test6( +; CHECK-NEXT: [[Y:%.*]] = and i1023 %X, 64 +; CHECK-NEXT: ret i1023 [[Y]] +; + %Y = and i1023 %X, 64 + %t = icmp ne i1023 %Y, 0 + %V = select i1 %t, i1023 64, i1023 0 + ret i1023 %V } + |

