[llvm] [SPIR-V] Fix illegal OpConstantComposite instruction with non-const constituents in SPIR-V Backend (PR #86352)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 15:47:09 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 3b3de48fd84b8269d5f45ee0a9dc6b7448368424 78feeefd9726fc1ec0bd16b59973be1d13cd4b08 -- llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.cpp llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp b/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
index f905ee6de1..4b922a15cf 100644
--- a/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
@@ -1666,8 +1666,7 @@ bool SPIRVInstructionSelector::wrapIntoSpecConstantOp(
     MRI->setType(WrapReg, LLT::pointer(0, 32));
     GR.assignSPIRVTypeToVReg(OpType, WrapReg, *MF);
     MachineBasicBlock &BB = *I.getParent();
-    Result = BuildMI(BB, I, I.getDebugLoc(),
-                     TII.get(SPIRV::OpSpecConstantOp))
+    Result = BuildMI(BB, I, I.getDebugLoc(), TII.get(SPIRV::OpSpecConstantOp))
                  .addDef(WrapReg)
                  .addUse(GR.getSPIRVTypeID(OpType))
                  .addImm(static_cast<uint32_t>(SPIRV::Opcode::Bitcast))

``````````

</details>


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


More information about the llvm-commits mailing list