From 0c1aec18911f2a67fb37b6593d08f4f8cb7e18ef Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Tue, 14 Dec 2010 03:22:07 +0000 Subject: bfi A, (and B, C1), C2) -> bfi A, B, C2 iff C1 & C2 == C1. rdar://8458663 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121746 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/ARM/bfi.ll | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/CodeGen/ARM/bfi.ll') diff --git a/test/CodeGen/ARM/bfi.ll b/test/CodeGen/ARM/bfi.ll index 157c90c753..946db1909f 100644 --- a/test/CodeGen/ARM/bfi.ll +++ b/test/CodeGen/ARM/bfi.ll @@ -49,3 +49,16 @@ define i32 @f4(i32 %a) nounwind { %ins12 = or i32 %ins7, 3137 ret i32 %ins12 } + +; rdar://8458663 +define i32 @f5(i32 %a, i32 %b) nounwind { +entry: +; CHECK: f5: +; CHECK-NOT: bfc +; CHECK: bfi r0, r1, #20, #4 + %0 = and i32 %a, -15728641 + %1 = shl i32 %b, 20 + %2 = and i32 %1, 15728640 + %3 = or i32 %2, %0 + ret i32 %3 +} -- cgit v1.2.3