[llvm] [X86] Add tuning features for Hygon C86-4G-M7 (PR #205992)

Xiaomeng Zhang via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 20:50:29 PDT 2026


https://github.com/zhangxiaomeng-hygon updated https://github.com/llvm/llvm-project/pull/205992

>From ef8b8e5bde5a3f015a4f6f43ef17eab7f52ffe70 Mon Sep 17 00:00:00 2001
From: zhangxiaomeng <zhangxiaomeng at hygon.cn>
Date: Fri, 26 Jun 2026 14:02:48 +0800
Subject: [PATCH] [X86] Add tuning features for Hygon C86-4G-M7

Add TuningPreferNoGather and TuningPrefer256Bit to C864GM7Tuning.
This will improve the performance of the C86-4G-M7.
---
 llvm/lib/Target/X86/X86.td                  | 5 ++++-
 llvm/test/CodeGen/X86/slow-unaligned-mem.ll | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Target/X86/X86.td b/llvm/lib/Target/X86/X86.td
index 7551966cb8e15..f09920ec00d92 100644
--- a/llvm/lib/Target/X86/X86.td
+++ b/llvm/lib/Target/X86/X86.td
@@ -1750,7 +1750,10 @@ def ProcessorFeatures {
   list<SubtargetFeature> C864GM7Features =
     !listconcat(C864GM4Features, C864GM7AdditionalFeatures);
 
-  list<SubtargetFeature> C864GM7AdditionalTuning = [TuningBranchFusion];
+  list<SubtargetFeature> C864GM7AdditionalTuning = [TuningBranchFusion,
+                                                    TuningPreferNoGather,
+                                                    TuningPreferNoScatter,
+                                                    TuningPrefer256Bit];
   list<SubtargetFeature> C864GM7Tuning =
     !listconcat(C864GM4Tuning, C864GM7AdditionalTuning);
 }
diff --git a/llvm/test/CodeGen/X86/slow-unaligned-mem.ll b/llvm/test/CodeGen/X86/slow-unaligned-mem.ll
index ec2a61c548fd1..2fd5f36d9e2ef 100644
--- a/llvm/test/CodeGen/X86/slow-unaligned-mem.ll
+++ b/llvm/test/CodeGen/X86/slow-unaligned-mem.ll
@@ -57,7 +57,7 @@
 
 ; RUN: llc < %s -mtriple=i386-unknown-unknown -mcpu=c86-4g-m4     2>&1 | FileCheck %s --check-prefixes=FAST,FAST-AVX256
 ; RUN: llc < %s -mtriple=i386-unknown-unknown -mcpu=c86-4g-m6     2>&1 | FileCheck %s --check-prefixes=FAST,FAST-AVX256
-; RUN: llc < %s -mtriple=i386-unknown-unknown -mcpu=c86-4g-m7     2>&1 | FileCheck %s --check-prefixes=FAST,FAST-AVX512
+; RUN: llc < %s -mtriple=i386-unknown-unknown -mcpu=c86-4g-m7     2>&1 | FileCheck %s --check-prefixes=FAST,FAST-AVX256
 
 ; Other chips with slow unaligned memory accesses
 



More information about the llvm-commits mailing list