From fba1fe6f629e50ee6ec5f36fc2f2b778c54edc91 Mon Sep 17 00:00:00 2001 From: Tom Honermann Date: Mon, 6 Jul 2026 20:29:57 -0700 Subject: [PATCH 1/2] [SYCL] Remove stale code previously used for FPGA loop fusion and coalescence Support for the [[intel::loop_coalesce]] and [[intel::nofusion]] attributes was previously removed by the following commits. - 3ee6128: [SYCL] PR 6 - Remove FPGA Attributes from SYCL FE (#21785) - 136b1cd: [SYCL] PR 1 - Remove FPGA attributes from SYCL FE (#21710) Removal of the attributes left a few data members and related setter functions unused. This change removes them. --- clang/lib/CodeGen/CGLoopInfo.h | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/clang/lib/CodeGen/CGLoopInfo.h b/clang/lib/CodeGen/CGLoopInfo.h index f4579f2845ad6..c629f034fffb3 100644 --- a/clang/lib/CodeGen/CGLoopInfo.h +++ b/clang/lib/CodeGen/CGLoopInfo.h @@ -118,12 +118,6 @@ struct LoopAttributes { llvm::SmallVector, 2> SYCLIntelFPGAVariantCount; - /// Flag for llvm.loop.coalesce metadata. - bool SYCLLoopCoalesceEnable; - - /// Value for llvm.loop.coalesce.count metadata. - unsigned SYCLLoopCoalesceNLevels; - /// Flag for llvm.loop.intel.pipelining.enable, i32 0 metadata. bool SYCLLoopPipeliningDisable; @@ -157,9 +151,6 @@ struct LoopAttributes { /// Value for llvm.loop.pipeline.iicount metadata. unsigned PipelineInitiationInterval; - /// Flag for llvm.loop.fusion.disable metatdata. - bool SYCLNofusionEnable; - /// Value for 'llvm.loop.align' metadata. unsigned CodeAlign; @@ -382,16 +373,6 @@ class LoopInfoStack { StagedAttrs.SYCLMaxConcurrencyNThreads = C; } - /// Set flag of loop_coalesce for the next loop pushed. - void setSYCLLoopCoalesceEnable() { - StagedAttrs.SYCLLoopCoalesceEnable = true; - } - - /// Set value of coalesced levels for the next loop pushed. - void setSYCLLoopCoalesceNLevels(unsigned C) { - StagedAttrs.SYCLLoopCoalesceNLevels = C; - } - /// Set flag of disable_loop_pipelining for the next loop pushed. void setSYCLLoopPipeliningDisable() { StagedAttrs.SYCLLoopPipeliningDisable = true; @@ -426,9 +407,6 @@ class LoopInfoStack { StagedAttrs.PipelineInitiationInterval = C; } - /// Set flag of nofusion for the next loop pushed. - void setSYCLNofusionEnable() { StagedAttrs.SYCLNofusionEnable = true; } - /// Set value of code align for the next loop pushed. void setCodeAlign(unsigned C) { StagedAttrs.CodeAlign = C; } From c0dda058e736b5d233f17c02074540f0806832d8 Mon Sep 17 00:00:00 2001 From: Tom Honermann Date: Tue, 7 Jul 2026 14:39:00 -0700 Subject: [PATCH 2/2] [SYCL] Remove stale code previously used for FPGA loop counts Support for the [[intel::loop_count(N)]], [[intel::loop_count_avg(N)]], [[intel::loop_count_min(N)]], and [[intel::loop_count_max(N)]] attributes was previously removed by the following commit. - 7102583: [SYCL] PR 2 - Remove FPGA attributes from SYCL FE (#21722) Removal of the attributes left a data member and related setter function with only inert uses left. This change removes them. --- clang/lib/CodeGen/CGLoopInfo.cpp | 11 +---------- clang/lib/CodeGen/CGLoopInfo.h | 9 --------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/clang/lib/CodeGen/CGLoopInfo.cpp b/clang/lib/CodeGen/CGLoopInfo.cpp index aced7100617bf..62b1e7264873f 100644 --- a/clang/lib/CodeGen/CGLoopInfo.cpp +++ b/clang/lib/CodeGen/CGLoopInfo.cpp @@ -570,13 +570,6 @@ SmallVector LoopInfo::createMetadata( LoopProperties.push_back(MDNode::get(Ctx, Vals)); } - for (const auto &VC : Attrs.SYCLIntelFPGAVariantCount) { - Metadata *Vals[] = {MDString::get(Ctx, VC.first), - ConstantAsMetadata::get(ConstantInt::get( - llvm::Type::getInt32Ty(Ctx), VC.second))}; - LoopProperties.push_back(MDNode::get(Ctx, Vals)); - } - if (Attrs.SYCLMaxReinvocationDelayNCycles) { Metadata *Vals[] = { MDString::get(Ctx, "llvm.loop.intel.max_reinvocation_delay.count"), @@ -630,7 +623,6 @@ void LoopAttributes::clear() { SYCLMaxConcurrencyNThreads.reset(); SYCLLoopPipeliningDisable = false; SYCLMaxInterleavingNInvocations.reset(); - SYCLIntelFPGAVariantCount.clear(); SYCLMaxReinvocationDelayNCycles.reset(); SYCLLoopPipeliningEnable = false; UnrollCount = 0; @@ -665,8 +657,7 @@ LoopInfo::LoopInfo(BasicBlock *Header, const LoopAttributes &Attrs, Attrs.ArraySYCLIVDepInfo.empty() && Attrs.SYCLIInterval == 0 && !Attrs.SYCLMaxConcurrencyNThreads && Attrs.SYCLLoopPipeliningDisable == false && - !Attrs.SYCLMaxInterleavingNInvocations && - Attrs.SYCLIntelFPGAVariantCount.empty() && Attrs.UnrollCount == 0 && + !Attrs.SYCLMaxInterleavingNInvocations && Attrs.UnrollCount == 0 && !Attrs.SYCLMaxReinvocationDelayNCycles && !Attrs.SYCLLoopPipeliningEnable && Attrs.UnrollAndJamCount == 0 && !Attrs.PipelineDisabled && !Attrs.LICMDisabled && diff --git a/clang/lib/CodeGen/CGLoopInfo.h b/clang/lib/CodeGen/CGLoopInfo.h index c629f034fffb3..0b2a2c3609f09 100644 --- a/clang/lib/CodeGen/CGLoopInfo.h +++ b/clang/lib/CodeGen/CGLoopInfo.h @@ -114,10 +114,6 @@ struct LoopAttributes { /// Value for llvm.loop.max_concurrency.count metadata. std::optional SYCLMaxConcurrencyNThreads; - /// Value for count variant (min/max/avg) and count metadata. - llvm::SmallVector, 2> - SYCLIntelFPGAVariantCount; - /// Flag for llvm.loop.intel.pipelining.enable, i32 0 metadata. bool SYCLLoopPipeliningDisable; @@ -388,11 +384,6 @@ class LoopInfoStack { StagedAttrs.SYCLSpeculatedIterationsNIterations = C; } - /// Set value of variant and loop count for the next loop pushed. - void setSYCLIntelFPGAVariantCount(const char *Var, unsigned int Count) { - StagedAttrs.SYCLIntelFPGAVariantCount.push_back({Var, Count}); - } - /// Set the unroll count for the next loop pushed. void setUnrollCount(unsigned C) { StagedAttrs.UnrollCount = C; }