[mlir] AsynToLLVM: do no use op->getOperands() in conversion patterns
authorEugene Zhulenev <ezhulenev@google.com>
Sat, 21 Nov 2020 11:50:05 +0000 (03:50 -0800)
committerEugene Zhulenev <ezhulenev@google.com>
Sat, 21 Nov 2020 12:57:26 +0000 (04:57 -0800)
Differential Revision: https://reviews.llvm.org/D91910

mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp

index b08f7e4..c36cde1 100644 (file)
@@ -592,7 +592,7 @@ public:
 
     CallOp call = cast<CallOp>(op);
     rewriter.replaceOpWithNewOp<CallOp>(op, resultTypes, call.callee(),
-                                        call.getOperands());
+                                        operands);
 
     return success();
   }
@@ -733,7 +733,7 @@ public:
     // async API await function call.
     if (!isInCoroutine)
       rewriter.create<CallOp>(loc, TypeRange(), blockingAwaitFuncName,
-                              ValueRange(op->getOperand(0)));
+                              ValueRange(operands[0]));
 
     // Inside the coroutine we convert await operation into coroutine suspension
     // point, and resume execution asynchronously.
@@ -755,8 +755,8 @@ public:
 
       // Call async runtime API to resume a coroutine in the managed thread when
       // the async await argument becomes ready.
-      SmallVector<Value, 3> awaitAndExecuteArgs = {
-          await.getOperand(), coro.coroHandle, resumePtr.res()};
+      SmallVector<Value, 3> awaitAndExecuteArgs = {operands[0], coro.coroHandle,
+                                                   resumePtr.res()};
       builder.create<CallOp>(loc, TypeRange(), coroAwaitFuncName,
                              awaitAndExecuteArgs);