[clang] [clang][SPIR-V][NFC] Remove dead argument classification loop (PR #233605)

via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 19 15:03:50 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-codegen

Author: Konstantinos Parasyris (koparasy)

<details>
<summary>Changes</summary>

I basically delete this part:

```cpp
for (auto &&[ArgumentsCount, I] : llvm::enumerate(FI.arguments()))
  I.info = ArgumentsCount < FI.getNumRequiredArgs()
               ? classifyArgumentType(I.type)
               : ABIArgInfo::getDirect();
```

Cause on SPIR-V it is followed by the
kernel/non-kernel loop, which unconditionally reassigns `I.info` for every
argument, so the results of the first loop are never observed. 

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


1 Files Affected:

- (modified) clang/lib/CodeGen/Targets/SPIR.cpp (-5) 


``````````diff
diff --git a/clang/lib/CodeGen/Targets/SPIR.cpp b/clang/lib/CodeGen/Targets/SPIR.cpp
index 19936d44208ddc..75dfb14ace7a80 100644
--- a/clang/lib/CodeGen/Targets/SPIR.cpp
+++ b/clang/lib/CodeGen/Targets/SPIR.cpp
@@ -186,11 +186,6 @@ void SPIRVABIInfo::computeInfo(CGFunctionInfo &FI) const {
   // arguments handling.
   llvm::CallingConv::ID CC = FI.getCallingConvention();
 
-  for (auto &&[ArgumentsCount, I] : llvm::enumerate(FI.arguments()))
-    I.info = ArgumentsCount < FI.getNumRequiredArgs()
-                 ? classifyArgumentType(I.type)
-                 : ABIArgInfo::getDirect();
-
   if (!getCXXABI().classifyReturnType(FI))
     FI.getReturnInfo() = classifyReturnType(FI.getReturnType());
 

``````````

</details>


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


More information about the cfe-commits mailing list