]> granicus.if.org Git - llvm/commitdiff
AArch64: fall back to DAG ISel for inline assembly.
authorTim Northover <tnorthover@apple.com>
Thu, 19 Jan 2017 23:59:35 +0000 (23:59 +0000)
committerTim Northover <tnorthover@apple.com>
Thu, 19 Jan 2017 23:59:35 +0000 (23:59 +0000)
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

lib/CodeGen/GlobalISel/IRTranslator.cpp
test/CodeGen/AArch64/GlobalISel/inline-asm.ll [new file with mode: 0644]

index b1f8afcc9bd868f0da9cd299478450a58823e542..821ebf97ce56853bb00a0856bf118447f3f0749a 100644 (file)
@@ -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<unsigned, 8> Args;
diff --git a/test/CodeGen/AArch64/GlobalISel/inline-asm.ll b/test/CodeGen/AArch64/GlobalISel/inline-asm.ll
new file mode 100644 (file)
index 0000000..3dc8f8c
--- /dev/null
@@ -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
+}