Do not attempt to use ROR for Thumb1.
authorBob Wilson <bob.wilson@apple.com>
Mon, 2 Jul 2012 17:22:47 +0000 (17:22 +0000)
committerBob Wilson <bob.wilson@apple.com>
Mon, 2 Jul 2012 17:22:47 +0000 (17:22 +0000)
Patch by Matt Fischer!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159538 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMInstrThumb2.td
test/CodeGen/Thumb2/thumb2-ror.ll

index bc980cdf4fb2888d3d7991974c7c9668d90054e1..048dc1f0fd079204d372cb07d0ef49683f53c00f 100644 (file)
@@ -2161,8 +2161,8 @@ defm t2ROR  : T2I_sh_ir<0b11, "ror", imm0_31,
                         BinOpFrag<(rotr node:$LHS, node:$RHS)>, "t2ROR">;
 
 // (rotr x, (and y, 0x...1f)) ==> (ROR x, y)
-def : Pat<(rotr rGPR:$lhs, (and rGPR:$rhs, lo5AllOne)),
-          (t2RORrr rGPR:$lhs, rGPR:$rhs)>;
+def : T2Pat<(rotr rGPR:$lhs, (and rGPR:$rhs, lo5AllOne)),
+            (t2RORrr rGPR:$lhs, rGPR:$rhs)>;
 
 let Uses = [CPSR] in {
 def t2RRX : T2sTwoReg<(outs rGPR:$Rd), (ins rGPR:$Rm), IIC_iMOVsi,
index 590c333b3d1a672ed989bfd2fb7eac61a2361eec..5ad92cd7290d93de6cb2272e21a041d046fc9410 100644 (file)
@@ -1,5 +1,5 @@
 ; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s
-
+; RUN: llc < %s -march=thumb | FileCheck %s -check-prefix=THUMB1
 
 ; CHECK: f1:
 ; CHECK:       ror.w   r0, r0, #22
@@ -13,6 +13,8 @@ define i32 @f1(i32 %a) {
 ; CHECK: f2:
 ; CHECK-NOT: and
 ; CHECK: ror
+; THUMB1: f2
+; THUMB1: and
 define i32 @f2(i32 %v, i32 %nbits) {
 entry:
   %and = and i32 %nbits, 31
@@ -21,4 +23,4 @@ entry:
   %shl = shl i32 %v, %sub
   %or = or i32 %shl, %shr
   ret i32 %or
-}
\ No newline at end of file
+}