X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=test%2FCodeGen%2FAArch64%2Ffast-isel-tbz.ll;h=d7f46b2cfde8adc3e65bcec8d8cae078e7e21163;hp=9fd10cb7a477ce4b3d70d35a471f56565a6ea22d;hb=5745cad86144b8a3d47f55568daff433033cf202;hpb=9952c922c2b5cf27fc75a148902c8ac0042b8bb2 diff --git a/test/CodeGen/AArch64/fast-isel-tbz.ll b/test/CodeGen/AArch64/fast-isel-tbz.ll index 9fd10cb7a47..d7f46b2cfde 100644 --- a/test/CodeGen/AArch64/fast-isel-tbz.ll +++ b/test/CodeGen/AArch64/fast-isel-tbz.ll @@ -121,5 +121,21 @@ bb2: ret i32 0 } +; Test that we don't fold the 'and' instruction into the compare. +define i32 @icmp_eq_and_i32(i32 %a, i1 %c) { +; CHECK-LABEL: icmp_eq_and_i32 +; CHECK: and [[REG:w[0-9]+]], w0, #0x4 +; CHECK-NEXT: cbz [[REG]], {{LBB.+_3}} + %1 = and i32 %a, 4 + br i1 %c, label %bb0, label %bb2 +bb0: + %2 = icmp eq i32 %1, 0 + br i1 %2, label %bb1, label %bb2, !prof !0 +bb1: + ret i32 1 +bb2: + ret i32 0 +} + !0 = metadata !{metadata !"branch_weights", i32 0, i32 2147483647} !1 = metadata !{metadata !"branch_weights", i32 2147483647, i32 0}