[llvm] r206171 - AArch64/ARM64: enable directcond.ll test on ARM64.

Tim Northover tnorthover at apple.com
Mon Apr 14 05:51:06 PDT 2014


Author: tnorthover
Date: Mon Apr 14 07:51:06 2014
New Revision: 206171

URL: http://llvm.org/viewvc/llvm-project?rev=206171&view=rev
Log:
AArch64/ARM64: enable directcond.ll test on ARM64.

Code change is because optimizeCompareInstr didn't know how to pull the
condition code out of FCSEL instructions.

Modified:
    llvm/trunk/lib/Target/ARM64/ARM64InstrInfo.cpp
    llvm/trunk/test/CodeGen/AArch64/directcond.ll

Modified: llvm/trunk/lib/Target/ARM64/ARM64InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM64/ARM64InstrInfo.cpp?rev=206171&r1=206170&r2=206171&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM64/ARM64InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM64/ARM64InstrInfo.cpp Mon Apr 14 07:51:06 2014
@@ -775,6 +775,8 @@ bool ARM64InstrInfo::optimizeCompareInst
       case ARM64::CSELXr:
       case ARM64::CSNEGWr:
       case ARM64::CSNEGXr:
+      case ARM64::FCSELSrrr:
+      case ARM64::FCSELDrrr:
         CC = (ARM64CC::CondCode)Instr.getOperand(IO - 1).getImm();
         break;
       }

Modified: llvm/trunk/test/CodeGen/AArch64/directcond.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/directcond.ll?rev=206171&r1=206170&r2=206171&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/directcond.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/directcond.ll Mon Apr 14 07:51:06 2014
@@ -1,11 +1,13 @@
-; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s
+; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-AARCH64
+; RUN: llc -verify-machineinstrs -o - %s -mtriple=arm64 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-ARM64
 ; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -mattr=-fp-armv8 | FileCheck --check-prefix=CHECK-NOFP %s
 
 define i32 @test_select_i32(i1 %bit, i32 %a, i32 %b) {
 ; CHECK-LABEL: test_select_i32:
   %val = select i1 %bit, i32 %a, i32 %b
-; CHECK: movz [[ONE:w[0-9]+]], #1
-; CHECK: tst w0, [[ONE]]
+; CHECK-AARCH64: movz [[ONE:w[0-9]+]], #1
+; CHECK-AARCH64: tst w0, [[ONE]]
+; CHECK-ARM64: tst w0, #0x1
 ; CHECK-NEXT: csel w0, w1, w2, ne
 
   ret i32 %val
@@ -14,8 +16,9 @@ define i32 @test_select_i32(i1 %bit, i32
 define i64 @test_select_i64(i1 %bit, i64 %a, i64 %b) {
 ; CHECK-LABEL: test_select_i64:
   %val = select i1 %bit, i64 %a, i64 %b
-; CHECK: movz [[ONE:w[0-9]+]], #1
-; CHECK: tst w0, [[ONE]]
+; CHECK-AARCH64: movz [[ONE:w[0-9]+]], #1
+; CHECK-AARCH64: tst w0, [[ONE]]
+; CHECK-ARM64: tst w0, #0x1
 ; CHECK-NEXT: csel x0, x1, x2, ne
 
   ret i64 %val
@@ -24,8 +27,9 @@ define i64 @test_select_i64(i1 %bit, i64
 define float @test_select_float(i1 %bit, float %a, float %b) {
 ; CHECK-LABEL: test_select_float:
   %val = select i1 %bit, float %a, float %b
-; CHECK: movz [[ONE:w[0-9]+]], #1
-; CHECK: tst w0, [[ONE]]
+; CHECK-AARCH64: movz [[ONE:w[0-9]+]], #1
+; CHECK-AARCH64: tst w0, [[ONE]]
+; CHECK-ARM64: tst w0, #0x1
 ; CHECK-NEXT: fcsel s0, s0, s1, ne
 ; CHECK-NOFP-NOT: fcsel
   ret float %val
@@ -34,8 +38,9 @@ define float @test_select_float(i1 %bit,
 define double @test_select_double(i1 %bit, double %a, double %b) {
 ; CHECK-LABEL: test_select_double:
   %val = select i1 %bit, double %a, double %b
-; CHECK: movz [[ONE:w[0-9]+]], #1
-; CHECK: tst w0, [[ONE]]
+; CHECK-AARCH64: movz [[ONE:w[0-9]+]], #1
+; CHECK-AARCH64: tst w0, [[ONE]]
+; CHECK-ARM64: tst w0, #0x1
 ; CHECK-NEXT: fcsel d0, d0, d1, ne
 ; CHECK-NOFP-NOT: fcsel
 





More information about the llvm-commits mailing list