Fix DTRACE_PROBE4() compilation failure

Resolves: rhbz#1967482
This commit is contained in:
Tom Stellard 2021-06-29 13:19:52 -07:00
parent 4a67878a12
commit 46cd2c3ef2
2 changed files with 73 additions and 1 deletions

View File

@ -0,0 +1,67 @@
From f78f530bd38472f6bd058a0307484fc5edc57b7c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder@redhat.com>
Date: Thu, 10 Jun 2021 06:48:09 +0200
Subject: [PATCH] [llvm][PPC] Add missing case for 'I' asm memory operands
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From https://llvm.org/docs/LangRef.html#asm-template-argument-modifiers:
I: Print the letter i if the operand is an integer constant,
otherwise nothing. Used to print addi vs add instructions.
Differential Revision: https://reviews.llvm.org/D103968
(cherry picked from commit a9e4f91adf59bbc72541b96dd30245eaeeedf3ce)
---
llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp | 6 ++++++
llvm/test/CodeGen/PowerPC/asm-template-I.ll | 19 +++++++++++++++++++
2 files changed, 25 insertions(+)
create mode 100644 llvm/test/CodeGen/PowerPC/asm-template-I.ll
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index cce21f32414a..6257709731b9 100644
--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -321,6 +321,12 @@ bool PPCAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
O << "0, ";
printOperand(MI, OpNo, O);
return false;
+ case 'I':
+ // Write 'i' if an integer constant, otherwise nothing. Used to print
+ // addi vs add, etc.
+ if (MI->getOperand(OpNo).isImm())
+ O << "i";
+ return false;
case 'U': // Print 'u' for update form.
case 'X': // Print 'x' for indexed form.
// FIXME: Currently for PowerPC memory operands are always loaded
diff --git a/llvm/test/CodeGen/PowerPC/asm-template-I.ll b/llvm/test/CodeGen/PowerPC/asm-template-I.ll
new file mode 100644
index 000000000000..f77e6900efc0
--- /dev/null
+++ b/llvm/test/CodeGen/PowerPC/asm-template-I.ll
@@ -0,0 +1,19 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-- | FileCheck %s
+; https://bugs.llvm.org/show_bug.cgi?id=50608
+
+define dso_local signext i32 @main(i32 signext %argc, i8** %argv) {
+; CHECK-LABEL: main:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: stw 3, -4(1)
+; CHECK-NEXT: li 3, 0
+; CHECK-NEXT: addi 4, 1, -4
+; CHECK-NEXT: #APP
+; CHECK-NEXT: .ascii "-1@0(4)"
+; CHECK-NEXT: .byte 0
+; CHECK-NEXT: #NO_APP
+; CHECK-NEXT: blr
+entry:
+ call void asm sideeffect " .asciz \22${0:n}@${1:I}$1\22 ", "n,nZr"(i32 1, i32 %argc)
+ ret i32 0
+}
--
2.27.0

View File

@ -53,7 +53,7 @@
Name: %{pkg_name} Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}} Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}
Release: 5%{?dist} Release: 6%{?dist}
Summary: The Low Level Virtual Machine Summary: The Low Level Virtual Machine
License: NCSA License: NCSA
@ -72,6 +72,8 @@ Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compat
Patch0: 0001-PATCH-llvm-Make-source-interleave-prefix-test-case-c.patch Patch0: 0001-PATCH-llvm-Make-source-interleave-prefix-test-case-c.patch
Patch1: 0001-llvm-jitlink-Replace-use-of-deprecated-gethostbyname.patch Patch1: 0001-llvm-jitlink-Replace-use-of-deprecated-gethostbyname.patch
# This patch is upstream and will be included in 12.0.1
Patch2: 0001-llvm-PPC-Add-missing-case-for-I-asm-memory-operands.patch
# RHEL-specific patches # RHEL-specific patches
Patch101: 0001-Deactivate-markdown-doc.patch Patch101: 0001-Deactivate-markdown-doc.patch
@ -597,6 +599,9 @@ fi
%endif %endif
%changelog %changelog
* Wed Jul 07 2021 Tom Stellard <tstellar@redhat.com> - 12.0.0-6
- Fix DTRACE_PROBE4() compilation failure
* Tue Jul 06 2021 sguelton@redhat.com - 12.0.0-5 * Tue Jul 06 2021 sguelton@redhat.com - 12.0.0-5
- backport cba2552bfec1c9d8 - backport cba2552bfec1c9d8