[llvm] r257546 - Guard fabs to bfc convert with V6T2 flag

Ana Pazos via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 16:03:35 PST 2016


Author: apazos
Date: Tue Jan 12 18:03:35 2016
New Revision: 257546

URL: http://llvm.org/viewvc/llvm-project?rev=257546&view=rev
Log:
Guard fabs to bfc convert with V6T2 flag

Summary:
BFC instructions are available in ARMv6T2 and above.


Reviewers: t.p.northover

Subscribers: aemerson

Differential Revision: http://reviews.llvm.org/D16076

Added:
    llvm/trunk/test/CodeGen/ARM/fabs-to-bfc.ll
Modified:
    llvm/trunk/lib/Target/ARM/ARMInstrVFP.td

Modified: llvm/trunk/lib/Target/ARM/ARMInstrVFP.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrVFP.td?rev=257546&r1=257545&r2=257546&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrVFP.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrVFP.td Tue Jan 12 18:03:35 2016
@@ -930,10 +930,10 @@ def VMOVDRR : AVConv5I<0b11000100, 0b101
 // and could enable the conversion to float to be removed completely.
 def : Pat<(fabs (arm_fmdrr GPR:$Rl, GPR:$Rh)),
           (VMOVDRR GPR:$Rl, (BFC GPR:$Rh, (i32 0x7FFFFFFF)))>,
-      Requires<[IsARM]>;
+      Requires<[IsARM, HasV6T2]>;
 def : Pat<(fabs (arm_fmdrr GPR:$Rl, GPR:$Rh)),
           (VMOVDRR GPR:$Rl, (t2BFC GPR:$Rh, (i32 0x7FFFFFFF)))>,
-      Requires<[IsThumb2]>;
+      Requires<[IsThumb2, HasV6T2]>;
 def : Pat<(fneg (arm_fmdrr GPR:$Rl, GPR:$Rh)),
           (VMOVDRR GPR:$Rl, (EORri GPR:$Rh, (i32 0x80000000)))>,
       Requires<[IsARM]>;

Added: llvm/trunk/test/CodeGen/ARM/fabs-to-bfc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fabs-to-bfc.ll?rev=257546&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/fabs-to-bfc.ll (added)
+++ llvm/trunk/test/CodeGen/ARM/fabs-to-bfc.ll Tue Jan 12 18:03:35 2016
@@ -0,0 +1,14 @@
+; RUN: llc < %s -mtriple=armv5e-none-linux-gnueabi -mattr=+vfp2  | FileCheck %s -check-prefix=CHECK-VABS
+; RUN: llc < %s -mtriple=armv7-none-linux-gnueabi  -mattr=+vfp3 | FileCheck  %s -check-prefix=CHECK-BFC
+
+
+define double @test(double %tx) {
+;CHECK-LABEL: test:
+  %call = tail call double @fabs(double %tx)
+  ret double %call
+;CHECK-VABS: vabs.f64
+;CHECK-BFC: bfc
+}
+
+declare double @fabs(double) readnone
+




More information about the llvm-commits mailing list