Mercurial > hg > CbC > CbC_llvm
diff test/CodeGen/AArch64/tbz-tbnz.ll @ 100:7d135dc70f03 LLVM 3.9
LLVM 3.9
author | Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 26 Jan 2016 22:53:40 +0900 |
parents | afa8332a0e37 |
children | 1172e4bd9c6f |
line wrap: on
line diff
--- a/test/CodeGen/AArch64/tbz-tbnz.ll Tue Oct 13 17:49:56 2015 +0900 +++ b/test/CodeGen/AArch64/tbz-tbnz.ll Tue Jan 26 22:53:40 2016 +0900 @@ -256,3 +256,106 @@ if.end: ret void } + +define void @test14(i1 %cond) { +; CHECK-LABEL: @test14 + br i1 %cond, label %if.end, label %if.then + +; CHECK-NOT: and +; CHECK: tbnz w0, #0 + +if.then: + call void @t() + br label %if.end + +if.end: + ret void +} + +define void @test15(i1 %cond) { +; CHECK-LABEL: @test15 + %cond1 = xor i1 %cond, -1 + br i1 %cond1, label %if.then, label %if.end + +; CHECK-NOT: movn +; CHECK: tbnz w0, #0 + +if.then: + call void @t() + br label %if.end + +if.end: + ret void +} + +define void @test16(i64 %in) { +; CHECK-LABEL: @test16 + %shl = shl i64 %in, 3 + %and = and i64 %shl, 32 + %cond = icmp eq i64 %and, 0 + br i1 %cond, label %then, label %end + +; CHECK-NOT: lsl +; CHECK: tbnz w0, #2 + +then: + call void @t() + br label %end + +end: + ret void +} + +define void @test17(i64 %in) { +; CHECK-LABEL: @test17 + %shr = ashr i64 %in, 3 + %and = and i64 %shr, 1 + %cond = icmp eq i64 %and, 0 + br i1 %cond, label %then, label %end + +; CHECK-NOT: lsr +; CHECK: tbnz w0, #3 + +then: + call void @t() + br label %end + +end: + ret void +} + +define void @test18(i32 %in) { +; CHECK-LABEL: @test18 + %shr = ashr i32 %in, 2 + %cond = icmp sge i32 %shr, 0 + br i1 %cond, label %then, label %end + +; CHECK-NOT: asr +; CHECK: tbnz w0, #31 + +then: + call void @t() + br label %end + +end: + ret void +} + +define void @test19(i64 %in) { +; CHECK-LABEL: @test19 + %shl = lshr i64 %in, 3 + %trunc = trunc i64 %shl to i32 + %and = and i32 %trunc, 1 + %cond = icmp eq i32 %and, 0 + br i1 %cond, label %then, label %end + +; CHECK-NOT: ubfx +; CHECK: tbnz w0, #3 + +then: + call void @t() + br label %end + +end: + ret void +}