diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-05-09 20:46:12 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-05-09 20:46:12 +0000 |
commit | 608cde04ab3e887fc242ada718a77837951198a8 (patch) | |
tree | a2f491196d725efe63a6bdd2986ca562358b52ff | |
parent | a088f2fbccd8f22e3c0f2b22085b406f5bfb4c53 (diff) | |
download | bcm5719-llvm-608cde04ab3e887fc242ada718a77837951198a8.tar.gz bcm5719-llvm-608cde04ab3e887fc242ada718a77837951198a8.zip |
[InstCombine] update test file to use FileCheck; NFC
llvm-svn: 302585
-rw-r--r-- | llvm/test/Transforms/InstCombine/bit-tracking.ll | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/llvm/test/Transforms/InstCombine/bit-tracking.ll b/llvm/test/Transforms/InstCombine/bit-tracking.ll index 51bbc088883..bd75e2cb723 100644 --- a/llvm/test/Transforms/InstCombine/bit-tracking.ll +++ b/llvm/test/Transforms/InstCombine/bit-tracking.ll @@ -1,26 +1,34 @@ +; RUN: opt < %s -instcombine -S | FileCheck %s + ; This file contains various testcases that require tracking whether bits are ; set or cleared by various instructions. -; RUN: opt < %s -instcombine -instcombine -S |\ -; RUN: not grep %ELIM ; Reduce down to a single XOR define i32 @test3(i32 %B) { - %ELIMinc = and i32 %B, 1 ; <i32> [#uses=1] - %tmp.5 = xor i32 %ELIMinc, 1 ; <i32> [#uses=1] - %ELIM7 = and i32 %B, -2 ; <i32> [#uses=1] - %tmp.8 = or i32 %tmp.5, %ELIM7 ; <i32> [#uses=1] - ret i32 %tmp.8 +; CHECK-LABEL: @test3( +; CHECK-NEXT: [[TMP_8:%.*]] = xor i32 %B, 1 +; CHECK-NEXT: ret i32 [[TMP_8]] +; + %ELIMinc = and i32 %B, 1 + %tmp.5 = xor i32 %ELIMinc, 1 + %ELIM7 = and i32 %B, -2 + %tmp.8 = or i32 %tmp.5, %ELIM7 + ret i32 %tmp.8 } ; Finally, a bigger case where we chain things together. This corresponds to ; incrementing a single-bit bitfield, which should become just an xor. define i32 @test4(i32 %B) { - %ELIM3 = shl i32 %B, 31 ; <i32> [#uses=1] - %ELIM4 = ashr i32 %ELIM3, 31 ; <i32> [#uses=1] - %inc = add i32 %ELIM4, 1 ; <i32> [#uses=1] - %ELIM5 = and i32 %inc, 1 ; <i32> [#uses=1] - %ELIM7 = and i32 %B, -2 ; <i32> [#uses=1] - %tmp.8 = or i32 %ELIM5, %ELIM7 ; <i32> [#uses=1] - ret i32 %tmp.8 +; CHECK-LABEL: @test4( +; CHECK-NEXT: [[TMP_8:%.*]] = xor i32 %B, 1 +; CHECK-NEXT: ret i32 [[TMP_8]] +; + %ELIM3 = shl i32 %B, 31 + %ELIM4 = ashr i32 %ELIM3, 31 + %inc = add i32 %ELIM4, 1 + %ELIM5 = and i32 %inc, 1 + %ELIM7 = and i32 %B, -2 + %tmp.8 = or i32 %ELIM5, %ELIM7 + ret i32 %tmp.8 } |