[Backport] Simple check to ignore Inline asm fwait insertion

Signed-off-by: liyunfei <liyunfei33@huawei.com>
This commit is contained in:
liyunfei 2024-11-18 21:18:42 +08:00
parent 1566d28f84
commit 6674164e54
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From cf9d549f2c40d548587f8d2d3cda0d32f13c9256 Mon Sep 17 00:00:00 2001
From: Temperatureblock <102174059+Temperature-block@users.noreply.github.com>
Date: Mon, 12 Aug 2024 20:06:58 +0530
Subject: [PATCH] Simple check to ignore Inline asm fwait insertion (#101686)
Just a simple check to ignore Inline asm fwait insertion
Fixes #101613
---
llvm/lib/Target/X86/X86InstrInfo.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp
index 10a0ccdcb023..e615fa09608c 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.cpp
+++ b/llvm/lib/Target/X86/X86InstrInfo.cpp
@@ -2947,6 +2947,11 @@ static bool isX87Reg(unsigned Reg) {
/// check if the instruction is X87 instruction
bool X86::isX87Instruction(MachineInstr &MI) {
+ // Call and inlineasm defs X87 register, so we special case it here because
+ // otherwise calls are incorrectly flagged as x87 instructions
+ // as a result.
+ if (MI.isInlineAsm())
+ return false;
for (const MachineOperand &MO : MI.operands()) {
if (!MO.isReg())
continue;
--
Gitee

View File

@ -46,7 +46,7 @@
Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
Release: 20
Release: 21
Summary: The Low Level Virtual Machine
License: NCSA
@ -81,6 +81,7 @@ Patch21: 0021-Add-BiSheng-Autotuner-support-for-LLVM-compiler.patch
Patch22: 0022-Prevent-environment-variables-from-exceeding-NAME_MA.patch
Patch23: 0023-AArch64-Support-HiSilicon-s-HIP09-Processor.patch
Patch24: 0024-Backport-LoongArch-fix-and-add-some-new-support.patch
Patch25: 0025-Backport-Simple-check-to-ignore-Inline-asm-fwait-insertion.patch
BuildRequires: binutils-devel
BuildRequires: cmake
@ -374,6 +375,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C %{__cmake
%{install_includedir}/llvm-gmock
%changelog
* Mon Nov 18 2024 liyunfei <liyunfei33@huawei.net> - 17.0.6-21
- [Backport] Simple check to ignore Inline asm fwait insertion
* Wed Nov 06 2024 Funda Wang <fundawang@yeah.net> - 17.0.6-20
- adopt to new cmake macro