summaryrefslogtreecommitdiff
path: root/test/CodeGen/Thumb2/bfi.ll
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-03-26 01:21:03 +0000
committerEric Christopher <echristo@apple.com>2011-03-26 01:21:03 +0000
commit29aeed1bf8c70eec381d5cbf7de2710b5157d526 (patch)
treed24dfe54fcc27a97879cd842c4a0f4f730d55f33 /test/CodeGen/Thumb2/bfi.ll
parente420449e80191051d6d1636883f2400cb0a8ace5 (diff)
downloadllvm-29aeed1bf8c70eec381d5cbf7de2710b5157d526.tar.gz
llvm-29aeed1bf8c70eec381d5cbf7de2710b5157d526.tar.bz2
llvm-29aeed1bf8c70eec381d5cbf7de2710b5157d526.tar.xz
Fix the bfi handling for or (and a mask) (and b mask). We need the two
masks to match inversely for the code as is to work. For the example given we actually want: bfi r0, r2, #1, #1 not #0, however, given the way the pattern is written it's not possible at the moment. Fixes rdar://9177502 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128320 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Thumb2/bfi.ll')
-rw-r--r--test/CodeGen/Thumb2/bfi.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGen/Thumb2/bfi.ll b/test/CodeGen/Thumb2/bfi.ll
index 6fb2fc888d..0405d98430 100644
--- a/test/CodeGen/Thumb2/bfi.ll
+++ b/test/CodeGen/Thumb2/bfi.ll
@@ -49,3 +49,14 @@ define i32 @f4(i32 %a) nounwind {
%ins12 = or i32 %ins7, 3137
ret i32 %ins12
}
+
+; rdar://9177502
+define i32 @f5(i32 %a, i32 %b) nounwind readnone {
+entry:
+; CHECK f5
+; CHECK-NOT: bfi r0, r2, #0, #1
+%and = and i32 %a, 2
+%b.masked = and i32 %b, -2
+%and3 = or i32 %b.masked, %and
+ret i32 %and3
+}