================ @@ -0,0 +1,220 @@ +//===-- cir-offload-merge/cir-offload-merge.cpp ---------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// \file +// This tool combines a host CIR module and its device CIR modules into a +// single module marked as an offload container (carrying the +// `cir.offload.container` unit attribute). +// +//===----------------------------------------------------------------------===// + +#include "mlir/Dialect/LLVMIR/LLVMDialect.h" +#include "mlir/Dialect/MemRef/IR/MemRef.h" +#include "mlir/IR/BuiltinAttributes.h" +#include "mlir/IR/BuiltinOps.h" +#include "mlir/IR/MLIRContext.h" +#include "mlir/IR/OwningOpRef.h" +#include "mlir/IR/Verifier.h" +#include "mlir/Parser/Parser.h" +#include "mlir/Support/FileUtilities.h" +#include "clang/CIR/Dialect/IR/CIRDialect.h" +#include "clang/CIR/InitAllDialects.h" +#include "clang/Driver/OffloadBundler.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringSet.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/InitLLVM.h" +#include "llvm/Support/ToolOutputFile.h" +#include "llvm/Support/raw_ostream.h" + +#include <string> + +static llvm::cl::OptionCategory + CIROffloadMergeCategory("cir-offload-merge options"); + +static llvm::cl::opt<bool> Combine("combine", + llvm::cl::desc("Combine CIR inputs"), + llvm::cl::cat(CIROffloadMergeCategory)); + +static llvm::cl::list<std::string> + InputFileNames("input", + llvm::cl::desc("Input CIR file. Can be specified multiple " + "times."), + llvm::cl::cat(CIROffloadMergeCategory)); ---------------- RiverDave wrote:
Done, inputs are positional now, e.g: `cir-offload-merge -combine mod1.cir mod2.cir -o out.cir`. I kept -combine as an explicit mode flag since a -split mode will follow in a later patch. https://github.com/llvm/llvm-project/pull/240322 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
