diff options
author | Hans Wennborg <hans@hanshq.net> | 2018-01-31 09:00:28 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2018-01-31 09:00:28 +0000 |
commit | a593839b62a2e5662984e911b5fd48eeb8f32b2b (patch) | |
tree | 342dc14bd3f9885a5f6f6f73b1d8f4687530b4cd | |
parent | 52eee2488bd6863692f35de460c4c82ad1d5e83f (diff) |
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
-rw-r--r-- | lib/CodeGen/GlobalISel/IRTranslator.cpp | 4 | ||||
-rw-r--r-- | test/CodeGen/AArch64/dllimport.ll | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/CodeGen/GlobalISel/IRTranslator.cpp b/lib/CodeGen/GlobalISel/IRTranslator.cpp index 705d4ded5b5..a329a71e2c9 100644 --- a/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -812,6 +812,10 @@ bool IRTranslator::translateCall(const User &U, MachineIRBuilder &MIRBuilder) { 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); diff --git a/test/CodeGen/AArch64/dllimport.ll b/test/CodeGen/AArch64/dllimport.ll index 781e984af11..281c847a39a 100644 --- a/test/CodeGen/AArch64/dllimport.ll +++ b/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 @@ define i32 @get_ext() { ; 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 @@ define i32 @call_internal() { } ; CHECK-LABEL: call_internal -; CHECK: b internal +; DAG-ISEL: b internal +; FAST-ISEL: b internal +; GLOBAL-ISEL: bl internal |