[PATCH] D42568: [GlobalISel] Bail out on calls to dllimported functions

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 11:54:24 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL323811: [GlobalISel] Bail out on calls to dllimported functions (authored by mstorsjo, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D42568?vs=131563&id=132019#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D42568

Files:
  llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
  llvm/trunk/test/CodeGen/AArch64/dllimport.ll


Index: llvm/trunk/test/CodeGen/AArch64/dllimport.ll
===================================================================
--- llvm/trunk/test/CodeGen/AArch64/dllimport.ll
+++ llvm/trunk/test/CodeGen/AArch64/dllimport.ll
@@ -1,5 +1,6 @@
 ; RUN: llc -mtriple aarch64-unknown-windows-msvc -filetype asm -o - %s | FileCheck %s -check-prefixes=CHECK,DAG-ISEL
 ; RUN: llc -mtriple aarch64-unknown-windows-msvc -fast-isel -filetype asm -o - %s | FileCheck %s -check-prefixes=CHECK,FAST-ISEL
+; RUN: llc -mtriple aarch64-unknown-windows-msvc -O0 -filetype asm -o - %s | FileCheck %s -check-prefixes=CHECK,GLOBAL-ISEL,GLOBAL-ISEL-FALLBACK
 
 @var = external dllimport global i32
 @ext = external global i32
@@ -27,6 +28,8 @@
 ; DAG-ISEL: ldr w0, [x8, ext]
 ; FAST-ISEL: add x8, x8, ext
 ; FAST-ISEL: ldr w0, [x8]
+; GLOBAL-ISEL-FALLBACK: add x8, x8, ext
+; GLOBAL-ISEL-FALLBACK: ldr w0, [x8]
 ; CHECK: ret
 
 define i32* @get_var_pointer() {
@@ -54,4 +57,6 @@
 }
 
 ; CHECK-LABEL: call_internal
-; CHECK: b internal
+; DAG-ISEL: b internal
+; FAST-ISEL: b internal
+; GLOBAL-ISEL: bl internal
Index: llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -817,6 +817,10 @@
   auto TII = MF->getTarget().getIntrinsicInfo();
   const Function *F = CI.getCalledFunction();
 
+  // FIXME: support Windows dllimport function calls.
+  if (F && F->hasDLLImportStorageClass())
+    return false;
+
   if (CI.isInlineAsm())
     return translateInlineAsm(CI, MIRBuilder);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42568.132019.patch
Type: text/x-patch
Size: 1632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180130/de535aa9/attachment.bin>


More information about the llvm-commits mailing list