From dd7d4a1441b4be21db2b7ba038bf20d74899c13f Mon Sep 17 00:00:00 2001 From: Quinn Dawkins Date: Wed, 3 Jul 2024 14:44:24 -0400 Subject: [PATCH] Integrate llvm-project @31015240d366e4bf6f114856caa6e9ce90742b7f (#17799) Carries the same reverts as the previous integrate - revert https://github.com/llvm/llvm-project/commit/2c06fb899966b49ff0fe4adf55fceb7d1941fbca - revert https://github.com/llvm/llvm-project/commit/fa0666876cdf11162af341911b99311a56be2274 - revert https://github.com/llvm/llvm-project/commit/137a7451f458cf7d8e1d88df93dbd8da6888886d --- .github/workflows/pkgci_regression_test.yml | 2 +- compiler/plugins/target/LLVMCPU/BUILD.bazel | 1 + compiler/plugins/target/LLVMCPU/CMakeLists.txt | 1 + .../plugins/target/LLVMCPU/LLVMTargetOptions.cpp | 1 + compiler/plugins/target/MetalSPIRV/MSLToMetalLib.cpp | 12 ++++++------ compiler/src/iree/compiler/PluginAPI/Client.h | 8 ++++---- compiler/src/iree/compiler/PluginAPI/PluginManager.h | 5 +++-- compiler/src/iree/compiler/Utils/OptionUtils.h | 2 +- third_party/llvm-project | 2 +- 9 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pkgci_regression_test.yml b/.github/workflows/pkgci_regression_test.yml index c49da34aedf1..99ee321502e0 100644 --- a/.github/workflows/pkgci_regression_test.yml +++ b/.github/workflows/pkgci_regression_test.yml @@ -306,7 +306,7 @@ jobs: --goldendispatch-rocm-clip 1569 \ --goldendispatch-rocm-vae 248 \ --goldensize-rocm-unet-bytes 2062938 \ - --goldensize-rocm-clip-bytes 780200 \ + --goldensize-rocm-clip-bytes 780328 \ --goldensize-rocm-vae-bytes 757933 \ --gpu-number 6 \ --rocm-chip gfx90a \ diff --git a/compiler/plugins/target/LLVMCPU/BUILD.bazel b/compiler/plugins/target/LLVMCPU/BUILD.bazel index 71abc152c6ab..0e765fc6a417 100644 --- a/compiler/plugins/target/LLVMCPU/BUILD.bazel +++ b/compiler/plugins/target/LLVMCPU/BUILD.bazel @@ -111,6 +111,7 @@ iree_compiler_cc_library( deps = [ "//compiler/src/iree/compiler/Utils", "@llvm-project//llvm:Analysis", + "@llvm-project//llvm:Core", "@llvm-project//llvm:MC", "@llvm-project//llvm:Passes", "@llvm-project//llvm:Support", diff --git a/compiler/plugins/target/LLVMCPU/CMakeLists.txt b/compiler/plugins/target/LLVMCPU/CMakeLists.txt index 2abea28dad36..5d372d01d355 100644 --- a/compiler/plugins/target/LLVMCPU/CMakeLists.txt +++ b/compiler/plugins/target/LLVMCPU/CMakeLists.txt @@ -98,6 +98,7 @@ iree_cc_library( "LLVMTargetOptions.cpp" DEPS LLVMAnalysis + LLVMCore LLVMMC LLVMPasses LLVMSupport diff --git a/compiler/plugins/target/LLVMCPU/LLVMTargetOptions.cpp b/compiler/plugins/target/LLVMCPU/LLVMTargetOptions.cpp index 8fe6469b790d..b8c2513bf2ae 100644 --- a/compiler/plugins/target/LLVMCPU/LLVMTargetOptions.cpp +++ b/compiler/plugins/target/LLVMCPU/LLVMTargetOptions.cpp @@ -11,6 +11,7 @@ #include "llvm/ADT/APFloat.h" #include "llvm/ADT/StringRef.h" #include "llvm/Analysis/TargetTransformInfo.h" +#include "llvm/IR/Module.h" #include "llvm/MC/TargetRegistry.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" diff --git a/compiler/plugins/target/MetalSPIRV/MSLToMetalLib.cpp b/compiler/plugins/target/MetalSPIRV/MSLToMetalLib.cpp index 5df65ce85b43..2937fefc354e 100644 --- a/compiler/plugins/target/MetalSPIRV/MSLToMetalLib.cpp +++ b/compiler/plugins/target/MetalSPIRV/MSLToMetalLib.cpp @@ -21,8 +21,8 @@ namespace mlir::iree_compiler::IREE::HAL { /// Returns the command to compile the given MSL source file into Metal library. static std::string getMetalCompileCommand(MetalTargetPlatform platform, - StringRef mslFile, - StringRef libFile) { + llvm::StringRef mslFile, + llvm::StringRef libFile) { const char *sdk = ""; switch (platform) { case MetalTargetPlatform::macOS: @@ -51,7 +51,7 @@ static std::string getMetalCompileCommand(MetalTargetPlatform platform, } /// Returns the given command via system shell. -static LogicalResult runSystemCommand(StringRef command) { +static LogicalResult runSystemCommand(llvm::StringRef command) { LLVM_DEBUG(llvm::dbgs() << "Running system command: '" << command << "'\n"); int exitCode = system(command.data()); if (exitCode == 0) @@ -62,9 +62,9 @@ static LogicalResult runSystemCommand(StringRef command) { } std::unique_ptr -compileMSLToMetalLib(MetalTargetPlatform targetPlatform, StringRef mslCode, - StringRef entryPoint) { - SmallString<32> mslFile, airFile, libFile; +compileMSLToMetalLib(MetalTargetPlatform targetPlatform, + llvm::StringRef mslCode, llvm::StringRef entryPoint) { + llvm::SmallString<32> mslFile, airFile, libFile; int mslFd = 0; llvm::sys::fs::createTemporaryFile(entryPoint, "metal", mslFd, mslFile); llvm::sys::fs::createTemporaryFile(entryPoint, "metallib", libFile); diff --git a/compiler/src/iree/compiler/PluginAPI/Client.h b/compiler/src/iree/compiler/PluginAPI/Client.h index 0272e2538012..f9e44b83d9a8 100644 --- a/compiler/src/iree/compiler/PluginAPI/Client.h +++ b/compiler/src/iree/compiler/PluginAPI/Client.h @@ -61,14 +61,14 @@ class PipelineExtensions { // Adds input type mnemonics that this instance supports. At least one plugin // must advertise support for a custom input type in order for it to be // considered valid. - virtual void populateCustomInputConversionTypes(StringSet<> &typeMnemonics) {} + virtual void + populateCustomInputConversionTypes(llvm::StringSet<> &typeMnemonics) {} // Adds input type mnemonics that this instance supports, if those types are // detected in |module|. // Requires that |registerDialects| has been called first. - virtual void - populateDetectedCustomInputConversionTypes(ModuleOp &module, - StringSet<> &typeMnemonics) {} + virtual void populateDetectedCustomInputConversionTypes( + ModuleOp &module, llvm::StringSet<> &typeMnemonics) {} // Adds passes to the input preprocessing pipeline for the given // InputDialectOptions::Type::plugin type with the given mnemonic. diff --git a/compiler/src/iree/compiler/PluginAPI/PluginManager.h b/compiler/src/iree/compiler/PluginAPI/PluginManager.h index 7f820dc54739..ef194993d25d 100644 --- a/compiler/src/iree/compiler/PluginAPI/PluginManager.h +++ b/compiler/src/iree/compiler/PluginAPI/PluginManager.h @@ -102,14 +102,15 @@ class PluginManagerSession : public PipelineExtensions { } } - void populateCustomInputConversionTypes(StringSet<> &typeMnemonics) override { + void populateCustomInputConversionTypes( + llvm::StringSet<> &typeMnemonics) override { for (auto *s : initializedSessions) { s->populateCustomInputConversionTypes(typeMnemonics); } } void populateDetectedCustomInputConversionTypes( - ModuleOp &module, StringSet<> &typeMnemonics) override { + ModuleOp &module, llvm::StringSet<> &typeMnemonics) override { for (auto *s : initializedSessions) { s->populateDetectedCustomInputConversionTypes(module, typeMnemonics); } diff --git a/compiler/src/iree/compiler/Utils/OptionUtils.h b/compiler/src/iree/compiler/Utils/OptionUtils.h index c2b581218738..d97228182410 100644 --- a/compiler/src/iree/compiler/Utils/OptionUtils.h +++ b/compiler/src/iree/compiler/Utils/OptionUtils.h @@ -129,7 +129,7 @@ class OptionsBinder { -> decltype(static_cast(parser), static_cast(*value), LocalOptionInfo::PrintCallback()) { return [optionName, &parser, value](llvm::raw_ostream &os) { - StringRef valueName(""); + llvm::StringRef valueName(""); for (unsigned i = 0; i < parser.getNumOptions(); ++i) { V cmpValue = static_cast &>( parser.getOptionValue(i)) diff --git a/third_party/llvm-project b/third_party/llvm-project index 8ded6ce55dea..4334375d5666 160000 --- a/third_party/llvm-project +++ b/third_party/llvm-project @@ -1 +1 @@ -Subproject commit 8ded6ce55deafcad4b78ec814f1ecc80f9889392 +Subproject commit 4334375d5666c628610fc500aaab2059fd3892ba