From: Craig Topper Date: Sat, 5 Oct 2019 23:21:17 +0000 (+0000) Subject: [FastISel] Copy the inline assembly dialect to the INLINEASM instruction. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7c5761290ded25500c75d9f3f7efcf7799348333;p=llvm [FastISel] Copy the inline assembly dialect to the INLINEASM instruction. Fixes PR43575. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373836 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 8904283ff8d..0fd2bd7815b 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -1303,6 +1303,7 @@ bool FastISel::selectCall(const User *I) { ExtraInfo |= InlineAsm::Extra_HasSideEffects; if (IA->isAlignStack()) ExtraInfo |= InlineAsm::Extra_IsAlignStack; + ExtraInfo |= IA->getDialect() * InlineAsm::Extra_AsmDialect; BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(TargetOpcode::INLINEASM)) diff --git a/test/CodeGen/X86/pr43575.ll b/test/CodeGen/X86/pr43575.ll new file mode 100644 index 00000000000..00c70c69709 --- /dev/null +++ b/test/CodeGen/X86/pr43575.ll @@ -0,0 +1,14 @@ +; RUN: llc < %s -mtriple=x86_64-apple-macosx10.14.0 -O0 | FileCheck %s + +define void @exit(i32 %status) +; CHECK-LABEL: exit: +; CHECK: ## %bb.0: +; CHECK: ## InlineAsm Start +; CHECK: movq $60, %rax +; CHECK: syscall +; CHECK: ## InlineAsm End +; CHECK: retq +{ + call void asm sideeffect inteldialect "mov rax, 60; syscall", ""() + ret void +}