]> granicus.if.org Git - llvm/commitdiff
[FastISel] Copy the inline assembly dialect to the INLINEASM instruction.
authorCraig Topper <craig.topper@intel.com>
Sat, 5 Oct 2019 23:21:17 +0000 (23:21 +0000)
committerCraig Topper <craig.topper@intel.com>
Sat, 5 Oct 2019 23:21:17 +0000 (23:21 +0000)
Fixes PR43575.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373836 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/FastISel.cpp
test/CodeGen/X86/pr43575.ll [new file with mode: 0644]

index 8904283ff8daef7bc16908099583113cc12d3662..0fd2bd7815ba14243dbf0e82881a68de0816e4ce 100644 (file)
@@ -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 (file)
index 0000000..00c70c6
--- /dev/null
@@ -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
+}