Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit a593839

Browse files
committed
Merging r323811:
------------------------------------------------------------------------ r323811 | mstorsjo | 2018-01-30 20:50:58 +0100 (Tue, 30 Jan 2018) | 3 lines [GlobalISel] Bail out on calls to dllimported functions Differential Revision: https://reviews.llvm.org/D42568 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_60@323853 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 52eee24 commit a593839

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/CodeGen/GlobalISel/IRTranslator.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,10 @@ bool IRTranslator::translateCall(const User &U, MachineIRBuilder &MIRBuilder) {
812812
auto TII = MF->getTarget().getIntrinsicInfo();
813813
const Function *F = CI.getCalledFunction();
814814

815+
// FIXME: support Windows dllimport function calls.
816+
if (F && F->hasDLLImportStorageClass())
817+
return false;
818+
815819
if (CI.isInlineAsm())
816820
return translateInlineAsm(CI, MIRBuilder);
817821

test/CodeGen/AArch64/dllimport.ll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
; RUN: llc -mtriple aarch64-unknown-windows-msvc -filetype asm -o - %s | FileCheck %s -check-prefixes=CHECK,DAG-ISEL
22
; RUN: llc -mtriple aarch64-unknown-windows-msvc -fast-isel -filetype asm -o - %s | FileCheck %s -check-prefixes=CHECK,FAST-ISEL
3+
; RUN: llc -mtriple aarch64-unknown-windows-msvc -O0 -filetype asm -o - %s | FileCheck %s -check-prefixes=CHECK,GLOBAL-ISEL,GLOBAL-ISEL-FALLBACK
34

45
@var = external dllimport global i32
56
@ext = external global i32
@@ -27,6 +28,8 @@ define i32 @get_ext() {
2728
; DAG-ISEL: ldr w0, [x8, ext]
2829
; FAST-ISEL: add x8, x8, ext
2930
; FAST-ISEL: ldr w0, [x8]
31+
; GLOBAL-ISEL-FALLBACK: add x8, x8, ext
32+
; GLOBAL-ISEL-FALLBACK: ldr w0, [x8]
3033
; CHECK: ret
3134

3235
define i32* @get_var_pointer() {
@@ -54,4 +57,6 @@ define i32 @call_internal() {
5457
}
5558

5659
; CHECK-LABEL: call_internal
57-
; CHECK: b internal
60+
; DAG-ISEL: b internal
61+
; FAST-ISEL: b internal
62+
; GLOBAL-ISEL: bl internal

0 commit comments

Comments
 (0)