From: Tim Northover Date: Thu, 19 Jan 2017 23:59:35 +0000 (+0000) Subject: AArch64: fall back to DAG ISel for inline assembly. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dfbb55fc0c58ce681ea4b7afb8a031f33b8cf327;p=llvm AArch64: fall back to DAG ISel for inline assembly. We can't currently handle "calls" to inlineasm strings so it's better to let the DAG handle it than generate rubbish. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292540 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/GlobalISel/IRTranslator.cpp b/lib/CodeGen/GlobalISel/IRTranslator.cpp index b1f8afcc9bd..821ebf97ce5 100644 --- a/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -581,6 +581,9 @@ bool IRTranslator::translateCall(const User &U, MachineIRBuilder &MIRBuilder) { auto TII = MF->getTarget().getIntrinsicInfo(); const Function *F = CI.getCalledFunction(); + if (CI.isInlineAsm()) + return false; + if (!F || !F->isIntrinsic()) { unsigned Res = CI.getType()->isVoidTy() ? 0 : getOrCreateVReg(CI); SmallVector Args; diff --git a/test/CodeGen/AArch64/GlobalISel/inline-asm.ll b/test/CodeGen/AArch64/GlobalISel/inline-asm.ll new file mode 100644 index 00000000000..3dc8f8cb706 --- /dev/null +++ b/test/CodeGen/AArch64/GlobalISel/inline-asm.ll @@ -0,0 +1,10 @@ +; RUN: llc -mtriple=aarch64 -global-isel -global-isel-abort=2 %s -o - | FileCheck %s + +; CHECK-LABEL: test_asm: +; CHECK: {{APP|InlineAsm Start}} +; CHECK: mov x0, x0 +; CHECK: {{NO_APP|InlineAsm End}} +define void @test_asm() { + call void asm sideeffect "mov x0, x0", ""() + ret void +}