[llvm] [SPIR-V] Handle ASM with multiple outputs (PR #187128)

Alex Voicu via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 25 18:59:19 PDT 2026


================
@@ -592,9 +595,26 @@ SPIRVPrepareFunctions::removeAggregateTypesFromSignature(Function *F) {
   return NewF;
 }
 
-// Mutates indirect callsites iff if aggregate argument/return types are present
-// with the types replaced by i32 types. The change in types is noted in
-// 'spv.mutated_callsites' metadata for later restoration.
+static std::string fixMultiOutputConstraintString(StringRef Constraints) {
+  // We should only have one =r return for the made up ASM type.
+  SmallVector<StringRef> Tmp;
+  SplitString(Constraints, Tmp, ",");
+  std::string SafeConstraints("=r,");
+  for (unsigned I = 0u; I != Tmp.size() - 1; ++I) {
----------------
AlexVlx wrote:

They cannot be empty for cases where this function would be called.

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


More information about the llvm-commits mailing list