aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/bfi.ll
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-06-15 01:12:31 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-06-15 01:12:31 +0000
commitbf188aeae7a579fb71480be7d32a2edc4d56d827 (patch)
treebb4fb35062d992f7249a8027f3cd0fa869615a60 /test/CodeGen/ARM/bfi.ll
parentcf886188fb04d9521db39fe5213df1295673f51e (diff)
PerformBFICombine - (bfi A, (and B, Mask1), Mask2) -> (bfi A, B, Mask2) iff
the bits being cleared by the AND are not demanded by the BFI. The previous BFI dag combine rule was actually incorrect (or used to be correct until BFI representation changed). rdar://9609030 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133034 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/bfi.ll')
-rw-r--r--test/CodeGen/ARM/bfi.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/bfi.ll b/test/CodeGen/ARM/bfi.ll
index c94b096d9c..84f3813975 100644
--- a/test/CodeGen/ARM/bfi.ll
+++ b/test/CodeGen/ARM/bfi.ll
@@ -61,3 +61,16 @@ entry:
%3 = or i32 %2, %0
ret i32 %3
}
+
+; rdar://9609030
+define i32 @f6(i32 %a, i32 %b) nounwind readnone {
+entry:
+; CHECK: f6:
+; CHECK-NOT: bic
+; CHECK: bfi r0, r1, #8, #9
+ %and = and i32 %a, -130817
+ %and2 = shl i32 %b, 8
+ %shl = and i32 %and2, 130816
+ %or = or i32 %shl, %and
+ ret i32 %or
+}