@@ -129,9 +129,10 @@ void PtxBuilder::insertValue(Value v, PTXRegisterMod itype) {
129129
130130// / Check if the operation needs to pack and unpack results.
131131static bool
132- needsPackUnpack (BasicPtxBuilderInterface interfaceOp, bool needsManualMapping,
132+ needsPackUnpack (BasicPtxBuilderInterface interfaceOp,
133+ bool needsManualRegisterMapping,
133134 SmallVectorImpl<PTXRegisterMod> ®isterModifiers) {
134- if (needsManualMapping )
135+ if (needsManualRegisterMapping )
135136 return false ;
136137 const unsigned writeOnly = interfaceOp->getNumResults ();
137138 const unsigned readWrite =
@@ -145,13 +146,15 @@ needsPackUnpack(BasicPtxBuilderInterface interfaceOp, bool needsManualMapping,
145146// / If the operation has multiple results, it packs them into a struct
146147// / type. Otherwise, it returns the original result types.
147148static SmallVector<Type>
148- packResultTypes (BasicPtxBuilderInterface interfaceOp, bool needsManualMapping,
149+ packResultTypes (BasicPtxBuilderInterface interfaceOp,
150+ bool needsManualRegisterMapping,
149151 SmallVectorImpl<PTXRegisterMod> ®isterModifiers,
150152 SmallVectorImpl<Value> &ptxOperands) {
151153 MLIRContext *ctx = interfaceOp->getContext ();
152154 TypeRange resultRange = interfaceOp->getResultTypes ();
153155
154- if (!needsPackUnpack (interfaceOp, needsManualMapping, registerModifiers)) {
156+ if (!needsPackUnpack (interfaceOp, needsManualRegisterMapping,
157+ registerModifiers)) {
155158 // Single value path:
156159 if (interfaceOp->getResults ().size () == 1 )
157160 return SmallVector<Type>{resultRange.front ()};
@@ -333,7 +336,7 @@ LLVM::InlineAsmOp PtxBuilder::build() {
333336 LLVM::AsmDialect::AD_ATT);
334337
335338 SmallVector<Type> resultTypes = packResultTypes (
336- interfaceOp, needsManualMapping , registerModifiers, ptxOperands);
339+ interfaceOp, needsManualRegisterMapping , registerModifiers, ptxOperands);
337340
338341 // Remove the last comma from the constraints string.
339342 if (!registerConstraints.empty () &&
@@ -342,7 +345,7 @@ LLVM::InlineAsmOp PtxBuilder::build() {
342345 registerConstraints = canonicalizeRegisterConstraints (registerConstraints);
343346
344347 std::string ptxInstruction = interfaceOp.getPtx ();
345- if (!needsManualMapping )
348+ if (!needsManualRegisterMapping )
346349 ptxInstruction = rewriteAsmPlaceholders (ptxInstruction);
347350
348351 // Add the predicate to the asm string.
@@ -379,13 +382,14 @@ void PtxBuilder::buildAndReplaceOp() {
379382 return ;
380383 }
381384
382- if (needsManualMapping ) {
385+ if (needsManualRegisterMapping ) {
383386 rewriter.replaceOp (interfaceOp, inlineAsmOp->getResults ());
384387 return ;
385388 }
386389
387390 // Case 1: Simple path, return single scalar
388- if (!needsPackUnpack (interfaceOp, needsManualMapping, registerModifiers)) {
391+ if (!needsPackUnpack (interfaceOp, needsManualRegisterMapping,
392+ registerModifiers)) {
389393 if (inlineAsmOp->getNumResults () > 0 ) {
390394 rewriter.replaceOp (interfaceOp, inlineAsmOp->getResults ());
391395 } else {
0 commit comments