[llvm] [OFFLOAD][L0][NFC] Cleanup dead code (PR #210060)

Alex Duran via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 06:39:03 PDT 2026


https://github.com/adurang created https://github.com/llvm/llvm-project/pull/210060

As we have done several refactorings lately, some dead code/data was left behind inadverteldy. This is just cleaning it up.

>From 37bb340fdef004e3b7981237f897be3c3b6dee6a Mon Sep 17 00:00:00 2001
From: "Duran, Alex" <alejandro.duran at intel.com>
Date: Thu, 16 Jul 2026 06:33:41 -0700
Subject: [PATCH] [OFFLOAD][L0][NFC] Cleanup dead code

As we have done several refactorings lately, some dead code/data was left behind
inadverteldy. This is just cleaning it up.
---
 .../level_zero/include/L0Kernel.h             |  2 --
 .../level_zero/include/L0Options.h            | 26 -------------------
 .../level_zero/src/L0Options.cpp              |  3 ---
 .../level_zero/src/L0Queue.cpp                |  2 --
 4 files changed, 33 deletions(-)

diff --git a/offload/plugins-nextgen/level_zero/include/L0Kernel.h b/offload/plugins-nextgen/level_zero/include/L0Kernel.h
index fb84c761d3ff1..d70522a9ab7a9 100644
--- a/offload/plugins-nextgen/level_zero/include/L0Kernel.h
+++ b/offload/plugins-nextgen/level_zero/include/L0Kernel.h
@@ -41,8 +41,6 @@ struct L0LaunchEnvTy {
   ze_group_count_t GroupCounts = {0, 0, 0};
   ze_group_size_t GroupSizes = {0, 0, 0};
   KernelPropertiesTy &KernelPR;
-  bool HalfNumThreads = false;
-  bool IsTeamsNDRange = false;
   bool IsCooperative = false;
   bool IsPtrArg = false;
   void **ArgPtrs = nullptr;
diff --git a/offload/plugins-nextgen/level_zero/include/L0Options.h b/offload/plugins-nextgen/level_zero/include/L0Options.h
index d73d4d931d50c..9f6bbbd3140f7 100644
--- a/offload/plugins-nextgen/level_zero/include/L0Options.h
+++ b/offload/plugins-nextgen/level_zero/include/L0Options.h
@@ -94,27 +94,6 @@ struct L0OptionsTy {
   /// Parameters for memory pools dedicated to reduction scratch space.
   std::array<int32_t, 3> ReductionPoolInfo{256, 8, 8192};
 
-  /// Oversubscription rate for normal kernels.
-  uint32_t SubscriptionRate = 4;
-
-  /// Loop kernels with known ND-range may be known to have
-  /// few iterations and they may not exploit the offload device
-  /// to the fullest extent.
-  /// Let's assume a device has N total HW threads available,
-  /// and the kernel requires M hardware threads with LWS set to L.
-  /// If (M < N * ThinThreadsThreshold), then we will try
-  /// to iteratively divide L by 2 to increase the number of HW
-  /// threads used for executing the kernel. Effectively, we will
-  /// end up with L less than the kernel's SIMD width, so the HW
-  /// threads will not use all their SIMD lanes. This (presumably) should
-  /// allow more parallelism, because the stalls in the SIMD lanes
-  /// will be distributed across more HW threads, and the probability
-  /// of having a stall (or a sequence of stalls) on a critical path
-  /// in the kernel should decrease.
-  /// Anyway, this is just a heuristics that seems to work well for some
-  /// kernels (which poorly expose parallelism in the first place).
-  double ThinThreadsThreshold = 0.1;
-
   // Compilation options for IGC.
   // OpenCL 2.0 builtins (like atomic_load_explicit and etc.) are used by
   // runtime, so we have to explicitly specify the "-cl-std=CL2.0" compilation
@@ -132,11 +111,6 @@ struct L0OptionsTy {
   /// Command execution mode.
   CommandModeTy CommandMode = CommandModeTy::InOrder;
 
-  /// Controls if we need to reduce available HW threads. We need this
-  /// adjustment on XeHPG when Level Zero debug is enabled
-  /// (ZET_ENABLE_PROGRAM_DEBUGGING=1).
-  bool ZeDebugEnabled = false;
-
   bool Init = false; // Have the options already been processed.
 
   // Allocator for long-lived allocations (e.g. spec constants).
diff --git a/offload/plugins-nextgen/level_zero/src/L0Options.cpp b/offload/plugins-nextgen/level_zero/src/L0Options.cpp
index eb718d4ddb099..e7294db1b8195 100644
--- a/offload/plugins-nextgen/level_zero/src/L0Options.cpp
+++ b/offload/plugins-nextgen/level_zero/src/L0Options.cpp
@@ -195,9 +195,6 @@ void L0OptionsTy::processEnvironmentVars() {
               "LIBOMPTARGET_LEVEL_ZERO_COMMAND_MODE=%s\n",
               CommandModeVar.get().c_str());
   }
-
-  // Detect if we need to enable compatibility with Level Zero debug mode.
-  ZeDebugEnabled = BoolEnvar("ZET_ENABLE_PROGRAM_DEBUGGING", false);
 }
 
 } // namespace llvm::omp::target::plugin
diff --git a/offload/plugins-nextgen/level_zero/src/L0Queue.cpp b/offload/plugins-nextgen/level_zero/src/L0Queue.cpp
index 81cef7be2df48..dd8e78e9fca2c 100644
--- a/offload/plugins-nextgen/level_zero/src/L0Queue.cpp
+++ b/offload/plugins-nextgen/level_zero/src/L0Queue.cpp
@@ -384,8 +384,6 @@ Expected<L0QueueTy *> L0QueueCacheTy::getQueue() {
   case CommandModeTy::InOrder:
     Queue = new L0InorderQueueTy(Device);
     break;
-  default:
-    return Plugin::error(ErrorCode::UNIMPLEMENTED, "Unsupported command mode");
   }
   if (auto Err = Queue->init()) {
     delete Queue;



More information about the llvm-commits mailing list