Changing compiler namespaces to the new single-line syntax. (#15827)
Some files already do this and now all do for consistency.
diff --git a/compiler/plugins/input/StableHLO/stablehlo-iree/PluginRegistration.cpp b/compiler/plugins/input/StableHLO/stablehlo-iree/PluginRegistration.cpp
index 2d8b002..e51d170 100644
--- a/compiler/plugins/input/StableHLO/stablehlo-iree/PluginRegistration.cpp
+++ b/compiler/plugins/input/StableHLO/stablehlo-iree/PluginRegistration.cpp
@@ -13,9 +13,7 @@
#include "stablehlo-iree/Conversion/Passes.h"
-namespace mlir {
-namespace iree_compiler {
-namespace stablehlo {
+namespace mlir::iree_compiler::stablehlo {
namespace {
@@ -158,9 +156,7 @@
} // namespace
-} // namespace stablehlo
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::stablehlo
IREE_DEFINE_COMPILER_OPTION_FLAGS(
::mlir::iree_compiler::stablehlo::StableHLOOptions);
diff --git a/compiler/plugins/input/TOSA/tosa-iree/InputConversion/Converti48Toi64.cpp b/compiler/plugins/input/TOSA/tosa-iree/InputConversion/Converti48Toi64.cpp
index 756e845..34f248b 100644
--- a/compiler/plugins/input/TOSA/tosa-iree/InputConversion/Converti48Toi64.cpp
+++ b/compiler/plugins/input/TOSA/tosa-iree/InputConversion/Converti48Toi64.cpp
@@ -19,8 +19,7 @@
using namespace mlir;
-namespace mlir {
-namespace iree_compiler {
+namespace mlir::iree_compiler {
class Converti48Toi64Pass : public Converti48Toi64Base<Converti48Toi64Pass> {
public:
@@ -184,5 +183,4 @@
return std::make_unique<Converti48Toi64Pass>();
}
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler
diff --git a/compiler/plugins/input/TOSA/tosa-iree/InputConversion/PassDetail.h b/compiler/plugins/input/TOSA/tosa-iree/InputConversion/PassDetail.h
index f763344..8baa946 100644
--- a/compiler/plugins/input/TOSA/tosa-iree/InputConversion/PassDetail.h
+++ b/compiler/plugins/input/TOSA/tosa-iree/InputConversion/PassDetail.h
@@ -15,13 +15,11 @@
#include "mlir/IR/BuiltinOps.h"
#include "mlir/Pass/Pass.h"
-namespace mlir {
-namespace iree_compiler {
+namespace mlir::iree_compiler {
#define GEN_PASS_CLASSES
#include "tosa-iree/InputConversion/Passes.h.inc"
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler
#endif // TOSA_IREE_INPUTCONVERSION_PASSDETAIL_H_
diff --git a/compiler/plugins/input/TOSA/tosa-iree/InputConversion/Passes.cpp b/compiler/plugins/input/TOSA/tosa-iree/InputConversion/Passes.cpp
index e974685..6ce26d2 100644
--- a/compiler/plugins/input/TOSA/tosa-iree/InputConversion/Passes.cpp
+++ b/compiler/plugins/input/TOSA/tosa-iree/InputConversion/Passes.cpp
@@ -18,8 +18,7 @@
#include "mlir/Pass/PassRegistry.h"
#include "mlir/Transforms/Passes.h"
-namespace mlir {
-namespace iree_compiler {
+namespace mlir::iree_compiler {
void registerTOSAConversionPassPipeline() {
PassPipelineRegistration<> tosa(
@@ -89,5 +88,4 @@
registerTOSAConversionPassPipeline();
}
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler
diff --git a/compiler/plugins/input/TOSA/tosa-iree/InputConversion/Passes.h b/compiler/plugins/input/TOSA/tosa-iree/InputConversion/Passes.h
index 06eb634..b896a74 100644
--- a/compiler/plugins/input/TOSA/tosa-iree/InputConversion/Passes.h
+++ b/compiler/plugins/input/TOSA/tosa-iree/InputConversion/Passes.h
@@ -11,8 +11,7 @@
#include "mlir/IR/BuiltinOps.h"
#include "mlir/Pass/Pass.h"
-namespace mlir {
-namespace iree_compiler {
+namespace mlir::iree_compiler {
//===----------------------------------------------------------------------===//
// Pipelines
@@ -51,7 +50,6 @@
void registerTOSAConversionPasses();
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler
#endif // TOSA_IREE_INPUTCONVERSION_PASSES_H_
diff --git a/compiler/plugins/input/TOSA/tosa-iree/InputConversion/StripSignedness.cpp b/compiler/plugins/input/TOSA/tosa-iree/InputConversion/StripSignedness.cpp
index 787626d..c133a98 100644
--- a/compiler/plugins/input/TOSA/tosa-iree/InputConversion/StripSignedness.cpp
+++ b/compiler/plugins/input/TOSA/tosa-iree/InputConversion/StripSignedness.cpp
@@ -10,8 +10,7 @@
#include "tosa-iree/InputConversion/PassDetail.h"
#include "tosa-iree/InputConversion/Passes.h"
-namespace mlir {
-namespace iree_compiler {
+namespace mlir::iree_compiler {
namespace {
@@ -131,5 +130,4 @@
return std::make_unique<StripSignednessPass>();
}
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler
diff --git a/compiler/plugins/input/TOSA/tosa-iree/InputConversion/TosaToLinalgExt.cpp b/compiler/plugins/input/TOSA/tosa-iree/InputConversion/TosaToLinalgExt.cpp
index 953aea0..affa17e 100644
--- a/compiler/plugins/input/TOSA/tosa-iree/InputConversion/TosaToLinalgExt.cpp
+++ b/compiler/plugins/input/TOSA/tosa-iree/InputConversion/TosaToLinalgExt.cpp
@@ -25,8 +25,7 @@
using namespace mlir;
using namespace mlir::tosa;
-namespace mlir {
-namespace iree_compiler {
+namespace mlir::iree_compiler {
// Converts tosa.scatter to the iree_linalg_ext.scatter operation. As the
// LinalgExt version is not batched therefore we materialize the batch index
@@ -174,5 +173,4 @@
return std::make_unique<TosaToLinalgExtPass>();
}
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler
diff --git a/compiler/plugins/input/TOSA/tosa-iree/InputConversion/VerifyCompilerTOSAInputLegality.cpp b/compiler/plugins/input/TOSA/tosa-iree/InputConversion/VerifyCompilerTOSAInputLegality.cpp
index 191a225..67a0b2a 100644
--- a/compiler/plugins/input/TOSA/tosa-iree/InputConversion/VerifyCompilerTOSAInputLegality.cpp
+++ b/compiler/plugins/input/TOSA/tosa-iree/InputConversion/VerifyCompilerTOSAInputLegality.cpp
@@ -11,8 +11,7 @@
#include "tosa-iree/InputConversion/PassDetail.h"
#include "tosa-iree/InputConversion/Passes.h"
-namespace mlir {
-namespace iree_compiler {
+namespace mlir::iree_compiler {
struct VerifyCompilerTOSAInputLegalityPass
: public VerifyCompilerTOSAInputLegalityBase<
@@ -69,5 +68,4 @@
return std::make_unique<VerifyCompilerTOSAInputLegalityPass>();
}
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler
diff --git a/compiler/plugins/input/TOSA/tosa-iree/PluginRegistration.cpp b/compiler/plugins/input/TOSA/tosa-iree/PluginRegistration.cpp
index 5235ba9..8021918 100644
--- a/compiler/plugins/input/TOSA/tosa-iree/PluginRegistration.cpp
+++ b/compiler/plugins/input/TOSA/tosa-iree/PluginRegistration.cpp
@@ -13,8 +13,7 @@
#include "tosa-iree/InputConversion/Passes.h"
-namespace mlir {
-namespace iree_compiler {
+namespace mlir::iree_compiler {
namespace {
@@ -70,8 +69,7 @@
} // namespace
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler
extern "C" bool iree_register_compiler_plugin_input_tosa(
mlir::iree_compiler::PluginRegistrar *registrar) {
diff --git a/compiler/plugins/input/Torch/torch-iree/InputConversion/BitCastQuantTensor.cpp b/compiler/plugins/input/Torch/torch-iree/InputConversion/BitCastQuantTensor.cpp
index e2fdd60..53fe2a4 100644
--- a/compiler/plugins/input/Torch/torch-iree/InputConversion/BitCastQuantTensor.cpp
+++ b/compiler/plugins/input/Torch/torch-iree/InputConversion/BitCastQuantTensor.cpp
@@ -18,9 +18,7 @@
#include "torch-mlir/Dialect/TorchConversion/IR/TorchConversionOps.h"
#include "torch-mlir/Dialect/TorchConversion/Transforms/Passes.h"
-namespace mlir {
-namespace iree_compiler {
-namespace TorchInput {
+namespace mlir::iree_compiler::TorchInput {
namespace {
@@ -132,6 +130,4 @@
return std::make_unique<BitCastQuantTensorPass>();
}
-} // namespace TorchInput
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::TorchInput
diff --git a/compiler/plugins/input/Torch/torch-iree/InputConversion/ConvertTMTensorToLinalgExt.cpp b/compiler/plugins/input/Torch/torch-iree/InputConversion/ConvertTMTensorToLinalgExt.cpp
index c0aae32..65063f1 100644
--- a/compiler/plugins/input/Torch/torch-iree/InputConversion/ConvertTMTensorToLinalgExt.cpp
+++ b/compiler/plugins/input/Torch/torch-iree/InputConversion/ConvertTMTensorToLinalgExt.cpp
@@ -16,9 +16,7 @@
#include "torch-iree/InputConversion/Passes.h"
#include "torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.h"
-namespace mlir {
-namespace iree_compiler {
-namespace TorchInput {
+namespace mlir::iree_compiler::TorchInput {
namespace {
@@ -205,6 +203,4 @@
return std::make_unique<ConvertTMTensorToLinalgExtPass>();
}
-} // namespace TorchInput
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::TorchInput
diff --git a/compiler/plugins/input/Torch/torch-iree/InputConversion/PassDetail.h b/compiler/plugins/input/Torch/torch-iree/InputConversion/PassDetail.h
index 9b20e2c..b9c6ec7 100644
--- a/compiler/plugins/input/Torch/torch-iree/InputConversion/PassDetail.h
+++ b/compiler/plugins/input/Torch/torch-iree/InputConversion/PassDetail.h
@@ -10,15 +10,11 @@
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Pass/Pass.h"
-namespace mlir {
-namespace iree_compiler {
-namespace TorchInput {
+namespace mlir::iree_compiler::TorchInput {
#define GEN_PASS_CLASSES
#include "torch-iree/InputConversion/Passes.h.inc"
-} // namespace TorchInput
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::TorchInput
#endif // TORCH_IREE_INPUTCONVERSION_PASSDETAIL_H_
diff --git a/compiler/plugins/input/Torch/torch-iree/InputConversion/Passes.cpp b/compiler/plugins/input/Torch/torch-iree/InputConversion/Passes.cpp
index 2edddcc..57105a9 100644
--- a/compiler/plugins/input/Torch/torch-iree/InputConversion/Passes.cpp
+++ b/compiler/plugins/input/Torch/torch-iree/InputConversion/Passes.cpp
@@ -17,9 +17,7 @@
#include "torch-mlir/Dialect/Torch/Transforms/Passes.h"
#include "torch-mlir/Dialect/TorchConversion/Transforms/Passes.h"
-namespace mlir {
-namespace iree_compiler {
-namespace TorchInput {
+namespace mlir::iree_compiler::TorchInput {
namespace {
#define GEN_PASS_REGISTRATION
@@ -84,6 +82,4 @@
createTorchToIREEPipeline);
}
-} // namespace TorchInput
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::TorchInput
diff --git a/compiler/plugins/input/Torch/torch-iree/InputConversion/Passes.h b/compiler/plugins/input/Torch/torch-iree/InputConversion/Passes.h
index a87ba69..7bbb7c2 100644
--- a/compiler/plugins/input/Torch/torch-iree/InputConversion/Passes.h
+++ b/compiler/plugins/input/Torch/torch-iree/InputConversion/Passes.h
@@ -10,9 +10,7 @@
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Pass/Pass.h"
-namespace mlir {
-namespace iree_compiler {
-namespace TorchInput {
+namespace mlir::iree_compiler::TorchInput {
struct TorchToIREELoweringPipelineOptions
: public PassPipelineOptions<TorchToIREELoweringPipelineOptions> {
@@ -41,8 +39,6 @@
void registerTMTensorConversionPasses();
-} // namespace TorchInput
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::TorchInput
#endif // TORCH_IREE_INPUTCONVERSION_PASSES_H_
diff --git a/compiler/plugins/input/Torch/torch-iree/InputConversion/SetStrictSymbolicShapes.cpp b/compiler/plugins/input/Torch/torch-iree/InputConversion/SetStrictSymbolicShapes.cpp
index c33b851..ebce85b 100644
--- a/compiler/plugins/input/Torch/torch-iree/InputConversion/SetStrictSymbolicShapes.cpp
+++ b/compiler/plugins/input/Torch/torch-iree/InputConversion/SetStrictSymbolicShapes.cpp
@@ -19,9 +19,7 @@
static const llvm::StringLiteral kStrictSymbolsMarker =
"torch.assume_strict_symbolic_shapes";
-namespace mlir {
-namespace iree_compiler {
-namespace TorchInput {
+namespace mlir::iree_compiler::TorchInput {
namespace {
struct SetStrictSymbolicShapesPass
@@ -38,6 +36,4 @@
return std::make_unique<SetStrictSymbolicShapesPass>();
}
-} // namespace TorchInput
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::TorchInput
diff --git a/compiler/plugins/target/CUDA/CUDATarget.cpp b/compiler/plugins/target/CUDA/CUDATarget.cpp
index 59e581c..a275acc 100644
--- a/compiler/plugins/target/CUDA/CUDATarget.cpp
+++ b/compiler/plugins/target/CUDA/CUDATarget.cpp
@@ -49,10 +49,7 @@
#include "mlir/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.h"
#include "mlir/Target/LLVMIR/Export.h"
-namespace mlir {
-namespace iree_compiler {
-namespace IREE {
-namespace HAL {
+namespace mlir::iree_compiler::IREE::HAL {
namespace {
struct CUDAOptions {
@@ -709,12 +706,10 @@
});
}
};
+
} // namespace
-} // namespace HAL
-} // namespace IREE
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::IREE::HAL
extern "C" bool iree_register_compiler_plugin_hal_target_cuda(
mlir::iree_compiler::PluginRegistrar *registrar) {
diff --git a/compiler/plugins/target/MetalSPIRV/MSLToMetalLib.cpp b/compiler/plugins/target/MetalSPIRV/MSLToMetalLib.cpp
index ca6b43e..b921c71 100644
--- a/compiler/plugins/target/MetalSPIRV/MSLToMetalLib.cpp
+++ b/compiler/plugins/target/MetalSPIRV/MSLToMetalLib.cpp
@@ -17,10 +17,7 @@
#define DEBUG_TYPE "iree-msl-to-metal-lib"
-namespace mlir {
-namespace iree_compiler {
-namespace IREE {
-namespace HAL {
+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,
@@ -95,7 +92,4 @@
return std::move(*fileOrErr);
}
-} // namespace HAL
-} // namespace IREE
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::IREE::HAL
diff --git a/compiler/plugins/target/MetalSPIRV/MSLToMetalLib.h b/compiler/plugins/target/MetalSPIRV/MSLToMetalLib.h
index a833f8b..03c5e5b 100644
--- a/compiler/plugins/target/MetalSPIRV/MSLToMetalLib.h
+++ b/compiler/plugins/target/MetalSPIRV/MSLToMetalLib.h
@@ -11,10 +11,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/MemoryBuffer.h"
-namespace mlir {
-namespace iree_compiler {
-namespace IREE {
-namespace HAL {
+namespace mlir::iree_compiler::IREE::HAL {
// Invokes system commands to compile the given |mslCode| into a Metal library
// and returns the library binary code. |fileName| will be used as a hint for
@@ -23,9 +20,6 @@
compileMSLToMetalLib(MetalTargetPlatform targetPlatform,
llvm::StringRef mslCode, llvm::StringRef fileName);
-} // namespace HAL
-} // namespace IREE
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::IREE::HAL
#endif // IREE_COMPILER_DIALECT_HAL_TARGET_METALSPIRV_MSLTOMETALLIB_H_
diff --git a/compiler/plugins/target/MetalSPIRV/MetalSPIRVTarget.cpp b/compiler/plugins/target/MetalSPIRV/MetalSPIRVTarget.cpp
index 522ef51..1ff62b4 100644
--- a/compiler/plugins/target/MetalSPIRV/MetalSPIRVTarget.cpp
+++ b/compiler/plugins/target/MetalSPIRV/MetalSPIRVTarget.cpp
@@ -26,10 +26,7 @@
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/Target/SPIRV/Serialization.h"
-namespace mlir {
-namespace iree_compiler {
-namespace IREE {
-namespace HAL {
+namespace mlir::iree_compiler::IREE::HAL {
namespace {
struct MetalSPIRVOptions {
@@ -328,10 +325,7 @@
}
};
-} // namespace HAL
-} // namespace IREE
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::IREE::HAL
extern "C" bool iree_register_compiler_plugin_hal_target_metal_spirv(
mlir::iree_compiler::PluginRegistrar *registrar) {
diff --git a/compiler/plugins/target/MetalSPIRV/MetalSPIRVTarget.h b/compiler/plugins/target/MetalSPIRV/MetalSPIRVTarget.h
index 849546e..bc2a0d4 100644
--- a/compiler/plugins/target/MetalSPIRV/MetalSPIRVTarget.h
+++ b/compiler/plugins/target/MetalSPIRV/MetalSPIRVTarget.h
@@ -9,17 +9,11 @@
#include <functional>
-namespace mlir {
-namespace iree_compiler {
-namespace IREE {
-namespace HAL {
+namespace mlir::iree_compiler::IREE::HAL {
// Registers the Metal/SPIR-V backends.
void registerMetalSPIRVTargetBackends();
-} // namespace HAL
-} // namespace IREE
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::IREE::HAL
#endif // IREE_COMPILER_DIALECT_HAL_TARGET_METALSPIRV_METALSPIRVTARGET_H_
diff --git a/compiler/plugins/target/MetalSPIRV/MetalTargetPlatform.h b/compiler/plugins/target/MetalSPIRV/MetalTargetPlatform.h
index aadce61..ddd03db 100644
--- a/compiler/plugins/target/MetalSPIRV/MetalTargetPlatform.h
+++ b/compiler/plugins/target/MetalSPIRV/MetalTargetPlatform.h
@@ -9,17 +9,11 @@
#include <functional>
-namespace mlir {
-namespace iree_compiler {
-namespace IREE {
-namespace HAL {
+namespace mlir::iree_compiler::IREE::HAL {
/// Metal target platforms.
enum class MetalTargetPlatform { macOS, iOS, iOSSimulator };
-} // namespace HAL
-} // namespace IREE
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::IREE::HAL
#endif // IREE_COMPILER_DIALECT_HAL_TARGET_METALSPIRV_METALTARGETPLATFORM_H_
diff --git a/compiler/plugins/target/MetalSPIRV/SPIRVToMSL.cpp b/compiler/plugins/target/MetalSPIRV/SPIRVToMSL.cpp
index a47b31f..ba8f613 100644
--- a/compiler/plugins/target/MetalSPIRV/SPIRVToMSL.cpp
+++ b/compiler/plugins/target/MetalSPIRV/SPIRVToMSL.cpp
@@ -20,8 +20,7 @@
/// Note that this MUST be kept consistent with the Metal HAL driver.
#define IREE_HAL_METAL_PUSH_CONSTANT_BUFFER_INDEX 3
-namespace mlir {
-namespace iree_compiler {
+namespace mlir::iree_compiler {
namespace {
class SPIRVToMSLCompiler : public SPIRV_CROSS_NAMESPACE::CompilerMSL {
@@ -182,5 +181,4 @@
spirvEntryPoint.name);
}
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler
diff --git a/compiler/plugins/target/MetalSPIRV/SPIRVToMSL.h b/compiler/plugins/target/MetalSPIRV/SPIRVToMSL.h
index 23400eb..e4ae7c3 100644
--- a/compiler/plugins/target/MetalSPIRV/SPIRVToMSL.h
+++ b/compiler/plugins/target/MetalSPIRV/SPIRVToMSL.h
@@ -16,8 +16,7 @@
#include "llvm/ADT/StringRef.h"
#include "mlir/Support/LLVM.h"
-namespace mlir {
-namespace iree_compiler {
+namespace mlir::iree_compiler {
struct MetalShader {
std::string source;
@@ -36,7 +35,6 @@
llvm::ArrayRef<uint32_t> spvBinary,
StringRef entryPoint);
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler
#endif // IREE_COMPILER_DIALECT_HAL_TARGET_METALSPIRV_SPIRVTOMSL_H_
diff --git a/compiler/plugins/target/ROCM/ROCMTarget.cpp b/compiler/plugins/target/ROCM/ROCMTarget.cpp
index f12eaad..a1ccd3f 100644
--- a/compiler/plugins/target/ROCM/ROCMTarget.cpp
+++ b/compiler/plugins/target/ROCM/ROCMTarget.cpp
@@ -38,12 +38,10 @@
#include "mlir/Target/LLVMIR/Dialect/ROCDL/ROCDLToLLVMIRTranslation.h"
#include "mlir/Target/LLVMIR/Export.h"
-namespace mlir {
-namespace iree_compiler {
-namespace IREE {
-namespace HAL {
+namespace mlir::iree_compiler::IREE::HAL {
namespace {
+
struct ROCMOptions {
std::string targetChip = "gfx908";
bool linkBitcode = false;
@@ -430,12 +428,10 @@
});
}
};
+
} // namespace
-} // namespace HAL
-} // namespace IREE
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::IREE::HAL
extern "C" bool iree_register_compiler_plugin_hal_target_rocm(
mlir::iree_compiler::PluginRegistrar *registrar) {
diff --git a/compiler/plugins/target/ROCM/ROCMTargetUtils.cpp b/compiler/plugins/target/ROCM/ROCMTargetUtils.cpp
index 19ae902..2972a81 100644
--- a/compiler/plugins/target/ROCM/ROCMTargetUtils.cpp
+++ b/compiler/plugins/target/ROCM/ROCMTargetUtils.cpp
@@ -20,10 +20,7 @@
#include "mlir/Support/FileUtilities.h"
#include "mlir/Support/LogicalResult.h"
-namespace mlir {
-namespace iree_compiler {
-namespace IREE {
-namespace HAL {
+namespace mlir::iree_compiler::IREE::HAL {
//===========Link LLVM Module to ROCDL Start===================/
// Inspiration of code from this section comes from XLA Kernel Gen Project
@@ -258,7 +255,4 @@
}
//==============Create HSACO End=============//
-} // namespace HAL
-} // namespace IREE
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::IREE::HAL
diff --git a/compiler/plugins/target/ROCM/ROCMTargetUtils.h b/compiler/plugins/target/ROCM/ROCMTargetUtils.h
index 6ad4081..ca5943e 100644
--- a/compiler/plugins/target/ROCM/ROCMTargetUtils.h
+++ b/compiler/plugins/target/ROCM/ROCMTargetUtils.h
@@ -10,10 +10,7 @@
#include "iree/compiler/Dialect/HAL/Target/TargetBackend.h"
#include "llvm/IR/Module.h"
-namespace mlir {
-namespace iree_compiler {
-namespace IREE {
-namespace HAL {
+namespace mlir::iree_compiler::IREE::HAL {
// Links LLVM module to ROC Device Library Bit Code
void linkROCDLIfNecessary(llvm::Module *module, std::string targetChip,
@@ -22,9 +19,6 @@
// Compiles ISAToHsaco Code
std::string createHsaco(Location loc, const std::string isa, StringRef name);
-} // namespace HAL
-} // namespace IREE
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::IREE::HAL
#endif // IREE_COMPILER_DIALECT_HAL_TARGET_ROCM_ROCMTARGETUTILS_H_
diff --git a/compiler/plugins/target/WebGPU/SPIRVToWGSL.cpp b/compiler/plugins/target/WebGPU/SPIRVToWGSL.cpp
index 19cccff..fd052f4 100644
--- a/compiler/plugins/target/WebGPU/SPIRVToWGSL.cpp
+++ b/compiler/plugins/target/WebGPU/SPIRVToWGSL.cpp
@@ -10,10 +10,7 @@
#include "llvm/Support/raw_ostream.h"
#include "tint/tint.h"
-namespace mlir {
-namespace iree_compiler {
-namespace IREE {
-namespace HAL {
+namespace mlir::iree_compiler::IREE::HAL {
std::optional<std::string>
compileSPIRVToWGSL(llvm::ArrayRef<uint32_t> spvBinary) {
@@ -55,7 +52,4 @@
return result.wgsl;
}
-} // namespace HAL
-} // namespace IREE
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::IREE::HAL
diff --git a/compiler/plugins/target/WebGPU/SPIRVToWGSL.h b/compiler/plugins/target/WebGPU/SPIRVToWGSL.h
index cee8f2d..4879456 100644
--- a/compiler/plugins/target/WebGPU/SPIRVToWGSL.h
+++ b/compiler/plugins/target/WebGPU/SPIRVToWGSL.h
@@ -12,19 +12,13 @@
#include "llvm/ADT/ArrayRef.h"
-namespace mlir {
-namespace iree_compiler {
-namespace IREE {
-namespace HAL {
+namespace mlir::iree_compiler::IREE::HAL {
// Compiles SPIR-V into WebGPU Shading Language (WGSL) source code.
// Returns std::nullopt on failure.
std::optional<std::string>
compileSPIRVToWGSL(llvm::ArrayRef<uint32_t> spvBinary);
-} // namespace HAL
-} // namespace IREE
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::IREE::HAL
#endif // IREE_COMPILER_DIALECT_HAL_TARGET_WEBGPU_SPIRVTOWGSL_H_
diff --git a/compiler/plugins/target/WebGPU/WebGPUTarget.cpp b/compiler/plugins/target/WebGPU/WebGPUTarget.cpp
index 00343a2..cdcc2ab 100644
--- a/compiler/plugins/target/WebGPU/WebGPUTarget.cpp
+++ b/compiler/plugins/target/WebGPU/WebGPUTarget.cpp
@@ -25,10 +25,7 @@
#include "mlir/Target/SPIRV/Serialization.h"
#include "spirv-tools/libspirv.hpp"
-namespace mlir {
-namespace iree_compiler {
-namespace IREE {
-namespace HAL {
+namespace mlir::iree_compiler::IREE::HAL {
namespace {
@@ -303,10 +300,7 @@
} // namespace
-} // namespace HAL
-} // namespace IREE
-} // namespace iree_compiler
-} // namespace mlir
+} // namespace mlir::iree_compiler::IREE::HAL
IREE_DEFINE_COMPILER_OPTION_FLAGS(
mlir::iree_compiler::IREE::HAL::WebGPUOptions);