[llvm] r307797 - [X86/FastIsel] Fall-back to SelectionDAG when lowering soft-floats.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 08:26:06 PDT 2017


Author: davide
Date: Wed Jul 12 08:26:06 2017
New Revision: 307797

URL: http://llvm.org/viewvc/llvm-project?rev=307797&view=rev
Log:
[X86/FastIsel] Fall-back to SelectionDAG when lowering soft-floats.

FastIsel can't handle them, so we would end up crashing during
register class selection.
Fixes PR26522.

Differential Revision:  https://reviews.llvm.org/D35272

Added:
    llvm/trunk/test/CodeGen/X86/fastisel-softfloat.ll
Modified:
    llvm/trunk/lib/Target/X86/X86FastISel.cpp

Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=307797&r1=307796&r2=307797&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Wed Jul 12 08:26:06 2017
@@ -3039,6 +3039,9 @@ bool X86FastISel::fastLowerArguments() {
   if (!Subtarget->is64Bit())
     return false;
 
+  if (Subtarget->useSoftFloat())
+    return false;
+
   // Only handle simple cases. i.e. Up to 6 i32/i64 scalar arguments.
   unsigned GPRCnt = 0;
   unsigned FPRCnt = 0;

Added: llvm/trunk/test/CodeGen/X86/fastisel-softfloat.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fastisel-softfloat.ll?rev=307797&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/fastisel-softfloat.ll (added)
+++ llvm/trunk/test/CodeGen/X86/fastisel-softfloat.ll Wed Jul 12 08:26:06 2017
@@ -0,0 +1,15 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc %s -o - | FileCheck %s
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define float @pr26522(float %pat) #0 {
+; CHECK-LABEL: pr26522:
+; CHECK:       # BB#0:
+; CHECK-NEXT:    movl %edi, %eax
+; CHECK-NEXT:    retq
+  ret float %pat
+}
+
+attributes #0 = { noinline optnone "target-features"="+soft-float" }




More information about the llvm-commits mailing list