diff --git a/mlir/test/mlir-tblgen/llvm-intrinsics.td b/mlir/test/mlir-tblgen/llvm-intrinsics.td --- a/mlir/test/mlir-tblgen/llvm-intrinsics.td +++ b/mlir/test/mlir-tblgen/llvm-intrinsics.td @@ -21,6 +21,7 @@ // CHECK: module, llvm::Intrinsic::is_constant, { // CHECK: opInst.getOperand(0).getType().cast().getUnderlyingType(), // CHECK: }); +// CHECK: lookupValues(opInst.getOperands()); //---------------------------------------------------------------------------// diff --git a/mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp b/mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp --- a/mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp +++ b/mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp @@ -181,9 +181,9 @@ if (overloadedRes.any() || overloadedOps.any()) os << "\n "; os << "});\n"; - os << " auto operands = llvm::to_vector<8, Value *>(\n"; - os << " opInst.operand_begin(), opInst.operand_end());\n"; - os << " " << (intr.getNumResults() > 0 ? "$res = " : "") + os << " auto operands =\n"; + os << " lookupValues(opInst.getOperands());\n"; + os << " " << (intr.getNumResults() > 0 ? "$res = " : "") << "builder.CreateCall(fn, operands);\n"; os << " "; }