From c2751737e58c86a9c90bc8d6246893abcb06c3ca Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sat, 9 Nov 2019 17:58:56 -0800 Subject: [PATCH] [X86] Handle MO_ConstantPoolIndex in X86AsmPrinter::PrintOperand Fixes PR43952 --- llvm/lib/Target/X86/X86AsmPrinter.cpp | 1 + llvm/test/CodeGen/X86/pr43952.ll | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 llvm/test/CodeGen/X86/pr43952.ll diff --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp b/llvm/lib/Target/X86/X86AsmPrinter.cpp index cc1e79d..de13d59 100644 --- a/llvm/lib/Target/X86/X86AsmPrinter.cpp +++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp @@ -218,6 +218,7 @@ void X86AsmPrinter::PrintOperand(const MachineInstr *MI, unsigned OpNo, O << MO.getImm(); return; + case MachineOperand::MO_ConstantPoolIndex: case MachineOperand::MO_GlobalAddress: { if (IsATT) O << '$'; diff --git a/llvm/test/CodeGen/X86/pr43952.ll b/llvm/test/CodeGen/X86/pr43952.ll new file mode 100644 index 0000000..9c6b511 --- /dev/null +++ b/llvm/test/CodeGen/X86/pr43952.ll @@ -0,0 +1,16 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc < %s -mtriple=x86_64-apple-macosx10.14.0 | FileCheck %s + +define void @x() { +; CHECK-LABEL: x: +; CHECK: ## %bb.0: ## %start +; CHECK-NEXT: ## InlineAsm Start +; CHECK-EMPTY: +; CHECK-NEXT: vpbroadcastq {{.*}}(%rip), %zmm0 {%k1} +; CHECK-EMPTY: +; CHECK-NEXT: ## InlineAsm End +; CHECK-NEXT: retq +start: + tail call void asm sideeffect inteldialect "vpbroadcastq zmm0{k1}, $0", "m,~{dirflag},~{fpsr},~{flags}"(i64 123) + ret void +} -- 2.7.4