[llvm-branch-commits] [compiler-rt] release/20.x: [RISCV][compiler-rt] drop __riscv_vendor_feature_bits (#126460) (PR #126845)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Feb 11 19:50:14 PST 2025


https://github.com/llvmbot created https://github.com/llvm/llvm-project/pull/126845

Backport 2cd8207

Requested by: @BeMg

>From 634d5b3a693b7979c9338c6cd92afe08680ac165 Mon Sep 17 00:00:00 2001
From: Piyou Chen <piyou.chen at sifive.com>
Date: Tue, 11 Feb 2025 15:19:19 +0800
Subject: [PATCH] [RISCV][compiler-rt] drop __riscv_vendor_feature_bits
 (#126460)

Address https://github.com/riscv-non-isa/riscv-c-api-doc/pull/101

(cherry picked from commit 2cd8207b26ea4269630feba661f68554d7ae3c15)
---
 compiler-rt/lib/builtins/cpu_model/riscv.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/compiler-rt/lib/builtins/cpu_model/riscv.c b/compiler-rt/lib/builtins/cpu_model/riscv.c
index 74534896057ef..6879c2ad48264 100644
--- a/compiler-rt/lib/builtins/cpu_model/riscv.c
+++ b/compiler-rt/lib/builtins/cpu_model/riscv.c
@@ -14,12 +14,6 @@ struct {
   unsigned long long features[RISCV_FEATURE_BITS_LENGTH];
 } __riscv_feature_bits __attribute__((visibility("hidden"), nocommon));
 
-#define RISCV_VENDOR_FEATURE_BITS_LENGTH 1
-struct {
-  unsigned length;
-  unsigned long long features[RISCV_VENDOR_FEATURE_BITS_LENGTH];
-} __riscv_vendor_feature_bits __attribute__((visibility("hidden"), nocommon));
-
 struct {
   unsigned mvendorid;
   unsigned long long marchid;
@@ -338,11 +332,11 @@ static int FeaturesBitCached = 0;
 void __init_riscv_feature_bits(void *);
 static void __init_riscv_feature_bits_ctor(void) CONSTRUCTOR_ATTRIBUTE;
 
-// A constructor function that sets __riscv_feature_bits, and
-// __riscv_vendor_feature_bits to the right values.  This needs to run
-// only once.  This constructor is given the highest priority and it should
-// run before constructors without the priority set.  However, it still runs
-// after ifunc initializers and needs to be called explicitly there.
+// A constructor function that sets __riscv_feature_bits
+// to the right values.  This needs to run only once.  This constructor is given
+// the highest priority and it should run before constructors without the
+// priority set.  However, it still runs after ifunc initializers and needs to
+// be called explicitly there.
 
 static void CONSTRUCTOR_ATTRIBUTE __init_riscv_feature_bits_ctor(void) {
   __init_riscv_feature_bits(0);
@@ -357,7 +351,6 @@ void __init_riscv_feature_bits(void *PlatformArgs) {
     return;
 
   __riscv_feature_bits.length = RISCV_FEATURE_BITS_LENGTH;
-  __riscv_vendor_feature_bits.length = RISCV_VENDOR_FEATURE_BITS_LENGTH;
 
 #if defined(__linux__)
   struct riscv_hwprobe Hwprobes[] = {



More information about the llvm-branch-commits mailing list