[llvm] [SPIR-V] Support 2 more instructions from SPV_INTEL_long_composites (PR #128190)

Vyacheslav Levytskyy via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 24 04:14:21 PST 2025


================
@@ -2113,8 +2113,32 @@ static bool generateSelectInst(const SPIRV::IncomingCall *Call,
 static bool generateConstructInst(const SPIRV::IncomingCall *Call,
                                   MachineIRBuilder &MIRBuilder,
                                   SPIRVGlobalRegistry *GR) {
-  return buildOpFromWrapper(MIRBuilder, SPIRV::OpCompositeConstruct, Call,
-                            GR->getSPIRVTypeID(Call->ReturnType));
+  auto MIB = MIRBuilder.buildInstr(SPIRV::OpCompositeConstruct)
+                 .addDef(Call->ReturnRegister)
+                 .addUse(GR->getSPIRVTypeID(Call->ReturnType));
+
+  constexpr unsigned MaxWordCount = UINT16_MAX;
----------------
VyacheslavLevytskyy wrote:

Would it be possible and make sense to try to factor out common logic of long composites support as a separate utility function to avoid repetitions in this and previous PR? I think we would end up with a more concise version eventually.

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


More information about the llvm-commits mailing list