[clang] [PowerPC] cleaned dead code of PPC.cpp and PPC.h (PR #130994)

2025-03-12 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-backend-powerpc

Author: zhijian lin (diggerlin)


Changes

There are some variables in the PPC.h which are defined and assigned a value to 
them,
but never be used, remove the code related to the variables.

---
Full diff: https://github.com/llvm/llvm-project/pull/130994.diff


2 Files Affected:

- (modified) clang/lib/Basic/Targets/PPC.cpp (-42) 
- (modified) clang/lib/Basic/Targets/PPC.h (-14) 


``diff
diff --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp
index 2d8891a739ca3..2441cb00dfdfc 100644
--- a/clang/lib/Basic/Targets/PPC.cpp
+++ b/clang/lib/Basic/Targets/PPC.cpp
@@ -46,18 +46,10 @@ bool 
PPCTargetInfo::handleTargetFeatures(std::vector &Features,
   HasAltivec = true;
 } else if (Feature == "+vsx") {
   HasVSX = true;
-} else if (Feature == "+crbits") {
-  UseCRBits = true;
-} else if (Feature == "+bpermd") {
-  HasBPERMD = true;
-} else if (Feature == "+extdiv") {
-  HasExtDiv = true;
 } else if (Feature == "+power8-vector") {
   HasP8Vector = true;
 } else if (Feature == "+crypto") {
   HasP8Crypto = true;
-} else if (Feature == "+direct-move") {
-  HasDirectMove = true;
 } else if (Feature == "+htm") {
   HasHTM = true;
 } else if (Feature == "+float128") {
@@ -68,8 +60,6 @@ bool 
PPCTargetInfo::handleTargetFeatures(std::vector &Features,
   HasP10Vector = true;
 } else if (Feature == "+pcrelative-memops") {
   HasPCRelativeMemops = true;
-} else if (Feature == "+prefix-instrs") {
-  HasPrefixInstrs = true;
 } else if (Feature == "+spe" || Feature == "+efpu2") {
   HasStrictFP = false;
   HasSPE = true;
@@ -81,30 +71,12 @@ bool 
PPCTargetInfo::handleTargetFeatures(std::vector &Features,
   HasFrsqrtes = true;
 } else if (Feature == "-hard-float") {
   FloatABI = SoftFloat;
-} else if (Feature == "+paired-vector-memops") {
-  PairedVectorMemops = true;
 } else if (Feature == "+mma") {
   HasMMA = true;
 } else if (Feature == "+rop-protect") {
   HasROPProtect = true;
-} else if (Feature == "+privileged") {
-  HasPrivileged = true;
-} else if (Feature == "+aix-small-local-exec-tls") {
-  HasAIXSmallLocalExecTLS = true;
-} else if (Feature == "+aix-small-local-dynamic-tls") {
-  HasAIXSmallLocalDynamicTLS = true;
-} else if (Feature == "+isa-v206-instructions") {
-  IsISA2_06 = true;
-} else if (Feature == "+isa-v207-instructions") {
-  IsISA2_07 = true;
-} else if (Feature == "+isa-v30-instructions") {
-  IsISA3_0 = true;
-} else if (Feature == "+isa-v31-instructions") {
-  IsISA3_1 = true;
 } else if (Feature == "+quadword-atomics") {
   HasQuadwordAtomics = true;
-} else if (Feature == "+aix-shared-lib-tls-model-opt") {
-  HasAIXShLibTLSModelOpt = true;
 } else if (Feature == "+longcall") {
   UseLongCalls = true;
 }
@@ -745,31 +717,17 @@ bool PPCTargetInfo::hasFeature(StringRef Feature) const {
   .Case("powerpc", true)
   .Case("altivec", HasAltivec)
   .Case("vsx", HasVSX)
-  .Case("crbits", UseCRBits)
   .Case("power8-vector", HasP8Vector)
   .Case("crypto", HasP8Crypto)
-  .Case("direct-move", HasDirectMove)
   .Case("htm", HasHTM)
-  .Case("bpermd", HasBPERMD)
-  .Case("extdiv", HasExtDiv)
   .Case("float128", HasFloat128)
   .Case("power9-vector", HasP9Vector)
-  .Case("paired-vector-memops", PairedVectorMemops)
   .Case("power10-vector", HasP10Vector)
   .Case("pcrelative-memops", HasPCRelativeMemops)
-  .Case("prefix-instrs", HasPrefixInstrs)
   .Case("spe", HasSPE)
   .Case("mma", HasMMA)
   .Case("rop-protect", HasROPProtect)
-  .Case("privileged", HasPrivileged)
-  .Case("aix-small-local-exec-tls", HasAIXSmallLocalExecTLS)
-  .Case("aix-small-local-dynamic-tls", HasAIXSmallLocalDynamicTLS)
-  .Case("isa-v206-instructions", IsISA2_06)
-  .Case("isa-v207-instructions", IsISA2_07)
-  .Case("isa-v30-instructions", IsISA3_0)
-  .Case("isa-v31-instructions", IsISA3_1)
   .Case("quadword-atomics", HasQuadwordAtomics)
-  .Case("aix-shared-lib-tls-model-opt", HasAIXShLibTLSModelOpt)
   .Case("longcall", UseLongCalls)
   .Default(false);
 }
diff --git a/clang/lib/Basic/Targets/PPC.h b/clang/lib/Basic/Targets/PPC.h
index db6ac6f0bd338..17057cef97a57 100644
--- a/clang/lib/Basic/Targets/PPC.h
+++ b/clang/lib/Basic/Targets/PPC.h
@@ -60,31 +60,17 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public 
TargetInfo {
   bool HasAltivec = false;
   bool HasMMA = false;
   bool HasROPProtect = false;
-  bool HasPrivileged = false;
-  bool HasAIXSmallLocalExecTLS = false;
-  bool HasAIXSmallLocalDynamicTLS = false;
   bool HasVSX = false;
-  bool UseCRBits = false;
   bool HasP8Vector = false;
   bool HasP8Crypto = false;
-  bool HasDirectMove = false;
   bool HasHTM = false;
-  bool HasB

[clang] [PowerPC] cleaned dead code of PPC.cpp and PPC.h (PR #130994)

2025-03-12 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: zhijian lin (diggerlin)


Changes

There are some variables in the PPC.h which are defined and assigned a value to 
them,
but never be used, remove the code related to the variables.

---
Full diff: https://github.com/llvm/llvm-project/pull/130994.diff


2 Files Affected:

- (modified) clang/lib/Basic/Targets/PPC.cpp (-42) 
- (modified) clang/lib/Basic/Targets/PPC.h (-14) 


``diff
diff --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp
index 2d8891a739ca3..2441cb00dfdfc 100644
--- a/clang/lib/Basic/Targets/PPC.cpp
+++ b/clang/lib/Basic/Targets/PPC.cpp
@@ -46,18 +46,10 @@ bool 
PPCTargetInfo::handleTargetFeatures(std::vector &Features,
   HasAltivec = true;
 } else if (Feature == "+vsx") {
   HasVSX = true;
-} else if (Feature == "+crbits") {
-  UseCRBits = true;
-} else if (Feature == "+bpermd") {
-  HasBPERMD = true;
-} else if (Feature == "+extdiv") {
-  HasExtDiv = true;
 } else if (Feature == "+power8-vector") {
   HasP8Vector = true;
 } else if (Feature == "+crypto") {
   HasP8Crypto = true;
-} else if (Feature == "+direct-move") {
-  HasDirectMove = true;
 } else if (Feature == "+htm") {
   HasHTM = true;
 } else if (Feature == "+float128") {
@@ -68,8 +60,6 @@ bool 
PPCTargetInfo::handleTargetFeatures(std::vector &Features,
   HasP10Vector = true;
 } else if (Feature == "+pcrelative-memops") {
   HasPCRelativeMemops = true;
-} else if (Feature == "+prefix-instrs") {
-  HasPrefixInstrs = true;
 } else if (Feature == "+spe" || Feature == "+efpu2") {
   HasStrictFP = false;
   HasSPE = true;
@@ -81,30 +71,12 @@ bool 
PPCTargetInfo::handleTargetFeatures(std::vector &Features,
   HasFrsqrtes = true;
 } else if (Feature == "-hard-float") {
   FloatABI = SoftFloat;
-} else if (Feature == "+paired-vector-memops") {
-  PairedVectorMemops = true;
 } else if (Feature == "+mma") {
   HasMMA = true;
 } else if (Feature == "+rop-protect") {
   HasROPProtect = true;
-} else if (Feature == "+privileged") {
-  HasPrivileged = true;
-} else if (Feature == "+aix-small-local-exec-tls") {
-  HasAIXSmallLocalExecTLS = true;
-} else if (Feature == "+aix-small-local-dynamic-tls") {
-  HasAIXSmallLocalDynamicTLS = true;
-} else if (Feature == "+isa-v206-instructions") {
-  IsISA2_06 = true;
-} else if (Feature == "+isa-v207-instructions") {
-  IsISA2_07 = true;
-} else if (Feature == "+isa-v30-instructions") {
-  IsISA3_0 = true;
-} else if (Feature == "+isa-v31-instructions") {
-  IsISA3_1 = true;
 } else if (Feature == "+quadword-atomics") {
   HasQuadwordAtomics = true;
-} else if (Feature == "+aix-shared-lib-tls-model-opt") {
-  HasAIXShLibTLSModelOpt = true;
 } else if (Feature == "+longcall") {
   UseLongCalls = true;
 }
@@ -745,31 +717,17 @@ bool PPCTargetInfo::hasFeature(StringRef Feature) const {
   .Case("powerpc", true)
   .Case("altivec", HasAltivec)
   .Case("vsx", HasVSX)
-  .Case("crbits", UseCRBits)
   .Case("power8-vector", HasP8Vector)
   .Case("crypto", HasP8Crypto)
-  .Case("direct-move", HasDirectMove)
   .Case("htm", HasHTM)
-  .Case("bpermd", HasBPERMD)
-  .Case("extdiv", HasExtDiv)
   .Case("float128", HasFloat128)
   .Case("power9-vector", HasP9Vector)
-  .Case("paired-vector-memops", PairedVectorMemops)
   .Case("power10-vector", HasP10Vector)
   .Case("pcrelative-memops", HasPCRelativeMemops)
-  .Case("prefix-instrs", HasPrefixInstrs)
   .Case("spe", HasSPE)
   .Case("mma", HasMMA)
   .Case("rop-protect", HasROPProtect)
-  .Case("privileged", HasPrivileged)
-  .Case("aix-small-local-exec-tls", HasAIXSmallLocalExecTLS)
-  .Case("aix-small-local-dynamic-tls", HasAIXSmallLocalDynamicTLS)
-  .Case("isa-v206-instructions", IsISA2_06)
-  .Case("isa-v207-instructions", IsISA2_07)
-  .Case("isa-v30-instructions", IsISA3_0)
-  .Case("isa-v31-instructions", IsISA3_1)
   .Case("quadword-atomics", HasQuadwordAtomics)
-  .Case("aix-shared-lib-tls-model-opt", HasAIXShLibTLSModelOpt)
   .Case("longcall", UseLongCalls)
   .Default(false);
 }
diff --git a/clang/lib/Basic/Targets/PPC.h b/clang/lib/Basic/Targets/PPC.h
index db6ac6f0bd338..17057cef97a57 100644
--- a/clang/lib/Basic/Targets/PPC.h
+++ b/clang/lib/Basic/Targets/PPC.h
@@ -60,31 +60,17 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public 
TargetInfo {
   bool HasAltivec = false;
   bool HasMMA = false;
   bool HasROPProtect = false;
-  bool HasPrivileged = false;
-  bool HasAIXSmallLocalExecTLS = false;
-  bool HasAIXSmallLocalDynamicTLS = false;
   bool HasVSX = false;
-  bool UseCRBits = false;
   bool HasP8Vector = false;
   bool HasP8Crypto = false;
-  bool HasDirectMove = false;
   bool HasHTM = false;
-  bool HasBPERMD = fa

[clang] [PowerPC] cleaned dead code of PPC.cpp and PPC.h (PR #130994)

2025-03-12 Thread zhijian lin via cfe-commits

https://github.com/diggerlin created 
https://github.com/llvm/llvm-project/pull/130994

There are some variables in the PPC.h which are defined and assigned a value to 
them,
but never be used, remove the code related to the variables.

>From 45a51fd46aeedd73fbfe5d9ae493eeb9084bc98c Mon Sep 17 00:00:00 2001
From: zhijian 
Date: Wed, 12 Mar 2025 16:50:13 +
Subject: [PATCH] cleand dead code of PPC.cpp and PPC.h

---
 clang/lib/Basic/Targets/PPC.cpp | 42 -
 clang/lib/Basic/Targets/PPC.h   | 14 ---
 2 files changed, 56 deletions(-)

diff --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp
index 2d8891a739ca3..2441cb00dfdfc 100644
--- a/clang/lib/Basic/Targets/PPC.cpp
+++ b/clang/lib/Basic/Targets/PPC.cpp
@@ -46,18 +46,10 @@ bool 
PPCTargetInfo::handleTargetFeatures(std::vector &Features,
   HasAltivec = true;
 } else if (Feature == "+vsx") {
   HasVSX = true;
-} else if (Feature == "+crbits") {
-  UseCRBits = true;
-} else if (Feature == "+bpermd") {
-  HasBPERMD = true;
-} else if (Feature == "+extdiv") {
-  HasExtDiv = true;
 } else if (Feature == "+power8-vector") {
   HasP8Vector = true;
 } else if (Feature == "+crypto") {
   HasP8Crypto = true;
-} else if (Feature == "+direct-move") {
-  HasDirectMove = true;
 } else if (Feature == "+htm") {
   HasHTM = true;
 } else if (Feature == "+float128") {
@@ -68,8 +60,6 @@ bool 
PPCTargetInfo::handleTargetFeatures(std::vector &Features,
   HasP10Vector = true;
 } else if (Feature == "+pcrelative-memops") {
   HasPCRelativeMemops = true;
-} else if (Feature == "+prefix-instrs") {
-  HasPrefixInstrs = true;
 } else if (Feature == "+spe" || Feature == "+efpu2") {
   HasStrictFP = false;
   HasSPE = true;
@@ -81,30 +71,12 @@ bool 
PPCTargetInfo::handleTargetFeatures(std::vector &Features,
   HasFrsqrtes = true;
 } else if (Feature == "-hard-float") {
   FloatABI = SoftFloat;
-} else if (Feature == "+paired-vector-memops") {
-  PairedVectorMemops = true;
 } else if (Feature == "+mma") {
   HasMMA = true;
 } else if (Feature == "+rop-protect") {
   HasROPProtect = true;
-} else if (Feature == "+privileged") {
-  HasPrivileged = true;
-} else if (Feature == "+aix-small-local-exec-tls") {
-  HasAIXSmallLocalExecTLS = true;
-} else if (Feature == "+aix-small-local-dynamic-tls") {
-  HasAIXSmallLocalDynamicTLS = true;
-} else if (Feature == "+isa-v206-instructions") {
-  IsISA2_06 = true;
-} else if (Feature == "+isa-v207-instructions") {
-  IsISA2_07 = true;
-} else if (Feature == "+isa-v30-instructions") {
-  IsISA3_0 = true;
-} else if (Feature == "+isa-v31-instructions") {
-  IsISA3_1 = true;
 } else if (Feature == "+quadword-atomics") {
   HasQuadwordAtomics = true;
-} else if (Feature == "+aix-shared-lib-tls-model-opt") {
-  HasAIXShLibTLSModelOpt = true;
 } else if (Feature == "+longcall") {
   UseLongCalls = true;
 }
@@ -745,31 +717,17 @@ bool PPCTargetInfo::hasFeature(StringRef Feature) const {
   .Case("powerpc", true)
   .Case("altivec", HasAltivec)
   .Case("vsx", HasVSX)
-  .Case("crbits", UseCRBits)
   .Case("power8-vector", HasP8Vector)
   .Case("crypto", HasP8Crypto)
-  .Case("direct-move", HasDirectMove)
   .Case("htm", HasHTM)
-  .Case("bpermd", HasBPERMD)
-  .Case("extdiv", HasExtDiv)
   .Case("float128", HasFloat128)
   .Case("power9-vector", HasP9Vector)
-  .Case("paired-vector-memops", PairedVectorMemops)
   .Case("power10-vector", HasP10Vector)
   .Case("pcrelative-memops", HasPCRelativeMemops)
-  .Case("prefix-instrs", HasPrefixInstrs)
   .Case("spe", HasSPE)
   .Case("mma", HasMMA)
   .Case("rop-protect", HasROPProtect)
-  .Case("privileged", HasPrivileged)
-  .Case("aix-small-local-exec-tls", HasAIXSmallLocalExecTLS)
-  .Case("aix-small-local-dynamic-tls", HasAIXSmallLocalDynamicTLS)
-  .Case("isa-v206-instructions", IsISA2_06)
-  .Case("isa-v207-instructions", IsISA2_07)
-  .Case("isa-v30-instructions", IsISA3_0)
-  .Case("isa-v31-instructions", IsISA3_1)
   .Case("quadword-atomics", HasQuadwordAtomics)
-  .Case("aix-shared-lib-tls-model-opt", HasAIXShLibTLSModelOpt)
   .Case("longcall", UseLongCalls)
   .Default(false);
 }
diff --git a/clang/lib/Basic/Targets/PPC.h b/clang/lib/Basic/Targets/PPC.h
index db6ac6f0bd338..17057cef97a57 100644
--- a/clang/lib/Basic/Targets/PPC.h
+++ b/clang/lib/Basic/Targets/PPC.h
@@ -60,31 +60,17 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public 
TargetInfo {
   bool HasAltivec = false;
   bool HasMMA = false;
   bool HasROPProtect = false;
-  bool HasPrivileged = false;
-  bool HasAIXSmallLocalExecTLS = false;
-  bool HasAIXSmallLocalDynamicTLS = false;
   bool HasVSX = false;
-  bool UseCRBits = false;
   b