[llvm] [SPIR-V] Improve type inference: deduce types of composite data structures (PR #86782)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 27 02:16:12 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 3cf169ca160eaf5464503fbd93d73ee1d8597936 b7ec2847aee7a3a263affb04a27a634bc8baea8a -- llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp llvm/lib/Target/SPIRV/SPIRVUtils.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h b/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
index acaf1bd532..72cde50a35 100644
--- a/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
+++ b/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
@@ -131,9 +131,7 @@ public:
 
   // Deduced element types of untyped pointers and composites:
   // - Add a record to the map of deduced element types.
-  void addDeducedElementType(Value *Val, Type *Ty) {
-    DeducedElTys[Val] = Ty;
-  }
+  void addDeducedElementType(Value *Val, Type *Ty) { DeducedElTys[Val] = Ty; }
   // - Find a record in the map of deduced element types.
   Type *findDeducedElementType(const Value *Val) {
     auto It = DeducedElTys.find(Val);
diff --git a/llvm/lib/Target/SPIRV/SPIRVUtils.h b/llvm/lib/Target/SPIRV/SPIRVUtils.h
index 9fdc1d0dc9..c2c3475e1a 100644
--- a/llvm/lib/Target/SPIRV/SPIRVUtils.h
+++ b/llvm/lib/Target/SPIRV/SPIRVUtils.h
@@ -142,8 +142,7 @@ inline Type *getPointeeTypeByAttr(Argument *Arg) {
   return nullptr;
 }
 
-inline
-Type *reconstructFunctionType(Function *F) {
+inline Type *reconstructFunctionType(Function *F) {
   SmallVector<Type *> ArgTys;
   for (unsigned i = 0; i < F->arg_size(); ++i)
     ArgTys.push_back(F->getArg(i)->getType());

``````````

</details>


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


More information about the llvm-commits mailing list