[clang] [RFC][Clang][AMDGPU] Emit only delta target-features to reduce IR bloat (PR #176533)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 20 05:38:09 PST 2026


================
@@ -2980,10 +2988,34 @@ bool CodeGenModule::GetCPUAndFeaturesAttributes(GlobalDecl GD,
       // favor this processor.
       TuneCPU = SD->getCPUName(GD.getMultiVersionIndex())->getName();
     }
+
+    // For AMDGPU, only emit delta features (features that differ from the
+    // target CPU's defaults). Other targets might want to follow a similar
+    // pattern.
+    if (getTarget().getTriple().isAMDGPU()) {
----------------
arsenm wrote:

For patch splitting this is fine but I think the next step should be to remove this. We have way too much legacy junk just because somebody didn't want to bother updating the other target tests 

https://github.com/llvm/llvm-project/pull/176533


More information about the cfe-commits mailing list