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

via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 20 17:09:58 PDT 2026


Author: Konstantinos Parasyris
Date: 2026-10-21T00:09:53Z
New Revision: 89989e72f2673fb3e307f8cee6712e789917fed5

URL: https://github.com/llvm/llvm-project/commit/89989e72f2673fb3e307f8cee6712e789917fed5
DIFF: https://github.com/llvm/llvm-project/commit/89989e72f2673fb3e307f8cee6712e789917fed5.diff

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

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.

Added: 
    

Modified: 
    clang/lib/CodeGen/Targets/SPIR.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/Targets/SPIR.cpp b/clang/lib/CodeGen/Targets/SPIR.cpp
index 19936d44208dd..75dfb14ace7a8 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());
 


        


More information about the cfe-commits mailing list