[flang-commits] [flang] [llvm] [mlir] mlir/LogicalResult: move into llvm (PR #97309)

Ramkumar Ramachandra via flang-commits flang-commits at lists.llvm.org
Mon Jul 1 08:53:55 PDT 2024


https://github.com/artagnon created https://github.com/llvm/llvm-project/pull/97309

This patch is part of a project to move the Presburger library into LLVM.

>From f4107b97d7e8e7bad6c9a4c0f5cce5c2b8bea25c Mon Sep 17 00:00:00 2001
From: Ramkumar Ramachandra <ramkumar.ramachandra at codasip.com>
Date: Mon, 1 Jul 2024 15:20:11 +0100
Subject: [PATCH] mlir/LogicalResult: move into llvm

This patch is part of a project to move the Presburger library into
LLVM.
---
 .../flang/Optimizer/CodeGen/FIROpPatterns.h   |  12 +-
 .../flang/Optimizer/CodeGen/TypeConverter.h   |   2 +-
 .../Dialect/FirAliasTagOpInterface.h          |   4 +-
 .../Dialect/FortranVariableInterface.td       |   2 +-
 .../Optimizer/Dialect/Support/KindMapping.h   |   2 +-
 .../include/flang/Optimizer/HLFIR/HLFIROps.td |   8 +-
 flang/lib/Optimizer/CodeGen/CodeGen.cpp       | 138 +++++++++---------
 flang/lib/Optimizer/CodeGen/CodeGenOpenMP.cpp |   2 +-
 flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp  |  14 +-
 flang/lib/Optimizer/CodeGen/TargetRewrite.cpp |   2 +-
 flang/lib/Optimizer/CodeGen/TypeConverter.cpp |   2 +-
 flang/lib/Optimizer/Dialect/CUF/CUFOps.cpp    |  14 +-
 flang/lib/Optimizer/Dialect/FIROps.cpp        |  86 +++++------
 flang/lib/Optimizer/Dialect/FIRType.cpp       |  22 +--
 .../Dialect/FirAliasTagOpInterface.cpp        |   6 +-
 .../Dialect/FortranVariableInterface.cpp      |   2 +-
 .../Optimizer/Dialect/Support/KindMapping.cpp |   4 +-
 flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp     |  84 +++++------
 .../HLFIR/Transforms/BufferizeHLFIR.cpp       |  27 ++--
 .../HLFIR/Transforms/ConvertToFIR.cpp         |  18 +--
 .../HLFIR/Transforms/InlineElementals.cpp     |   2 +-
 .../HLFIR/Transforms/LowerHLFIRIntrinsics.cpp |  13 +-
 .../LowerHLFIROrderedAssignments.cpp          |   8 +-
 .../Transforms/OptimizedBufferization.cpp     |  16 +-
 .../Transforms/SimplifyHLFIRIntrinsics.cpp    |   2 +-
 .../Optimizer/Transforms/AbstractResult.cpp   |  10 +-
 .../Optimizer/Transforms/AffineDemotion.cpp   |   4 +-
 .../Optimizer/Transforms/AffinePromotion.cpp  |   4 +-
 .../Optimizer/Transforms/ArrayValueCopy.cpp   |  14 +-
 .../Transforms/AssumedRankOpConversion.cpp    |   4 +-
 .../Transforms/CharacterConversion.cpp        |   2 +-
 .../ConstantArgumentGlobalisation.cpp         |   2 +-
 .../Transforms/ControlFlowConverter.cpp       |   6 +-
 .../Optimizer/Transforms/MemoryAllocation.cpp |   2 +-
 .../Transforms/PolymorphicOpConversion.cpp    |  14 +-
 .../lib/Optimizer/Transforms/StackArrays.cpp  |   9 +-
 flang/tools/bbc/bbc.cpp                       |   4 +-
 flang/tools/tco/tco.cpp                       |   2 +-
 .../include/llvm}/Support/LogicalResult.h     |  69 +++++----
 mlir/docs/PDLL.md                             |  14 +-
 mlir/docs/Tutorials/Toy/Ch-2.md               |   6 +-
 mlir/docs/Tutorials/Toy/Ch-3.md               |   6 +-
 mlir/docs/Tutorials/Toy/Ch-5.md               |   2 +-
 .../lib/Standalone/StandalonePasses.cpp       |   1 -
 .../standalone-translate.cpp                  |   3 +-
 mlir/examples/toy/Ch2/mlir/Dialect.cpp        |   7 +-
 mlir/examples/toy/Ch2/mlir/MLIRGen.cpp        |   9 +-
 mlir/examples/toy/Ch3/mlir/Dialect.cpp        |   7 +-
 mlir/examples/toy/Ch3/mlir/MLIRGen.cpp        |   9 +-
 mlir/examples/toy/Ch3/mlir/ToyCombine.cpp     |   3 +-
 mlir/examples/toy/Ch3/toyc.cpp                |   1 -
 mlir/examples/toy/Ch4/mlir/Dialect.cpp        |   7 +-
 mlir/examples/toy/Ch4/mlir/MLIRGen.cpp        |   9 +-
 mlir/examples/toy/Ch4/mlir/ToyCombine.cpp     |   3 +-
 mlir/examples/toy/Ch4/toyc.cpp                |   1 -
 mlir/examples/toy/Ch5/mlir/Dialect.cpp        |   7 +-
 .../toy/Ch5/mlir/LowerToAffineLoops.cpp       |   1 -
 mlir/examples/toy/Ch5/mlir/MLIRGen.cpp        |   9 +-
 mlir/examples/toy/Ch5/mlir/ToyCombine.cpp     |   3 +-
 mlir/examples/toy/Ch5/toyc.cpp                |   1 -
 mlir/examples/toy/Ch6/mlir/Dialect.cpp        |   7 +-
 .../toy/Ch6/mlir/LowerToAffineLoops.cpp       |   1 -
 mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp    |   1 -
 mlir/examples/toy/Ch6/mlir/MLIRGen.cpp        |   9 +-
 mlir/examples/toy/Ch6/mlir/ToyCombine.cpp     |   3 +-
 mlir/examples/toy/Ch6/toyc.cpp                |   1 -
 mlir/examples/toy/Ch7/mlir/Dialect.cpp        |  13 +-
 .../toy/Ch7/mlir/LowerToAffineLoops.cpp       |   1 -
 mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp    |   1 -
 mlir/examples/toy/Ch7/mlir/MLIRGen.cpp        |  11 +-
 mlir/examples/toy/Ch7/mlir/ToyCombine.cpp     |   3 +-
 mlir/examples/toy/Ch7/toyc.cpp                |   1 -
 .../transform-opt/mlir-transform-opt.cpp      |  10 +-
 .../transform/Ch4/lib/MyExtension.cpp         |   2 +-
 .../Analysis/FlatLinearValueConstraints.h     |   1 -
 .../mlir/Bytecode/BytecodeImplementation.h    |   1 -
 .../mlir/Bytecode/BytecodeOpInterface.h       |   1 -
 mlir/include/mlir/Bytecode/BytecodeReader.h   |   1 -
 .../mlir/Bytecode/BytecodeReaderConfig.h      |   1 -
 mlir/include/mlir/CAPI/Support.h              |   6 +-
 .../AffineToStandard/AffineToStandard.h       |   1 -
 .../ConvertToLLVM/ToLLVMInterface.h           |   1 -
 .../Conversion/FuncToLLVM/ConvertFuncToLLVM.h |   1 -
 .../mlir/Conversion/GPUCommon/GPUCommonPass.h |   1 -
 .../mlir/Conversion/SCFToGPU/SCFToGPU.h       |   1 -
 .../mlir/Conversion/VectorToGPU/VectorToGPU.h |   1 -
 mlir/include/mlir/Debug/CLOptionsSetup.h      |   1 -
 .../mlir/Dialect/AMDGPU/Utils/Chipset.h       |   2 +-
 .../Affine/Analysis/AffineStructures.h        |   1 -
 .../Affine/IR/ValueBoundsOpInterfaceImpl.h    |   2 +-
 mlir/include/mlir/Dialect/Affine/LoopUtils.h  |   1 -
 .../Dialect/Affine/Transforms/Transforms.h    |   1 -
 mlir/include/mlir/Dialect/Affine/Utils.h      |   2 -
 .../Dialect/Arith/Transforms/Transforms.h     |   1 -
 .../IR/BufferizableOpInterface.td             |   8 +-
 .../Transforms/OneShotModuleBufferize.h       |  19 ++-
 .../GPU/IR/CompilationAttrInterfaces.td       |   4 +-
 .../GPU/Transforms/ParallelLoopMapper.h       |   1 -
 .../mlir/Dialect/GPU/Transforms/Utils.h       |   1 -
 .../mlir/Dialect/IRDL/IR/IRDLInterfaces.h     |   1 -
 .../include/mlir/Dialect/IRDL/IR/IRDLTraits.h |   1 -
 mlir/include/mlir/Dialect/IRDL/IRDLLoading.h  |   8 +-
 .../include/mlir/Dialect/IRDL/IRDLVerifiers.h |   1 -
 .../Linalg/TransformOps/GPUHeuristics.h       |   1 -
 .../mlir/Dialect/Linalg/TransformOps/Syntax.h |   1 -
 .../Dialect/Linalg/Transforms/Transforms.h    |   1 -
 .../Dialect/MemRef/Transforms/Transforms.h    |   2 +-
 .../Dialect/Mesh/Transforms/Spmdization.h     |   1 -
 .../Dialect/NVGPU/Transforms/Transforms.h     |   3 +-
 .../Interfaces/AtomicInterfaces.td            |  24 +--
 .../mlir/Dialect/Polynomial/IR/Polynomial.h   |   1 -
 .../mlir/Dialect/SCF/Transforms/Transforms.h  |   2 -
 .../SCF/Utils/AffineCanonicalizationUtils.h   |   2 -
 mlir/include/mlir/Dialect/SCF/Utils/Utils.h   |   1 -
 .../SparseTensor/IR/SparseTensorInterfaces.td |   2 +-
 .../Interfaces/TransformInterfaces.h          |   3 +-
 .../Interfaces/TransformInterfaces.td         |   2 +-
 .../Transforms/TransformInterpreterUtils.h    |   1 -
 .../Vector/Transforms/VectorRewritePatterns.h |   1 -
 mlir/include/mlir/ExecutionEngine/JitRunner.h |   6 +-
 mlir/include/mlir/IR/Action.h                 |   1 -
 mlir/include/mlir/IR/AffineExpr.h             |   1 -
 mlir/include/mlir/IR/AffineExprVisitor.h      |   2 +-
 mlir/include/mlir/IR/AffineMap.h              |   1 -
 .../mlir/IR/BuiltinAttributeInterfaces.h      |   1 -
 .../mlir/IR/BuiltinAttributeInterfaces.td     |   2 +-
 mlir/include/mlir/IR/Diagnostics.h            |   1 -
 mlir/include/mlir/IR/Dialect.h                |   3 -
 mlir/include/mlir/IR/EnumAttr.td              |   4 +-
 mlir/include/mlir/IR/ExtensibleDialect.h      |   1 -
 mlir/include/mlir/IR/OperationSupport.h       |   1 -
 mlir/include/mlir/IR/StorageUniquerSupport.h  |   1 -
 mlir/include/mlir/IR/SymbolInterfaces.td      |   4 +-
 mlir/include/mlir/IR/TensorEncoding.td        |   2 +-
 mlir/include/mlir/IR/Verifier.h               |   3 +-
 mlir/include/mlir/IR/Visitors.h               |   1 -
 .../mlir/Interfaces/DataLayoutInterfaces.td   |  10 +-
 mlir/include/mlir/Interfaces/FoldInterfaces.h |   1 -
 .../mlir/Interfaces/FunctionInterfaces.td     |   4 +-
 .../mlir/Interfaces/InferTypeOpInterface.td   |  20 +--
 .../mlir/Interfaces/LoopLikeInterface.td      |   2 +-
 .../mlir/Interfaces/MemorySlotInterfaces.td   |   6 +-
 .../mlir/Interfaces/TilingInterface.td        |  20 +--
 mlir/include/mlir/Pass/Pass.h                 |   1 -
 mlir/include/mlir/Pass/PassManager.h          |   1 -
 mlir/include/mlir/Pass/PassOptions.h          |   1 -
 mlir/include/mlir/Query/Query.h               |  13 +-
 mlir/include/mlir/Reducer/ReductionNode.h     |   1 -
 mlir/include/mlir/Support/LLVM.h              |  14 +-
 mlir/include/mlir/Support/StorageUniquer.h    |   1 -
 mlir/include/mlir/Support/ToolUtilities.h     |   2 -
 mlir/include/mlir/Target/Cpp/CppEmitter.h     |   1 -
 mlir/include/mlir/Target/LLVM/ROCDL/Utils.h   |   1 +
 .../mlir/Target/LLVMIR/LLVMImportInterface.h  |   1 -
 .../Target/LLVMIR/LLVMTranslationInterface.h  |   1 -
 .../include/mlir/Target/SPIRV/Serialization.h |   1 -
 mlir/include/mlir/Tools/PDLL/AST/Diagnostic.h |   1 -
 .../include/mlir/Tools/PDLL/CodeGen/MLIRGen.h |   2 -
 mlir/include/mlir/Tools/PDLL/Parser/Parser.h  |   2 +-
 .../lsp-server-support/CompilationDatabase.h  |   1 +
 .../mlir/Tools/lsp-server-support/Protocol.h  |   3 -
 .../mlir/Tools/lsp-server-support/Transport.h |   1 -
 .../Tools/mlir-lsp-server/MlirLspServerMain.h |   9 +-
 .../include/mlir/Tools/mlir-opt/MlirOptMain.h |   1 -
 .../MlirPdllLspServerMain.h                   |   6 +-
 .../mlir/Tools/mlir-query/MlirQueryMain.h     |   2 +-
 .../mlir/Tools/mlir-reduce/MlirReduceMain.h   |   2 +-
 .../Tools/mlir-translate/MlirTranslateMain.h  |   2 +-
 .../tblgen-lsp-server/TableGenLspServerMain.h |   7 +-
 .../Transforms/HomomorphismSimplification.h   |   1 -
 mlir/include/mlir/Transforms/Inliner.h        |   1 -
 .../mlir/Transforms/LocationSnapshot.h        |   1 -
 mlir/include/mlir/Transforms/SROA.h           |   2 +-
 .../AliasAnalysis/LocalAliasAnalysis.cpp      |   1 -
 .../DataFlow/ConstantPropagationAnalysis.cpp  |   1 -
 .../Analysis/DataFlow/DeadCodeAnalysis.cpp    |   1 -
 mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp  |   1 -
 mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp |   1 -
 mlir/lib/Analysis/DataFlowFramework.cpp       |   1 -
 .../Analysis/FlatLinearValueConstraints.cpp   |   1 -
 mlir/lib/AsmParser/AffineParser.cpp           |   1 -
 mlir/lib/AsmParser/AsmParserState.cpp         |   1 -
 mlir/lib/AsmParser/DialectSymbolParser.cpp    |   1 -
 mlir/lib/AsmParser/LocationParser.cpp         |   1 -
 mlir/lib/AsmParser/Parser.cpp                 |   1 -
 mlir/lib/AsmParser/TypeParser.cpp             |   1 -
 mlir/lib/Bytecode/Reader/BytecodeReader.cpp   |   1 -
 mlir/lib/Bytecode/Writer/BytecodeWriter.cpp   |   1 -
 mlir/lib/CAPI/IR/BuiltinTypes.cpp             |   1 -
 .../ArithToAMDGPU/ArithToAMDGPU.cpp           |   1 -
 .../Conversion/ArithToEmitC/ArithToEmitC.cpp  |   1 -
 .../BufferizationToMemRef.cpp                 |   1 -
 .../ControlFlowToSPIRV/ControlFlowToSPIRV.cpp |   1 -
 mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp |   1 -
 .../Conversion/FuncToSPIRV/FuncToSPIRV.cpp    |   1 -
 mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp |   1 -
 .../MemRefToSPIRV/MemRefToSPIRV.cpp           |   1 -
 mlir/lib/Conversion/NVVMToLLVM/NVVMToLLVM.cpp |   1 -
 .../Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp    |   1 -
 .../TensorToLinalg/TensorToLinalg.cpp         |   1 -
 .../TensorToSPIRV/TensorToSPIRV.cpp           |   1 -
 .../Conversion/VectorToGPU/VectorToGPU.cpp    |   1 -
 .../VectorToSPIRV/VectorToSPIRV.cpp           |   1 -
 .../Transforms/AffineScalarReplacement.cpp    |   1 -
 mlir/lib/Dialect/Arith/IR/ArithOps.cpp        |   1 -
 .../Arith/Transforms/EmulateNarrowType.cpp    |   1 -
 .../Arith/Transforms/EmulateWideInt.cpp       |   1 -
 .../Dialect/Arith/Transforms/IntNarrowing.cpp |   1 -
 .../LowerContractionToSMMLAPattern.cpp        |   1 -
 .../Transforms/LowerDeallocations.cpp         |   1 -
 mlir/lib/Dialect/GPU/IR/GPUDialect.cpp        |   1 -
 .../GPU/Transforms/SubgroupReduceLowering.cpp |   1 -
 mlir/lib/Dialect/IRDL/IR/IRDL.cpp             |   1 -
 mlir/lib/Dialect/IRDL/IRDLLoading.cpp         |   1 -
 mlir/lib/Dialect/IRDL/IRDLVerifiers.cpp       |   1 -
 .../LLVMIR/IR/BasicPtxBuilderInterface.cpp    |   1 -
 mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp    |   1 -
 .../Transforms/MeshShardingInterfaceImpl.cpp  |   1 -
 .../Linalg/Transforms/TransposeConv2D.cpp     |   1 -
 .../Dialect/MemRef/IR/MemRefMemorySlot.cpp    |   1 -
 .../MemRef/Transforms/EmulateNarrowType.cpp   |   1 -
 mlir/lib/Dialect/Mesh/IR/MeshOps.cpp          |   1 -
 .../Mesh/Interfaces/ShardingInterface.cpp     |   1 -
 .../Mesh/Transforms/ShardingPropagation.cpp   |   1 -
 .../Mesh/Transforms/Simplifications.cpp       |   1 -
 .../Dialect/Mesh/Transforms/Spmdization.cpp   |   1 -
 .../NVGPU/Transforms/MmaSyncTF32Transform.cpp |   1 -
 .../NVGPU/Transforms/OptimizeSharedMemory.cpp |   3 +-
 mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp  |   1 -
 mlir/lib/Dialect/Polynomial/IR/Polynomial.cpp |   1 -
 .../Polynomial/IR/PolynomialAttributes.cpp    |   1 -
 .../Polynomial/IR/PolynomialDialect.cpp       |   1 -
 .../Dialect/Polynomial/IR/PolynomialOps.cpp   |   1 -
 .../Dialect/Quant/IR/QuantDialectBytecode.cpp |   1 -
 mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp        |   1 -
 .../Transforms/SPIRVWebGPUTransforms.cpp      |   1 -
 mlir/lib/Dialect/Tosa/IR/TosaOps.cpp          |   2 +-
 .../Dialect/Tosa/Transforms/TosaFolders.cpp   |   1 -
 .../Interfaces/TransformInterfaces.cpp        |   1 -
 .../Vector/Transforms/LowerVectorBitCast.cpp  |   1 -
 .../Transforms/LowerVectorBroadcast.cpp       |   1 -
 .../Vector/Transforms/LowerVectorContract.cpp |   1 -
 .../Vector/Transforms/LowerVectorGather.cpp   |   1 -
 .../Transforms/LowerVectorInterleave.cpp      |   1 -
 .../Vector/Transforms/LowerVectorScan.cpp     |   1 -
 .../Transforms/LowerVectorShapeCast.cpp       |   1 -
 .../Transforms/LowerVectorTranspose.cpp       |   1 -
 .../Vector/Transforms/VectorLinearize.cpp     |   1 -
 .../Vector/Transforms/VectorTransforms.cpp    |   1 -
 mlir/lib/IR/AffineMap.cpp                     |   1 -
 mlir/lib/IR/ExtensibleDialect.cpp             |   1 -
 mlir/lib/Query/Query.cpp                      |  16 +-
 mlir/lib/Support/ToolUtilities.cpp            |   1 -
 mlir/lib/TableGen/CodeGenHelpers.cpp          |  12 +-
 .../LLVMIR/Dialect/GPU/SelectObjectAttr.cpp   |   4 +-
 .../Dialect/NVVM/NVVMToLLVMIRTranslation.cpp  |   1 -
 .../OpenMP/OpenMPToLLVMIRTranslation.cpp      |   1 -
 mlir/lib/Target/LLVMIR/ModuleTranslation.cpp  |   1 -
 .../SPIRV/Deserialization/Deserializer.cpp    |   1 -
 .../SPIRV/Serialization/SerializeOps.cpp      |   1 -
 .../Target/SPIRV/Serialization/Serializer.cpp |   1 -
 mlir/lib/Tools/PDLL/CodeGen/CPPGen.cpp        |   2 +-
 mlir/lib/Tools/PDLL/Parser/Lexer.cpp          |   1 -
 mlir/lib/Tools/PDLL/Parser/Lexer.h            |   2 -
 mlir/lib/Tools/PDLL/Parser/Parser.cpp         |   1 -
 .../lib/Tools/lsp-server-support/Protocol.cpp |   1 -
 mlir/lib/Tools/mlir-lsp-server/LSPServer.h    |   7 +-
 mlir/lib/Tools/mlir-opt/MlirOptMain.cpp       |   1 -
 .../Tools/mlir-pdll-lsp-server/LSPServer.h    |   7 +-
 .../Tools/mlir-pdll-lsp-server/PDLLServer.h   |   3 +-
 mlir/lib/Tools/mlir-query/MlirQueryMain.cpp   |   3 +-
 mlir/lib/Tools/mlir-reduce/MlirReduceMain.cpp |   1 -
 .../mlir-translate/MlirTranslateMain.cpp      |   1 -
 mlir/lib/Tools/tblgen-lsp-server/LSPServer.h  |   8 +-
 .../tblgen-lsp-server/TableGenServer.cpp      |   4 -
 .../Tools/tblgen-lsp-server/TableGenServer.h  |   3 +-
 .../DataFlow/TestLivenessAnalysis.cpp         |   1 -
 .../Dialect/ArmNeon/TestLowerToArmNeon.cpp    |   1 -
 mlir/test/lib/Dialect/Mesh/TestOpLowering.cpp |   1 -
 .../Mesh/TestReshardingSpmdization.cpp        |   1 -
 mlir/test/lib/Dialect/Test/TestAttributes.cpp |   1 -
 mlir/test/lib/Dialect/Test/TestDialect.cpp    |   1 -
 mlir/test/lib/Dialect/Test/TestOpDefs.cpp     |   2 +-
 mlir/test/lib/Dialect/Test/TestOps.h          |  10 +-
 mlir/test/lib/Dialect/Test/TestOps.td         |  12 +-
 mlir/test/lib/Dialect/Test/TestOpsSyntax.cpp  |   2 +-
 mlir/test/lib/Dialect/Test/TestOpsSyntax.td   |   8 +-
 mlir/test/lib/Dialect/Test/TestTypeDefs.td    |   2 +-
 mlir/test/lib/Dialect/Test/TestTypes.h        |   4 +-
 mlir/test/mlir-pdll/CodeGen/CPP/general.pdll  |   2 +-
 mlir/test/mlir-tblgen/attrdefs.td             |   2 +-
 mlir/test/mlir-tblgen/constraint-unique.td    |  18 +--
 .../mlir-tblgen/interfaces-as-constraints.td  |   8 +-
 mlir/test/mlir-tblgen/op-attribute.td         |   4 +-
 mlir/test/mlir-tblgen/op-decl-and-defs.td     |  10 +-
 mlir/test/mlir-tblgen/predicate.td            |   6 +-
 .../mlir-tblgen/rewriter-static-matcher.td    |   6 +-
 mlir/test/mlir-tblgen/typedefs.td             |   2 +-
 mlir/test/python/python_test_ops.td           |   6 +-
 .../mlir-pdll-lsp-server.cpp                  |   2 +-
 .../mlir-src-sharder/mlir-src-sharder.cpp     |   2 +-
 mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp   |   6 +-
 .../tools/mlir-tblgen/AttrOrTypeFormatGen.cpp |   1 -
 mlir/tools/mlir-tblgen/DialectGen.cpp         |   6 +-
 mlir/tools/mlir-tblgen/FormatGen.h            |   1 -
 .../tools/mlir-tblgen/LLVMIRConversionGen.cpp |   1 -
 mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp   |  22 +--
 mlir/tools/mlir-tblgen/OpFormatGen.cpp        |   2 +-
 mlir/tools/mlir-tblgen/OpInterfacesGen.cpp    |   2 +-
 mlir/tools/mlir-tblgen/RewriterGen.cpp        |   4 +-
 mlir/tools/mlir-translate/mlir-translate.cpp  |   2 +-
 mlir/tools/mlir-vulkan-runner/VulkanRuntime.h |   2 +-
 .../tblgen-lsp-server/tblgen-lsp-server.cpp   |   2 +-
 mlir/unittests/Rewrite/PatternBenefit.cpp     |   4 +-
 314 files changed, 632 insertions(+), 814 deletions(-)
 rename {mlir/include/mlir => llvm/include/llvm}/Support/LogicalResult.h (70%)

diff --git a/flang/include/flang/Optimizer/CodeGen/FIROpPatterns.h b/flang/include/flang/Optimizer/CodeGen/FIROpPatterns.h
index ac095664f6188..91b2025176770 100644
--- a/flang/include/flang/Optimizer/CodeGen/FIROpPatterns.h
+++ b/flang/include/flang/Optimizer/CodeGen/FIROpPatterns.h
@@ -205,10 +205,10 @@ class FIROpConversion : public ConvertFIRToLLVMPattern {
     rewrite(mlir::cast<SourceOp>(op),
             OpAdaptor(operands, mlir::cast<SourceOp>(op)), rewriter);
   }
-  mlir::LogicalResult match(mlir::Operation *op) const final {
+  llvm::LogicalResult match(mlir::Operation *op) const final {
     return match(mlir::cast<SourceOp>(op));
   }
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(mlir::Operation *op, mlir::ArrayRef<mlir::Value> operands,
                   mlir::ConversionPatternRewriter &rewriter) const final {
     return matchAndRewrite(mlir::cast<SourceOp>(op),
@@ -218,14 +218,14 @@ class FIROpConversion : public ConvertFIRToLLVMPattern {
 
   /// Rewrite and Match methods that operate on the SourceOp type. These must be
   /// overridden by the derived pattern class.
-  virtual mlir::LogicalResult match(SourceOp op) const {
+  virtual llvm::LogicalResult match(SourceOp op) const {
     llvm_unreachable("must override match or matchAndRewrite");
   }
   virtual void rewrite(SourceOp op, OpAdaptor adaptor,
                        mlir::ConversionPatternRewriter &rewriter) const {
     llvm_unreachable("must override rewrite or matchAndRewrite");
   }
-  virtual mlir::LogicalResult
+  virtual llvm::LogicalResult
   matchAndRewrite(SourceOp op, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const {
     if (mlir::failed(match(op)))
@@ -246,14 +246,14 @@ class FIROpAndTypeConversion : public FIROpConversion<FromOp> {
   using FIROpConversion<FromOp>::FIROpConversion;
   using OpAdaptor = typename FromOp::Adaptor;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(FromOp op, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const final {
     mlir::Type ty = this->convertType(op.getType());
     return doRewrite(op, ty, adaptor, rewriter);
   }
 
-  virtual mlir::LogicalResult
+  virtual llvm::LogicalResult
   doRewrite(FromOp addr, mlir::Type ty, OpAdaptor adaptor,
             mlir::ConversionPatternRewriter &rewriter) const = 0;
 };
diff --git a/flang/include/flang/Optimizer/CodeGen/TypeConverter.h b/flang/include/flang/Optimizer/CodeGen/TypeConverter.h
index 58803a5cc4044..ece3e4e073f68 100644
--- a/flang/include/flang/Optimizer/CodeGen/TypeConverter.h
+++ b/flang/include/flang/Optimizer/CodeGen/TypeConverter.h
@@ -60,7 +60,7 @@ class LLVMTypeConverter : public mlir::LLVMTypeConverter {
   mlir::Type indexType() const;
 
   // fir.type<name(p : TY'...){f : TY...}>  -->  llvm<"%name = { ty... }">
-  std::optional<mlir::LogicalResult>
+  std::optional<llvm::LogicalResult>
   convertRecordType(fir::RecordType derived,
                     llvm::SmallVectorImpl<mlir::Type> &results);
 
diff --git a/flang/include/flang/Optimizer/Dialect/FirAliasTagOpInterface.h b/flang/include/flang/Optimizer/Dialect/FirAliasTagOpInterface.h
index f2d5b39acf3a7..1e3728e735145 100644
--- a/flang/include/flang/Optimizer/Dialect/FirAliasTagOpInterface.h
+++ b/flang/include/flang/Optimizer/Dialect/FirAliasTagOpInterface.h
@@ -16,10 +16,10 @@
 
 #include "mlir/IR/OpDefinition.h"
 #include "mlir/IR/Operation.h"
-#include "mlir/Support/LogicalResult.h"
+#include "llvm/Support/LogicalResult.h"
 
 namespace fir::detail {
-mlir::LogicalResult verifyFirAliasTagOpInterface(mlir::Operation *op);
+llvm::LogicalResult verifyFirAliasTagOpInterface(mlir::Operation *op);
 } // namespace fir::detail
 
 #include "flang/Optimizer/Dialect/FirAliasTagOpInterface.h.inc"
diff --git a/flang/include/flang/Optimizer/Dialect/FortranVariableInterface.td b/flang/include/flang/Optimizer/Dialect/FortranVariableInterface.td
index 3f78a93a2515e..926e00ca04340 100644
--- a/flang/include/flang/Optimizer/Dialect/FortranVariableInterface.td
+++ b/flang/include/flang/Optimizer/Dialect/FortranVariableInterface.td
@@ -192,7 +192,7 @@ def fir_FortranVariableOpInterface : OpInterface<"FortranVariableOpInterface"> {
     }
 
     /// Interface verifier imlementation for declare operations.
-    mlir::LogicalResult verifyDeclareLikeOpImpl(mlir::Value memRef);
+    llvm::LogicalResult verifyDeclareLikeOpImpl(mlir::Value memRef);
 
   }];
 
diff --git a/flang/include/flang/Optimizer/Dialect/Support/KindMapping.h b/flang/include/flang/Optimizer/Dialect/Support/KindMapping.h
index 138123b7b48ba..083526fcbac94 100644
--- a/flang/include/flang/Optimizer/Dialect/Support/KindMapping.h
+++ b/flang/include/flang/Optimizer/Dialect/Support/KindMapping.h
@@ -124,7 +124,7 @@ class KindMapping {
 private:
   MatchResult badMapString(const llvm::Twine &ptr);
   MatchResult parse(llvm::StringRef kindMap);
-  mlir::LogicalResult setDefaultKinds(llvm::ArrayRef<KindTy> defs);
+  llvm::LogicalResult setDefaultKinds(llvm::ArrayRef<KindTy> defs);
 
   mlir::MLIRContext *context;
   llvm::DenseMap<std::pair<char, KindTy>, Bitsize> intMap;
diff --git a/flang/include/flang/Optimizer/HLFIR/HLFIROps.td b/flang/include/flang/Optimizer/HLFIR/HLFIROps.td
index e9915e899c2c9..fdf0db9d3c75d 100644
--- a/flang/include/flang/Optimizer/HLFIR/HLFIROps.td
+++ b/flang/include/flang/Optimizer/HLFIR/HLFIROps.td
@@ -733,7 +733,7 @@ def hlfir_AssociateOp : hlfir_Op<"associate", [AttrSizedOperandSegments,
       CArg<"mlir::Value", "{}">:$shape, CArg<"mlir::ValueRange", "{}">:$typeparams,
       CArg<"fir::FortranVariableFlagsAttr", "{}">:$fortran_attrs)>,
     OpBuilder<(ins "mlir::Value":$memref, CArg<"mlir::Value", "{}">:$shape,
-      CArg<"mlir::ValueRange", "{}">:$typeparams, 
+      CArg<"mlir::ValueRange", "{}">:$typeparams,
       CArg<"fir::FortranVariableFlagsAttr", "{}">:$fortran_attrs,
       CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>];
 
@@ -1258,7 +1258,7 @@ def hlfir_OrderedAssignmentTreeOpInterface : OpInterface<"OrderedAssignmentTreeO
 
   let extraClassDeclaration = [{
     /// Interface verifier imlementation.
-    mlir::LogicalResult verifyImpl();
+    llvm::LogicalResult verifyImpl();
 
     mlir::Block* getSubTreeBlock() {
       mlir::Region* region = getSubTreeRegion();
@@ -1733,8 +1733,8 @@ def hlfir_CharExtremumOp : hlfir_Op<"char_extremum",
     [DeclareOpInterfaceMethods<MemoryEffectsOpInterface>]> {
   let summary = "Find max/min from given character strings";
   let description = [{
-    Find the lexicographical minimum or maximum of two or more character 
-    strings of the same character kind and return the string with the lexicographical 
+    Find the lexicographical minimum or maximum of two or more character
+    strings of the same character kind and return the string with the lexicographical
     minimum or maximum number of characters. Example:
 
     %0 = hlfir.char_extremum min, %arg0, %arg1 : (!fir.ref<!fir.char<1,10>>, !fir.ref<!fir.char<1,20>>) -> !hlfir.expr<!fir.char<1,10>>
diff --git a/flang/lib/Optimizer/CodeGen/CodeGen.cpp b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
index 5f35825783c51..7483acfcd1ca7 100644
--- a/flang/lib/Optimizer/CodeGen/CodeGen.cpp
+++ b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
@@ -113,7 +113,7 @@ namespace {
 struct AddrOfOpConversion : public fir::FIROpConversion<fir::AddrOfOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::AddrOfOp addr, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     auto ty = convertType(addr.getType());
@@ -174,7 +174,7 @@ namespace {
 struct DeclareOpConversion : public fir::FIROpConversion<fir::cg::XDeclareOp> {
 public:
   using FIROpConversion::FIROpConversion;
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::cg::XDeclareOp declareOp, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     auto memRef = adaptor.getOperands()[0];
@@ -197,7 +197,7 @@ namespace {
 struct AllocaOpConversion : public fir::FIROpConversion<fir::AllocaOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::AllocaOp alloc, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::ValueRange operands = adaptor.getOperands();
@@ -294,7 +294,7 @@ namespace {
 struct BoxAddrOpConversion : public fir::FIROpConversion<fir::BoxAddrOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::BoxAddrOp boxaddr, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Value a = adaptor.getOperands()[0];
@@ -316,7 +316,7 @@ struct BoxAddrOpConversion : public fir::FIROpConversion<fir::BoxAddrOp> {
 struct BoxCharLenOpConversion : public fir::FIROpConversion<fir::BoxCharLenOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::BoxCharLenOp boxCharLen, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Value boxChar = adaptor.getOperands()[0];
@@ -339,7 +339,7 @@ struct BoxCharLenOpConversion : public fir::FIROpConversion<fir::BoxCharLenOp> {
 struct BoxDimsOpConversion : public fir::FIROpConversion<fir::BoxDimsOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::BoxDimsOp boxdims, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     llvm::SmallVector<mlir::Type, 3> resultTypes = {
@@ -361,7 +361,7 @@ struct BoxDimsOpConversion : public fir::FIROpConversion<fir::BoxDimsOp> {
 struct BoxEleSizeOpConversion : public fir::FIROpConversion<fir::BoxEleSizeOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::BoxEleSizeOp boxelesz, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Value box = adaptor.getOperands()[0];
@@ -379,7 +379,7 @@ struct BoxEleSizeOpConversion : public fir::FIROpConversion<fir::BoxEleSizeOp> {
 struct BoxIsAllocOpConversion : public fir::FIROpConversion<fir::BoxIsAllocOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::BoxIsAllocOp boxisalloc, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Value box = adaptor.getOperands()[0];
@@ -397,7 +397,7 @@ struct BoxIsAllocOpConversion : public fir::FIROpConversion<fir::BoxIsAllocOp> {
 struct BoxIsArrayOpConversion : public fir::FIROpConversion<fir::BoxIsArrayOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::BoxIsArrayOp boxisarray, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Value a = adaptor.getOperands()[0];
@@ -416,7 +416,7 @@ struct BoxIsArrayOpConversion : public fir::FIROpConversion<fir::BoxIsArrayOp> {
 struct BoxIsPtrOpConversion : public fir::FIROpConversion<fir::BoxIsPtrOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::BoxIsPtrOp boxisptr, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Value box = adaptor.getOperands()[0];
@@ -434,7 +434,7 @@ struct BoxIsPtrOpConversion : public fir::FIROpConversion<fir::BoxIsPtrOp> {
 struct BoxRankOpConversion : public fir::FIROpConversion<fir::BoxRankOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::BoxRankOp boxrank, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Value a = adaptor.getOperands()[0];
@@ -456,7 +456,7 @@ struct BoxProcHostOpConversion
     : public fir::FIROpConversion<fir::BoxProcHostOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::BoxProcHostOp boxprochost, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     TODO(boxprochost.getLoc(), "fir.boxproc_host codegen");
@@ -470,7 +470,7 @@ struct BoxTypeDescOpConversion
     : public fir::FIROpConversion<fir::BoxTypeDescOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::BoxTypeDescOp boxtypedesc, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Value box = adaptor.getOperands()[0];
@@ -488,7 +488,7 @@ struct BoxTypeCodeOpConversion
     : public fir::FIROpConversion<fir::BoxTypeCodeOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::BoxTypeCodeOp op, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Value box = adaptor.getOperands()[0];
@@ -506,7 +506,7 @@ struct BoxTypeCodeOpConversion
 struct StringLitOpConversion : public fir::FIROpConversion<fir::StringLitOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::StringLitOp constop, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     auto ty = convertType(constop.getType());
@@ -547,7 +547,7 @@ struct StringLitOpConversion : public fir::FIROpConversion<fir::StringLitOp> {
 struct CallOpConversion : public fir::FIROpConversion<fir::CallOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::CallOp call, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     llvm::SmallVector<mlir::Type> resultTys;
@@ -578,7 +578,7 @@ namespace {
 struct CmpcOpConversion : public fir::FIROpConversion<fir::CmpcOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::CmpcOp cmp, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::ValueRange operands = adaptor.getOperands();
@@ -616,7 +616,7 @@ struct CmpcOpConversion : public fir::FIROpConversion<fir::CmpcOp> {
 struct ConstcOpConversion : public fir::FIROpConversion<fir::ConstcOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::ConstcOp conc, OpAdaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Location loc = conc.getLoc();
@@ -647,7 +647,7 @@ struct ConvertOpConversion : public fir::FIROpConversion<fir::ConvertOp> {
     return mlir::isa<mlir::FloatType>(ty);
   }
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::ConvertOp convert, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     auto fromFirTy = convert.getValue().getType();
@@ -814,7 +814,7 @@ struct ConvertOpConversion : public fir::FIROpConversion<fir::ConvertOp> {
 struct TypeInfoOpConversion : public fir::FIROpConversion<fir::TypeInfoOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::TypeInfoOp op, OpAdaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     rewriter.eraseOp(op);
@@ -827,7 +827,7 @@ struct TypeInfoOpConversion : public fir::FIROpConversion<fir::TypeInfoOp> {
 struct DTEntryOpConversion : public fir::FIROpConversion<fir::DTEntryOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::DTEntryOp op, OpAdaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     rewriter.eraseOp(op);
@@ -839,7 +839,7 @@ struct DTEntryOpConversion : public fir::FIROpConversion<fir::DTEntryOp> {
 struct GlobalLenOpConversion : public fir::FIROpConversion<fir::GlobalLenOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::GlobalLenOp globalLen, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     TODO(globalLen.getLoc(), "fir.global_len codegen");
@@ -853,7 +853,7 @@ struct LenParamIndexOpConversion
   using FIROpConversion::FIROpConversion;
 
   // FIXME: this should be specialized by the runtime target
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::LenParamIndexOp lenp, OpAdaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     TODO(lenp.getLoc(), "fir.len_param_index codegen");
@@ -867,7 +867,7 @@ struct LenParamIndexOpConversion
 struct EmboxCharOpConversion : public fir::FIROpConversion<fir::EmboxCharOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::EmboxCharOp emboxChar, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::ValueRange operands = adaptor.getOperands();
@@ -960,7 +960,7 @@ namespace {
 struct AllocMemOpConversion : public fir::FIROpConversion<fir::AllocMemOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::AllocMemOp heap, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Type heapTy = heap.getType();
@@ -1030,7 +1030,7 @@ namespace {
 struct FreeMemOpConversion : public fir::FIROpConversion<fir::FreeMemOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::FreeMemOp freemem, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Location loc = freemem.getLoc();
@@ -1481,7 +1481,7 @@ computeTripletExtent(mlir::ConversionPatternRewriter &rewriter,
 struct EmboxOpConversion : public EmboxCommonConversion<fir::EmboxOp> {
   using EmboxCommonConversion::EmboxCommonConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::EmboxOp embox, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::ValueRange operands = adaptor.getOperands();
@@ -1513,7 +1513,7 @@ struct EmboxOpConversion : public EmboxCommonConversion<fir::EmboxOp> {
 struct XEmboxOpConversion : public EmboxCommonConversion<fir::cg::XEmboxOp> {
   using EmboxCommonConversion::EmboxCommonConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::cg::XEmboxOp xbox, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::ValueRange operands = adaptor.getOperands();
@@ -1711,7 +1711,7 @@ struct XEmboxOpConversion : public EmboxCommonConversion<fir::cg::XEmboxOp> {
 struct XReboxOpConversion : public EmboxCommonConversion<fir::cg::XReboxOp> {
   using EmboxCommonConversion::EmboxCommonConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::cg::XReboxOp rebox, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Location loc = rebox.getLoc();
@@ -1794,7 +1794,7 @@ struct XReboxOpConversion : public EmboxCommonConversion<fir::cg::XReboxOp> {
 private:
   /// Write resulting shape and base address in descriptor, and replace rebox
   /// op.
-  mlir::LogicalResult
+  llvm::LogicalResult
   finalizeRebox(fir::cg::XReboxOp rebox, mlir::Type destBoxTy, mlir::Value dest,
                 mlir::Value base, mlir::ValueRange lbounds,
                 mlir::ValueRange extents, mlir::ValueRange strides,
@@ -1825,7 +1825,7 @@ struct XReboxOpConversion : public EmboxCommonConversion<fir::cg::XReboxOp> {
   }
 
   // Apply slice given the base address, extents and strides of the input box.
-  mlir::LogicalResult
+  llvm::LogicalResult
   sliceBox(fir::cg::XReboxOp rebox, mlir::Type destBoxTy, mlir::Value dest,
            mlir::Value base, mlir::ValueRange inputExtents,
            mlir::ValueRange inputStrides, mlir::ValueRange operands,
@@ -1908,7 +1908,7 @@ struct XReboxOpConversion : public EmboxCommonConversion<fir::cg::XReboxOp> {
 
   /// Apply a new shape to the data described by a box given the base address,
   /// extents and strides of the box.
-  mlir::LogicalResult
+  llvm::LogicalResult
   reshapeBox(fir::cg::XReboxOp rebox, mlir::Type destBoxTy, mlir::Value dest,
              mlir::Value base, mlir::ValueRange inputExtents,
              mlir::ValueRange inputStrides, mlir::ValueRange operands,
@@ -1960,7 +1960,7 @@ struct XReboxOpConversion : public EmboxCommonConversion<fir::cg::XReboxOp> {
 struct EmboxProcOpConversion : public fir::FIROpConversion<fir::EmboxProcOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::EmboxProcOp emboxproc, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     TODO(emboxproc.getLoc(), "fir.emboxproc codegen");
@@ -2027,7 +2027,7 @@ struct ExtractValueOpConversion
       public ValueOpCommon {
   using FIROpAndTypeConversion::FIROpAndTypeConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   doRewrite(fir::ExtractValueOp extractVal, mlir::Type ty, OpAdaptor adaptor,
             mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::ValueRange operands = adaptor.getOperands();
@@ -2046,7 +2046,7 @@ struct InsertValueOpConversion
       public ValueOpCommon {
   using FIROpAndTypeConversion::FIROpAndTypeConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   doRewrite(fir::InsertValueOp insertVal, mlir::Type ty, OpAdaptor adaptor,
             mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::ValueRange operands = adaptor.getOperands();
@@ -2074,7 +2074,7 @@ struct InsertOnRangeOpConversion
     }
   }
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   doRewrite(fir::InsertOnRangeOp range, mlir::Type ty, OpAdaptor adaptor,
             mlir::ConversionPatternRewriter &rewriter) const override {
 
@@ -2127,7 +2127,7 @@ struct XArrayCoorOpConversion
     : public fir::FIROpAndTypeConversion<fir::cg::XArrayCoorOp> {
   using FIROpAndTypeConversion::FIROpAndTypeConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   doRewrite(fir::cg::XArrayCoorOp coor, mlir::Type llvmPtrTy, OpAdaptor adaptor,
             mlir::ConversionPatternRewriter &rewriter) const override {
     auto loc = coor.getLoc();
@@ -2296,7 +2296,7 @@ struct CoordinateOpConversion
     : public fir::FIROpAndTypeConversion<fir::CoordinateOp> {
   using FIROpAndTypeConversion::FIROpAndTypeConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   doRewrite(fir::CoordinateOp coor, mlir::Type ty, OpAdaptor adaptor,
             mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::ValueRange operands = adaptor.getOperands();
@@ -2396,7 +2396,7 @@ struct CoordinateOpConversion
   }
 
 private:
-  mlir::LogicalResult
+  llvm::LogicalResult
   doRewriteBox(fir::CoordinateOp coor, mlir::ValueRange operands,
                mlir::Location loc,
                mlir::ConversionPatternRewriter &rewriter) const {
@@ -2482,7 +2482,7 @@ struct CoordinateOpConversion
     return mlir::success();
   }
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   doRewriteRefOrPtr(fir::CoordinateOp coor, mlir::Type llvmObjectTy,
                     mlir::ValueRange operands, mlir::Location loc,
                     mlir::ConversionPatternRewriter &rewriter) const {
@@ -2593,7 +2593,7 @@ struct FieldIndexOpConversion : public fir::FIROpConversion<fir::FieldIndexOp> {
   using FIROpConversion::FIROpConversion;
 
   // NB: most field references should be resolved by this point
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::FieldIndexOp field, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     auto recTy = mlir::cast<fir::RecordType>(field.getOnType());
@@ -2633,7 +2633,7 @@ struct FieldIndexOpConversion : public fir::FIROpConversion<fir::FieldIndexOp> {
 struct FirEndOpConversion : public fir::FIROpConversion<fir::FirEndOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::FirEndOp firEnd, OpAdaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     TODO(firEnd.getLoc(), "fir.end codegen");
@@ -2645,7 +2645,7 @@ struct FirEndOpConversion : public fir::FIROpConversion<fir::FirEndOp> {
 struct TypeDescOpConversion : public fir::FIROpConversion<fir::TypeDescOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::TypeDescOp typeDescOp, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Type inTy = typeDescOp.getInType();
@@ -2672,7 +2672,7 @@ struct TypeDescOpConversion : public fir::FIROpConversion<fir::TypeDescOp> {
 struct HasValueOpConversion : public fir::FIROpConversion<fir::HasValueOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::HasValueOp op, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     rewriter.replaceOpWithNewOp<mlir::LLVM::ReturnOp>(op,
@@ -2725,7 +2725,7 @@ static inline bool attributeTypeIsCompatible(mlir::MLIRContext *ctx,
 struct GlobalOpConversion : public fir::FIROpConversion<fir::GlobalOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::GlobalOp global, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
 
@@ -2867,7 +2867,7 @@ struct GlobalOpConversion : public fir::FIROpConversion<fir::GlobalOp> {
 struct LoadOpConversion : public fir::FIROpConversion<fir::LoadOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::LoadOp load, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Type llvmLoadTy = convertObjectType(load.getType());
@@ -2925,7 +2925,7 @@ struct LoadOpConversion : public fir::FIROpConversion<fir::LoadOp> {
 struct NoReassocOpConversion : public fir::FIROpConversion<fir::NoReassocOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::NoReassocOp noreassoc, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     rewriter.replaceOp(noreassoc, adaptor.getOperands()[0]);
@@ -2986,7 +2986,7 @@ static void genCaseLadderStep(mlir::Location loc, mlir::Value cmp,
 struct SelectCaseOpConversion : public fir::FIROpConversion<fir::SelectCaseOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::SelectCaseOp caseOp, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     unsigned conds = caseOp.getNumConditions();
@@ -3101,7 +3101,7 @@ static void selectMatchAndRewrite(const fir::LLVMTypeConverter &lowering,
 struct SelectOpConversion : public fir::FIROpConversion<fir::SelectOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::SelectOp op, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     selectMatchAndRewrite<fir::SelectOp>(lowerTy(), op, adaptor, rewriter);
@@ -3113,7 +3113,7 @@ struct SelectOpConversion : public fir::FIROpConversion<fir::SelectOp> {
 struct SelectRankOpConversion : public fir::FIROpConversion<fir::SelectRankOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::SelectRankOp op, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     selectMatchAndRewrite<fir::SelectRankOp>(lowerTy(), op, adaptor, rewriter);
@@ -3125,7 +3125,7 @@ struct SelectRankOpConversion : public fir::FIROpConversion<fir::SelectRankOp> {
 struct SelectTypeOpConversion : public fir::FIROpConversion<fir::SelectTypeOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::SelectTypeOp select, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::emitError(select.getLoc(),
@@ -3138,7 +3138,7 @@ struct SelectTypeOpConversion : public fir::FIROpConversion<fir::SelectTypeOp> {
 struct StoreOpConversion : public fir::FIROpConversion<fir::StoreOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::StoreOp store, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Location loc = store.getLoc();
@@ -3181,7 +3181,7 @@ namespace {
 struct UnboxCharOpConversion : public fir::FIROpConversion<fir::UnboxCharOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::UnboxCharOp unboxchar, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Type lenTy = convertType(unboxchar.getType(1));
@@ -3206,7 +3206,7 @@ struct UnboxCharOpConversion : public fir::FIROpConversion<fir::UnboxCharOp> {
 struct UnboxProcOpConversion : public fir::FIROpConversion<fir::UnboxProcOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::UnboxProcOp unboxproc, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     TODO(unboxproc.getLoc(), "fir.unboxproc codegen");
@@ -3218,7 +3218,7 @@ struct UnboxProcOpConversion : public fir::FIROpConversion<fir::UnboxProcOp> {
 struct UndefOpConversion : public fir::FIROpConversion<fir::UndefOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::UndefOp undef, OpAdaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     rewriter.replaceOpWithNewOp<mlir::LLVM::UndefOp>(
@@ -3230,7 +3230,7 @@ struct UndefOpConversion : public fir::FIROpConversion<fir::UndefOp> {
 struct ZeroOpConversion : public fir::FIROpConversion<fir::ZeroOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::ZeroOp zero, OpAdaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Type ty = convertType(zero.getType());
@@ -3244,7 +3244,7 @@ struct UnreachableOpConversion
     : public fir::FIROpConversion<fir::UnreachableOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::UnreachableOp unreach, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     rewriter.replaceOpWithNewOp<mlir::LLVM::UnreachableOp>(unreach);
@@ -3261,7 +3261,7 @@ struct UnreachableOpConversion
 struct IsPresentOpConversion : public fir::FIROpConversion<fir::IsPresentOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::IsPresentOp isPresent, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Type idxTy = lowerTy().indexType();
@@ -3290,7 +3290,7 @@ struct IsPresentOpConversion : public fir::FIROpConversion<fir::IsPresentOp> {
 struct AbsentOpConversion : public fir::FIROpConversion<fir::AbsentOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::AbsentOp absent, OpAdaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Type ty = convertType(absent.getType());
@@ -3350,7 +3350,7 @@ namespace {
 struct AddcOpConversion : public fir::FIROpConversion<fir::AddcOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::AddcOp addc, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     // given: (x + iy) + (x' + iy')
@@ -3365,7 +3365,7 @@ struct AddcOpConversion : public fir::FIROpConversion<fir::AddcOp> {
 struct SubcOpConversion : public fir::FIROpConversion<fir::SubcOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::SubcOp subc, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     // given: (x + iy) - (x' + iy')
@@ -3381,7 +3381,7 @@ struct SubcOpConversion : public fir::FIROpConversion<fir::SubcOp> {
 struct MulcOpConversion : public fir::FIROpConversion<fir::MulcOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::MulcOp mulc, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     // TODO: Can we use a call to __muldc3 ?
@@ -3415,7 +3415,7 @@ struct MulcOpConversion : public fir::FIROpConversion<fir::MulcOp> {
 struct DivcOpConversion : public fir::FIROpConversion<fir::DivcOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::DivcOp divc, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     // TODO: Can we use a call to __divdc3 instead?
@@ -3455,7 +3455,7 @@ struct DivcOpConversion : public fir::FIROpConversion<fir::DivcOp> {
 struct NegcOpConversion : public fir::FIROpConversion<fir::NegcOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::NegcOp neg, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     // given: -(x + iy)
@@ -3476,7 +3476,7 @@ struct NegcOpConversion : public fir::FIROpConversion<fir::NegcOp> {
 struct BoxOffsetOpConversion : public fir::FIROpConversion<fir::BoxOffsetOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::BoxOffsetOp boxOffset, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
 
@@ -3505,7 +3505,7 @@ struct MustBeDeadConversion : public fir::FIROpConversion<FromOp> {
       : fir::FIROpConversion<FromOp>(lowering, options) {}
   using OpAdaptor = typename FromOp::Adaptor;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(FromOp op, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const final {
     if (!op->getUses().empty())
@@ -3519,7 +3519,7 @@ struct UnrealizedConversionCastOpConversion
     : public fir::FIROpConversion<mlir::UnrealizedConversionCastOp> {
   using FIROpConversion::FIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(mlir::UnrealizedConversionCastOp op, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     assert(op.getOutputs().getTypes().size() == 1 && "expect a single type");
@@ -3562,7 +3562,7 @@ class RenameMSVCLibmCallees
 public:
   using OpRewritePattern::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(mlir::LLVM::CallOp op,
                   mlir::PatternRewriter &rewriter) const override {
     rewriter.startOpModification(op);
@@ -3581,7 +3581,7 @@ class RenameMSVCLibmFuncs
 public:
   using OpRewritePattern::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(mlir::LLVM::LLVMFuncOp op,
                   mlir::PatternRewriter &rewriter) const override {
     rewriter.startOpModification(op);
diff --git a/flang/lib/Optimizer/CodeGen/CodeGenOpenMP.cpp b/flang/lib/Optimizer/CodeGen/CodeGenOpenMP.cpp
index a6fa05fe06542..48d6c000ee44a 100644
--- a/flang/lib/Optimizer/CodeGen/CodeGenOpenMP.cpp
+++ b/flang/lib/Optimizer/CodeGen/CodeGenOpenMP.cpp
@@ -59,7 +59,7 @@ struct MapInfoOpConversion
     : public OpenMPFIROpConversion<mlir::omp::MapInfoOp> {
   using OpenMPFIROpConversion::OpenMPFIROpConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(mlir::omp::MapInfoOp curOp, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     const mlir::TypeConverter *converter = getTypeConverter();
diff --git a/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp b/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
index 6a0cd5ef4b34e..c57f5140c29eb 100644
--- a/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
+++ b/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
@@ -80,7 +80,7 @@ class EmboxConversion : public mlir::OpRewritePattern<fir::EmboxOp> {
 public:
   using OpRewritePattern::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::EmboxOp embox,
                   mlir::PatternRewriter &rewriter) const override {
     // If the embox does not include a shape, then do not convert it
@@ -95,7 +95,7 @@ class EmboxConversion : public mlir::OpRewritePattern<fir::EmboxOp> {
     return mlir::failure();
   }
 
-  mlir::LogicalResult rewriteStaticShape(fir::EmboxOp embox,
+  llvm::LogicalResult rewriteStaticShape(fir::EmboxOp embox,
                                          mlir::PatternRewriter &rewriter,
                                          fir::SequenceType seqTy) const {
     auto loc = embox.getLoc();
@@ -115,7 +115,7 @@ class EmboxConversion : public mlir::OpRewritePattern<fir::EmboxOp> {
     return mlir::success();
   }
 
-  mlir::LogicalResult rewriteDynamicShape(fir::EmboxOp embox,
+  llvm::LogicalResult rewriteDynamicShape(fir::EmboxOp embox,
                                           mlir::PatternRewriter &rewriter,
                                           mlir::Value shapeVal) const {
     auto loc = embox.getLoc();
@@ -168,7 +168,7 @@ class ReboxConversion : public mlir::OpRewritePattern<fir::ReboxOp> {
 public:
   using OpRewritePattern::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::ReboxOp rebox,
                   mlir::PatternRewriter &rewriter) const override {
     auto loc = rebox.getLoc();
@@ -227,7 +227,7 @@ class ArrayCoorConversion : public mlir::OpRewritePattern<fir::ArrayCoorOp> {
 public:
   using OpRewritePattern::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::ArrayCoorOp arrCoor,
                   mlir::PatternRewriter &rewriter) const override {
     auto loc = arrCoor.getLoc();
@@ -277,7 +277,7 @@ class DeclareOpConversion : public mlir::OpRewritePattern<fir::DeclareOp> {
   DeclareOpConversion(mlir::MLIRContext *ctx, bool preserveDecl)
       : OpRewritePattern(ctx), preserveDeclare(preserveDecl) {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::DeclareOp declareOp,
                   mlir::PatternRewriter &rewriter) const override {
     if (!preserveDeclare) {
@@ -316,7 +316,7 @@ class DummyScopeOpConversion
 public:
   using OpRewritePattern::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::DummyScopeOp dummyScopeOp,
                   mlir::PatternRewriter &rewriter) const override {
     rewriter.replaceOpWithNewOp<fir::UndefOp>(dummyScopeOp,
diff --git a/flang/lib/Optimizer/CodeGen/TargetRewrite.cpp b/flang/lib/Optimizer/CodeGen/TargetRewrite.cpp
index 8199c5ef7fa26..561d700f41220 100644
--- a/flang/lib/Optimizer/CodeGen/TargetRewrite.cpp
+++ b/flang/lib/Optimizer/CodeGen/TargetRewrite.cpp
@@ -667,7 +667,7 @@ class TargetRewrite : public fir::impl::TargetRewritePassBase<TargetRewrite> {
   /// Convert the type signatures on all the functions present in the module.
   /// As the type signature is being changed, this must also update the
   /// function itself to use any new arguments, etc.
-  mlir::LogicalResult convertTypes(mlir::ModuleOp mod) {
+  llvm::LogicalResult convertTypes(mlir::ModuleOp mod) {
     mlir::MLIRContext *ctx = mod->getContext();
     auto targetCPU = specifics->getTargetCPU();
     mlir::StringAttr targetCPUAttr =
diff --git a/flang/lib/Optimizer/CodeGen/TypeConverter.cpp b/flang/lib/Optimizer/CodeGen/TypeConverter.cpp
index 501a36f5b68ba..ce86c625e082f 100644
--- a/flang/lib/Optimizer/CodeGen/TypeConverter.cpp
+++ b/flang/lib/Optimizer/CodeGen/TypeConverter.cpp
@@ -170,7 +170,7 @@ mlir::Type LLVMTypeConverter::indexType() const {
 }
 
 // fir.type<name(p : TY'...){f : TY...}>  -->  llvm<"%name = { ty... }">
-std::optional<mlir::LogicalResult> LLVMTypeConverter::convertRecordType(
+std::optional<llvm::LogicalResult> LLVMTypeConverter::convertRecordType(
     fir::RecordType derived, llvm::SmallVectorImpl<mlir::Type> &results) {
   auto name = fir::NameUniquer::dropTypeConversionMarkers(derived.getName());
   auto st = mlir::LLVM::LLVMStructType::getIdentified(&getContext(), name);
diff --git a/flang/lib/Optimizer/Dialect/CUF/CUFOps.cpp b/flang/lib/Optimizer/Dialect/CUF/CUFOps.cpp
index 4fa1d3986b219..53092bed5720b 100644
--- a/flang/lib/Optimizer/Dialect/CUF/CUFOps.cpp
+++ b/flang/lib/Optimizer/Dialect/CUF/CUFOps.cpp
@@ -51,7 +51,7 @@ void cuf::AllocOp::build(mlir::OpBuilder &builder, mlir::OperationState &result,
 }
 
 template <typename Op>
-static mlir::LogicalResult checkCudaAttr(Op op) {
+static llvm::LogicalResult checkCudaAttr(Op op) {
   if (op.getDataAttr() == cuf::DataAttribute::Device ||
       op.getDataAttr() == cuf::DataAttribute::Managed ||
       op.getDataAttr() == cuf::DataAttribute::Unified)
@@ -59,19 +59,19 @@ static mlir::LogicalResult checkCudaAttr(Op op) {
   return op.emitOpError("expect device, managed or unified cuda attribute");
 }
 
-mlir::LogicalResult cuf::AllocOp::verify() { return checkCudaAttr(*this); }
+llvm::LogicalResult cuf::AllocOp::verify() { return checkCudaAttr(*this); }
 
 //===----------------------------------------------------------------------===//
 // FreeOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult cuf::FreeOp::verify() { return checkCudaAttr(*this); }
+llvm::LogicalResult cuf::FreeOp::verify() { return checkCudaAttr(*this); }
 
 //===----------------------------------------------------------------------===//
 // AllocateOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult cuf::AllocateOp::verify() {
+llvm::LogicalResult cuf::AllocateOp::verify() {
   if (getPinned() && getStream())
     return emitOpError("pinned and stream cannot appears at the same time");
   if (!mlir::isa<fir::BaseBoxType>(fir::unwrapRefType(getBox().getType())))
@@ -94,7 +94,7 @@ mlir::LogicalResult cuf::AllocateOp::verify() {
 // DataTransferOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult cuf::DataTransferOp::verify() {
+llvm::LogicalResult cuf::DataTransferOp::verify() {
   mlir::Type srcTy = getSrc().getType();
   mlir::Type dstTy = getDst().getType();
   if ((fir::isa_ref_type(srcTy) && fir::isa_ref_type(dstTy)) ||
@@ -114,7 +114,7 @@ mlir::LogicalResult cuf::DataTransferOp::verify() {
 // DeallocateOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult cuf::DeallocateOp::verify() {
+llvm::LogicalResult cuf::DeallocateOp::verify() {
   if (!mlir::isa<fir::BaseBoxType>(fir::unwrapRefType(getBox().getType())))
     return emitOpError(
         "expect box to be a reference to class or box type value");
@@ -225,7 +225,7 @@ void printCUFKernelLoopControl(
   p.printRegion(region, /*printEntryBlockArgs=*/false);
 }
 
-mlir::LogicalResult cuf::KernelOp::verify() {
+llvm::LogicalResult cuf::KernelOp::verify() {
   if (getLowerbound().size() != getUpperbound().size() ||
       getLowerbound().size() != getStep().size())
     return emitOpError(
diff --git a/flang/lib/Optimizer/Dialect/FIROps.cpp b/flang/lib/Optimizer/Dialect/FIROps.cpp
index 84711c5406581..fd3aa2ab6103a 100644
--- a/flang/lib/Optimizer/Dialect/FIROps.cpp
+++ b/flang/lib/Optimizer/Dialect/FIROps.cpp
@@ -263,7 +263,7 @@ void fir::AllocaOp::print(mlir::OpAsmPrinter &p) {
   printAllocatableOp(p, *this);
 }
 
-mlir::LogicalResult fir::AllocaOp::verify() {
+llvm::LogicalResult fir::AllocaOp::verify() {
   llvm::SmallVector<llvm::StringRef> visited;
   if (verifyInType(getInType(), visited, numShapeOperands()))
     return emitOpError("invalid type for allocation");
@@ -339,7 +339,7 @@ void fir::AllocMemOp::print(mlir::OpAsmPrinter &p) {
   printAllocatableOp(p, *this);
 }
 
-mlir::LogicalResult fir::AllocMemOp::verify() {
+llvm::LogicalResult fir::AllocMemOp::verify() {
   llvm::SmallVector<llvm::StringRef> visited;
   if (verifyInType(getInType(), visited, numShapeOperands()))
     return emitOpError("invalid type for allocation");
@@ -375,7 +375,7 @@ static bool validTypeParams(mlir::Type dynTy, mlir::ValueRange typeParams) {
   return typeParams.size() == 0;
 }
 
-mlir::LogicalResult fir::ArrayCoorOp::verify() {
+llvm::LogicalResult fir::ArrayCoorOp::verify() {
   auto eleTy = fir::dyn_cast_ptrOrBoxEleTy(getMemref().getType());
   auto arrTy = mlir::dyn_cast<fir::SequenceType>(eleTy);
   if (!arrTy)
@@ -424,7 +424,7 @@ mlir::LogicalResult fir::ArrayCoorOp::verify() {
 // Pull in fir.embox and fir.rebox into fir.array_coor when possible.
 struct SimplifyArrayCoorOp : public mlir::OpRewritePattern<fir::ArrayCoorOp> {
   using mlir::OpRewritePattern<fir::ArrayCoorOp>::OpRewritePattern;
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::ArrayCoorOp op,
                   mlir::PatternRewriter &rewriter) const override {
     mlir::Value memref = op.getMemref();
@@ -821,7 +821,7 @@ std::vector<mlir::Value> fir::ArrayLoadOp::getExtents() {
   return {};
 }
 
-mlir::LogicalResult fir::ArrayLoadOp::verify() {
+llvm::LogicalResult fir::ArrayLoadOp::verify() {
   auto eleTy = fir::dyn_cast_ptrOrBoxEleTy(getMemref().getType());
   auto arrTy = mlir::dyn_cast<fir::SequenceType>(eleTy);
   if (!arrTy)
@@ -864,7 +864,7 @@ mlir::LogicalResult fir::ArrayLoadOp::verify() {
 // ArrayMergeStoreOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::ArrayMergeStoreOp::verify() {
+llvm::LogicalResult fir::ArrayMergeStoreOp::verify() {
   if (!mlir::isa<fir::ArrayLoadOp>(getOriginal().getDefiningOp()))
     return emitOpError("operand #0 must be result of a fir.array_load op");
   if (auto sl = getSlice()) {
@@ -914,7 +914,7 @@ mlir::Type validArraySubobject(A op) {
   return fir::applyPathToType(ty, op.getIndices());
 }
 
-mlir::LogicalResult fir::ArrayFetchOp::verify() {
+llvm::LogicalResult fir::ArrayFetchOp::verify() {
   auto arrTy = mlir::cast<fir::SequenceType>(getSequence().getType());
   auto indSize = getIndices().size();
   if (indSize < arrTy.getDimension())
@@ -936,7 +936,7 @@ mlir::LogicalResult fir::ArrayFetchOp::verify() {
 // ArrayAccessOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::ArrayAccessOp::verify() {
+llvm::LogicalResult fir::ArrayAccessOp::verify() {
   auto arrTy = mlir::cast<fir::SequenceType>(getSequence().getType());
   std::size_t indSize = getIndices().size();
   if (indSize < arrTy.getDimension())
@@ -956,7 +956,7 @@ mlir::LogicalResult fir::ArrayAccessOp::verify() {
 // ArrayUpdateOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::ArrayUpdateOp::verify() {
+llvm::LogicalResult fir::ArrayUpdateOp::verify() {
   if (fir::isa_ref_type(getMerge().getType()))
     return emitOpError("does not support reference type for merge");
   auto arrTy = mlir::cast<fir::SequenceType>(getSequence().getType());
@@ -978,7 +978,7 @@ mlir::LogicalResult fir::ArrayUpdateOp::verify() {
 // ArrayModifyOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::ArrayModifyOp::verify() {
+llvm::LogicalResult fir::ArrayModifyOp::verify() {
   auto arrTy = mlir::cast<fir::SequenceType>(getSequence().getType());
   auto indSize = getIndices().size();
   if (indSize < arrTy.getDimension())
@@ -1171,7 +1171,7 @@ void fir::CallOp::build(mlir::OpBuilder &builder, mlir::OperationState &result,
 // CharConvertOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::CharConvertOp::verify() {
+llvm::LogicalResult fir::CharConvertOp::verify() {
   auto unwrap = [&](mlir::Type t) {
     t = fir::unwrapSequenceType(fir::dyn_cast_ptrEleTy(t));
     return mlir::dyn_cast<fir::CharacterType>(t);
@@ -1294,7 +1294,7 @@ void fir::ConstcOp::print(mlir::OpAsmPrinter &p) {
   p.printType(getType());
 }
 
-mlir::LogicalResult fir::ConstcOp::verify() {
+llvm::LogicalResult fir::ConstcOp::verify() {
   if (!mlir::isa<fir::ComplexType>(getType()))
     return emitOpError("must be a !fir.complex type");
   return mlir::success();
@@ -1427,7 +1427,7 @@ bool fir::ConvertOp::canBeConverted(mlir::Type inType, mlir::Type outType) {
          areVectorsCompatible(inType, outType);
 }
 
-mlir::LogicalResult fir::ConvertOp::verify() {
+llvm::LogicalResult fir::ConvertOp::verify() {
   if (canBeConverted(getValue().getType(), getType()))
     return mlir::success();
   return emitOpError("invalid type conversion")
@@ -1468,7 +1468,7 @@ mlir::ParseResult fir::CoordinateOp::parse(mlir::OpAsmParser &parser,
   return mlir::success();
 }
 
-mlir::LogicalResult fir::CoordinateOp::verify() {
+llvm::LogicalResult fir::CoordinateOp::verify() {
   const mlir::Type refTy = getRef().getType();
   if (fir::isa_ref_type(refTy)) {
     auto eleTy = fir::dyn_cast_ptrEleTy(refTy);
@@ -1551,7 +1551,7 @@ mlir::LogicalResult fir::CoordinateOp::verify() {
 // DispatchOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::DispatchOp::verify() {
+llvm::LogicalResult fir::DispatchOp::verify() {
   // Check that pass_arg_pos is in range of actual operands. pass_arg_pos is
   // unsigned so check for less than zero is not needed.
   if (getPassArgPos() && *getPassArgPos() > (getArgOperands().size() - 1))
@@ -1588,7 +1588,7 @@ void fir::TypeInfoOp::build(mlir::OpBuilder &builder,
   result.addAttributes(attrs);
 }
 
-mlir::LogicalResult fir::TypeInfoOp::verify() {
+llvm::LogicalResult fir::TypeInfoOp::verify() {
   if (!getDispatchTable().empty())
     for (auto &op : getDispatchTable().front().without_terminator())
       if (!mlir::isa<fir::DTEntryOp>(op))
@@ -1606,7 +1606,7 @@ mlir::LogicalResult fir::TypeInfoOp::verify() {
 // EmboxOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::EmboxOp::verify() {
+llvm::LogicalResult fir::EmboxOp::verify() {
   auto eleTy = fir::dyn_cast_ptrEleTy(getMemref().getType());
   bool isArray = false;
   if (auto seqTy = mlir::dyn_cast<fir::SequenceType>(eleTy)) {
@@ -1642,7 +1642,7 @@ mlir::LogicalResult fir::EmboxOp::verify() {
 // EmboxCharOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::EmboxCharOp::verify() {
+llvm::LogicalResult fir::EmboxCharOp::verify() {
   auto eleTy = fir::dyn_cast_ptrEleTy(getMemref().getType());
   if (!mlir::dyn_cast_or_null<fir::CharacterType>(eleTy))
     return mlir::failure();
@@ -1653,7 +1653,7 @@ mlir::LogicalResult fir::EmboxCharOp::verify() {
 // EmboxProcOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::EmboxProcOp::verify() {
+llvm::LogicalResult fir::EmboxProcOp::verify() {
   // host bindings (optional) must be a reference to a tuple
   if (auto h = getHost()) {
     if (auto r = mlir::dyn_cast<fir::ReferenceType>(h.getType()))
@@ -1691,7 +1691,7 @@ void fir::TypeDescOp::print(mlir::OpAsmPrinter &p) {
   p.printOptionalAttrDict(getOperation()->getAttrs(), {"in_type"});
 }
 
-mlir::LogicalResult fir::TypeDescOp::verify() {
+llvm::LogicalResult fir::TypeDescOp::verify() {
   mlir::Type resultTy = getType();
   if (auto tdesc = mlir::dyn_cast<fir::TypeDescType>(resultTy)) {
     if (tdesc.getOfTy() != getInType())
@@ -2036,7 +2036,7 @@ static void printCustomRangeSubscript(mlir::OpAsmPrinter &printer,
 }
 
 /// Range bounds must be nonnegative, and the range must not be empty.
-mlir::LogicalResult fir::InsertOnRangeOp::verify() {
+llvm::LogicalResult fir::InsertOnRangeOp::verify() {
   if (fir::hasDynamicSize(getSeq().getType()))
     return emitOpError("must have constant shape and size");
   mlir::DenseIntElementsAttr coorAttr = getCoor();
@@ -2079,7 +2079,7 @@ struct UndoComplexPattern : public mlir::RewritePattern {
   UndoComplexPattern(mlir::MLIRContext *ctx)
       : mlir::RewritePattern("fir.insert_value", 2, ctx) {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(mlir::Operation *op,
                   mlir::PatternRewriter &rewriter) const override {
     auto insval = mlir::dyn_cast_or_null<fir::InsertValueOp>(op);
@@ -2250,7 +2250,7 @@ mlir::ParseResult fir::IterWhileOp::parse(mlir::OpAsmParser &parser,
   return mlir::success();
 }
 
-mlir::LogicalResult fir::IterWhileOp::verify() {
+llvm::LogicalResult fir::IterWhileOp::verify() {
   // Check that the body defines as single block argument for the induction
   // variable.
   auto *body = getBody();
@@ -2610,7 +2610,7 @@ fir::DoLoopOp fir::getForInductionVarOwner(mlir::Value val) {
 }
 
 // Lifted from loop.loop
-mlir::LogicalResult fir::DoLoopOp::verify() {
+llvm::LogicalResult fir::DoLoopOp::verify() {
   // Check that the body defines as single block argument for the induction
   // variable.
   auto *body = getBody();
@@ -2785,7 +2785,7 @@ static bool areCompatibleCharacterTypes(mlir::Type t1, mlir::Type t2) {
   return c1.getLen() == c2.getLen();
 }
 
-mlir::LogicalResult fir::ReboxOp::verify() {
+llvm::LogicalResult fir::ReboxOp::verify() {
   auto inputBoxTy = getBox().getType();
   if (fir::isa_unknown_size_box(inputBoxTy))
     return emitOpError("box operand must not have unknown rank or type");
@@ -2883,7 +2883,7 @@ static bool areCompatibleAssumedRankElementType(mlir::Type inputEleTy,
   return false;
 }
 
-mlir::LogicalResult fir::ReboxAssumedRankOp::verify() {
+llvm::LogicalResult fir::ReboxAssumedRankOp::verify() {
   mlir::Type inputType = getBox().getType();
   if (!mlir::isa<fir::BaseBoxType>(inputType) && !fir::isBoxAddress(inputType))
     return emitOpError("input must be a box or box address");
@@ -2911,7 +2911,7 @@ void fir::ReboxAssumedRankOp::getEffects(
 // ResultOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::ResultOp::verify() {
+llvm::LogicalResult fir::ResultOp::verify() {
   auto *parentOp = (*this)->getParentOp();
   auto results = parentOp->getResults();
   auto operands = (*this)->getOperands();
@@ -2928,7 +2928,7 @@ mlir::LogicalResult fir::ResultOp::verify() {
 // SaveResultOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::SaveResultOp::verify() {
+llvm::LogicalResult fir::SaveResultOp::verify() {
   auto resultType = getValue().getType();
   if (resultType != fir::dyn_cast_ptrEleTy(getMemref().getType()))
     return emitOpError("value type must match memory reference type");
@@ -2992,7 +2992,7 @@ static constexpr llvm::StringRef getTargetOffsetAttr() {
 }
 
 template <typename OpT>
-static mlir::LogicalResult verifyIntegralSwitchTerminator(OpT op) {
+static llvm::LogicalResult verifyIntegralSwitchTerminator(OpT op) {
   if (!mlir::isa<mlir::IntegerType, mlir::IndexType, fir::IntegerType>(
           op.getSelector().getType()))
     return op.emitOpError("must be an integer");
@@ -3086,7 +3086,7 @@ static void printIntegralSwitchTerminator(OpT op, mlir::OpAsmPrinter &p) {
 // SelectOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::SelectOp::verify() {
+llvm::LogicalResult fir::SelectOp::verify() {
   return verifyIntegralSwitchTerminator(*this);
 }
 
@@ -3412,7 +3412,7 @@ void fir::SelectCaseOp::build(mlir::OpBuilder &builder,
         destOperands, attributes);
 }
 
-mlir::LogicalResult fir::SelectCaseOp::verify() {
+llvm::LogicalResult fir::SelectCaseOp::verify() {
   if (!mlir::isa<mlir::IntegerType, mlir::IndexType, fir::IntegerType,
                  fir::LogicalType, fir::CharacterType>(getSelector().getType()))
     return emitOpError("must be an integer, character, or logical");
@@ -3443,7 +3443,7 @@ mlir::LogicalResult fir::SelectCaseOp::verify() {
 // SelectRankOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::SelectRankOp::verify() {
+llvm::LogicalResult fir::SelectRankOp::verify() {
   return verifyIntegralSwitchTerminator(*this);
 }
 
@@ -3608,7 +3608,7 @@ void fir::SelectTypeOp::print(mlir::OpAsmPrinter &p) {
                            fir::SelectTypeOp::getOperandSegmentSizeAttr()});
 }
 
-mlir::LogicalResult fir::SelectTypeOp::verify() {
+llvm::LogicalResult fir::SelectTypeOp::verify() {
   if (!mlir::isa<fir::BaseBoxType>(getSelector().getType()))
     return emitOpError("must be a fir.class or fir.box type");
   if (auto boxType = mlir::dyn_cast<fir::BoxType>(getSelector().getType()))
@@ -3670,7 +3670,7 @@ void fir::SelectTypeOp::build(mlir::OpBuilder &builder,
 // ShapeOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::ShapeOp::verify() {
+llvm::LogicalResult fir::ShapeOp::verify() {
   auto size = getExtents().size();
   auto shapeTy = mlir::dyn_cast<fir::ShapeType>(getType());
   assert(shapeTy && "must be a shape type");
@@ -3689,7 +3689,7 @@ void fir::ShapeOp::build(mlir::OpBuilder &builder, mlir::OperationState &result,
 // ShapeShiftOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::ShapeShiftOp::verify() {
+llvm::LogicalResult fir::ShapeShiftOp::verify() {
   auto size = getPairs().size();
   if (size < 2 || size > 16 * 2)
     return emitOpError("incorrect number of args");
@@ -3706,7 +3706,7 @@ mlir::LogicalResult fir::ShapeShiftOp::verify() {
 // ShiftOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::ShiftOp::verify() {
+llvm::LogicalResult fir::ShiftOp::verify() {
   auto size = getOrigins().size();
   auto shiftTy = mlir::dyn_cast<fir::ShiftType>(getType());
   assert(shiftTy && "must be a shift type");
@@ -3742,7 +3742,7 @@ unsigned fir::SliceOp::getOutputRank(mlir::ValueRange triples) {
   return rank;
 }
 
-mlir::LogicalResult fir::SliceOp::verify() {
+llvm::LogicalResult fir::SliceOp::verify() {
   auto size = getTriples().size();
   if (size < 3 || size > 16 * 3)
     return emitOpError("incorrect number of args for triple");
@@ -3788,7 +3788,7 @@ void fir::StoreOp::print(mlir::OpAsmPrinter &p) {
   p << " : " << getMemref().getType();
 }
 
-mlir::LogicalResult fir::StoreOp::verify() {
+llvm::LogicalResult fir::StoreOp::verify() {
   if (getValue().getType() != fir::dyn_cast_ptrEleTy(getMemref().getType()))
     return emitOpError("store value type must match memory reference type");
   return mlir::success();
@@ -3920,7 +3920,7 @@ void fir::StringLitOp::print(mlir::OpAsmPrinter &p) {
   p.printType(getType());
 }
 
-mlir::LogicalResult fir::StringLitOp::verify() {
+llvm::LogicalResult fir::StringLitOp::verify() {
   if (mlir::cast<mlir::IntegerAttr>(getSize()).getValue().isNegative())
     return emitOpError("size must be non-negative");
   if (auto xl = getOperation()->getAttr(fir::StringLitOp::xlist())) {
@@ -3941,7 +3941,7 @@ mlir::LogicalResult fir::StringLitOp::verify() {
 // UnboxProcOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::UnboxProcOp::verify() {
+llvm::LogicalResult fir::UnboxProcOp::verify() {
   if (auto eleTy = fir::dyn_cast_ptrEleTy(getRefTuple().getType()))
     if (mlir::isa<mlir::TupleType>(eleTy))
       return mlir::success();
@@ -4067,7 +4067,7 @@ mlir::ParseResult fir::IfOp::parse(mlir::OpAsmParser &parser,
   return mlir::success();
 }
 
-mlir::LogicalResult fir::IfOp::verify() {
+llvm::LogicalResult fir::IfOp::verify() {
   if (getNumResults() != 0 && getElseRegion().empty())
     return emitOpError("must have an else block if defining values");
 
@@ -4109,7 +4109,7 @@ void fir::IfOp::resultToSourceOps(llvm::SmallVectorImpl<mlir::Value> &results,
 // BoxOffsetOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult fir::BoxOffsetOp::verify() {
+llvm::LogicalResult fir::BoxOffsetOp::verify() {
   auto boxType = mlir::dyn_cast_or_null<fir::BaseBoxType>(
       fir::dyn_cast_ptrEleTy(getBoxRef().getType()));
   if (!boxType)
@@ -4402,7 +4402,7 @@ mlir::Type fir::applyPathToType(mlir::Type eleTy, mlir::ValueRange path) {
   return eleTy;
 }
 
-mlir::LogicalResult fir::DeclareOp::verify() {
+llvm::LogicalResult fir::DeclareOp::verify() {
   auto fortranVar =
       mlir::cast<fir::FortranVariableOpInterface>(this->getOperation());
   return fortranVar.verifyDeclareLikeOpImpl(getMemref());
diff --git a/flang/lib/Optimizer/Dialect/FIRType.cpp b/flang/lib/Optimizer/Dialect/FIRType.cpp
index b3f2ec848a2d0..dbccacfa8be26 100644
--- a/flang/lib/Optimizer/Dialect/FIRType.cpp
+++ b/flang/lib/Optimizer/Dialect/FIRType.cpp
@@ -683,7 +683,7 @@ void fir::BoxProcType::print(mlir::AsmPrinter &printer) const {
   printer << "<" << getEleTy() << '>';
 }
 
-mlir::LogicalResult
+llvm::LogicalResult
 BoxProcType::verify(llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
                     mlir::Type eleTy) {
   if (mlir::isa<mlir::FunctionType>(eleTy))
@@ -704,7 +704,7 @@ static bool cannotBePointerOrHeapElementType(mlir::Type eleTy) {
 // BoxType
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult
+llvm::LogicalResult
 fir::BoxType::verify(llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
                      mlir::Type eleTy) {
   if (mlir::isa<fir::BaseBoxType>(eleTy))
@@ -773,7 +773,7 @@ void fir::CharacterType::print(mlir::AsmPrinter &printer) const {
 // ClassType
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult
+llvm::LogicalResult
 fir::ClassType::verify(llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
                        mlir::Type eleTy) {
   if (mlir::isa<fir::RecordType, fir::SequenceType, fir::HeapType,
@@ -820,7 +820,7 @@ void fir::HeapType::print(mlir::AsmPrinter &printer) const {
   printer << "<" << getEleTy() << '>';
 }
 
-mlir::LogicalResult
+llvm::LogicalResult
 fir::HeapType::verify(llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
                       mlir::Type eleTy) {
   if (cannotBePointerOrHeapElementType(eleTy))
@@ -868,7 +868,7 @@ void fir::PointerType::print(mlir::AsmPrinter &printer) const {
   printer << "<" << getEleTy() << '>';
 }
 
-mlir::LogicalResult fir::PointerType::verify(
+llvm::LogicalResult fir::PointerType::verify(
     llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
     mlir::Type eleTy) {
   if (cannotBePointerOrHeapElementType(eleTy))
@@ -889,7 +889,7 @@ void fir::RealType::print(mlir::AsmPrinter &printer) const {
   printer << "<" << getFKind() << '>';
 }
 
-mlir::LogicalResult
+llvm::LogicalResult
 fir::RealType::verify(llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
                       KindTy fKind) {
   // TODO
@@ -1012,7 +1012,7 @@ detail::RecordTypeStorage const *fir::RecordType::uniqueKey() const {
   return getImpl();
 }
 
-mlir::LogicalResult fir::RecordType::verify(
+llvm::LogicalResult fir::RecordType::verify(
     llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
     llvm::StringRef name) {
   if (name.size() == 0)
@@ -1047,7 +1047,7 @@ void fir::ReferenceType::print(mlir::AsmPrinter &printer) const {
   printer << "<" << getEleTy() << '>';
 }
 
-mlir::LogicalResult fir::ReferenceType::verify(
+llvm::LogicalResult fir::ReferenceType::verify(
     llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
     mlir::Type eleTy) {
   if (mlir::isa<ShapeType, ShapeShiftType, SliceType, FieldType, LenType,
@@ -1121,7 +1121,7 @@ unsigned fir::SequenceType::getConstantRows() const {
   return count;
 }
 
-mlir::LogicalResult fir::SequenceType::verify(
+llvm::LogicalResult fir::SequenceType::verify(
     llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
     llvm::ArrayRef<int64_t> shape, mlir::Type eleTy,
     mlir::AffineMapAttr layoutMap) {
@@ -1196,7 +1196,7 @@ void fir::TypeDescType::print(mlir::AsmPrinter &printer) const {
   printer << "<" << getOfTy() << '>';
 }
 
-mlir::LogicalResult fir::TypeDescType::verify(
+llvm::LogicalResult fir::TypeDescType::verify(
     llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
     mlir::Type eleTy) {
   if (mlir::isa<BoxType, BoxCharType, BoxProcType, ShapeType, ShapeShiftType,
@@ -1225,7 +1225,7 @@ void fir::VectorType::print(mlir::AsmPrinter &printer) const {
   printer << "<" << getLen() << ':' << getEleTy() << '>';
 }
 
-mlir::LogicalResult fir::VectorType::verify(
+llvm::LogicalResult fir::VectorType::verify(
     llvm::function_ref<mlir::InFlightDiagnostic()> emitError, uint64_t len,
     mlir::Type eleTy) {
   if (!(fir::isa_real(eleTy) || fir::isa_integer(eleTy)))
diff --git a/flang/lib/Optimizer/Dialect/FirAliasTagOpInterface.cpp b/flang/lib/Optimizer/Dialect/FirAliasTagOpInterface.cpp
index 648f490f63bf3..bf058c12e1147 100644
--- a/flang/lib/Optimizer/Dialect/FirAliasTagOpInterface.cpp
+++ b/flang/lib/Optimizer/Dialect/FirAliasTagOpInterface.cpp
@@ -15,17 +15,17 @@
 
 #include "flang/Optimizer/Dialect/FirAliasTagOpInterface.cpp.inc"
 
-mlir::LogicalResult
+llvm::LogicalResult
 fir::detail::verifyFirAliasTagOpInterface(mlir::Operation *op) {
   auto iface = mlir::cast<FirAliasTagOpInterface>(op);
 
   mlir::ArrayAttr tags = iface.getTBAATagsOrNull();
   if (!tags)
-    return mlir::success();
+    return llvm::success();
 
   for (mlir::Attribute iter : tags)
     if (!mlir::isa<mlir::LLVM::TBAATagAttr>(iter))
       return op->emitOpError("expected op to return array of ")
              << mlir::LLVM::TBAATagAttr::getMnemonic() << " attributes";
-  return mlir::success();
+  return llvm::success();
 }
diff --git a/flang/lib/Optimizer/Dialect/FortranVariableInterface.cpp b/flang/lib/Optimizer/Dialect/FortranVariableInterface.cpp
index 70b1a2f3d8446..034f8c74ec79f 100644
--- a/flang/lib/Optimizer/Dialect/FortranVariableInterface.cpp
+++ b/flang/lib/Optimizer/Dialect/FortranVariableInterface.cpp
@@ -14,7 +14,7 @@
 
 #include "flang/Optimizer/Dialect/FortranVariableInterface.cpp.inc"
 
-mlir::LogicalResult
+llvm::LogicalResult
 fir::FortranVariableOpInterface::verifyDeclareLikeOpImpl(mlir::Value memref) {
   const unsigned numExplicitTypeParams = getExplicitTypeParams().size();
   mlir::Type memType = memref.getType();
diff --git a/flang/lib/Optimizer/Dialect/Support/KindMapping.cpp b/flang/lib/Optimizer/Dialect/Support/KindMapping.cpp
index bcb112186aeef..30c603045774f 100644
--- a/flang/lib/Optimizer/Dialect/Support/KindMapping.cpp
+++ b/flang/lib/Optimizer/Dialect/Support/KindMapping.cpp
@@ -177,7 +177,7 @@ static MatchResult parseInt(unsigned &result, const char *&ptr,
   return mlir::success();
 }
 
-static mlir::LogicalResult matchString(const char *&ptr, const char *endPtr,
+static llvm::LogicalResult matchString(const char *&ptr, const char *endPtr,
                                        llvm::StringRef literal) {
   llvm::StringRef s(ptr, endPtr - ptr);
   if (s.starts_with(literal)) {
@@ -351,7 +351,7 @@ std::string fir::KindMapping::mapToString() const {
   return result;
 }
 
-mlir::LogicalResult
+llvm::LogicalResult
 fir::KindMapping::setDefaultKinds(llvm::ArrayRef<KindTy> defs) {
   if (defs.empty()) {
     // generic front-end defaults
diff --git a/flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp b/flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
index cbe789fed1162..ae62affaed6b0 100644
--- a/flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
+++ b/flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
@@ -78,7 +78,7 @@ static bool isAllocatableBoxRef(mlir::Type type) {
   return boxType && mlir::isa<fir::HeapType>(boxType.getEleTy());
 }
 
-mlir::LogicalResult hlfir::AssignOp::verify() {
+llvm::LogicalResult hlfir::AssignOp::verify() {
   mlir::Type lhsType = getLhs().getType();
   if (isAllocatableAssignment() && !isAllocatableBoxRef(lhsType))
     return emitOpError("lhs must be an allocatable when `realloc` is set");
@@ -137,7 +137,7 @@ void hlfir::DeclareOp::build(mlir::OpBuilder &builder,
         typeparams, dummy_scope, nameAttr, fortran_attrs, data_attr);
 }
 
-mlir::LogicalResult hlfir::DeclareOp::verify() {
+llvm::LogicalResult hlfir::DeclareOp::verify() {
   if (getMemref().getType() != getResult(1).getType())
     return emitOpError("second result type must match input memref type");
   mlir::Type hlfirVariableType = getHLFIRVariableType(
@@ -278,7 +278,7 @@ static void printDesignatorComplexPart(mlir::OpAsmPrinter &p,
   }
 }
 
-mlir::LogicalResult hlfir::DesignateOp::verify() {
+llvm::LogicalResult hlfir::DesignateOp::verify() {
   mlir::Type memrefType = getMemref().getType();
   mlir::Type baseType = getFortranElementOrSequenceType(memrefType);
   mlir::Type baseElementType = fir::unwrapSequenceType(baseType);
@@ -433,7 +433,7 @@ mlir::LogicalResult hlfir::DesignateOp::verify() {
 // ParentComponentOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult hlfir::ParentComponentOp::verify() {
+llvm::LogicalResult hlfir::ParentComponentOp::verify() {
   mlir::Type baseType =
       hlfir::getFortranElementOrSequenceType(getMemref().getType());
   auto maybeInputSeqType = mlir::dyn_cast<fir::SequenceType>(baseType);
@@ -488,7 +488,7 @@ mlir::LogicalResult hlfir::ParentComponentOp::verify() {
 // LogicalReductionOp
 //===----------------------------------------------------------------------===//
 template <typename LogicalReductionOp>
-static mlir::LogicalResult
+static llvm::LogicalResult
 verifyLogicalReductionOp(LogicalReductionOp reductionOp) {
   mlir::Operation *op = reductionOp->getOperation();
 
@@ -539,7 +539,7 @@ verifyLogicalReductionOp(LogicalReductionOp reductionOp) {
 // AllOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult hlfir::AllOp::verify() {
+llvm::LogicalResult hlfir::AllOp::verify() {
   return verifyLogicalReductionOp<hlfir::AllOp *>(this);
 }
 
@@ -554,7 +554,7 @@ void hlfir::AllOp::getEffects(
 // AnyOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult hlfir::AnyOp::verify() {
+llvm::LogicalResult hlfir::AnyOp::verify() {
   return verifyLogicalReductionOp<hlfir::AnyOp *>(this);
 }
 
@@ -569,7 +569,7 @@ void hlfir::AnyOp::getEffects(
 // CountOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult hlfir::CountOp::verify() {
+llvm::LogicalResult hlfir::CountOp::verify() {
   mlir::Operation *op = getOperation();
 
   auto results = op->getResultTypes();
@@ -626,7 +626,7 @@ getCharacterLengthIfStatic(mlir::Type t) {
   return std::nullopt;
 }
 
-mlir::LogicalResult hlfir::ConcatOp::verify() {
+llvm::LogicalResult hlfir::ConcatOp::verify() {
   if (getStrings().size() < 2)
     return emitOpError("must be provided at least two string operands");
   unsigned kind = getCharacterKind(getResult().getType());
@@ -668,7 +668,7 @@ void hlfir::ConcatOp::getEffects(
 //===----------------------------------------------------------------------===//
 
 template <typename NumericalReductionOp>
-static mlir::LogicalResult
+static llvm::LogicalResult
 verifyArrayAndMaskForReductionOp(NumericalReductionOp reductionOp) {
   mlir::Value array = reductionOp->getArray();
   mlir::Value mask = reductionOp->getMask();
@@ -707,7 +707,7 @@ verifyArrayAndMaskForReductionOp(NumericalReductionOp reductionOp) {
 }
 
 template <typename NumericalReductionOp>
-static mlir::LogicalResult
+static llvm::LogicalResult
 verifyNumericalReductionOp(NumericalReductionOp reductionOp) {
   mlir::Operation *op = reductionOp->getOperation();
   auto results = op->getResultTypes();
@@ -760,7 +760,7 @@ verifyNumericalReductionOp(NumericalReductionOp reductionOp) {
 // ProductOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult hlfir::ProductOp::verify() {
+llvm::LogicalResult hlfir::ProductOp::verify() {
   return verifyNumericalReductionOp<hlfir::ProductOp *>(this);
 }
 
@@ -776,7 +776,7 @@ void hlfir::ProductOp::getEffects(
 //===----------------------------------------------------------------------===//
 
 template <typename CharacterReductionOp>
-static mlir::LogicalResult
+static llvm::LogicalResult
 verifyCharacterReductionOp(CharacterReductionOp reductionOp) {
   mlir::Operation *op = reductionOp->getOperation();
   auto results = op->getResultTypes();
@@ -821,7 +821,7 @@ verifyCharacterReductionOp(CharacterReductionOp reductionOp) {
 // MaxvalOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult hlfir::MaxvalOp::verify() {
+llvm::LogicalResult hlfir::MaxvalOp::verify() {
   mlir::Operation *op = getOperation();
 
   auto results = op->getResultTypes();
@@ -845,7 +845,7 @@ void hlfir::MaxvalOp::getEffects(
 // MinvalOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult hlfir::MinvalOp::verify() {
+llvm::LogicalResult hlfir::MinvalOp::verify() {
   mlir::Operation *op = getOperation();
 
   auto results = op->getResultTypes();
@@ -870,7 +870,7 @@ void hlfir::MinvalOp::getEffects(
 //===----------------------------------------------------------------------===//
 
 template <typename NumericalReductionOp>
-static mlir::LogicalResult
+static llvm::LogicalResult
 verifyResultForMinMaxLoc(NumericalReductionOp reductionOp) {
   mlir::Operation *op = reductionOp->getOperation();
   auto results = op->getResultTypes();
@@ -908,7 +908,7 @@ verifyResultForMinMaxLoc(NumericalReductionOp reductionOp) {
   return mlir::success();
 }
 
-mlir::LogicalResult hlfir::MinlocOp::verify() {
+llvm::LogicalResult hlfir::MinlocOp::verify() {
   auto res = verifyArrayAndMaskForReductionOp(this);
   if (failed(res))
     return res;
@@ -927,7 +927,7 @@ void hlfir::MinlocOp::getEffects(
 // MaxlocOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult hlfir::MaxlocOp::verify() {
+llvm::LogicalResult hlfir::MaxlocOp::verify() {
   auto res = verifyArrayAndMaskForReductionOp(this);
   if (failed(res))
     return res;
@@ -971,7 +971,7 @@ void hlfir::SetLengthOp::getEffects(
 // SumOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult hlfir::SumOp::verify() {
+llvm::LogicalResult hlfir::SumOp::verify() {
   return verifyNumericalReductionOp<hlfir::SumOp *>(this);
 }
 
@@ -986,7 +986,7 @@ void hlfir::SumOp::getEffects(
 // DotProductOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult hlfir::DotProductOp::verify() {
+llvm::LogicalResult hlfir::DotProductOp::verify() {
   mlir::Value lhs = getLhs();
   mlir::Value rhs = getRhs();
   fir::SequenceType lhsTy = mlir::cast<fir::SequenceType>(
@@ -1042,7 +1042,7 @@ void hlfir::DotProductOp::getEffects(
 // MatmulOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult hlfir::MatmulOp::verify() {
+llvm::LogicalResult hlfir::MatmulOp::verify() {
   mlir::Value lhs = getLhs();
   mlir::Value rhs = getRhs();
   fir::SequenceType lhsTy = mlir::cast<fir::SequenceType>(
@@ -1111,7 +1111,7 @@ mlir::LogicalResult hlfir::MatmulOp::verify() {
   return mlir::success();
 }
 
-mlir::LogicalResult
+llvm::LogicalResult
 hlfir::MatmulOp::canonicalize(MatmulOp matmulOp,
                               mlir::PatternRewriter &rewriter) {
   // the only two uses of the transposed matrix should be for the hlfir.matmul
@@ -1170,7 +1170,7 @@ void hlfir::MatmulOp::getEffects(
 // TransposeOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult hlfir::TransposeOp::verify() {
+llvm::LogicalResult hlfir::TransposeOp::verify() {
   mlir::Value array = getArray();
   fir::SequenceType arrayTy = mlir::cast<fir::SequenceType>(
       hlfir::getFortranElementOrSequenceType(array.getType()));
@@ -1212,7 +1212,7 @@ void hlfir::TransposeOp::getEffects(
 // MatmulTransposeOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult hlfir::MatmulTransposeOp::verify() {
+llvm::LogicalResult hlfir::MatmulTransposeOp::verify() {
   mlir::Value lhs = getLhs();
   mlir::Value rhs = getRhs();
   fir::SequenceType lhsTy = mlir::cast<fir::SequenceType>(
@@ -1350,7 +1350,7 @@ void hlfir::EndAssociateOp::build(mlir::OpBuilder &builder,
                associate.getMustFreeStrorageFlag());
 }
 
-mlir::LogicalResult hlfir::EndAssociateOp::verify() {
+llvm::LogicalResult hlfir::EndAssociateOp::verify() {
   mlir::Value var = getVar();
   if (hlfir::mayHaveAllocatableComponent(var.getType()) &&
       !hlfir::isFortranEntity(var))
@@ -1438,7 +1438,7 @@ mlir::Value hlfir::ElementalOp::getElementEntity() {
   return mlir::cast<hlfir::YieldElementOp>(getBody()->back()).getElementValue();
 }
 
-mlir::LogicalResult hlfir::ElementalOp::verify() {
+llvm::LogicalResult hlfir::ElementalOp::verify() {
   mlir::Value mold = getMold();
   hlfir::ExprType resultType = mlir::cast<hlfir::ExprType>(getType());
   if (!!mold != resultType.isPolymorphic())
@@ -1476,7 +1476,7 @@ void hlfir::NullOp::build(mlir::OpBuilder &builder,
 // DestroyOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult hlfir::DestroyOp::verify() {
+llvm::LogicalResult hlfir::DestroyOp::verify() {
   if (mustFinalizeExpr()) {
     mlir::Value expr = getExpr();
     hlfir::ExprType exprTy = mlir::cast<hlfir::ExprType>(expr.getType());
@@ -1517,7 +1517,7 @@ std::size_t hlfir::ShapeOfOp::getRank() {
   return shape.getRank();
 }
 
-mlir::LogicalResult hlfir::ShapeOfOp::verify() {
+llvm::LogicalResult hlfir::ShapeOfOp::verify() {
   mlir::Value expr = getExpr();
   hlfir::ExprType exprTy = mlir::cast<hlfir::ExprType>(expr.getType());
   std::size_t exprRank = exprTy.getShape().size();
@@ -1532,7 +1532,7 @@ mlir::LogicalResult hlfir::ShapeOfOp::verify() {
   return mlir::success();
 }
 
-mlir::LogicalResult
+llvm::LogicalResult
 hlfir::ShapeOfOp::canonicalize(ShapeOfOp shapeOf,
                                mlir::PatternRewriter &rewriter) {
   // if extent information is available at compile time, immediately fold the
@@ -1544,11 +1544,11 @@ hlfir::ShapeOfOp::canonicalize(ShapeOfOp shapeOf,
   mlir::Value shape = hlfir::genExprShape(rewriter, loc, expr);
   if (!shape)
     // shape information is not available at compile time
-    return mlir::LogicalResult::failure();
+    return llvm::LogicalResult::failure();
 
   rewriter.replaceAllUsesWith(shapeOf.getResult(), shape);
   rewriter.eraseOp(shapeOf);
-  return mlir::LogicalResult::success();
+  return llvm::LogicalResult::success();
 }
 
 //===----------------------------------------------------------------------===//
@@ -1563,7 +1563,7 @@ void hlfir::GetExtentOp::build(mlir::OpBuilder &builder,
   build(builder, result, indexTy, shape, dimAttr);
 }
 
-mlir::LogicalResult hlfir::GetExtentOp::verify() {
+llvm::LogicalResult hlfir::GetExtentOp::verify() {
   fir::ShapeType shapeTy = mlir::cast<fir::ShapeType>(getShape().getType());
   std::uint64_t rank = shapeTy.getRank();
   llvm::APInt dim = getDim();
@@ -1640,7 +1640,7 @@ static mlir::Operation *getTerminator(mlir::Region &region) {
   return &region.back().back();
 }
 
-mlir::LogicalResult hlfir::RegionAssignOp::verify() {
+llvm::LogicalResult hlfir::RegionAssignOp::verify() {
   if (!mlir::isa_and_nonnull<hlfir::YieldOp>(getTerminator(getRhsRegion())))
     return emitOpError(
         "right-hand side region must be terminated by an hlfir.yield");
@@ -1692,7 +1692,7 @@ void hlfir::ElementalAddrOp::build(mlir::OpBuilder &builder,
   odsState.addRegion();
 }
 
-mlir::LogicalResult hlfir::ElementalAddrOp::verify() {
+llvm::LogicalResult hlfir::ElementalAddrOp::verify() {
   hlfir::YieldOp yieldOp =
       mlir::dyn_cast_or_null<hlfir::YieldOp>(getTerminator(getBody()));
   if (!yieldOp)
@@ -1729,7 +1729,7 @@ mlir::Region *hlfir::ElementalAddrOp::getElementCleanup() {
 // OrderedAssignmentTreeOpInterface
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult hlfir::OrderedAssignmentTreeOpInterface::verifyImpl() {
+llvm::LogicalResult hlfir::OrderedAssignmentTreeOpInterface::verifyImpl() {
   if (mlir::Region *body = getSubTreeRegion())
     if (!body->empty())
       for (mlir::Operation &op : body->front())
@@ -1812,7 +1812,7 @@ static bool yieldsLogical(mlir::Region &region, bool mustBeScalarI1) {
              hlfir::getFortranElementOrSequenceType(yieldType));
 }
 
-mlir::LogicalResult hlfir::ForallMaskOp::verify() {
+llvm::LogicalResult hlfir::ForallMaskOp::verify() {
   if (!yieldsLogical(getMaskRegion(), /*mustBeScalarI1=*/true))
     return emitOpError("mask region must yield a scalar i1");
   mlir::Operation *op = getOperation();
@@ -1828,7 +1828,7 @@ mlir::LogicalResult hlfir::ForallMaskOp::verify() {
 //===----------------------------------------------------------------------===//
 
 template <typename ConcreteOp>
-static mlir::LogicalResult verifyWhereAndElseWhereBody(ConcreteOp &concreteOp) {
+static llvm::LogicalResult verifyWhereAndElseWhereBody(ConcreteOp &concreteOp) {
   for (mlir::Operation &op : concreteOp.getBody().front())
     if (mlir::isa<hlfir::ForallOp>(op))
       return concreteOp.emitOpError(
@@ -1836,13 +1836,13 @@ static mlir::LogicalResult verifyWhereAndElseWhereBody(ConcreteOp &concreteOp) {
   return mlir::success();
 }
 
-mlir::LogicalResult hlfir::WhereOp::verify() {
+llvm::LogicalResult hlfir::WhereOp::verify() {
   if (!yieldsLogical(getMaskRegion(), /*mustBeScalarI1=*/false))
     return emitOpError("mask region must yield a logical array");
   return verifyWhereAndElseWhereBody(*this);
 }
 
-mlir::LogicalResult hlfir::ElseWhereOp::verify() {
+llvm::LogicalResult hlfir::ElseWhereOp::verify() {
   if (!getMaskRegion().empty())
     if (!yieldsLogical(getMaskRegion(), /*mustBeScalarI1=*/false))
       return emitOpError(
@@ -1854,7 +1854,7 @@ mlir::LogicalResult hlfir::ElseWhereOp::verify() {
 // ForallIndexOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult
+llvm::LogicalResult
 hlfir::ForallIndexOp::canonicalize(hlfir::ForallIndexOp indexOp,
                                    mlir::PatternRewriter &rewriter) {
   for (mlir::Operation *user : indexOp->getResult(0).getUsers())
@@ -1878,7 +1878,7 @@ hlfir::ForallIndexOp::canonicalize(hlfir::ForallIndexOp indexOp,
 // CharExtremumOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult hlfir::CharExtremumOp::verify() {
+llvm::LogicalResult hlfir::CharExtremumOp::verify() {
   if (getStrings().size() < 2)
     return emitOpError("must be provided at least two string operands");
   unsigned kind = getCharacterKind(getResult().getType());
@@ -1922,7 +1922,7 @@ void hlfir::CharExtremumOp::getEffects(
 // GetLength
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult
+llvm::LogicalResult
 hlfir::GetLengthOp::canonicalize(GetLengthOp getLength,
                                  mlir::PatternRewriter &rewriter) {
   mlir::Location loc = getLength.getLoc();
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp b/flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp
index e292b562763cc..a70a6b388c4b1 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp
+++ b/flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp
@@ -30,7 +30,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/Pass/Pass.h"
 #include "mlir/Pass/PassManager.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/DialectConversion.h"
 #include "llvm/ADT/TypeSwitch.h"
 
@@ -180,7 +179,7 @@ struct AsExprOpConversion : public mlir::OpConversionPattern<hlfir::AsExprOp> {
   using mlir::OpConversionPattern<hlfir::AsExprOp>::OpConversionPattern;
   explicit AsExprOpConversion(mlir::MLIRContext *ctx)
       : mlir::OpConversionPattern<hlfir::AsExprOp>{ctx} {}
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::AsExprOp asExpr, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Location loc = asExpr->getLoc();
@@ -205,7 +204,7 @@ struct ShapeOfOpConversion
     : public mlir::OpConversionPattern<hlfir::ShapeOfOp> {
   using mlir::OpConversionPattern<hlfir::ShapeOfOp>::OpConversionPattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::ShapeOfOp shapeOf, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Location loc = shapeOf.getLoc();
@@ -237,7 +236,7 @@ struct ApplyOpConversion : public mlir::OpConversionPattern<hlfir::ApplyOp> {
   using mlir::OpConversionPattern<hlfir::ApplyOp>::OpConversionPattern;
   explicit ApplyOpConversion(mlir::MLIRContext *ctx)
       : mlir::OpConversionPattern<hlfir::ApplyOp>{ctx} {}
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::ApplyOp apply, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Location loc = apply->getLoc();
@@ -262,7 +261,7 @@ struct AssignOpConversion : public mlir::OpConversionPattern<hlfir::AssignOp> {
   using mlir::OpConversionPattern<hlfir::AssignOp>::OpConversionPattern;
   explicit AssignOpConversion(mlir::MLIRContext *ctx)
       : mlir::OpConversionPattern<hlfir::AssignOp>{ctx} {}
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::AssignOp assign, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     llvm::SmallVector<mlir::Value> newOperands;
@@ -279,7 +278,7 @@ struct ConcatOpConversion : public mlir::OpConversionPattern<hlfir::ConcatOp> {
   using mlir::OpConversionPattern<hlfir::ConcatOp>::OpConversionPattern;
   explicit ConcatOpConversion(mlir::MLIRContext *ctx)
       : mlir::OpConversionPattern<hlfir::ConcatOp>{ctx} {}
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::ConcatOp concat, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Location loc = concat->getLoc();
@@ -318,7 +317,7 @@ struct SetLengthOpConversion
   using mlir::OpConversionPattern<hlfir::SetLengthOp>::OpConversionPattern;
   explicit SetLengthOpConversion(mlir::MLIRContext *ctx)
       : mlir::OpConversionPattern<hlfir::SetLengthOp>{ctx} {}
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::SetLengthOp setLength, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Location loc = setLength->getLoc();
@@ -351,7 +350,7 @@ struct GetLengthOpConversion
   using mlir::OpConversionPattern<hlfir::GetLengthOp>::OpConversionPattern;
   explicit GetLengthOpConversion(mlir::MLIRContext *ctx)
       : mlir::OpConversionPattern<hlfir::GetLengthOp>{ctx} {}
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::GetLengthOp getLength, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Location loc = getLength->getLoc();
@@ -441,7 +440,7 @@ struct AssociateOpConversion
   using mlir::OpConversionPattern<hlfir::AssociateOp>::OpConversionPattern;
   explicit AssociateOpConversion(mlir::MLIRContext *ctx)
       : mlir::OpConversionPattern<hlfir::AssociateOp>{ctx} {}
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::AssociateOp associate, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Location loc = associate->getLoc();
@@ -660,7 +659,7 @@ struct EndAssociateOpConversion
   using mlir::OpConversionPattern<hlfir::EndAssociateOp>::OpConversionPattern;
   explicit EndAssociateOpConversion(mlir::MLIRContext *ctx)
       : mlir::OpConversionPattern<hlfir::EndAssociateOp>{ctx} {}
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::EndAssociateOp endAssociate, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Location loc = endAssociate->getLoc();
@@ -677,7 +676,7 @@ struct DestroyOpConversion
   using mlir::OpConversionPattern<hlfir::DestroyOp>::OpConversionPattern;
   explicit DestroyOpConversion(mlir::MLIRContext *ctx)
       : mlir::OpConversionPattern<hlfir::DestroyOp>{ctx} {}
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::DestroyOp destroy, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     // If expr was bufferized on the heap, now is time to deallocate the buffer.
@@ -706,7 +705,7 @@ struct NoReassocOpConversion
   using mlir::OpConversionPattern<hlfir::NoReassocOp>::OpConversionPattern;
   explicit NoReassocOpConversion(mlir::MLIRContext *ctx)
       : mlir::OpConversionPattern<hlfir::NoReassocOp>{ctx} {}
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::NoReassocOp noreassoc, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Location loc = noreassoc->getLoc();
@@ -767,7 +766,7 @@ struct ElementalOpConversion
     // by the nesting level of ElementalOp's.
     setHasBoundedRewriteRecursion();
   }
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::ElementalOp elemental, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Location loc = elemental->getLoc();
@@ -860,7 +859,7 @@ struct CharExtremumOpConversion
   using mlir::OpConversionPattern<hlfir::CharExtremumOp>::OpConversionPattern;
   explicit CharExtremumOpConversion(mlir::MLIRContext *ctx)
       : mlir::OpConversionPattern<hlfir::CharExtremumOp>{ctx} {}
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::CharExtremumOp char_extremum, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Location loc = char_extremum->getLoc();
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/ConvertToFIR.cpp b/flang/lib/Optimizer/HLFIR/Transforms/ConvertToFIR.cpp
index 74bbab0d72e9f..98205959020d2 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/ConvertToFIR.cpp
+++ b/flang/lib/Optimizer/HLFIR/Transforms/ConvertToFIR.cpp
@@ -38,7 +38,7 @@ class AssignOpConversion : public mlir::OpRewritePattern<hlfir::AssignOp> {
 public:
   explicit AssignOpConversion(mlir::MLIRContext *ctx) : OpRewritePattern{ctx} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::AssignOp assignOp,
                   mlir::PatternRewriter &rewriter) const override {
     mlir::Location loc = assignOp->getLoc();
@@ -231,7 +231,7 @@ class CopyInOpConversion : public mlir::OpRewritePattern<hlfir::CopyInOp> {
     return {res[0], res[1]};
   }
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::CopyInOp copyInOp,
                   mlir::PatternRewriter &rewriter) const override {
     mlir::Location loc = copyInOp.getLoc();
@@ -249,7 +249,7 @@ class CopyOutOpConversion : public mlir::OpRewritePattern<hlfir::CopyOutOp> {
   explicit CopyOutOpConversion(mlir::MLIRContext *ctx)
       : OpRewritePattern{ctx} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::CopyOutOp copyOutOp,
                   mlir::PatternRewriter &rewriter) const override {
     mlir::Location loc = copyOutOp.getLoc();
@@ -290,7 +290,7 @@ class DeclareOpConversion : public mlir::OpRewritePattern<hlfir::DeclareOp> {
   explicit DeclareOpConversion(mlir::MLIRContext *ctx)
       : OpRewritePattern{ctx} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::DeclareOp declareOp,
                   mlir::PatternRewriter &rewriter) const override {
     mlir::Location loc = declareOp->getLoc();
@@ -428,7 +428,7 @@ class DesignateOpConversion
   explicit DesignateOpConversion(mlir::MLIRContext *ctx)
       : OpRewritePattern{ctx} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::DesignateOp designate,
                   mlir::PatternRewriter &rewriter) const override {
     mlir::Location loc = designate.getLoc();
@@ -648,7 +648,7 @@ class ParentComponentOpConversion
   explicit ParentComponentOpConversion(mlir::MLIRContext *ctx)
       : OpRewritePattern{ctx} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::ParentComponentOp parentComponent,
                   mlir::PatternRewriter &rewriter) const override {
     mlir::Location loc = parentComponent.getLoc();
@@ -696,7 +696,7 @@ class NoReassocOpConversion
   explicit NoReassocOpConversion(mlir::MLIRContext *ctx)
       : OpRewritePattern{ctx} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::NoReassocOp noreassoc,
                   mlir::PatternRewriter &rewriter) const override {
     rewriter.replaceOpWithNewOp<fir::NoReassocOp>(noreassoc,
@@ -709,7 +709,7 @@ class NullOpConversion : public mlir::OpRewritePattern<hlfir::NullOp> {
 public:
   explicit NullOpConversion(mlir::MLIRContext *ctx) : OpRewritePattern{ctx} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::NullOp nullop,
                   mlir::PatternRewriter &rewriter) const override {
     rewriter.replaceOpWithNewOp<fir::ZeroOp>(nullop, nullop.getType());
@@ -722,7 +722,7 @@ class GetExtentOpConversion
 public:
   using mlir::OpRewritePattern<hlfir::GetExtentOp>::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::GetExtentOp getExtentOp,
                   mlir::PatternRewriter &rewriter) const override {
     mlir::Value shape = getExtentOp.getShape();
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/InlineElementals.cpp b/flang/lib/Optimizer/HLFIR/Transforms/InlineElementals.cpp
index 4b0b8594c3ccf..769e14b1316d6 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/InlineElementals.cpp
+++ b/flang/lib/Optimizer/HLFIR/Transforms/InlineElementals.cpp
@@ -73,7 +73,7 @@ class InlineElementalConversion
 public:
   using mlir::OpRewritePattern<hlfir::ElementalOp>::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::ElementalOp elemental,
                   mlir::PatternRewriter &rewriter) const override {
     std::optional<std::pair<hlfir::ApplyOp, hlfir::DestroyOp>> maybeTuple =
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIRIntrinsics.cpp b/flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIRIntrinsics.cpp
index 0347bec3a9a2a..bfb4148d93bfd 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIRIntrinsics.cpp
+++ b/flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIRIntrinsics.cpp
@@ -22,7 +22,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/Pass/Pass.h"
 #include "mlir/Pass/PassManager.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 #include <optional>
 
@@ -235,7 +234,7 @@ class HlfirReductionIntrinsicConversion : public HlfirIntrinsicConversion<OP> {
   };
 
 public:
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(OP operation,
                   mlir::PatternRewriter &rewriter) const override {
     std::string opName;
@@ -311,7 +310,7 @@ using AllOpConversion = HlfirReductionIntrinsicConversion<hlfir::AllOp>;
 struct CountOpConversion : public HlfirIntrinsicConversion<hlfir::CountOp> {
   using HlfirIntrinsicConversion<hlfir::CountOp>::HlfirIntrinsicConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::CountOp count,
                   mlir::PatternRewriter &rewriter) const override {
     fir::FirOpBuilder builder{rewriter, count.getOperation()};
@@ -345,7 +344,7 @@ struct CountOpConversion : public HlfirIntrinsicConversion<hlfir::CountOp> {
 struct MatmulOpConversion : public HlfirIntrinsicConversion<hlfir::MatmulOp> {
   using HlfirIntrinsicConversion<hlfir::MatmulOp>::HlfirIntrinsicConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::MatmulOp matmul,
                   mlir::PatternRewriter &rewriter) const override {
     fir::FirOpBuilder builder{rewriter, matmul.getOperation()};
@@ -376,7 +375,7 @@ struct DotProductOpConversion
     : public HlfirIntrinsicConversion<hlfir::DotProductOp> {
   using HlfirIntrinsicConversion<hlfir::DotProductOp>::HlfirIntrinsicConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::DotProductOp dotProduct,
                   mlir::PatternRewriter &rewriter) const override {
     fir::FirOpBuilder builder{rewriter, dotProduct.getOperation()};
@@ -407,7 +406,7 @@ class TransposeOpConversion
     : public HlfirIntrinsicConversion<hlfir::TransposeOp> {
   using HlfirIntrinsicConversion<hlfir::TransposeOp>::HlfirIntrinsicConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::TransposeOp transpose,
                   mlir::PatternRewriter &rewriter) const override {
     fir::FirOpBuilder builder{rewriter, transpose.getOperation()};
@@ -437,7 +436,7 @@ struct MatmulTransposeOpConversion
   using HlfirIntrinsicConversion<
       hlfir::MatmulTransposeOp>::HlfirIntrinsicConversion;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::MatmulTransposeOp multranspose,
                   mlir::PatternRewriter &rewriter) const override {
     fir::FirOpBuilder builder{rewriter, multranspose.getOperation()};
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIROrderedAssignments.cpp b/flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIROrderedAssignments.cpp
index a1a89bb5154fb..85dd517cb5791 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIROrderedAssignments.cpp
+++ b/flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIROrderedAssignments.cpp
@@ -1309,7 +1309,7 @@ static void lower(hlfir::OrderedAssignmentTreeOpInterface root,
 
 /// Shared rewrite entry point for all the ordered assignment tree root
 /// operations. It calls the scheduler and then apply the schedule.
-static mlir::LogicalResult rewrite(hlfir::OrderedAssignmentTreeOpInterface root,
+static llvm::LogicalResult rewrite(hlfir::OrderedAssignmentTreeOpInterface root,
                                    bool tryFusingAssignments,
                                    mlir::PatternRewriter &rewriter) {
   hlfir::Schedule schedule =
@@ -1337,7 +1337,7 @@ class ForallOpConversion : public mlir::OpRewritePattern<hlfir::ForallOp> {
   explicit ForallOpConversion(mlir::MLIRContext *ctx, bool tryFusingAssignments)
       : OpRewritePattern{ctx}, tryFusingAssignments{tryFusingAssignments} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::ForallOp forallOp,
                   mlir::PatternRewriter &rewriter) const override {
     auto root = mlir::cast<hlfir::OrderedAssignmentTreeOpInterface>(
@@ -1354,7 +1354,7 @@ class WhereOpConversion : public mlir::OpRewritePattern<hlfir::WhereOp> {
   explicit WhereOpConversion(mlir::MLIRContext *ctx, bool tryFusingAssignments)
       : OpRewritePattern{ctx}, tryFusingAssignments{tryFusingAssignments} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::WhereOp whereOp,
                   mlir::PatternRewriter &rewriter) const override {
     auto root = mlir::cast<hlfir::OrderedAssignmentTreeOpInterface>(
@@ -1370,7 +1370,7 @@ class RegionAssignConversion
   explicit RegionAssignConversion(mlir::MLIRContext *ctx)
       : OpRewritePattern{ctx} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::RegionAssignOp regionAssignOp,
                   mlir::PatternRewriter &rewriter) const override {
     auto root = mlir::cast<hlfir::OrderedAssignmentTreeOpInterface>(
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp b/flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp
index 1dfa2f9d093bb..c5b809514c54c 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp
+++ b/flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp
@@ -89,7 +89,7 @@ class ElementalAssignBufferization
 public:
   using mlir::OpRewritePattern<hlfir::ElementalOp>::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::ElementalOp elemental,
                   mlir::PatternRewriter &rewriter) const override;
 };
@@ -465,7 +465,7 @@ ElementalAssignBufferization::findMatch(hlfir::ElementalOp elemental) {
   return match;
 }
 
-mlir::LogicalResult ElementalAssignBufferization::matchAndRewrite(
+llvm::LogicalResult ElementalAssignBufferization::matchAndRewrite(
     hlfir::ElementalOp elemental, mlir::PatternRewriter &rewriter) const {
   std::optional<MatchInfo> match = findMatch(elemental);
   if (!match)
@@ -519,12 +519,12 @@ class BroadcastAssignBufferization
 public:
   using mlir::OpRewritePattern<hlfir::AssignOp>::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::AssignOp assign,
                   mlir::PatternRewriter &rewriter) const override;
 };
 
-mlir::LogicalResult BroadcastAssignBufferization::matchAndRewrite(
+llvm::LogicalResult BroadcastAssignBufferization::matchAndRewrite(
     hlfir::AssignOp assign, mlir::PatternRewriter &rewriter) const {
   // Since RHS is a scalar and LHS is an array, LHS must be allocated
   // in a conforming Fortran program, and LHS cannot be reallocated
@@ -587,12 +587,12 @@ class VariableAssignBufferization
 public:
   using mlir::OpRewritePattern<hlfir::AssignOp>::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::AssignOp assign,
                   mlir::PatternRewriter &rewriter) const override;
 };
 
-mlir::LogicalResult VariableAssignBufferization::matchAndRewrite(
+llvm::LogicalResult VariableAssignBufferization::matchAndRewrite(
     hlfir::AssignOp assign, mlir::PatternRewriter &rewriter) const {
   if (assign.isAllocatableAssignment())
     return rewriter.notifyMatchFailure(assign, "AssignOp may imply allocation");
@@ -716,7 +716,7 @@ class ReductionElementalConversion : public mlir::OpRewritePattern<Op> {
 public:
   using mlir::OpRewritePattern<Op>::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(Op op, mlir::PatternRewriter &rewriter) const override {
     mlir::Location loc = op.getLoc();
     hlfir::ElementalOp elemental =
@@ -817,7 +817,7 @@ class MinMaxlocElementalConversion : public mlir::OpRewritePattern<Op> {
 public:
   using mlir::OpRewritePattern<Op>::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(Op mloc, mlir::PatternRewriter &rewriter) const override {
     if (!mloc.getMask() || mloc.getDim() || mloc.getBack())
       return rewriter.notifyMatchFailure(mloc,
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/SimplifyHLFIRIntrinsics.cpp b/flang/lib/Optimizer/HLFIR/Transforms/SimplifyHLFIRIntrinsics.cpp
index 6153c82fa7347..60b06437e6a98 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/SimplifyHLFIRIntrinsics.cpp
+++ b/flang/lib/Optimizer/HLFIR/Transforms/SimplifyHLFIRIntrinsics.cpp
@@ -35,7 +35,7 @@ class TransposeAsElementalConversion
 public:
   using mlir::OpRewritePattern<hlfir::TransposeOp>::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(hlfir::TransposeOp transpose,
                   mlir::PatternRewriter &rewriter) const override {
     mlir::Location loc = transpose.getLoc();
diff --git a/flang/lib/Optimizer/Transforms/AbstractResult.cpp b/flang/lib/Optimizer/Transforms/AbstractResult.cpp
index 85472cdc5103a..3906aa553cb34 100644
--- a/flang/lib/Optimizer/Transforms/AbstractResult.cpp
+++ b/flang/lib/Optimizer/Transforms/AbstractResult.cpp
@@ -84,7 +84,7 @@ class CallConversion : public mlir::OpRewritePattern<Op> {
   CallConversion(mlir::MLIRContext *context, bool shouldBoxResult)
       : OpRewritePattern<Op>(context, 1), shouldBoxResult{shouldBoxResult} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(Op op, mlir::PatternRewriter &rewriter) const override {
     auto loc = op.getLoc();
     auto result = op->getResult(0);
@@ -192,7 +192,7 @@ class SaveResultOpConversion
   using OpRewritePattern::OpRewritePattern;
   SaveResultOpConversion(mlir::MLIRContext *context)
       : OpRewritePattern(context) {}
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::SaveResultOp op,
                   mlir::PatternRewriter &rewriter) const override {
     rewriter.eraseOp(op);
@@ -205,7 +205,7 @@ class ReturnOpConversion : public mlir::OpRewritePattern<mlir::func::ReturnOp> {
   using OpRewritePattern::OpRewritePattern;
   ReturnOpConversion(mlir::MLIRContext *context, mlir::Value newArg)
       : OpRewritePattern(context), newArg{newArg} {}
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(mlir::func::ReturnOp ret,
                   mlir::PatternRewriter &rewriter) const override {
     auto loc = ret.getLoc();
@@ -258,7 +258,7 @@ class AddrOfOpConversion : public mlir::OpRewritePattern<fir::AddrOfOp> {
   using OpRewritePattern::OpRewritePattern;
   AddrOfOpConversion(mlir::MLIRContext *context, bool shouldBoxResult)
       : OpRewritePattern(context), shouldBoxResult{shouldBoxResult} {}
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::AddrOfOp addrOf,
                   mlir::PatternRewriter &rewriter) const override {
     auto oldFuncTy = mlir::cast<mlir::FunctionType>(addrOf.getType());
@@ -432,4 +432,4 @@ class AbstractResultOpt
 };
 
 } // end anonymous namespace
-} // namespace fir
\ No newline at end of file
+} // namespace fir
diff --git a/flang/lib/Optimizer/Transforms/AffineDemotion.cpp b/flang/lib/Optimizer/Transforms/AffineDemotion.cpp
index b4523a060f5a5..c416302d671eb 100644
--- a/flang/lib/Optimizer/Transforms/AffineDemotion.cpp
+++ b/flang/lib/Optimizer/Transforms/AffineDemotion.cpp
@@ -95,7 +95,7 @@ class AffineStoreConversion
 class ConvertConversion : public mlir::OpRewritePattern<fir::ConvertOp> {
 public:
   using OpRewritePattern::OpRewritePattern;
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::ConvertOp op,
                   mlir::PatternRewriter &rewriter) const override {
     if (mlir::isa<mlir::MemRefType>(op.getRes().getType())) {
@@ -133,7 +133,7 @@ mlir::Type convertMemRef(mlir::MemRefType type) {
 class StdAllocConversion : public mlir::OpRewritePattern<memref::AllocOp> {
 public:
   using OpRewritePattern::OpRewritePattern;
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(memref::AllocOp op,
                   mlir::PatternRewriter &rewriter) const override {
     rewriter.replaceOpWithNewOp<fir::AllocaOp>(op, convertMemRef(op.getType()),
diff --git a/flang/lib/Optimizer/Transforms/AffinePromotion.cpp b/flang/lib/Optimizer/Transforms/AffinePromotion.cpp
index 7d0131ac6fa4e..43fccf52dc8ab 100644
--- a/flang/lib/Optimizer/Transforms/AffinePromotion.cpp
+++ b/flang/lib/Optimizer/Transforms/AffinePromotion.cpp
@@ -453,7 +453,7 @@ class AffineLoopConversion : public mlir::OpRewritePattern<fir::DoLoopOp> {
   AffineLoopConversion(mlir::MLIRContext *context, AffineFunctionAnalysis &afa)
       : OpRewritePattern(context), functionAnalysis(afa) {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::DoLoopOp loop,
                   mlir::PatternRewriter &rewriter) const override {
     LLVM_DEBUG(llvm::dbgs() << "AffineLoopConversion: rewriting loop:\n";
@@ -546,7 +546,7 @@ class AffineIfConversion : public mlir::OpRewritePattern<fir::IfOp> {
   using OpRewritePattern::OpRewritePattern;
   AffineIfConversion(mlir::MLIRContext *context, AffineFunctionAnalysis &afa)
       : OpRewritePattern(context) {}
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::IfOp op,
                   mlir::PatternRewriter &rewriter) const override {
     LLVM_DEBUG(llvm::dbgs() << "AffineIfConversion: rewriting if:\n";
diff --git a/flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp b/flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp
index ebc1862225256..8544d17f62248 100644
--- a/flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp
+++ b/flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp
@@ -796,7 +796,7 @@ class ArrayLoadConversion : public mlir::OpRewritePattern<ArrayLoadOp> {
 public:
   using OpRewritePattern::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(ArrayLoadOp load,
                   mlir::PatternRewriter &rewriter) const override {
     LLVM_DEBUG(llvm::dbgs() << "replace load " << load << " with undef.\n");
@@ -810,7 +810,7 @@ class ArrayMergeStoreConversion
 public:
   using OpRewritePattern::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(ArrayMergeStoreOp store,
                   mlir::PatternRewriter &rewriter) const override {
     LLVM_DEBUG(llvm::dbgs() << "marking store " << store << " as dead.\n");
@@ -1248,7 +1248,7 @@ class ArrayUpdateConversion : public ArrayUpdateConversionBase<ArrayUpdateOp> {
                                  const OperationUseMapT &m)
       : ArrayUpdateConversionBase{ctx, a, m} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(ArrayUpdateOp update,
                   mlir::PatternRewriter &rewriter) const override {
     auto loc = update.getLoc();
@@ -1276,7 +1276,7 @@ class ArrayModifyConversion : public ArrayUpdateConversionBase<ArrayModifyOp> {
                                  const OperationUseMapT &m)
       : ArrayUpdateConversionBase{ctx, a, m} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(ArrayModifyOp modify,
                   mlir::PatternRewriter &rewriter) const override {
     auto loc = modify.getLoc();
@@ -1298,7 +1298,7 @@ class ArrayFetchConversion : public mlir::OpRewritePattern<ArrayFetchOp> {
                                 const OperationUseMapT &m)
       : OpRewritePattern{ctx}, useMap{m} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(ArrayFetchOp fetch,
                   mlir::PatternRewriter &rewriter) const override {
     auto *op = fetch.getOperation();
@@ -1329,7 +1329,7 @@ class ArrayAccessConversion : public ArrayUpdateConversionBase<ArrayAccessOp> {
                                  const OperationUseMapT &m)
       : ArrayUpdateConversionBase{ctx, a, m} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(ArrayAccessOp access,
                   mlir::PatternRewriter &rewriter) const override {
     auto *op = access.getOperation();
@@ -1362,7 +1362,7 @@ class ArrayAmendConversion : public mlir::OpRewritePattern<ArrayAmendOp> {
   explicit ArrayAmendConversion(mlir::MLIRContext *ctx)
       : OpRewritePattern{ctx} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(ArrayAmendOp amend,
                   mlir::PatternRewriter &rewriter) const override {
     auto *op = amend.getOperation();
diff --git a/flang/lib/Optimizer/Transforms/AssumedRankOpConversion.cpp b/flang/lib/Optimizer/Transforms/AssumedRankOpConversion.cpp
index 5dfc5009d2355..2c9c73e8a5394 100644
--- a/flang/lib/Optimizer/Transforms/AssumedRankOpConversion.cpp
+++ b/flang/lib/Optimizer/Transforms/AssumedRankOpConversion.cpp
@@ -63,7 +63,7 @@ class ReboxAssumedRankConv
       : mlir::OpRewritePattern<fir::ReboxAssumedRankOp>(context),
         symbolTable{symbolTable}, kindMap{kindMap} {};
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::ReboxAssumedRankOp rebox,
                   mlir::PatternRewriter &rewriter) const override {
     fir::FirOpBuilder builder{rewriter, kindMap, symbolTable};
@@ -123,7 +123,7 @@ class IsAssumedSizeConv : public mlir::OpRewritePattern<fir::IsAssumedSizeOp> {
       : mlir::OpRewritePattern<fir::IsAssumedSizeOp>(context),
         symbolTable{symbolTable}, kindMap{kindMap} {};
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::IsAssumedSizeOp isAssumedSizeOp,
                   mlir::PatternRewriter &rewriter) const override {
     fir::FirOpBuilder builder{rewriter, kindMap, symbolTable};
diff --git a/flang/lib/Optimizer/Transforms/CharacterConversion.cpp b/flang/lib/Optimizer/Transforms/CharacterConversion.cpp
index 44baad73aa258..aee7e8ca5cb66 100644
--- a/flang/lib/Optimizer/Transforms/CharacterConversion.cpp
+++ b/flang/lib/Optimizer/Transforms/CharacterConversion.cpp
@@ -38,7 +38,7 @@ class CharacterConvertConversion
 public:
   using OpRewritePattern::OpRewritePattern;
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::CharConvertOp conv,
                   mlir::PatternRewriter &rewriter) const override {
     auto kindMap = fir::getKindMapping(conv->getParentOfType<mlir::ModuleOp>());
diff --git a/flang/lib/Optimizer/Transforms/ConstantArgumentGlobalisation.cpp b/flang/lib/Optimizer/Transforms/ConstantArgumentGlobalisation.cpp
index f7074a79a8a8d..7d0b8b3d7bc53 100644
--- a/flang/lib/Optimizer/Transforms/ConstantArgumentGlobalisation.cpp
+++ b/flang/lib/Optimizer/Transforms/ConstantArgumentGlobalisation.cpp
@@ -37,7 +37,7 @@ class CallOpRewriter : public mlir::OpRewritePattern<fir::CallOp> {
   CallOpRewriter(mlir::MLIRContext *ctx, const mlir::DominanceInfo &_di)
       : OpRewritePattern(ctx), di(_di) {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::CallOp callOp,
                   mlir::PatternRewriter &rewriter) const override {
     LLVM_DEBUG(llvm::dbgs() << "Processing call op: " << callOp << "\n");
diff --git a/flang/lib/Optimizer/Transforms/ControlFlowConverter.cpp b/flang/lib/Optimizer/Transforms/ControlFlowConverter.cpp
index 1af5a68e85297..3b79d6d311b71 100644
--- a/flang/lib/Optimizer/Transforms/ControlFlowConverter.cpp
+++ b/flang/lib/Optimizer/Transforms/ControlFlowConverter.cpp
@@ -47,7 +47,7 @@ class CfgLoopConv : public mlir::OpRewritePattern<fir::DoLoopOp> {
       : mlir::OpRewritePattern<fir::DoLoopOp>(ctx),
         forceLoopToExecuteOnce(forceLoopToExecuteOnce), setNSW(setNSW) {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(DoLoopOp loop,
                   mlir::PatternRewriter &rewriter) const override {
     auto loc = loop.getLoc();
@@ -162,7 +162,7 @@ class CfgIfConv : public mlir::OpRewritePattern<fir::IfOp> {
   CfgIfConv(mlir::MLIRContext *ctx, bool forceLoopToExecuteOnce, bool setNSW)
       : mlir::OpRewritePattern<fir::IfOp>(ctx) {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(IfOp ifOp, mlir::PatternRewriter &rewriter) const override {
     auto loc = ifOp.getLoc();
 
@@ -228,7 +228,7 @@ class CfgIterWhileConv : public mlir::OpRewritePattern<fir::IterWhileOp> {
                    bool setNSW)
       : mlir::OpRewritePattern<fir::IterWhileOp>(ctx), setNSW(setNSW) {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::IterWhileOp whileOp,
                   mlir::PatternRewriter &rewriter) const override {
     auto loc = whileOp.getLoc();
diff --git a/flang/lib/Optimizer/Transforms/MemoryAllocation.cpp b/flang/lib/Optimizer/Transforms/MemoryAllocation.cpp
index ada67b4201e15..03b1ae89428af 100644
--- a/flang/lib/Optimizer/Transforms/MemoryAllocation.cpp
+++ b/flang/lib/Optimizer/Transforms/MemoryAllocation.cpp
@@ -100,7 +100,7 @@ class AllocaOpConversion : public mlir::OpRewritePattern<fir::AllocaOp> {
                      llvm::ArrayRef<mlir::Operation *> rets)
       : OpRewritePattern(ctx), returnOps(rets) {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::AllocaOp alloca,
                   mlir::PatternRewriter &rewriter) const override {
     auto loc = alloca.getLoc();
diff --git a/flang/lib/Optimizer/Transforms/PolymorphicOpConversion.cpp b/flang/lib/Optimizer/Transforms/PolymorphicOpConversion.cpp
index 76c12d2de5c44..57f19f257b569 100644
--- a/flang/lib/Optimizer/Transforms/PolymorphicOpConversion.cpp
+++ b/flang/lib/Optimizer/Transforms/PolymorphicOpConversion.cpp
@@ -50,7 +50,7 @@ class SelectTypeConv : public OpConversionPattern<fir::SelectTypeOp> {
   SelectTypeConv(mlir::MLIRContext *ctx)
       : mlir::OpConversionPattern<fir::SelectTypeOp>(ctx) {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::SelectTypeOp selectType, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override;
 
@@ -60,7 +60,7 @@ class SelectTypeConv : public OpConversionPattern<fir::SelectTypeOp> {
                                  mlir::Type ty, mlir::ModuleOp mod,
                                  mlir::PatternRewriter &rewriter) const;
 
-  mlir::LogicalResult genTypeLadderStep(mlir::Location loc,
+  llvm::LogicalResult genTypeLadderStep(mlir::Location loc,
                                         mlir::Value selector,
                                         mlir::Attribute attr, mlir::Block *dest,
                                         std::optional<mlir::ValueRange> destOps,
@@ -81,7 +81,7 @@ struct DispatchOpConv : public OpConversionPattern<fir::DispatchOp> {
       : mlir::OpConversionPattern<fir::DispatchOp>(ctx),
         bindingTables(bindingTables) {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::DispatchOp dispatch, OpAdaptor adaptor,
                   mlir::ConversionPatternRewriter &rewriter) const override {
     mlir::Location loc = dispatch.getLoc();
@@ -135,7 +135,7 @@ struct DispatchOpConv : public OpConversionPattern<fir::DispatchOp> {
     //   %18 = fir.field_index proc, !fir.type<_QM__fortran_type_infoTbinding>
     //   %19 = fir.coordinate_of %17, %18 : (!fir.ref<!fir.type<_QM__fortran_type_infoTbinding>>, !fir.field) -> !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_funptr>>
     //   %20 = fir.field_index __address, !fir.type<_QM__fortran_builtinsT__builtin_c_funptr>
-    //   %21 = fir.coordinate_of %19, %20 : (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_funptr>>, !fir.field) -> !fir.ref<i64> 
+    //   %21 = fir.coordinate_of %19, %20 : (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_funptr>>, !fir.field) -> !fir.ref<i64>
     //   %22 = fir.load %21 : !fir.ref<i64>
     //   %23 = fir.convert %22 : (i64) -> (() -> ())
     //   fir.call %23()  : () -> ()
@@ -217,7 +217,7 @@ struct DispatchOpConv : public OpConversionPattern<fir::DispatchOp> {
 class PolymorphicOpConversion
     : public fir::impl::PolymorphicOpConversionBase<PolymorphicOpConversion> {
 public:
-  mlir::LogicalResult initialize(mlir::MLIRContext *ctx) override {
+  llvm::LogicalResult initialize(mlir::MLIRContext *ctx) override {
     return mlir::success();
   }
 
@@ -250,7 +250,7 @@ class PolymorphicOpConversion
 };
 } // namespace
 
-mlir::LogicalResult SelectTypeConv::matchAndRewrite(
+llvm::LogicalResult SelectTypeConv::matchAndRewrite(
     fir::SelectTypeOp selectType, OpAdaptor adaptor,
     mlir::ConversionPatternRewriter &rewriter) const {
   auto operands = adaptor.getOperands();
@@ -341,7 +341,7 @@ mlir::LogicalResult SelectTypeConv::matchAndRewrite(
   return mlir::success();
 }
 
-mlir::LogicalResult SelectTypeConv::genTypeLadderStep(
+llvm::LogicalResult SelectTypeConv::genTypeLadderStep(
     mlir::Location loc, mlir::Value selector, mlir::Attribute attr,
     mlir::Block *dest, std::optional<mlir::ValueRange> destOps,
     mlir::ModuleOp mod, mlir::PatternRewriter &rewriter,
diff --git a/flang/lib/Optimizer/Transforms/StackArrays.cpp b/flang/lib/Optimizer/Transforms/StackArrays.cpp
index 7157b55b47c93..e8fa70ebc39d8 100644
--- a/flang/lib/Optimizer/Transforms/StackArrays.cpp
+++ b/flang/lib/Optimizer/Transforms/StackArrays.cpp
@@ -25,7 +25,6 @@
 #include "mlir/IR/Value.h"
 #include "mlir/Interfaces/LoopLikeInterface.h"
 #include "mlir/Pass/Pass.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 #include "mlir/Transforms/Passes.h"
 #include "llvm/ADT/DenseMap.h"
@@ -180,7 +179,7 @@ class StackArraysAnalysisWrapper {
 private:
   llvm::DenseMap<mlir::Operation *, AllocMemMap> funcMaps;
 
-  mlir::LogicalResult analyseFunction(mlir::Operation *func);
+  llvm::LogicalResult analyseFunction(mlir::Operation *func);
 };
 
 /// Converts a fir.allocmem to a fir.alloca
@@ -191,7 +190,7 @@ class AllocMemConversion : public mlir::OpRewritePattern<fir::AllocMemOp> {
       const StackArraysAnalysisWrapper::AllocMemMap &candidateOps)
       : OpRewritePattern(ctx), candidateOps{candidateOps} {}
 
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(fir::AllocMemOp allocmem,
                   mlir::PatternRewriter &rewriter) const override;
 
@@ -415,7 +414,7 @@ void AllocationAnalysis::processOperation(mlir::Operation *op) {
   visitOperationImpl(op, *before, after);
 }
 
-mlir::LogicalResult
+llvm::LogicalResult
 StackArraysAnalysisWrapper::analyseFunction(mlir::Operation *func) {
   assert(mlir::isa<mlir::func::FuncOp>(func));
   size_t nAllocs = 0;
@@ -507,7 +506,7 @@ static mlir::Value convertAllocationType(mlir::PatternRewriter &rewriter,
   return conv;
 }
 
-mlir::LogicalResult
+llvm::LogicalResult
 AllocMemConversion::matchAndRewrite(fir::AllocMemOp allocmem,
                                     mlir::PatternRewriter &rewriter) const {
   auto oldInsertionPt = rewriter.saveInsertionPoint();
diff --git a/flang/tools/bbc/bbc.cpp b/flang/tools/bbc/bbc.cpp
index 3485c1499d3b6..e5e41ad3e9cf2 100644
--- a/flang/tools/bbc/bbc.cpp
+++ b/flang/tools/bbc/bbc.cpp
@@ -269,7 +269,7 @@ createTargetMachine(llvm::StringRef targetTriple, std::string &error) {
 /// of the pass manager, allowing it to be invoked as soon as it's
 /// required without impacting the main pass pipeline that may be invoked
 /// more than once for verification.
-static mlir::LogicalResult runOpenMPPasses(mlir::ModuleOp mlirModule) {
+static llvm::LogicalResult runOpenMPPasses(mlir::ModuleOp mlirModule) {
   mlir::PassManager pm(mlirModule->getName(),
                        mlir::OpPassManager::Nesting::Implicit);
   fir::createOpenMPFIRPassPipeline(pm, enableOpenMPDevice);
@@ -285,7 +285,7 @@ static mlir::LogicalResult runOpenMPPasses(mlir::ModuleOp mlirModule) {
 // Translate Fortran input to FIR, a dialect of MLIR.
 //===----------------------------------------------------------------------===//
 
-static mlir::LogicalResult convertFortranSourceToMLIR(
+static llvm::LogicalResult convertFortranSourceToMLIR(
     std::string path, Fortran::parser::Options options,
     const ProgramName &programPrefix,
     Fortran::semantics::SemanticsContext &semanticsContext,
diff --git a/flang/tools/tco/tco.cpp b/flang/tools/tco/tco.cpp
index 399ea1362fda4..34ac0e1a5cb98 100644
--- a/flang/tools/tco/tco.cpp
+++ b/flang/tools/tco/tco.cpp
@@ -74,7 +74,7 @@ static void printModule(mlir::ModuleOp mod, raw_ostream &output) {
 }
 
 // compile a .fir file
-static mlir::LogicalResult
+static llvm::LogicalResult
 compileFIR(const mlir::PassPipelineCLParser &passPipeline) {
   // check that there is a file to load
   ErrorOr<std::unique_ptr<MemoryBuffer>> fileOrErr =
diff --git a/mlir/include/mlir/Support/LogicalResult.h b/llvm/include/llvm/Support/LogicalResult.h
similarity index 70%
rename from mlir/include/mlir/Support/LogicalResult.h
rename to llvm/include/llvm/Support/LogicalResult.h
index 7ee7046a59b50..2cfd866b7c96a 100644
--- a/mlir/include/mlir/Support/LogicalResult.h
+++ b/llvm/include/llvm/Support/LogicalResult.h
@@ -6,14 +6,13 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef MLIR_SUPPORT_LOGICALRESULT_H
-#define MLIR_SUPPORT_LOGICALRESULT_H
+#ifndef LLVM_SUPPORT_LOGICALRESULT_H
+#define LLVM_SUPPORT_LOGICALRESULT_H
 
-#include "mlir/Support/LLVM.h"
+#include <cassert>
 #include <optional>
 
-namespace mlir {
-
+namespace llvm {
 /// This class represents an efficient way to signal success or failure. It
 /// should be preferred over the use of `bool` when appropriate, as it avoids
 /// all of the ambiguity that arises in interpreting a boolean result. This
@@ -27,72 +26,71 @@ struct [[nodiscard]] LogicalResult {
 public:
   /// If isSuccess is true a `success` result is generated, otherwise a
   /// 'failure' result is generated.
-  static LogicalResult success(bool isSuccess = true) {
-    return LogicalResult(isSuccess);
+  static LogicalResult success(bool IsSuccess = true) {
+    return LogicalResult(IsSuccess);
   }
 
   /// If isFailure is true a `failure` result is generated, otherwise a
   /// 'success' result is generated.
-  static LogicalResult failure(bool isFailure = true) {
-    return LogicalResult(!isFailure);
+  static LogicalResult failure(bool IsFailure = true) {
+    return LogicalResult(!IsFailure);
   }
 
   /// Returns true if the provided LogicalResult corresponds to a success value.
-  bool succeeded() const { return isSuccess; }
+  constexpr bool succeeded() const { return IsSuccess; }
 
   /// Returns true if the provided LogicalResult corresponds to a failure value.
-  bool failed() const { return !isSuccess; }
+  constexpr bool failed() const { return !IsSuccess; }
 
 private:
-  LogicalResult(bool isSuccess) : isSuccess(isSuccess) {}
+  LogicalResult(bool IsSuccess) : IsSuccess(IsSuccess) {}
 
   /// Boolean indicating if this is a success result, if false this is a
   /// failure result.
-  bool isSuccess;
+  bool IsSuccess;
 };
 
 /// Utility function to generate a LogicalResult. If isSuccess is true a
 /// `success` result is generated, otherwise a 'failure' result is generated.
-inline LogicalResult success(bool isSuccess = true) {
-  return LogicalResult::success(isSuccess);
+inline LogicalResult success(bool IsSuccess = true) {
+  return LogicalResult::success(IsSuccess);
 }
 
 /// Utility function to generate a LogicalResult. If isFailure is true a
 /// `failure` result is generated, otherwise a 'success' result is generated.
-inline LogicalResult failure(bool isFailure = true) {
-  return LogicalResult::failure(isFailure);
+inline LogicalResult failure(bool IsFailure = true) {
+  return LogicalResult::failure(IsFailure);
 }
 
 /// Utility function that returns true if the provided LogicalResult corresponds
 /// to a success value.
-inline bool succeeded(LogicalResult result) { return result.succeeded(); }
+inline bool succeeded(LogicalResult Result) { return Result.succeeded(); }
 
 /// Utility function that returns true if the provided LogicalResult corresponds
 /// to a failure value.
-inline bool failed(LogicalResult result) { return result.failed(); }
+inline bool failed(LogicalResult Result) { return Result.failed(); }
 
 /// This class provides support for representing a failure result, or a valid
 /// value of type `T`. This allows for integrating with LogicalResult, while
 /// also providing a value on the success path.
-template <typename T>
-class [[nodiscard]] FailureOr : public std::optional<T> {
+template <typename T> class [[nodiscard]] FailureOr : public std::optional<T> {
 public:
   /// Allow constructing from a LogicalResult. The result *must* be a failure.
   /// Success results should use a proper instance of type `T`.
-  FailureOr(LogicalResult result) {
-    assert(failed(result) &&
+  FailureOr(LogicalResult Result) {
+    assert(failed(Result) &&
            "success should be constructed with an instance of 'T'");
   }
   FailureOr() : FailureOr(failure()) {}
-  FailureOr(T &&y) : std::optional<T>(std::forward<T>(y)) {}
-  FailureOr(const T &y) : std::optional<T>(y) {}
+  FailureOr(T &&Y) : std::optional<T>(std::forward<T>(Y)) {}
+  FailureOr(const T &Y) : std::optional<T>(Y) {}
   template <typename U,
             std::enable_if_t<std::is_constructible<T, U>::value> * = nullptr>
-  FailureOr(const FailureOr<U> &other)
-      : std::optional<T>(failed(other) ? std::optional<T>()
-                                       : std::optional<T>(*other)) {}
+  FailureOr(const FailureOr<U> &Other)
+      : std::optional<T>(failed(Other) ? std::optional<T>()
+                                       : std::optional<T>(*Other)) {}
 
-  operator LogicalResult() const { return success(this->has_value()); }
+  operator LogicalResult() const { return success(has_value()); }
 
 private:
   /// Hide the bool conversion as it easily creates confusion.
@@ -103,8 +101,8 @@ class [[nodiscard]] FailureOr : public std::optional<T> {
 /// Wrap a value on the success path in a FailureOr of the same value type.
 template <typename T,
           typename = std::enable_if_t<!std::is_convertible_v<T, bool>>>
-inline auto success(T &&t) {
-  return FailureOr<std::decay_t<T>>(std::forward<T>(t));
+inline auto success(T &&Y) {
+  return FailureOr<std::decay_t<T>>(std::forward<T>(Y));
 }
 
 /// This class represents success/failure for parsing-like operations that find
@@ -120,12 +118,11 @@ inline auto success(T &&t) {
 ///
 class [[nodiscard]] ParseResult : public LogicalResult {
 public:
-  ParseResult(LogicalResult result = success()) : LogicalResult(result) {}
+  ParseResult(LogicalResult Result = success()) : LogicalResult(Result) {}
 
   /// Failure is true in a boolean context.
-  explicit operator bool() const { return failed(); }
+  constexpr explicit operator bool() const { return failed(); }
 };
+} // namespace llvm
 
-} // namespace mlir
-
-#endif // MLIR_SUPPORT_LOGICALRESULT_H
+#endif // LLVM_SUPPORT_LOGICALRESULT_H
diff --git a/mlir/docs/PDLL.md b/mlir/docs/PDLL.md
index 340940f38547c..f5651156a860c 100644
--- a/mlir/docs/PDLL.md
+++ b/mlir/docs/PDLL.md
@@ -277,7 +277,7 @@ Pattern {
   // * Match Section
   //    - Describes the input IR.
   let root = op<toy.reshape>(op<toy.reshape>(arg: Value));
-  
+
   // * Rewrite Section
   //    - Describes how to transform the IR.
   //    - Last statement starts the rewrite.
@@ -1009,7 +1009,7 @@ Pattern {
   // Return a tuple of values.
   let result = ExtractMultipleResults(op: op<my_dialect.foo>);
 
-  // Index the tuple elements by index, or by name. 
+  // Index the tuple elements by index, or by name.
   replace op<my_dialect.foo> with (result.0, result.1, result.result1);
 }
 ```
@@ -1150,7 +1150,7 @@ same name. See the ["type translation"](#native-constraint-type-translations) be
 detailed information on how PDLL types are converted to native types. In addition to the
 PDLL arguments, the code block may also access the current `PatternRewriter` using
 `rewriter`. The result type of the native constraint function is implicitly defined
-as a `::mlir::LogicalResult`.
+as a `::llvm::LogicalResult`.
 
 Taking the constraints defined above as an example, these function would roughly be
 translated into:
@@ -1220,7 +1220,7 @@ was imported:
 
   * `Attr` constraints
     - Imported `Attr` constraints utilize the `storageType` field for native type translation.
-  
+
   * `Type` constraints
     - Imported `Type` constraints utilize the `cppClassName` field for native type translation.
 
@@ -1310,7 +1310,7 @@ Pattern {
 // A pattern that replaces the root operation with another operation.
 // Note that when an operation is used as the replacement, we can infer its
 // result types from the input operation. In these cases, the result
-// types of replacement operation may be elided. 
+// types of replacement operation may be elided.
 Pattern {
   // Note: In this pattern we also inlined the `root` expression.
   replace op<my_dialect.foo> with op<my_dialect.bar>;
@@ -1385,7 +1385,7 @@ Pattern {
     // Invoke the rewrite, which returns a tuple of values.
     let result = CreateRewriteOps();
 
-    // Index the tuple elements by index, or by name. 
+    // Index the tuple elements by index, or by name.
     replace root with (result.0, result.1, result.result1);
   }
 }
@@ -1466,7 +1466,7 @@ the C++ PDL API. For example, the rewrite above may be registered as:
 ```c++
 static Operation *buildOpImpl(PDLResultList &results, Value value) {
   // insert special rewrite logic here.
-  Operation *resultOp = ...; 
+  Operation *resultOp = ...;
   return resultOp;
 }
 
diff --git a/mlir/docs/Tutorials/Toy/Ch-2.md b/mlir/docs/Tutorials/Toy/Ch-2.md
index 680136941f6cb..b807ee3a20492 100644
--- a/mlir/docs/Tutorials/Toy/Ch-2.md
+++ b/mlir/docs/Tutorials/Toy/Ch-2.md
@@ -243,7 +243,7 @@ operation. This operation will represent a constant value in the Toy language.
 This operation takes zero operands, a
 [dense elements](../../Dialects/Builtin.md/#denseintorfpelementsattr) attribute named
 `value` to represent the constant value, and returns a single result of
-[RankedTensorType](../../Dialects/Builtin.md/#rankedtensortype). An operation class 
+[RankedTensorType](../../Dialects/Builtin.md/#rankedtensortype). An operation class
 inherits from the [CRTP](https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern)
 `mlir::Op` class which also takes some optional [*traits*](../../Traits) to
 customize its behavior. `Traits` are a mechanism with which we can inject
@@ -497,10 +497,10 @@ def ConstantOp : Toy_Op<"constant"> {
   let results = (outs F64Tensor);
 
   // Add additional verification logic to the constant operation. Setting this bit
-  // to `1` will generate a `::mlir::LogicalResult verify()` declaration on the
+  // to `1` will generate a `::llvm::LogicalResult verify()` declaration on the
   // operation class that is called after ODS constructs have been verified, for
   // example the types of arguments and results. We implement additional verification
-  // in the definition of this `verify` method in the C++ source file. 
+  // in the definition of this `verify` method in the C++ source file.
   let hasVerifier = 1;
 }
 ```
diff --git a/mlir/docs/Tutorials/Toy/Ch-3.md b/mlir/docs/Tutorials/Toy/Ch-3.md
index ac38cbe298d52..4cde64d781fc7 100644
--- a/mlir/docs/Tutorials/Toy/Ch-3.md
+++ b/mlir/docs/Tutorials/Toy/Ch-3.md
@@ -86,7 +86,7 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
   /// This method is attempting to match a pattern and rewrite it. The rewriter
   /// argument is the orchestrator of the sequence of rewrites. It is expected
   /// to interact with it to perform any changes to the IR from here.
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(TransposeOp op,
                   mlir::PatternRewriter &rewriter) const override {
     // Look through the input of the current transpose.
@@ -128,7 +128,7 @@ similar way to LLVM:
   pm.addNestedPass<mlir::toy::FuncOp>(mlir::createCanonicalizerPass());
 ```
 
-Finally, we can run `toyc-ch3 test/Examples/Toy/Ch3/transpose_transpose.toy 
+Finally, we can run `toyc-ch3 test/Examples/Toy/Ch3/transpose_transpose.toy
 -emit=mlir -opt` and observe our pattern in action:
 
 ```mlir
@@ -239,7 +239,7 @@ module {
 }
 ```
 
-We can try to run `toyc-ch3 test/Examples/Toy/Ch3/trivial_reshape.toy -emit=mlir 
+We can try to run `toyc-ch3 test/Examples/Toy/Ch3/trivial_reshape.toy -emit=mlir
 -opt` and observe our pattern in action:
 
 ```mlir
diff --git a/mlir/docs/Tutorials/Toy/Ch-5.md b/mlir/docs/Tutorials/Toy/Ch-5.md
index 6fe0080d77294..7d4f95e4e17dc 100644
--- a/mlir/docs/Tutorials/Toy/Ch-5.md
+++ b/mlir/docs/Tutorials/Toy/Ch-5.md
@@ -113,7 +113,7 @@ struct TransposeOpLowering : public mlir::ConversionPattern {
 
   /// Match and rewrite the given `toy.transpose` operation, with the given
   /// operands that have been remapped from `tensor<...>` to `memref<...>`.
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(mlir::Operation *op, ArrayRef<mlir::Value> operands,
                   mlir::ConversionPatternRewriter &rewriter) const final {
     auto loc = op->getLoc();
diff --git a/mlir/examples/standalone/lib/Standalone/StandalonePasses.cpp b/mlir/examples/standalone/lib/Standalone/StandalonePasses.cpp
index a23d0420f0435..8166aa238bf2c 100644
--- a/mlir/examples/standalone/lib/Standalone/StandalonePasses.cpp
+++ b/mlir/examples/standalone/lib/Standalone/StandalonePasses.cpp
@@ -8,7 +8,6 @@
 #include "mlir/Dialect/Func/IR/FuncOps.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/Rewrite/FrozenRewritePatternSet.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 
 #include "Standalone/StandalonePasses.h"
diff --git a/mlir/examples/standalone/standalone-translate/standalone-translate.cpp b/mlir/examples/standalone/standalone-translate/standalone-translate.cpp
index a4da328fd7899..46b9c77d3324f 100644
--- a/mlir/examples/standalone/standalone-translate/standalone-translate.cpp
+++ b/mlir/examples/standalone/standalone-translate/standalone-translate.cpp
@@ -15,7 +15,6 @@
 #include "mlir/IR/DialectRegistry.h"
 #include "mlir/IR/Operation.h"
 #include "mlir/InitAllTranslations.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Tools/mlir-translate/MlirTranslateMain.h"
 #include "mlir/Tools/mlir-translate/Translation.h"
 #include "llvm/Support/raw_ostream.h"
@@ -27,7 +26,7 @@ int main(int argc, char **argv) {
   mlir::TranslateFromMLIRRegistration withdescription(
       "option", "different from option",
       [](mlir::Operation *op, llvm::raw_ostream &output) {
-        return mlir::LogicalResult::success();
+        return llvm::LogicalResult::success();
       },
       [](mlir::DialectRegistry &a) {});
 
diff --git a/mlir/examples/toy/Ch2/mlir/Dialect.cpp b/mlir/examples/toy/Ch2/mlir/Dialect.cpp
index d35bd9fc5f731..489f348c8be52 100644
--- a/mlir/examples/toy/Ch2/mlir/Dialect.cpp
+++ b/mlir/examples/toy/Ch2/mlir/Dialect.cpp
@@ -22,7 +22,6 @@
 #include "mlir/IR/Value.h"
 #include "mlir/Interfaces/FunctionImplementation.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
@@ -142,7 +141,7 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
 
 /// Verifier for the constant operation. This corresponds to the
 /// `let hasVerifier = 1` in the op definition.
-mlir::LogicalResult ConstantOp::verify() {
+llvm::LogicalResult ConstantOp::verify() {
   // If the return type of the constant is not an unranked tensor, the shape
   // must match the shape of the attribute holding the data.
   auto resultType = llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
@@ -257,7 +256,7 @@ void MulOp::print(mlir::OpAsmPrinter &p) { printBinaryOp(p, *this); }
 // ReturnOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult ReturnOp::verify() {
+llvm::LogicalResult ReturnOp::verify() {
   // We know that the parent operation is a function, because of the 'HasParent'
   // trait attached to the operation definition.
   auto function = cast<FuncOp>((*this)->getParentOp());
@@ -300,7 +299,7 @@ void TransposeOp::build(mlir::OpBuilder &builder, mlir::OperationState &state,
   state.addOperands(value);
 }
 
-mlir::LogicalResult TransposeOp::verify() {
+llvm::LogicalResult TransposeOp::verify() {
   auto inputType = llvm::dyn_cast<RankedTensorType>(getOperand().getType());
   auto resultType = llvm::dyn_cast<RankedTensorType>(getType());
   if (!inputType || !resultType)
diff --git a/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp
index 2f0a88f7095b7..bf4c099fe05d2 100644
--- a/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp
@@ -15,7 +15,6 @@
 #include "mlir/IR/Block.h"
 #include "mlir/IR/Diagnostics.h"
 #include "mlir/IR/Value.h"
-#include "mlir/Support/LogicalResult.h"
 #include "toy/AST.h"
 #include "toy/Dialect.h"
 
@@ -105,7 +104,7 @@ class MLIRGenImpl {
 
   /// Declare a variable in the current scope, return success if the variable
   /// wasn't declared yet.
-  mlir::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
+  llvm::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
     if (symbolTable.count(var))
       return mlir::failure();
     symbolTable.insert(var, value);
@@ -225,7 +224,7 @@ class MLIRGenImpl {
   }
 
   /// Emit a return operation. This will return failure if any generation fails.
-  mlir::LogicalResult mlirGen(ReturnExprAST &ret) {
+  llvm::LogicalResult mlirGen(ReturnExprAST &ret) {
     auto location = loc(ret.loc());
 
     // 'return' takes an optional expression, handle that case here.
@@ -337,7 +336,7 @@ class MLIRGenImpl {
 
   /// Emit a print expression. It emits specific operations for two builtins:
   /// transpose(x) and print(x).
-  mlir::LogicalResult mlirGen(PrintExprAST &call) {
+  llvm::LogicalResult mlirGen(PrintExprAST &call) {
     auto arg = mlirGen(*call.getArg());
     if (!arg)
       return mlir::failure();
@@ -403,7 +402,7 @@ class MLIRGenImpl {
   }
 
   /// Codegen a list of expression, return failure if one of them hit an error.
-  mlir::LogicalResult mlirGen(ExprASTList &blockAST) {
+  llvm::LogicalResult mlirGen(ExprASTList &blockAST) {
     ScopedHashTableScope<StringRef, mlir::Value> varScope(symbolTable);
     for (auto &expr : blockAST) {
       // Specific handling for variable declarations, return statement, and
diff --git a/mlir/examples/toy/Ch3/mlir/Dialect.cpp b/mlir/examples/toy/Ch3/mlir/Dialect.cpp
index 79d82e59645d9..708855f18cf45 100644
--- a/mlir/examples/toy/Ch3/mlir/Dialect.cpp
+++ b/mlir/examples/toy/Ch3/mlir/Dialect.cpp
@@ -22,7 +22,6 @@
 #include "mlir/IR/Value.h"
 #include "mlir/Interfaces/FunctionImplementation.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
@@ -142,7 +141,7 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
 
 /// Verifier for the constant operation. This corresponds to the
 /// `let hasVerifier = 1` in the op definition.
-mlir::LogicalResult ConstantOp::verify() {
+llvm::LogicalResult ConstantOp::verify() {
   // If the return type of the constant is not an unranked tensor, the shape
   // must match the shape of the attribute holding the data.
   auto resultType = llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
@@ -257,7 +256,7 @@ void MulOp::print(mlir::OpAsmPrinter &p) { printBinaryOp(p, *this); }
 // ReturnOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult ReturnOp::verify() {
+llvm::LogicalResult ReturnOp::verify() {
   // We know that the parent operation is a function, because of the 'HasParent'
   // trait attached to the operation definition.
   auto function = cast<FuncOp>((*this)->getParentOp());
@@ -300,7 +299,7 @@ void TransposeOp::build(mlir::OpBuilder &builder, mlir::OperationState &state,
   state.addOperands(value);
 }
 
-mlir::LogicalResult TransposeOp::verify() {
+llvm::LogicalResult TransposeOp::verify() {
   auto inputType = llvm::dyn_cast<RankedTensorType>(getOperand().getType());
   auto resultType = llvm::dyn_cast<RankedTensorType>(getType());
   if (!inputType || !resultType)
diff --git a/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp
index 2f0a88f7095b7..bf4c099fe05d2 100644
--- a/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp
@@ -15,7 +15,6 @@
 #include "mlir/IR/Block.h"
 #include "mlir/IR/Diagnostics.h"
 #include "mlir/IR/Value.h"
-#include "mlir/Support/LogicalResult.h"
 #include "toy/AST.h"
 #include "toy/Dialect.h"
 
@@ -105,7 +104,7 @@ class MLIRGenImpl {
 
   /// Declare a variable in the current scope, return success if the variable
   /// wasn't declared yet.
-  mlir::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
+  llvm::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
     if (symbolTable.count(var))
       return mlir::failure();
     symbolTable.insert(var, value);
@@ -225,7 +224,7 @@ class MLIRGenImpl {
   }
 
   /// Emit a return operation. This will return failure if any generation fails.
-  mlir::LogicalResult mlirGen(ReturnExprAST &ret) {
+  llvm::LogicalResult mlirGen(ReturnExprAST &ret) {
     auto location = loc(ret.loc());
 
     // 'return' takes an optional expression, handle that case here.
@@ -337,7 +336,7 @@ class MLIRGenImpl {
 
   /// Emit a print expression. It emits specific operations for two builtins:
   /// transpose(x) and print(x).
-  mlir::LogicalResult mlirGen(PrintExprAST &call) {
+  llvm::LogicalResult mlirGen(PrintExprAST &call) {
     auto arg = mlirGen(*call.getArg());
     if (!arg)
       return mlir::failure();
@@ -403,7 +402,7 @@ class MLIRGenImpl {
   }
 
   /// Codegen a list of expression, return failure if one of them hit an error.
-  mlir::LogicalResult mlirGen(ExprASTList &blockAST) {
+  llvm::LogicalResult mlirGen(ExprASTList &blockAST) {
     ScopedHashTableScope<StringRef, mlir::Value> varScope(symbolTable);
     for (auto &expr : blockAST) {
       // Specific handling for variable declarations, return statement, and
diff --git a/mlir/examples/toy/Ch3/mlir/ToyCombine.cpp b/mlir/examples/toy/Ch3/mlir/ToyCombine.cpp
index 3ce35c86eb880..f8397c2e06490 100644
--- a/mlir/examples/toy/Ch3/mlir/ToyCombine.cpp
+++ b/mlir/examples/toy/Ch3/mlir/ToyCombine.cpp
@@ -14,7 +14,6 @@
 #include "mlir/IR/MLIRContext.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/Value.h"
-#include "mlir/Support/LogicalResult.h"
 #include "toy/Dialect.h"
 using namespace mlir;
 using namespace toy;
@@ -36,7 +35,7 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
   /// This method attempts to match a pattern and rewrite it. The rewriter
   /// argument is the orchestrator of the sequence of rewrites. The pattern is
   /// expected to interact with it to perform any changes to the IR from here.
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(TransposeOp op,
                   mlir::PatternRewriter &rewriter) const override {
     // Look through the input of the current transpose.
diff --git a/mlir/examples/toy/Ch3/toyc.cpp b/mlir/examples/toy/Ch3/toyc.cpp
index c2c5f1fe1ba17..f8aa846582267 100644
--- a/mlir/examples/toy/Ch3/toyc.cpp
+++ b/mlir/examples/toy/Ch3/toyc.cpp
@@ -11,7 +11,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "mlir/IR/Diagnostics.h"
-#include "mlir/Support/LogicalResult.h"
 #include "toy/AST.h"
 #include "toy/Dialect.h"
 #include "toy/Lexer.h"
diff --git a/mlir/examples/toy/Ch4/mlir/Dialect.cpp b/mlir/examples/toy/Ch4/mlir/Dialect.cpp
index 86a0e1df95c17..6c6cdd934cea8 100644
--- a/mlir/examples/toy/Ch4/mlir/Dialect.cpp
+++ b/mlir/examples/toy/Ch4/mlir/Dialect.cpp
@@ -23,7 +23,6 @@
 #include "mlir/Interfaces/CallInterfaces.h"
 #include "mlir/Interfaces/FunctionImplementation.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/InliningUtils.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
@@ -204,7 +203,7 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
 
 /// Verifier for the constant operation. This corresponds to the
 /// `let hasVerifier = 1` in the op definition.
-mlir::LogicalResult ConstantOp::verify() {
+llvm::LogicalResult ConstantOp::verify() {
   // If the return type of the constant is not an unranked tensor, the shape
   // must match the shape of the attribute holding the data.
   auto resultType = llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
@@ -372,7 +371,7 @@ void MulOp::inferShapes() { getResult().setType(getLhs().getType()); }
 // ReturnOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult ReturnOp::verify() {
+llvm::LogicalResult ReturnOp::verify() {
   // We know that the parent operation is a function, because of the 'HasParent'
   // trait attached to the operation definition.
   auto function = cast<FuncOp>((*this)->getParentOp());
@@ -421,7 +420,7 @@ void TransposeOp::inferShapes() {
   getResult().setType(RankedTensorType::get(dims, arrayTy.getElementType()));
 }
 
-mlir::LogicalResult TransposeOp::verify() {
+llvm::LogicalResult TransposeOp::verify() {
   auto inputType = llvm::dyn_cast<RankedTensorType>(getOperand().getType());
   auto resultType = llvm::dyn_cast<RankedTensorType>(getType());
   if (!inputType || !resultType)
diff --git a/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp
index 6c5474a9646bc..b56e2f7c90086 100644
--- a/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp
@@ -15,7 +15,6 @@
 #include "mlir/IR/Block.h"
 #include "mlir/IR/Diagnostics.h"
 #include "mlir/IR/Value.h"
-#include "mlir/Support/LogicalResult.h"
 #include "toy/AST.h"
 #include "toy/Dialect.h"
 
@@ -105,7 +104,7 @@ class MLIRGenImpl {
 
   /// Declare a variable in the current scope, return success if the variable
   /// wasn't declared yet.
-  mlir::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
+  llvm::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
     if (symbolTable.count(var))
       return mlir::failure();
     symbolTable.insert(var, value);
@@ -229,7 +228,7 @@ class MLIRGenImpl {
   }
 
   /// Emit a return operation. This will return failure if any generation fails.
-  mlir::LogicalResult mlirGen(ReturnExprAST &ret) {
+  llvm::LogicalResult mlirGen(ReturnExprAST &ret) {
     auto location = loc(ret.loc());
 
     // 'return' takes an optional expression, handle that case here.
@@ -341,7 +340,7 @@ class MLIRGenImpl {
 
   /// Emit a print expression. It emits specific operations for two builtins:
   /// transpose(x) and print(x).
-  mlir::LogicalResult mlirGen(PrintExprAST &call) {
+  llvm::LogicalResult mlirGen(PrintExprAST &call) {
     auto arg = mlirGen(*call.getArg());
     if (!arg)
       return mlir::failure();
@@ -407,7 +406,7 @@ class MLIRGenImpl {
   }
 
   /// Codegen a list of expression, return failure if one of them hit an error.
-  mlir::LogicalResult mlirGen(ExprASTList &blockAST) {
+  llvm::LogicalResult mlirGen(ExprASTList &blockAST) {
     ScopedHashTableScope<StringRef, mlir::Value> varScope(symbolTable);
     for (auto &expr : blockAST) {
       // Specific handling for variable declarations, return statement, and
diff --git a/mlir/examples/toy/Ch4/mlir/ToyCombine.cpp b/mlir/examples/toy/Ch4/mlir/ToyCombine.cpp
index 3ce35c86eb880..f8397c2e06490 100644
--- a/mlir/examples/toy/Ch4/mlir/ToyCombine.cpp
+++ b/mlir/examples/toy/Ch4/mlir/ToyCombine.cpp
@@ -14,7 +14,6 @@
 #include "mlir/IR/MLIRContext.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/Value.h"
-#include "mlir/Support/LogicalResult.h"
 #include "toy/Dialect.h"
 using namespace mlir;
 using namespace toy;
@@ -36,7 +35,7 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
   /// This method attempts to match a pattern and rewrite it. The rewriter
   /// argument is the orchestrator of the sequence of rewrites. The pattern is
   /// expected to interact with it to perform any changes to the IR from here.
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(TransposeOp op,
                   mlir::PatternRewriter &rewriter) const override {
     // Look through the input of the current transpose.
diff --git a/mlir/examples/toy/Ch4/toyc.cpp b/mlir/examples/toy/Ch4/toyc.cpp
index a1534ed30341c..ae02bc4314bab 100644
--- a/mlir/examples/toy/Ch4/toyc.cpp
+++ b/mlir/examples/toy/Ch4/toyc.cpp
@@ -11,7 +11,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "mlir/IR/Diagnostics.h"
-#include "mlir/Support/LogicalResult.h"
 #include "toy/AST.h"
 #include "toy/Dialect.h"
 #include "toy/Lexer.h"
diff --git a/mlir/examples/toy/Ch5/mlir/Dialect.cpp b/mlir/examples/toy/Ch5/mlir/Dialect.cpp
index c587dd27dc2b9..72072f9188bf3 100644
--- a/mlir/examples/toy/Ch5/mlir/Dialect.cpp
+++ b/mlir/examples/toy/Ch5/mlir/Dialect.cpp
@@ -23,7 +23,6 @@
 #include "mlir/Interfaces/CallInterfaces.h"
 #include "mlir/Interfaces/FunctionImplementation.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/InliningUtils.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
@@ -204,7 +203,7 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
 
 /// Verifier for the constant operation. This corresponds to the
 /// `let hasVerifier = 1` in the op definition.
-mlir::LogicalResult ConstantOp::verify() {
+llvm::LogicalResult ConstantOp::verify() {
   // If the return type of the constant is not an unranked tensor, the shape
   // must match the shape of the attribute holding the data.
   auto resultType = llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
@@ -372,7 +371,7 @@ void MulOp::inferShapes() { getResult().setType(getLhs().getType()); }
 // ReturnOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult ReturnOp::verify() {
+llvm::LogicalResult ReturnOp::verify() {
   // We know that the parent operation is a function, because of the 'HasParent'
   // trait attached to the operation definition.
   auto function = cast<FuncOp>((*this)->getParentOp());
@@ -421,7 +420,7 @@ void TransposeOp::inferShapes() {
   getResult().setType(RankedTensorType::get(dims, arrayTy.getElementType()));
 }
 
-mlir::LogicalResult TransposeOp::verify() {
+llvm::LogicalResult TransposeOp::verify() {
   auto inputType = llvm::dyn_cast<RankedTensorType>(getOperand().getType());
   auto resultType = llvm::dyn_cast<RankedTensorType>(getType());
   if (!inputType || !resultType)
diff --git a/mlir/examples/toy/Ch5/mlir/LowerToAffineLoops.cpp b/mlir/examples/toy/Ch5/mlir/LowerToAffineLoops.cpp
index bded61542188e..741321432b452 100644
--- a/mlir/examples/toy/Ch5/mlir/LowerToAffineLoops.cpp
+++ b/mlir/examples/toy/Ch5/mlir/LowerToAffineLoops.cpp
@@ -21,7 +21,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/ValueRange.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Support/TypeID.h"
 #include "toy/Dialect.h"
 #include "toy/Passes.h"
diff --git a/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp
index 6c5474a9646bc..b56e2f7c90086 100644
--- a/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp
@@ -15,7 +15,6 @@
 #include "mlir/IR/Block.h"
 #include "mlir/IR/Diagnostics.h"
 #include "mlir/IR/Value.h"
-#include "mlir/Support/LogicalResult.h"
 #include "toy/AST.h"
 #include "toy/Dialect.h"
 
@@ -105,7 +104,7 @@ class MLIRGenImpl {
 
   /// Declare a variable in the current scope, return success if the variable
   /// wasn't declared yet.
-  mlir::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
+  llvm::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
     if (symbolTable.count(var))
       return mlir::failure();
     symbolTable.insert(var, value);
@@ -229,7 +228,7 @@ class MLIRGenImpl {
   }
 
   /// Emit a return operation. This will return failure if any generation fails.
-  mlir::LogicalResult mlirGen(ReturnExprAST &ret) {
+  llvm::LogicalResult mlirGen(ReturnExprAST &ret) {
     auto location = loc(ret.loc());
 
     // 'return' takes an optional expression, handle that case here.
@@ -341,7 +340,7 @@ class MLIRGenImpl {
 
   /// Emit a print expression. It emits specific operations for two builtins:
   /// transpose(x) and print(x).
-  mlir::LogicalResult mlirGen(PrintExprAST &call) {
+  llvm::LogicalResult mlirGen(PrintExprAST &call) {
     auto arg = mlirGen(*call.getArg());
     if (!arg)
       return mlir::failure();
@@ -407,7 +406,7 @@ class MLIRGenImpl {
   }
 
   /// Codegen a list of expression, return failure if one of them hit an error.
-  mlir::LogicalResult mlirGen(ExprASTList &blockAST) {
+  llvm::LogicalResult mlirGen(ExprASTList &blockAST) {
     ScopedHashTableScope<StringRef, mlir::Value> varScope(symbolTable);
     for (auto &expr : blockAST) {
       // Specific handling for variable declarations, return statement, and
diff --git a/mlir/examples/toy/Ch5/mlir/ToyCombine.cpp b/mlir/examples/toy/Ch5/mlir/ToyCombine.cpp
index 3ce35c86eb880..f8397c2e06490 100644
--- a/mlir/examples/toy/Ch5/mlir/ToyCombine.cpp
+++ b/mlir/examples/toy/Ch5/mlir/ToyCombine.cpp
@@ -14,7 +14,6 @@
 #include "mlir/IR/MLIRContext.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/Value.h"
-#include "mlir/Support/LogicalResult.h"
 #include "toy/Dialect.h"
 using namespace mlir;
 using namespace toy;
@@ -36,7 +35,7 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
   /// This method attempts to match a pattern and rewrite it. The rewriter
   /// argument is the orchestrator of the sequence of rewrites. The pattern is
   /// expected to interact with it to perform any changes to the IR from here.
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(TransposeOp op,
                   mlir::PatternRewriter &rewriter) const override {
     // Look through the input of the current transpose.
diff --git a/mlir/examples/toy/Ch5/toyc.cpp b/mlir/examples/toy/Ch5/toyc.cpp
index 4eb6fdeeafa1d..6a0c6318bae2a 100644
--- a/mlir/examples/toy/Ch5/toyc.cpp
+++ b/mlir/examples/toy/Ch5/toyc.cpp
@@ -12,7 +12,6 @@
 
 #include "mlir/Dialect/Func/Extensions/AllExtensions.h"
 #include "mlir/IR/Diagnostics.h"
-#include "mlir/Support/LogicalResult.h"
 #include "toy/AST.h"
 #include "toy/Dialect.h"
 #include "toy/Lexer.h"
diff --git a/mlir/examples/toy/Ch6/mlir/Dialect.cpp b/mlir/examples/toy/Ch6/mlir/Dialect.cpp
index c587dd27dc2b9..72072f9188bf3 100644
--- a/mlir/examples/toy/Ch6/mlir/Dialect.cpp
+++ b/mlir/examples/toy/Ch6/mlir/Dialect.cpp
@@ -23,7 +23,6 @@
 #include "mlir/Interfaces/CallInterfaces.h"
 #include "mlir/Interfaces/FunctionImplementation.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/InliningUtils.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
@@ -204,7 +203,7 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
 
 /// Verifier for the constant operation. This corresponds to the
 /// `let hasVerifier = 1` in the op definition.
-mlir::LogicalResult ConstantOp::verify() {
+llvm::LogicalResult ConstantOp::verify() {
   // If the return type of the constant is not an unranked tensor, the shape
   // must match the shape of the attribute holding the data.
   auto resultType = llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
@@ -372,7 +371,7 @@ void MulOp::inferShapes() { getResult().setType(getLhs().getType()); }
 // ReturnOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult ReturnOp::verify() {
+llvm::LogicalResult ReturnOp::verify() {
   // We know that the parent operation is a function, because of the 'HasParent'
   // trait attached to the operation definition.
   auto function = cast<FuncOp>((*this)->getParentOp());
@@ -421,7 +420,7 @@ void TransposeOp::inferShapes() {
   getResult().setType(RankedTensorType::get(dims, arrayTy.getElementType()));
 }
 
-mlir::LogicalResult TransposeOp::verify() {
+llvm::LogicalResult TransposeOp::verify() {
   auto inputType = llvm::dyn_cast<RankedTensorType>(getOperand().getType());
   auto resultType = llvm::dyn_cast<RankedTensorType>(getType());
   if (!inputType || !resultType)
diff --git a/mlir/examples/toy/Ch6/mlir/LowerToAffineLoops.cpp b/mlir/examples/toy/Ch6/mlir/LowerToAffineLoops.cpp
index bded61542188e..741321432b452 100644
--- a/mlir/examples/toy/Ch6/mlir/LowerToAffineLoops.cpp
+++ b/mlir/examples/toy/Ch6/mlir/LowerToAffineLoops.cpp
@@ -21,7 +21,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/ValueRange.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Support/TypeID.h"
 #include "toy/Dialect.h"
 #include "toy/Passes.h"
diff --git a/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp b/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp
index f91d880413c9c..3ad70e7279692 100644
--- a/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp
+++ b/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp
@@ -28,7 +28,6 @@
 #include "mlir/IR/BuiltinOps.h"
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Support/TypeID.h"
 #include "toy/Dialect.h"
 #include "toy/Passes.h"
diff --git a/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp
index 6c5474a9646bc..b56e2f7c90086 100644
--- a/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp
@@ -15,7 +15,6 @@
 #include "mlir/IR/Block.h"
 #include "mlir/IR/Diagnostics.h"
 #include "mlir/IR/Value.h"
-#include "mlir/Support/LogicalResult.h"
 #include "toy/AST.h"
 #include "toy/Dialect.h"
 
@@ -105,7 +104,7 @@ class MLIRGenImpl {
 
   /// Declare a variable in the current scope, return success if the variable
   /// wasn't declared yet.
-  mlir::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
+  llvm::LogicalResult declare(llvm::StringRef var, mlir::Value value) {
     if (symbolTable.count(var))
       return mlir::failure();
     symbolTable.insert(var, value);
@@ -229,7 +228,7 @@ class MLIRGenImpl {
   }
 
   /// Emit a return operation. This will return failure if any generation fails.
-  mlir::LogicalResult mlirGen(ReturnExprAST &ret) {
+  llvm::LogicalResult mlirGen(ReturnExprAST &ret) {
     auto location = loc(ret.loc());
 
     // 'return' takes an optional expression, handle that case here.
@@ -341,7 +340,7 @@ class MLIRGenImpl {
 
   /// Emit a print expression. It emits specific operations for two builtins:
   /// transpose(x) and print(x).
-  mlir::LogicalResult mlirGen(PrintExprAST &call) {
+  llvm::LogicalResult mlirGen(PrintExprAST &call) {
     auto arg = mlirGen(*call.getArg());
     if (!arg)
       return mlir::failure();
@@ -407,7 +406,7 @@ class MLIRGenImpl {
   }
 
   /// Codegen a list of expression, return failure if one of them hit an error.
-  mlir::LogicalResult mlirGen(ExprASTList &blockAST) {
+  llvm::LogicalResult mlirGen(ExprASTList &blockAST) {
     ScopedHashTableScope<StringRef, mlir::Value> varScope(symbolTable);
     for (auto &expr : blockAST) {
       // Specific handling for variable declarations, return statement, and
diff --git a/mlir/examples/toy/Ch6/mlir/ToyCombine.cpp b/mlir/examples/toy/Ch6/mlir/ToyCombine.cpp
index 3ce35c86eb880..f8397c2e06490 100644
--- a/mlir/examples/toy/Ch6/mlir/ToyCombine.cpp
+++ b/mlir/examples/toy/Ch6/mlir/ToyCombine.cpp
@@ -14,7 +14,6 @@
 #include "mlir/IR/MLIRContext.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/Value.h"
-#include "mlir/Support/LogicalResult.h"
 #include "toy/Dialect.h"
 using namespace mlir;
 using namespace toy;
@@ -36,7 +35,7 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
   /// This method attempts to match a pattern and rewrite it. The rewriter
   /// argument is the orchestrator of the sequence of rewrites. The pattern is
   /// expected to interact with it to perform any changes to the IR from here.
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(TransposeOp op,
                   mlir::PatternRewriter &rewriter) const override {
     // Look through the input of the current transpose.
diff --git a/mlir/examples/toy/Ch6/toyc.cpp b/mlir/examples/toy/Ch6/toyc.cpp
index ddc0c2516bb3c..c244b31434ba9 100644
--- a/mlir/examples/toy/Ch6/toyc.cpp
+++ b/mlir/examples/toy/Ch6/toyc.cpp
@@ -12,7 +12,6 @@
 
 #include "mlir/Dialect/Func/Extensions/AllExtensions.h"
 #include "mlir/Dialect/LLVMIR/LLVMDialect.h"
-#include "mlir/Support/LogicalResult.h"
 #include "toy/AST.h"
 #include "toy/Dialect.h"
 #include "toy/Lexer.h"
diff --git a/mlir/examples/toy/Ch7/mlir/Dialect.cpp b/mlir/examples/toy/Ch7/mlir/Dialect.cpp
index b268b1ef157f9..7e030ffc5488c 100644
--- a/mlir/examples/toy/Ch7/mlir/Dialect.cpp
+++ b/mlir/examples/toy/Ch7/mlir/Dialect.cpp
@@ -27,7 +27,6 @@
 #include "mlir/Interfaces/CallInterfaces.h"
 #include "mlir/Interfaces/FunctionImplementation.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/InliningUtils.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/Hashing.h"
@@ -195,7 +194,7 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
 }
 
 /// Verify that the given attribute value is valid for the given type.
-static mlir::LogicalResult verifyConstantForType(mlir::Type type,
+static llvm::LogicalResult verifyConstantForType(mlir::Type type,
                                                  mlir::Attribute opaqueValue,
                                                  mlir::Operation *op) {
   if (llvm::isa<mlir::TensorType>(type)) {
@@ -252,11 +251,11 @@ static mlir::LogicalResult verifyConstantForType(mlir::Type type,
 
 /// Verifier for the constant operation. This corresponds to the `::verify(...)`
 /// in the op definition.
-mlir::LogicalResult ConstantOp::verify() {
+llvm::LogicalResult ConstantOp::verify() {
   return verifyConstantForType(getResult().getType(), getValue(), *this);
 }
 
-mlir::LogicalResult StructConstantOp::verify() {
+llvm::LogicalResult StructConstantOp::verify() {
   return verifyConstantForType(getResult().getType(), getValue(), *this);
 }
 
@@ -406,7 +405,7 @@ void MulOp::inferShapes() { getResult().setType(getLhs().getType()); }
 // ReturnOp
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult ReturnOp::verify() {
+llvm::LogicalResult ReturnOp::verify() {
   // We know that the parent operation is a function, because of the 'HasParent'
   // trait attached to the operation definition.
   auto function = cast<FuncOp>((*this)->getParentOp());
@@ -454,7 +453,7 @@ void StructAccessOp::build(mlir::OpBuilder &b, mlir::OperationState &state,
   build(b, state, resultType, input, b.getI64IntegerAttr(index));
 }
 
-mlir::LogicalResult StructAccessOp::verify() {
+llvm::LogicalResult StructAccessOp::verify() {
   StructType structTy = llvm::cast<StructType>(getInput().getType());
   size_t indexValue = getIndex();
   if (indexValue >= structTy.getNumElementTypes())
@@ -483,7 +482,7 @@ void TransposeOp::inferShapes() {
   getResult().setType(RankedTensorType::get(dims, arrayTy.getElementType()));
 }
 
-mlir::LogicalResult TransposeOp::verify() {
+llvm::LogicalResult TransposeOp::verify() {
   auto inputType = llvm::dyn_cast<RankedTensorType>(getOperand().getType());
   auto resultType = llvm::dyn_cast<RankedTensorType>(getType());
   if (!inputType || !resultType)
diff --git a/mlir/examples/toy/Ch7/mlir/LowerToAffineLoops.cpp b/mlir/examples/toy/Ch7/mlir/LowerToAffineLoops.cpp
index bded61542188e..741321432b452 100644
--- a/mlir/examples/toy/Ch7/mlir/LowerToAffineLoops.cpp
+++ b/mlir/examples/toy/Ch7/mlir/LowerToAffineLoops.cpp
@@ -21,7 +21,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/ValueRange.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Support/TypeID.h"
 #include "toy/Dialect.h"
 #include "toy/Passes.h"
diff --git a/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp b/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp
index f91d880413c9c..3ad70e7279692 100644
--- a/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp
+++ b/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp
@@ -28,7 +28,6 @@
 #include "mlir/IR/BuiltinOps.h"
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Support/TypeID.h"
 #include "toy/Dialect.h"
 #include "toy/Passes.h"
diff --git a/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp
index 0f8e8df38525f..090e5ff914604 100644
--- a/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp
@@ -15,7 +15,6 @@
 #include "mlir/IR/Block.h"
 #include "mlir/IR/Diagnostics.h"
 #include "mlir/IR/Value.h"
-#include "mlir/Support/LogicalResult.h"
 #include "toy/AST.h"
 #include "toy/Dialect.h"
 
@@ -133,7 +132,7 @@ class MLIRGenImpl {
 
   /// Declare a variable in the current scope, return success if the variable
   /// wasn't declared yet.
-  mlir::LogicalResult declare(VarDeclExprAST &var, mlir::Value value) {
+  llvm::LogicalResult declare(VarDeclExprAST &var, mlir::Value value) {
     if (symbolTable.count(var.getName()))
       return mlir::failure();
     symbolTable.insert(var.getName(), {value, &var});
@@ -141,7 +140,7 @@ class MLIRGenImpl {
   }
 
   /// Create an MLIR type for the given struct.
-  mlir::LogicalResult mlirGen(StructAST &str) {
+  llvm::LogicalResult mlirGen(StructAST &str) {
     if (structMap.count(str.getName()))
       return emitError(loc(str.loc())) << "error: struct type with name `"
                                        << str.getName() << "' already exists";
@@ -368,7 +367,7 @@ class MLIRGenImpl {
   }
 
   /// Emit a return operation. This will return failure if any generation fails.
-  mlir::LogicalResult mlirGen(ReturnExprAST &ret) {
+  llvm::LogicalResult mlirGen(ReturnExprAST &ret) {
     auto location = loc(ret.loc());
 
     // 'return' takes an optional expression, handle that case here.
@@ -542,7 +541,7 @@ class MLIRGenImpl {
 
   /// Emit a print expression. It emits specific operations for two builtins:
   /// transpose(x) and print(x).
-  mlir::LogicalResult mlirGen(PrintExprAST &call) {
+  llvm::LogicalResult mlirGen(PrintExprAST &call) {
     auto arg = mlirGen(*call.getArg());
     if (!arg)
       return mlir::failure();
@@ -626,7 +625,7 @@ class MLIRGenImpl {
   }
 
   /// Codegen a list of expression, return failure if one of them hit an error.
-  mlir::LogicalResult mlirGen(ExprASTList &blockAST) {
+  llvm::LogicalResult mlirGen(ExprASTList &blockAST) {
     SymbolTableScopeT varScope(symbolTable);
     for (auto &expr : blockAST) {
       // Specific handling for variable declarations, return statement, and
diff --git a/mlir/examples/toy/Ch7/mlir/ToyCombine.cpp b/mlir/examples/toy/Ch7/mlir/ToyCombine.cpp
index 72f5e4b5c847b..1d8cf744739e1 100644
--- a/mlir/examples/toy/Ch7/mlir/ToyCombine.cpp
+++ b/mlir/examples/toy/Ch7/mlir/ToyCombine.cpp
@@ -16,7 +16,6 @@
 #include "mlir/IR/OpDefinition.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/Value.h"
-#include "mlir/Support/LogicalResult.h"
 #include "toy/Dialect.h"
 #include "llvm/Support/Casting.h"
 #include <cstddef>
@@ -57,7 +56,7 @@ struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
   /// This method attempts to match a pattern and rewrite it. The rewriter
   /// argument is the orchestrator of the sequence of rewrites. The pattern is
   /// expected to interact with it to perform any changes to the IR from here.
-  mlir::LogicalResult
+  llvm::LogicalResult
   matchAndRewrite(TransposeOp op,
                   mlir::PatternRewriter &rewriter) const override {
     // Look through the input of the current transpose.
diff --git a/mlir/examples/toy/Ch7/toyc.cpp b/mlir/examples/toy/Ch7/toyc.cpp
index 5eb40b779bcd6..fea56796adf10 100644
--- a/mlir/examples/toy/Ch7/toyc.cpp
+++ b/mlir/examples/toy/Ch7/toyc.cpp
@@ -12,7 +12,6 @@
 
 #include "mlir/Dialect/Func/Extensions/AllExtensions.h"
 #include "mlir/Dialect/LLVMIR/LLVMDialect.h"
-#include "mlir/Support/LogicalResult.h"
 #include "toy/AST.h"
 #include "toy/Dialect.h"
 #include "toy/Lexer.h"
diff --git a/mlir/examples/transform-opt/mlir-transform-opt.cpp b/mlir/examples/transform-opt/mlir-transform-opt.cpp
index 41a17f18726b1..65615fb25bff6 100644
--- a/mlir/examples/transform-opt/mlir-transform-opt.cpp
+++ b/mlir/examples/transform-opt/mlir-transform-opt.cpp
@@ -118,7 +118,7 @@ class DiagnosticHandlerWrapper {
   DiagnosticHandlerWrapper &operator=(DiagnosticHandlerWrapper &&) = default;
 
   /// Verifies the captured "expected-*" diagnostics if required.
-  mlir::LogicalResult verify() const {
+  llvm::LogicalResult verify() const {
     if (auto *ptr =
             handler.dyn_cast<mlir::SourceMgrDiagnosticVerifierHandler *>()) {
       return ptr->verify();
@@ -192,7 +192,7 @@ class TransformSourceMgr {
   /// If diagnostic message verification has been requested upon construction of
   /// this source manager, performs the verification, reports errors and returns
   /// the result of the verification. Otherwise passes through the given value.
-  mlir::LogicalResult checkResult(mlir::LogicalResult result) {
+  llvm::LogicalResult checkResult(llvm::LogicalResult result) {
     resultChecked = true;
     if (!verifyDiagnostics)
       return result;
@@ -222,7 +222,7 @@ class TransformSourceMgr {
 
 /// Trivial wrapper around `applyTransforms` that doesn't support extra mapping
 /// and doesn't enforce the entry point transform ops being top-level.
-static mlir::LogicalResult
+static llvm::LogicalResult
 applyTransforms(mlir::Operation *payloadRoot,
                 mlir::transform::TransformOpInterface transformRoot,
                 const mlir::transform::TransformOptions &options) {
@@ -237,7 +237,7 @@ applyTransforms(mlir::Operation *payloadRoot,
 /// application is successful, prints the transformed input buffer into the
 /// given output stream. Additional configuration options are derived from
 /// command-line options.
-static mlir::LogicalResult processPayloadBuffer(
+static llvm::LogicalResult processPayloadBuffer(
     raw_ostream &os, std::unique_ptr<MemoryBuffer> inputBuffer,
     std::unique_ptr<llvm::MemoryBuffer> transformBuffer,
     MutableArrayRef<std::unique_ptr<MemoryBuffer>> transformLibraries,
@@ -309,7 +309,7 @@ static mlir::LogicalResult processPayloadBuffer(
 }
 
 /// Tool entry point.
-static mlir::LogicalResult runMain(int argc, char **argv) {
+static llvm::LogicalResult runMain(int argc, char **argv) {
   // Register all upstream dialects and extensions. Specific uses are advised
   // not to register all dialects indiscriminately but rather hand-pick what is
   // necessary for their use case.
diff --git a/mlir/examples/transform/Ch4/lib/MyExtension.cpp b/mlir/examples/transform/Ch4/lib/MyExtension.cpp
index 079073679fc43..38c8ca1125a24 100644
--- a/mlir/examples/transform/Ch4/lib/MyExtension.cpp
+++ b/mlir/examples/transform/Ch4/lib/MyExtension.cpp
@@ -166,7 +166,7 @@ void mlir::transform::HasOperandSatisfyingOp::getEffects(
 
 // Verify well-formedness of the operation and emit diagnostics if it is
 // ill-formed.
-mlir::LogicalResult mlir::transform::HasOperandSatisfyingOp::verify() {
+llvm::LogicalResult mlir::transform::HasOperandSatisfyingOp::verify() {
   mlir::Block &bodyBlock = getBody().front();
   if (bodyBlock.getNumArguments() != 1 ||
       !isa<TransformValueHandleTypeInterface>(
diff --git a/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h b/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h
index cc6ab64b4b7d7..63305e0cbf8d7 100644
--- a/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h
+++ b/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h
@@ -13,7 +13,6 @@
 #include "mlir/Analysis/Presburger/Matrix.h"
 #include "mlir/IR/AffineExpr.h"
 #include "mlir/IR/OpDefinition.h"
-#include "mlir/Support/LogicalResult.h"
 #include <optional>
 
 namespace mlir {
diff --git a/mlir/include/mlir/Bytecode/BytecodeImplementation.h b/mlir/include/mlir/Bytecode/BytecodeImplementation.h
index bc91318cf1b6a..0ddc531073e23 100644
--- a/mlir/include/mlir/Bytecode/BytecodeImplementation.h
+++ b/mlir/include/mlir/Bytecode/BytecodeImplementation.h
@@ -19,7 +19,6 @@
 #include "mlir/IR/Dialect.h"
 #include "mlir/IR/DialectInterface.h"
 #include "mlir/IR/OpImplementation.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/Twine.h"
 
diff --git a/mlir/include/mlir/Bytecode/BytecodeOpInterface.h b/mlir/include/mlir/Bytecode/BytecodeOpInterface.h
index 10f5be0737914..c9c60608fa5b9 100644
--- a/mlir/include/mlir/Bytecode/BytecodeOpInterface.h
+++ b/mlir/include/mlir/Bytecode/BytecodeOpInterface.h
@@ -18,7 +18,6 @@
 #include "mlir/Bytecode/BytecodeReader.h"
 #include "mlir/Bytecode/BytecodeWriter.h"
 #include "mlir/IR/OpDefinition.h"
-#include "mlir/Support/LogicalResult.h"
 
 /// Include the generated interface declarations.
 #include "mlir/Bytecode/BytecodeOpInterface.h.inc"
diff --git a/mlir/include/mlir/Bytecode/BytecodeReader.h b/mlir/include/mlir/Bytecode/BytecodeReader.h
index 9f26506d486ee..19f74a0750cc9 100644
--- a/mlir/include/mlir/Bytecode/BytecodeReader.h
+++ b/mlir/include/mlir/Bytecode/BytecodeReader.h
@@ -15,7 +15,6 @@
 
 #include "mlir/IR/AsmState.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include <functional>
 #include <memory>
 
diff --git a/mlir/include/mlir/Bytecode/BytecodeReaderConfig.h b/mlir/include/mlir/Bytecode/BytecodeReaderConfig.h
index d623d0da2c0c9..47be732fa3880 100644
--- a/mlir/include/mlir/Bytecode/BytecodeReaderConfig.h
+++ b/mlir/include/mlir/Bytecode/BytecodeReaderConfig.h
@@ -14,7 +14,6 @@
 #define MLIR_BYTECODE_BYTECODEREADERCONFIG_H
 
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
diff --git a/mlir/include/mlir/CAPI/Support.h b/mlir/include/mlir/CAPI/Support.h
index 622745256111e..89a460375f936 100644
--- a/mlir/include/mlir/CAPI/Support.h
+++ b/mlir/include/mlir/CAPI/Support.h
@@ -17,9 +17,9 @@
 
 #include "mlir-c/Support.h"
 #include "mlir/CAPI/Wrap.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Support/TypeID.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/LogicalResult.h"
 
 namespace llvm {
 class ThreadPoolInterface;
@@ -35,13 +35,13 @@ inline llvm::StringRef unwrap(MlirStringRef ref) {
   return llvm::StringRef(ref.data, ref.length);
 }
 
-inline MlirLogicalResult wrap(mlir::LogicalResult res) {
+inline MlirLogicalResult wrap(llvm::LogicalResult res) {
   if (mlir::succeeded(res))
     return mlirLogicalResultSuccess();
   return mlirLogicalResultFailure();
 }
 
-inline mlir::LogicalResult unwrap(MlirLogicalResult res) {
+inline llvm::LogicalResult unwrap(MlirLogicalResult res) {
   return mlir::success(mlirLogicalResultIsSuccess(res));
 }
 
diff --git a/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h b/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h
index 3850a0088575e..96ee4f0255d9a 100644
--- a/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h
+++ b/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h
@@ -13,7 +13,6 @@
 
 namespace mlir {
 class Location;
-struct LogicalResult;
 class OpBuilder;
 class Pass;
 class RewritePattern;
diff --git a/mlir/include/mlir/Conversion/ConvertToLLVM/ToLLVMInterface.h b/mlir/include/mlir/Conversion/ConvertToLLVM/ToLLVMInterface.h
index 424ab38a13b24..00aeed9bf29dc 100644
--- a/mlir/include/mlir/Conversion/ConvertToLLVM/ToLLVMInterface.h
+++ b/mlir/include/mlir/Conversion/ConvertToLLVM/ToLLVMInterface.h
@@ -11,7 +11,6 @@
 
 #include "mlir/IR/DialectInterface.h"
 #include "mlir/IR/MLIRContext.h"
-#include "mlir/Support/LogicalResult.h"
 
 namespace mlir {
 class ConversionTarget;
diff --git a/mlir/include/mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h b/mlir/include/mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h
index 107718eeba873..76eb3b5dd11e9 100644
--- a/mlir/include/mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h
+++ b/mlir/include/mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h
@@ -15,7 +15,6 @@
 #define MLIR_CONVERSION_FUNCTOLLVM_CONVERTFUNCTOLLVM_H
 
 #include "mlir/Interfaces/FunctionInterfaces.h"
-#include "mlir/Support/LogicalResult.h"
 
 namespace mlir {
 
diff --git a/mlir/include/mlir/Conversion/GPUCommon/GPUCommonPass.h b/mlir/include/mlir/Conversion/GPUCommon/GPUCommonPass.h
index 2d5e9d27c5bdf..5f40315a84909 100644
--- a/mlir/include/mlir/Conversion/GPUCommon/GPUCommonPass.h
+++ b/mlir/include/mlir/Conversion/GPUCommon/GPUCommonPass.h
@@ -26,7 +26,6 @@ namespace mlir {
 
 class LLVMTypeConverter;
 class Location;
-struct LogicalResult;
 class ModuleOp;
 class Operation;
 class RewritePatternSet;
diff --git a/mlir/include/mlir/Conversion/SCFToGPU/SCFToGPU.h b/mlir/include/mlir/Conversion/SCFToGPU/SCFToGPU.h
index a180a12cad231..69e3f70f756cf 100644
--- a/mlir/include/mlir/Conversion/SCFToGPU/SCFToGPU.h
+++ b/mlir/include/mlir/Conversion/SCFToGPU/SCFToGPU.h
@@ -12,7 +12,6 @@
 
 namespace mlir {
 class ConversionTarget;
-struct LogicalResult;
 class MLIRContext;
 class Value;
 class Operation;
diff --git a/mlir/include/mlir/Conversion/VectorToGPU/VectorToGPU.h b/mlir/include/mlir/Conversion/VectorToGPU/VectorToGPU.h
index 3530eb5651e8f..10467e61ad083 100644
--- a/mlir/include/mlir/Conversion/VectorToGPU/VectorToGPU.h
+++ b/mlir/include/mlir/Conversion/VectorToGPU/VectorToGPU.h
@@ -12,7 +12,6 @@
 #include "mlir/IR/PatternMatch.h"
 
 namespace mlir {
-struct LogicalResult;
 class MLIRContext;
 class Pass;
 class RewritePatternSet;
diff --git a/mlir/include/mlir/Debug/CLOptionsSetup.h b/mlir/include/mlir/Debug/CLOptionsSetup.h
index a30ffe0ff1af4..e7e9727e726bf 100644
--- a/mlir/include/mlir/Debug/CLOptionsSetup.h
+++ b/mlir/include/mlir/Debug/CLOptionsSetup.h
@@ -10,7 +10,6 @@
 #define MLIR_DEBUG_CLOPTIONSSETUP_H
 
 #include "mlir/Debug/BreakpointManagers/FileLineColLocBreakpointManager.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/StringRef.h"
 
 #include <memory>
diff --git a/mlir/include/mlir/Dialect/AMDGPU/Utils/Chipset.h b/mlir/include/mlir/Dialect/AMDGPU/Utils/Chipset.h
index 5031dc4856173..38e0ebe68f943 100644
--- a/mlir/include/mlir/Dialect/AMDGPU/Utils/Chipset.h
+++ b/mlir/include/mlir/Dialect/AMDGPU/Utils/Chipset.h
@@ -8,7 +8,7 @@
 #ifndef MLIR_DIALECT_AMDGPU_UTILS_CHIPSET_H_
 #define MLIR_DIALECT_AMDGPU_UTILS_CHIPSET_H_
 
-#include "mlir/Support/LogicalResult.h"
+#include "mlir/Support/LLVM.h"
 
 namespace mlir {
 namespace amdgpu {
diff --git a/mlir/include/mlir/Dialect/Affine/Analysis/AffineStructures.h b/mlir/include/mlir/Dialect/Affine/Analysis/AffineStructures.h
index c9d3dc1abfd1d..707eec779aa58 100644
--- a/mlir/include/mlir/Dialect/Affine/Analysis/AffineStructures.h
+++ b/mlir/include/mlir/Dialect/Affine/Analysis/AffineStructures.h
@@ -18,7 +18,6 @@
 #include "mlir/Analysis/Presburger/Matrix.h"
 #include "mlir/IR/AffineExpr.h"
 #include "mlir/IR/OpDefinition.h"
-#include "mlir/Support/LogicalResult.h"
 #include <optional>
 
 namespace mlir {
diff --git a/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h b/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h
index 6e617ef40a53d..451c466fa0c95 100644
--- a/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h
+++ b/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h
@@ -9,7 +9,7 @@
 #ifndef MLIR_DIALECT_AFFINE_IR_VALUEBOUNDSOPINTERFACEIMPL_H
 #define MLIR_DIALECT_AFFINE_IR_VALUEBOUNDSOPINTERFACEIMPL_H
 
-#include "mlir/Support/LogicalResult.h"
+#include "mlir/Support/LLVM.h"
 
 namespace mlir {
 class DialectRegistry;
diff --git a/mlir/include/mlir/Dialect/Affine/LoopUtils.h b/mlir/include/mlir/Dialect/Affine/LoopUtils.h
index d143954b78fc1..99c500c7dd645 100644
--- a/mlir/include/mlir/Dialect/Affine/LoopUtils.h
+++ b/mlir/include/mlir/Dialect/Affine/LoopUtils.h
@@ -17,7 +17,6 @@
 
 #include "mlir/IR/Block.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/RegionUtils.h"
 #include <optional>
 
diff --git a/mlir/include/mlir/Dialect/Affine/Transforms/Transforms.h b/mlir/include/mlir/Dialect/Affine/Transforms/Transforms.h
index 1ea7375220815..b244d37c0707f 100644
--- a/mlir/include/mlir/Dialect/Affine/Transforms/Transforms.h
+++ b/mlir/include/mlir/Dialect/Affine/Transforms/Transforms.h
@@ -16,7 +16,6 @@
 
 #include "mlir/Interfaces/ValueBoundsOpInterface.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 
 namespace mlir {
 class AffineMap;
diff --git a/mlir/include/mlir/Dialect/Affine/Utils.h b/mlir/include/mlir/Dialect/Affine/Utils.h
index 7f25db029781c..9a2767e0ad87f 100644
--- a/mlir/include/mlir/Dialect/Affine/Utils.h
+++ b/mlir/include/mlir/Dialect/Affine/Utils.h
@@ -33,8 +33,6 @@ namespace memref {
 class AllocOp;
 } // namespace memref
 
-struct LogicalResult;
-
 namespace affine {
 class AffineForOp;
 class AffineIfOp;
diff --git a/mlir/include/mlir/Dialect/Arith/Transforms/Transforms.h b/mlir/include/mlir/Dialect/Arith/Transforms/Transforms.h
index bbc7e5d3e0dd7..8d6c68cef680d 100644
--- a/mlir/include/mlir/Dialect/Arith/Transforms/Transforms.h
+++ b/mlir/include/mlir/Dialect/Arith/Transforms/Transforms.h
@@ -10,7 +10,6 @@
 #define MLIR_DIALECT_ARITH_TRANSFORMS_TRANSFORMS_H
 
 #include "mlir/Interfaces/ValueBoundsOpInterface.h"
-#include "mlir/Support/LogicalResult.h"
 
 namespace mlir {
 class Location;
diff --git a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.td b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.td
index 007c05adc30b5..80cd13d687f5a 100644
--- a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.td
+++ b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.td
@@ -378,7 +378,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
           This method can query analysis information from the given analysis
           state.
         }],
-        /*retType=*/"::mlir::LogicalResult",
+        /*retType=*/"::llvm::LogicalResult",
         /*methodName=*/"resolveConflicts",
         /*args=*/(ins "::mlir::RewriterBase &":$rewriter,
                       "const ::mlir::bufferization::AnalysisState &":$state),
@@ -423,7 +423,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
           suggestion to make sure IR is valid at every point in time and could
           be done differently).
         }],
-        /*retType=*/"::mlir::LogicalResult",
+        /*retType=*/"::llvm::LogicalResult",
         /*methodName=*/"bufferize",
         /*args=*/(ins "::mlir::RewriterBase &":$rewriter,
                       "const ::mlir::bufferization::BufferizationOptions &":$options),
@@ -490,7 +490,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
           This method can be used to check expected invariants and limitations
           of the current bufferization implementation.
         }],
-        /*retType=*/"::mlir::LogicalResult",
+        /*retType=*/"::llvm::LogicalResult",
         /*methodName=*/"verifyAnalysis",
         /*args=*/(ins "const ::mlir::bufferization::AnalysisState &":$state),
         /*methodBody=*/"",
@@ -613,7 +613,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
   let extraClassDeclaration = [{
     /// Resolve out-of-place tensor OpOperands with explicit allocations in the
     /// form of `bufferization.alloc_tensor` ops.
-    ::mlir::LogicalResult resolveTensorOpOperandConflicts(
+    ::llvm::LogicalResult resolveTensorOpOperandConflicts(
         ::mlir::RewriterBase &rewriter,
         const ::mlir::bufferization::AnalysisState &state);
 
diff --git a/mlir/include/mlir/Dialect/Bufferization/Transforms/OneShotModuleBufferize.h b/mlir/include/mlir/Dialect/Bufferization/Transforms/OneShotModuleBufferize.h
index cd4c009a05bc9..4e5f5e9c730fa 100644
--- a/mlir/include/mlir/Dialect/Bufferization/Transforms/OneShotModuleBufferize.h
+++ b/mlir/include/mlir/Dialect/Bufferization/Transforms/OneShotModuleBufferize.h
@@ -9,9 +9,11 @@
 #ifndef MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_ONESHOTMODULEBUFFERIZE_H
 #define MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_ONESHOTMODULEBUFFERIZE_H
 
-namespace mlir {
-
+namespace llvm {
 struct LogicalResult;
+} // namespace llvm
+
+namespace mlir {
 class ModuleOp;
 
 namespace bufferization {
@@ -21,8 +23,9 @@ struct OneShotBufferizationOptions;
 
 /// Analyze `moduleOp` and its nested ops. Bufferization decisions are stored in
 /// `state`.
-LogicalResult analyzeModuleOp(ModuleOp moduleOp, OneShotAnalysisState &state,
-                              BufferizationStatistics *statistics = nullptr);
+llvm::LogicalResult
+analyzeModuleOp(ModuleOp moduleOp, OneShotAnalysisState &state,
+                BufferizationStatistics *statistics = nullptr);
 
 /// Bufferize `op` and its nested ops that implement `BufferizableOpInterface`.
 ///
@@ -33,9 +36,9 @@ LogicalResult analyzeModuleOp(ModuleOp moduleOp, OneShotAnalysisState &state,
 /// - `options.copyBeforeWrite` is not set and `options.noAnalysisFuncFilter`
 ///   is not empty. The FuncOps it contains were not analyzed. Buffer copies
 ///   will be inserted only to these FuncOps.
-LogicalResult bufferizeModuleOp(ModuleOp moduleOp,
-                                const OneShotBufferizationOptions &options,
-                                BufferizationStatistics *statistics = nullptr);
+llvm::LogicalResult
+bufferizeModuleOp(ModuleOp moduleOp, const OneShotBufferizationOptions &options,
+                  BufferizationStatistics *statistics = nullptr);
 
 /// Remove bufferization attributes on every FuncOp arguments in the ModuleOp.
 void removeBufferizationAttributesInModule(ModuleOp moduleOp);
@@ -44,7 +47,7 @@ void removeBufferizationAttributesInModule(ModuleOp moduleOp);
 /// function call analysis to determine which function arguments are
 /// inplaceable. Then analyzes and bufferizes FuncOps one-by-one with One-Shot
 /// Bufferize.
-LogicalResult runOneShotModuleBufferize(
+llvm::LogicalResult runOneShotModuleBufferize(
     ModuleOp moduleOp,
     const bufferization::OneShotBufferizationOptions &options,
     BufferizationStatistics *statistics = nullptr);
diff --git a/mlir/include/mlir/Dialect/GPU/IR/CompilationAttrInterfaces.td b/mlir/include/mlir/Dialect/GPU/IR/CompilationAttrInterfaces.td
index 582ab91311974..43ca5337067ca 100644
--- a/mlir/include/mlir/Dialect/GPU/IR/CompilationAttrInterfaces.td
+++ b/mlir/include/mlir/Dialect/GPU/IR/CompilationAttrInterfaces.td
@@ -113,7 +113,7 @@ def OffloadingLLVMTranslationAttrInterface :
         The first argument has to be a GPU binary operation.
         If the function fails at any point, it must return `failure`.
       }],
-      "::mlir::LogicalResult", "embedBinary",
+      "::llvm::LogicalResult", "embedBinary",
       (ins "::mlir::Operation*":$binaryOp,
            "::llvm::IRBuilderBase&":$hostBuilder,
            "::mlir::LLVM::ModuleTranslation&":$hostModuleTranslation)
@@ -130,7 +130,7 @@ def OffloadingLLVMTranslationAttrInterface :
         respectively. If the function fails at any point, it must return
         `failure`.
       }],
-      "::mlir::LogicalResult", "launchKernel",
+      "::llvm::LogicalResult", "launchKernel",
       (ins "::mlir::Operation*":$launchFunc, "::mlir::Operation*":$binaryOp,
            "::llvm::IRBuilderBase&":$hostBuilder,
            "::mlir::LLVM::ModuleTranslation&":$hostModuleTranslation)
diff --git a/mlir/include/mlir/Dialect/GPU/Transforms/ParallelLoopMapper.h b/mlir/include/mlir/Dialect/GPU/Transforms/ParallelLoopMapper.h
index 74b78f96649ec..30511e7faa582 100644
--- a/mlir/include/mlir/Dialect/GPU/Transforms/ParallelLoopMapper.h
+++ b/mlir/include/mlir/Dialect/GPU/Transforms/ParallelLoopMapper.h
@@ -21,7 +21,6 @@
 namespace mlir {
 
 class AffineMap;
-struct LogicalResult;
 class Operation;
 class Region;
 
diff --git a/mlir/include/mlir/Dialect/GPU/Transforms/Utils.h b/mlir/include/mlir/Dialect/GPU/Transforms/Utils.h
index f8c018ef40bba..073493971e6b7 100644
--- a/mlir/include/mlir/Dialect/GPU/Transforms/Utils.h
+++ b/mlir/include/mlir/Dialect/GPU/Transforms/Utils.h
@@ -20,7 +20,6 @@
 #include <string>
 
 namespace mlir {
-struct LogicalResult;
 class Operation;
 class Value;
 
diff --git a/mlir/include/mlir/Dialect/IRDL/IR/IRDLInterfaces.h b/mlir/include/mlir/Dialect/IRDL/IR/IRDLInterfaces.h
index 64553851ec1c4..554fccecdbd80 100644
--- a/mlir/include/mlir/Dialect/IRDL/IR/IRDLInterfaces.h
+++ b/mlir/include/mlir/Dialect/IRDL/IR/IRDLInterfaces.h
@@ -19,7 +19,6 @@
 #include "mlir/IR/ExtensibleDialect.h"
 #include "mlir/IR/OpImplementation.h"
 #include "mlir/IR/Types.h"
-#include "mlir/Support/LogicalResult.h"
 #include <optional>
 
 namespace mlir {
diff --git a/mlir/include/mlir/Dialect/IRDL/IR/IRDLTraits.h b/mlir/include/mlir/Dialect/IRDL/IR/IRDLTraits.h
index 1755341160bb5..98bedbfe5f51c 100644
--- a/mlir/include/mlir/Dialect/IRDL/IR/IRDLTraits.h
+++ b/mlir/include/mlir/Dialect/IRDL/IR/IRDLTraits.h
@@ -15,7 +15,6 @@
 #define MLIR_DIALECT_IRDL_IR_IRDLTRAITS_H_
 
 #include "mlir/IR/OpDefinition.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/Support/Casting.h"
 
 namespace mlir {
diff --git a/mlir/include/mlir/Dialect/IRDL/IRDLLoading.h b/mlir/include/mlir/Dialect/IRDL/IRDLLoading.h
index 64ad72b1a982a..b9ef3333ad06c 100644
--- a/mlir/include/mlir/Dialect/IRDL/IRDLLoading.h
+++ b/mlir/include/mlir/Dialect/IRDL/IRDLLoading.h
@@ -13,8 +13,12 @@
 #ifndef MLIR_DIALECT_IRDL_IRDLREGISTRATION_H
 #define MLIR_DIALECT_IRDL_IRDLREGISTRATION_H
 
-namespace mlir {
+#include "llvm/Support/LogicalResult.h"
+namespace llvm {
 struct LogicalResult;
+} // namespace llvm
+
+namespace mlir {
 class ModuleOp;
 } // namespace mlir
 
@@ -22,7 +26,7 @@ namespace mlir {
 namespace irdl {
 
 /// Load all the dialects defined in the module.
-LogicalResult loadDialects(ModuleOp op);
+llvm::LogicalResult loadDialects(ModuleOp op);
 
 } // namespace irdl
 } // namespace mlir
diff --git a/mlir/include/mlir/Dialect/IRDL/IRDLVerifiers.h b/mlir/include/mlir/Dialect/IRDL/IRDLVerifiers.h
index 89e99a63a5f10..bad52bb2d1436 100644
--- a/mlir/include/mlir/Dialect/IRDL/IRDLVerifiers.h
+++ b/mlir/include/mlir/Dialect/IRDL/IRDLVerifiers.h
@@ -21,7 +21,6 @@
 #include <optional>
 
 namespace mlir {
-struct LogicalResult;
 class InFlightDiagnostic;
 class DynamicAttrDefinition;
 class DynamicTypeDefinition;
diff --git a/mlir/include/mlir/Dialect/Linalg/TransformOps/GPUHeuristics.h b/mlir/include/mlir/Dialect/Linalg/TransformOps/GPUHeuristics.h
index f9fd32c2031af..5430fd9d65e9e 100644
--- a/mlir/include/mlir/Dialect/Linalg/TransformOps/GPUHeuristics.h
+++ b/mlir/include/mlir/Dialect/Linalg/TransformOps/GPUHeuristics.h
@@ -11,7 +11,6 @@
 
 #include "mlir/IR/Attributes.h"
 #include "mlir/IR/MLIRContext.h"
-#include "mlir/Support/LogicalResult.h"
 
 namespace mlir {
 namespace transform {
diff --git a/mlir/include/mlir/Dialect/Linalg/TransformOps/Syntax.h b/mlir/include/mlir/Dialect/Linalg/TransformOps/Syntax.h
index 13b0dc0e0b95e..50e55e7222612 100644
--- a/mlir/include/mlir/Dialect/Linalg/TransformOps/Syntax.h
+++ b/mlir/include/mlir/Dialect/Linalg/TransformOps/Syntax.h
@@ -12,7 +12,6 @@
 #include "mlir/Support/LLVM.h"
 
 namespace mlir {
-class ParseResult;
 class OpAsmParser;
 class OpAsmPrinter;
 class Type;
diff --git a/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h b/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
index 3812eb50095d5..2a58d02d7b704 100644
--- a/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
+++ b/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
@@ -22,7 +22,6 @@
 #include "mlir/Dialect/X86Vector/Transforms.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/Interfaces/TilingInterface.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/DialectConversion.h"
 #include "llvm/ADT/SmallBitVector.h"
 #include "llvm/ADT/SmallSet.h"
diff --git a/mlir/include/mlir/Dialect/MemRef/Transforms/Transforms.h b/mlir/include/mlir/Dialect/MemRef/Transforms/Transforms.h
index a918f62cbc8db..4444a7651b407 100644
--- a/mlir/include/mlir/Dialect/MemRef/Transforms/Transforms.h
+++ b/mlir/include/mlir/Dialect/MemRef/Transforms/Transforms.h
@@ -14,7 +14,7 @@
 #ifndef MLIR_DIALECT_MEMREF_TRANSFORMS_TRANSFORMS_H
 #define MLIR_DIALECT_MEMREF_TRANSFORMS_TRANSFORMS_H
 
-#include "mlir/Support/LogicalResult.h"
+#include "mlir/Support/LLVM.h"
 #include "llvm/ADT/STLFunctionalExtras.h"
 
 namespace mlir {
diff --git a/mlir/include/mlir/Dialect/Mesh/Transforms/Spmdization.h b/mlir/include/mlir/Dialect/Mesh/Transforms/Spmdization.h
index f847ce30a1b40..2f6de3e134319 100644
--- a/mlir/include/mlir/Dialect/Mesh/Transforms/Spmdization.h
+++ b/mlir/include/mlir/Dialect/Mesh/Transforms/Spmdization.h
@@ -11,7 +11,6 @@
 
 #include "mlir/Dialect/Mesh/IR/MeshOps.h"
 #include "mlir/IR/DialectRegistry.h"
-#include "mlir/Support/LogicalResult.h"
 
 namespace mlir {
 namespace mesh {
diff --git a/mlir/include/mlir/Dialect/NVGPU/Transforms/Transforms.h b/mlir/include/mlir/Dialect/NVGPU/Transforms/Transforms.h
index 4bac8986567ea..2ff9ac43851d8 100644
--- a/mlir/include/mlir/Dialect/NVGPU/Transforms/Transforms.h
+++ b/mlir/include/mlir/Dialect/NVGPU/Transforms/Transforms.h
@@ -14,7 +14,6 @@
 #define MLIR_DIALECT_NVGPU_TRANSFORMS_TRANSFORMS_H_
 
 #include "mlir/IR/Operation.h"
-#include "mlir/Support/LogicalResult.h"
 
 namespace mlir {
 class RewriterBase;
@@ -44,7 +43,7 @@ namespace nvgpu {
 /// function that depends on the row Index. The permutation function is chosen
 /// to ensure that sequential distributed+vectorized reads/writes down a single
 /// dimension of the memref have minimal conflicts.
-mlir::LogicalResult optimizeSharedMemoryReadsAndWrites(Operation *parentOp,
+llvm::LogicalResult optimizeSharedMemoryReadsAndWrites(Operation *parentOp,
                                                        Value memrefValue);
 
 ///
diff --git a/mlir/include/mlir/Dialect/OpenACCMPCommon/Interfaces/AtomicInterfaces.td b/mlir/include/mlir/Dialect/OpenACCMPCommon/Interfaces/AtomicInterfaces.td
index 57063ca763d2f..223bee9ab1c27 100644
--- a/mlir/include/mlir/Dialect/OpenACCMPCommon/Interfaces/AtomicInterfaces.td
+++ b/mlir/include/mlir/Dialect/OpenACCMPCommon/Interfaces/AtomicInterfaces.td
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// Defines the operation interface for atomic operations used in OpenACC and 
+// Defines the operation interface for atomic operations used in OpenACC and
 // OpenMP.
 //
 //===----------------------------------------------------------------------===//
@@ -34,7 +34,7 @@ def AtomicReadOpInterface : OpInterface<"AtomicReadOpInterface"> {
     InterfaceMethod<[{
         Common verifier for operation that implements atomic read interface.
       }],
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"verifyCommon",
       /*args=*/(ins),
       /*methodBody=*/"",
@@ -81,7 +81,7 @@ def AtomicWriteOpInterface : OpInterface<"AtomicWriteOpInterface"> {
     InterfaceMethod<[{
         Common verifier for operation that implements atomic write interface.
       }],
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"verifyCommon",
       /*args=*/(ins),
       /*methodBody=*/"",
@@ -118,7 +118,7 @@ def AtomicUpdateOpInterface : OpInterface<"AtomicUpdateOpInterface"> {
 
     The interface terminology uses `x` to specify the address where a value
     is atomically written/read.
-    
+
     Since atomic update expression comes in many forms, this interface requires
     that the operation uses a region with a single argument to capture the
     expression.
@@ -162,9 +162,9 @@ def AtomicUpdateOpInterface : OpInterface<"AtomicUpdateOpInterface"> {
       /*defaultImplementation=*/[{
         // The atomic update is a no-op if the terminator is the first and only
         // operation in its region.
-        mlir::Operation* terminator = 
+        mlir::Operation* terminator =
           llvm::dyn_cast<mlir::RegionBranchTerminatorOpInterface>($_op.getFirstOp());
-        return terminator && terminator->getOperands().front() == 
+        return terminator && terminator->getOperands().front() ==
           $_op.getRegion().front().getArgument(0);
       }]
     >,
@@ -177,9 +177,9 @@ def AtomicUpdateOpInterface : OpInterface<"AtomicUpdateOpInterface"> {
       /*args=*/(ins),
       /*methodBody=*/"",
       /*defaultImplementation=*/[{
-        mlir::Operation* terminator = 
+        mlir::Operation* terminator =
           llvm::dyn_cast<mlir::RegionBranchTerminatorOpInterface>($_op.getFirstOp());
-        if (terminator && terminator->getOperands().front() != 
+        if (terminator && terminator->getOperands().front() !=
           $_op.getRegion().front().getArgument(0)) {
           return terminator->getOperands().front();
         }
@@ -189,7 +189,7 @@ def AtomicUpdateOpInterface : OpInterface<"AtomicUpdateOpInterface"> {
     InterfaceMethod<[{
         Common verifier for operation that implements atomic update interface.
       }],
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"verifyCommon",
       /*args=*/(ins),
       /*methodBody=*/"",
@@ -210,7 +210,7 @@ def AtomicUpdateOpInterface : OpInterface<"AtomicUpdateOpInterface"> {
         Common verifier of the required region for operation that implements
         atomic update interface.
       }],
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"verifyRegionsCommon",
       /*args=*/(ins),
       /*methodBody=*/"",
@@ -219,7 +219,7 @@ def AtomicUpdateOpInterface : OpInterface<"AtomicUpdateOpInterface"> {
 
         if (terminator->getOperands().size() != 1)
           return $_op.emitError("only updated value must be returned");
-    
+
         if (terminator->getOperands().front().getType() !=
             $_op.getRegion().getArgument(0).getType())
           return $_op.emitError("input and yielded value must have the same type");
@@ -272,7 +272,7 @@ def AtomicCaptureOpInterface : OpInterface<"AtomicCaptureOpInterface"> {
         Common verifier of the required region for operation that implements
         atomic capture interface.
       }],
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"verifyRegionsCommon",
       /*args=*/(ins),
       /*methodBody=*/"",
diff --git a/mlir/include/mlir/Dialect/Polynomial/IR/Polynomial.h b/mlir/include/mlir/Dialect/Polynomial/IR/Polynomial.h
index e14cef51185e0..3f206cd1e545a 100644
--- a/mlir/include/mlir/Dialect/Polynomial/IR/Polynomial.h
+++ b/mlir/include/mlir/Dialect/Polynomial/IR/Polynomial.h
@@ -10,7 +10,6 @@
 #define MLIR_DIALECT_POLYNOMIAL_IR_POLYNOMIAL_H_
 
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/ArrayRef.h"
diff --git a/mlir/include/mlir/Dialect/SCF/Transforms/Transforms.h b/mlir/include/mlir/Dialect/SCF/Transforms/Transforms.h
index 186331738d64b..71835cd178930 100644
--- a/mlir/include/mlir/Dialect/SCF/Transforms/Transforms.h
+++ b/mlir/include/mlir/Dialect/SCF/Transforms/Transforms.h
@@ -18,8 +18,6 @@
 #include "llvm/ADT/ArrayRef.h"
 
 namespace mlir {
-
-struct LogicalResult;
 class Region;
 class RewriterBase;
 class Operation;
diff --git a/mlir/include/mlir/Dialect/SCF/Utils/AffineCanonicalizationUtils.h b/mlir/include/mlir/Dialect/SCF/Utils/AffineCanonicalizationUtils.h
index 5022cbf898ec1..2913a74c6a9d6 100644
--- a/mlir/include/mlir/Dialect/SCF/Utils/AffineCanonicalizationUtils.h
+++ b/mlir/include/mlir/Dialect/SCF/Utils/AffineCanonicalizationUtils.h
@@ -15,11 +15,9 @@
 #define MLIR_DIALECT_SCF_UTILS_AFFINECANONICALIZATIONUTILS_H_
 
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 
 namespace mlir {
 class AffineMap;
-struct LogicalResult;
 class Operation;
 class OpFoldResult;
 class RewriterBase;
diff --git a/mlir/include/mlir/Dialect/SCF/Utils/Utils.h b/mlir/include/mlir/Dialect/SCF/Utils/Utils.h
index fea151b393152..de807c3e4e1f8 100644
--- a/mlir/include/mlir/Dialect/SCF/Utils/Utils.h
+++ b/mlir/include/mlir/Dialect/SCF/Utils/Utils.h
@@ -16,7 +16,6 @@
 #include "mlir/Dialect/SCF/IR/SCF.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/STLExtras.h"
 #include <optional>
 
diff --git a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorInterfaces.td b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorInterfaces.td
index 05eed0483f2c8..5c07e813ac49a 100644
--- a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorInterfaces.td
+++ b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorInterfaces.td
@@ -32,7 +32,7 @@ def StageWithSortSparseOpInterface : OpInterface<"StageWithSortSparseOp"> {
     /*methodBody=*/"">,
     InterfaceMethod<
     /*desc=*/"Stage the operation, return the final result value after staging.",
-    /*retTy=*/"::mlir::LogicalResult",
+    /*retTy=*/"::llvm::LogicalResult",
     /*methodName=*/"stageWithSort",
     /*args=*/(ins "::mlir::PatternRewriter &":$rewriter,
                   "Value &":$tmpBuf),
diff --git a/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h b/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h
index b8353043ee09d..842e244dcde56 100644
--- a/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h
+++ b/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h
@@ -14,7 +14,6 @@
 #include "mlir/IR/OpDefinition.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/Interfaces/SideEffectInterfaces.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/DialectConversion.h"
 
 #include "mlir/Dialect/Transform/Interfaces/TransformTypeInterfaces.h.inc"
@@ -1595,7 +1594,7 @@ mlir::transform::TransformEachOpTrait<OpTy>::apply(
 }
 
 template <typename OpTy>
-mlir::LogicalResult
+llvm::LogicalResult
 mlir::transform::TransformEachOpTrait<OpTy>::verifyTrait(Operation *op) {
   static_assert(OpTy::template hasTrait<OpTrait::OneOperand>(),
                 "expected single-operand op");
diff --git a/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.td b/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.td
index c5c4c61bc2fe5..9439104a700b0 100644
--- a/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.td
+++ b/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.td
@@ -401,7 +401,7 @@ def ConversionPatternDescriptorOpInterface
         Verify the default type converter that is provided by the enclosing
         "apply_conversion_patterns" op.
       }],
-      /*returnType=*/"::mlir::LogicalResult",
+      /*returnType=*/"::llvm::LogicalResult",
       /*name=*/"verifyTypeConverter",
       /*arguments=*/(ins "TypeConverterBuilderOpInterface":$builder),
       /*methodBody=*/"",
diff --git a/mlir/include/mlir/Dialect/Transform/Transforms/TransformInterpreterUtils.h b/mlir/include/mlir/Dialect/Transform/Transforms/TransformInterpreterUtils.h
index 4c16d40d368e0..e78cf770d4a66 100644
--- a/mlir/include/mlir/Dialect/Transform/Transforms/TransformInterpreterUtils.h
+++ b/mlir/include/mlir/Dialect/Transform/Transforms/TransformInterpreterUtils.h
@@ -16,7 +16,6 @@
 #include <memory>
 
 namespace mlir {
-struct LogicalResult;
 class MLIRContext;
 class ModuleOp;
 class Operation;
diff --git a/mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h b/mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h
index fa2912a3e577d..8e6d36f0b5f09 100644
--- a/mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h
+++ b/mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h
@@ -15,7 +15,6 @@
 #include "mlir/Dialect/Vector/IR/VectorOps.h"
 #include "mlir/Dialect/Vector/Utils/VectorUtils.h"
 #include "mlir/IR/PatternMatch.h"
-#include "mlir/Support/LogicalResult.h"
 
 #include "mlir/Dialect/Vector/Transforms/VectorTransformsEnums.h.inc"
 
diff --git a/mlir/include/mlir/ExecutionEngine/JitRunner.h b/mlir/include/mlir/ExecutionEngine/JitRunner.h
index 2dde0943942d7..b4210f6a34020 100644
--- a/mlir/include/mlir/ExecutionEngine/JitRunner.h
+++ b/mlir/include/mlir/ExecutionEngine/JitRunner.h
@@ -24,6 +24,7 @@
 namespace llvm {
 class Module;
 class LLVMContext;
+struct LogicalResult;
 
 namespace orc {
 class MangleAndInterner;
@@ -34,7 +35,6 @@ namespace mlir {
 
 class DialectRegistry;
 class Operation;
-struct LogicalResult;
 
 /// JitRunner command line options used by JitRunnerConfig methods
 struct JitRunnerOptions {
@@ -48,8 +48,8 @@ struct JitRunnerOptions {
 struct JitRunnerConfig {
   /// MLIR transformer applied after parsing the input into MLIR IR and before
   /// passing the MLIR IR to the ExecutionEngine.
-  llvm::function_ref<LogicalResult(mlir::Operation *,
-                                   JitRunnerOptions &options)>
+  llvm::function_ref<llvm::LogicalResult(mlir::Operation *,
+                                         JitRunnerOptions &options)>
       mlirTransformer = nullptr;
 
   /// A custom function that is passed to ExecutionEngine. It processes MLIR and
diff --git a/mlir/include/mlir/IR/Action.h b/mlir/include/mlir/IR/Action.h
index 9359324dd6090..2fad47768ceff 100644
--- a/mlir/include/mlir/IR/Action.h
+++ b/mlir/include/mlir/IR/Action.h
@@ -16,7 +16,6 @@
 #define MLIR_IR_ACTION_H
 
 #include "mlir/IR/Unit.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Support/TypeID.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/Sequence.h"
diff --git a/mlir/include/mlir/IR/AffineExpr.h b/mlir/include/mlir/IR/AffineExpr.h
index 63314cc756355..a93e74b449cee 100644
--- a/mlir/include/mlir/IR/AffineExpr.h
+++ b/mlir/include/mlir/IR/AffineExpr.h
@@ -20,7 +20,6 @@
 #include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/Casting.h"
-#include <functional>
 #include <type_traits>
 
 namespace mlir {
diff --git a/mlir/include/mlir/IR/AffineExprVisitor.h b/mlir/include/mlir/IR/AffineExprVisitor.h
index fc4cd915d8453..1826f5fd8ad35 100644
--- a/mlir/include/mlir/IR/AffineExprVisitor.h
+++ b/mlir/include/mlir/IR/AffineExprVisitor.h
@@ -14,7 +14,7 @@
 #define MLIR_IR_AFFINEEXPRVISITOR_H
 
 #include "mlir/IR/AffineExpr.h"
-#include "mlir/Support/LogicalResult.h"
+#include "mlir/Support/LLVM.h"
 #include "llvm/ADT/ArrayRef.h"
 
 namespace mlir {
diff --git a/mlir/include/mlir/IR/AffineMap.h b/mlir/include/mlir/IR/AffineMap.h
index cce141253989e..264c1c8308e78 100644
--- a/mlir/include/mlir/IR/AffineMap.h
+++ b/mlir/include/mlir/IR/AffineMap.h
@@ -35,7 +35,6 @@ struct AffineMapStorage;
 
 class Attribute;
 class Builder;
-struct LogicalResult;
 class OpFoldResult;
 class MLIRContext;
 
diff --git a/mlir/include/mlir/IR/BuiltinAttributeInterfaces.h b/mlir/include/mlir/IR/BuiltinAttributeInterfaces.h
index b0b9493c1519f..c4a42020d1389 100644
--- a/mlir/include/mlir/IR/BuiltinAttributeInterfaces.h
+++ b/mlir/include/mlir/IR/BuiltinAttributeInterfaces.h
@@ -13,7 +13,6 @@
 #include "mlir/IR/Attributes.h"
 #include "mlir/IR/BuiltinTypeInterfaces.h"
 #include "mlir/IR/Types.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/Support/raw_ostream.h"
 #include <complex>
 #include <optional>
diff --git a/mlir/include/mlir/IR/BuiltinAttributeInterfaces.td b/mlir/include/mlir/IR/BuiltinAttributeInterfaces.td
index c741db9b47f34..954429c7d8eae 100644
--- a/mlir/include/mlir/IR/BuiltinAttributeInterfaces.td
+++ b/mlir/include/mlir/IR/BuiltinAttributeInterfaces.td
@@ -483,7 +483,7 @@ def MemRefLayoutAttrInterface : AttrInterface<"MemRefLayoutAttrInterface"> {
 
     InterfaceMethod<
       "Check if the current layout is applicable to the provided shape",
-      "::mlir::LogicalResult", "verifyLayout",
+      "::llvm::LogicalResult", "verifyLayout",
       (ins "::llvm::ArrayRef<int64_t>":$shape,
            "::llvm::function_ref<::mlir::InFlightDiagnostic()>":$emitError),
       [{}],
diff --git a/mlir/include/mlir/IR/Diagnostics.h b/mlir/include/mlir/IR/Diagnostics.h
index 205c5d9274226..bb2e1bb183e9b 100644
--- a/mlir/include/mlir/IR/Diagnostics.h
+++ b/mlir/include/mlir/IR/Diagnostics.h
@@ -25,7 +25,6 @@ class SourceMgr;
 
 namespace mlir {
 class DiagnosticEngine;
-struct LogicalResult;
 class MLIRContext;
 class Operation;
 class OperationName;
diff --git a/mlir/include/mlir/IR/Dialect.h b/mlir/include/mlir/IR/Dialect.h
index f7c1f4df16fc4..f3e5f6d88c531 100644
--- a/mlir/include/mlir/IR/Dialect.h
+++ b/mlir/include/mlir/IR/Dialect.h
@@ -17,9 +17,6 @@
 #include "mlir/IR/OperationSupport.h"
 #include "mlir/Support/TypeID.h"
 
-#include <map>
-#include <tuple>
-
 namespace mlir {
 class DialectAsmParser;
 class DialectAsmPrinter;
diff --git a/mlir/include/mlir/IR/EnumAttr.td b/mlir/include/mlir/IR/EnumAttr.td
index f4dc480647783..9fec28f03ec28 100644
--- a/mlir/include/mlir/IR/EnumAttr.td
+++ b/mlir/include/mlir/IR/EnumAttr.td
@@ -227,7 +227,7 @@ class IntEnumAttr<I intType, string name, string summary,
                           stringToSymbolFnName # [{(enumKeyword);
     if (maybeEnum)
       return *maybeEnum;
-    return {(::mlir::LogicalResult)($_parser.emitError(loc) << "expected " }] #
+    return {(::llvm::LogicalResult)($_parser.emitError(loc) << "expected " }] #
     [{<< "}] # cppType # [{" << " to be one of: " << }] #
     !interleave(!foreach(enum, enumerants, "\"" # enum.str # "\""),
                 [{ << ", " << }]) # [{)};
@@ -300,7 +300,7 @@ class BitEnumAttr<I intType, string name, string summary,
       auto maybeEnum = }] # cppNamespace # "::" #
                             stringToSymbolFnName # [{(enumKeyword);
       if (!maybeEnum) {
-          return {(::mlir::LogicalResult)($_parser.emitError(loc) << }] #
+          return {(::llvm::LogicalResult)($_parser.emitError(loc) << }] #
               [{"expected " << "}] # cppType # [{" << " to be one of: " << }] #
               !interleave(!foreach(enum, enumerants, "\"" # enum.str # "\""),
                           [{ << ", " << }]) # [{)};
diff --git a/mlir/include/mlir/IR/ExtensibleDialect.h b/mlir/include/mlir/IR/ExtensibleDialect.h
index 5ae1e9ab537af..494f3dfb05a04 100644
--- a/mlir/include/mlir/IR/ExtensibleDialect.h
+++ b/mlir/include/mlir/IR/ExtensibleDialect.h
@@ -38,7 +38,6 @@ class DynamicType;
 class ExtensibleDialect;
 class MLIRContext;
 class OptionalParseResult;
-class ParseResult;
 
 namespace detail {
 struct DynamicAttrStorage;
diff --git a/mlir/include/mlir/IR/OperationSupport.h b/mlir/include/mlir/IR/OperationSupport.h
index f8ab5338107f2..1b93f3d3d04fe 100644
--- a/mlir/include/mlir/IR/OperationSupport.h
+++ b/mlir/include/mlir/IR/OperationSupport.h
@@ -51,7 +51,6 @@ class OpAsmPrinter;
 class OperandRange;
 class OperandRangeRange;
 class OpFoldResult;
-class ParseResult;
 class Pattern;
 class Region;
 class ResultRange;
diff --git a/mlir/include/mlir/IR/StorageUniquerSupport.h b/mlir/include/mlir/IR/StorageUniquerSupport.h
index 982d5220ab52c..fb64f15162df5 100644
--- a/mlir/include/mlir/IR/StorageUniquerSupport.h
+++ b/mlir/include/mlir/IR/StorageUniquerSupport.h
@@ -16,7 +16,6 @@
 #include "mlir/IR/AttrTypeSubElements.h"
 #include "mlir/IR/DialectRegistry.h"
 #include "mlir/Support/InterfaceSupport.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Support/StorageUniquer.h"
 #include "mlir/Support/TypeID.h"
 #include "llvm/ADT/FunctionExtras.h"
diff --git a/mlir/include/mlir/IR/SymbolInterfaces.td b/mlir/include/mlir/IR/SymbolInterfaces.td
index 60b38185fa8cc..a8b04d0453110 100644
--- a/mlir/include/mlir/IR/SymbolInterfaces.td
+++ b/mlir/include/mlir/IR/SymbolInterfaces.td
@@ -121,7 +121,7 @@ def Symbol : OpInterface<"SymbolOpInterface"> {
         symbol 'newSymbol' that are nested within the given operation 'from'.
         Note: See mlir::SymbolTable::replaceAllSymbolUses for more details.
       }],
-      "::mlir::LogicalResult", "replaceAllSymbolUses",
+      "::llvm::LogicalResult", "replaceAllSymbolUses",
       (ins "::mlir::StringAttr":$newSymbol, "::mlir::Operation *":$from), [{}],
       /*defaultImplementation=*/[{
         return ::mlir::SymbolTable::replaceAllSymbolUses(this->getOperation(),
@@ -214,7 +214,7 @@ def SymbolUserOpInterface : OpInterface<"SymbolUserOpInterface"> {
 
   let methods = [
     InterfaceMethod<"Verify the symbol uses held by this operation.",
-      "::mlir::LogicalResult", "verifySymbolUses",
+      "::llvm::LogicalResult", "verifySymbolUses",
       (ins "::mlir::SymbolTableCollection &":$symbolTable)
     >,
   ];
diff --git a/mlir/include/mlir/IR/TensorEncoding.td b/mlir/include/mlir/IR/TensorEncoding.td
index 4907dcbb5de96..d8ccd1f0c548e 100644
--- a/mlir/include/mlir/IR/TensorEncoding.td
+++ b/mlir/include/mlir/IR/TensorEncoding.td
@@ -31,7 +31,7 @@ def VerifiableTensorEncoding : AttrInterface<"VerifiableTensorEncoding"> {
         given shape and element type. Generates a diagnostic using
         the supplied callback on failure.
       }],
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"verifyEncoding",
       /*args=*/(ins
         "::mlir::ArrayRef<int64_t>":$shape,
diff --git a/mlir/include/mlir/IR/Verifier.h b/mlir/include/mlir/IR/Verifier.h
index 1fcc99e63206d..eb96d11443fc7 100644
--- a/mlir/include/mlir/IR/Verifier.h
+++ b/mlir/include/mlir/IR/Verifier.h
@@ -9,8 +9,9 @@
 #ifndef MLIR_IR_VERIFIER_H
 #define MLIR_IR_VERIFIER_H
 
+#include "mlir/Support/LLVM.h"
+
 namespace mlir {
-struct LogicalResult;
 class Operation;
 
 /// Perform (potentially expensive) checks of invariants, used to detect
diff --git a/mlir/include/mlir/IR/Visitors.h b/mlir/include/mlir/IR/Visitors.h
index fe987741aa907..15abf2559e5c4 100644
--- a/mlir/include/mlir/IR/Visitors.h
+++ b/mlir/include/mlir/IR/Visitors.h
@@ -14,7 +14,6 @@
 #define MLIR_IR_VISITORS_H
 
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/STLExtras.h"
 
 namespace mlir {
diff --git a/mlir/include/mlir/Interfaces/DataLayoutInterfaces.td b/mlir/include/mlir/Interfaces/DataLayoutInterfaces.td
index d4b89997d9c86..bc5080c9c6a55 100644
--- a/mlir/include/mlir/Interfaces/DataLayoutInterfaces.td
+++ b/mlir/include/mlir/Interfaces/DataLayoutInterfaces.td
@@ -52,7 +52,7 @@ def DataLayoutEntryInterface : AttrInterface<"DataLayoutEntryInterface"> {
     InterfaceMethod<
       /*description=*/"Checks that the entry is well-formed, reports errors "
                       "at the provided location.",
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"verifyEntry",
       /*args=*/(ins "::mlir::Location":$loc),
       /*methodBody=*/"",
@@ -166,7 +166,7 @@ def DataLayoutSpecInterface : AttrInterface<"DataLayoutSpecInterface"> {
     InterfaceMethod<
       /*description=*/"Verifies the validity of the specification and reports "
                       "any errors at the given location.",
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"verifySpec",
       /*args=*/(ins "::mlir::Location":$loc),
       /*methodBody=*/"",
@@ -232,7 +232,7 @@ def TargetDeviceSpecInterface : AttrInterface<"TargetDeviceSpecInterface"> {
     InterfaceMethod<
       /*description=*/"Checks that the entry is well-formed, reports errors "
                       "at the provided location.",
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"verifyEntry",
       /*args=*/(ins "::mlir::Location":$loc),
       /*methodBody=*/"",
@@ -275,7 +275,7 @@ def TargetSystemSpecInterface : AttrInterface<"TargetSystemSpecInterface"> {
     InterfaceMethod<
       /*description=*/"Verifies the validity of the specification and "
                       "reports any errors at the given location.",
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"verifySpec",
       /*args=*/(ins "::mlir::Location":$loc),
       /*methodBody=*/"",
@@ -574,7 +574,7 @@ def DataLayoutTypeInterface : TypeInterface<"DataLayoutTypeInterface"> {
     InterfaceMethod<
       /*description=*/"Verifies that the given list of entries is valid for "
                       "this type.",
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"verifyEntries",
       /*args=*/(ins "::mlir::DataLayoutEntryListRef":$entries,
                     "::mlir::Location":$loc),
diff --git a/mlir/include/mlir/Interfaces/FoldInterfaces.h b/mlir/include/mlir/Interfaces/FoldInterfaces.h
index 6278e31b49177..b3d116101149f 100644
--- a/mlir/include/mlir/Interfaces/FoldInterfaces.h
+++ b/mlir/include/mlir/Interfaces/FoldInterfaces.h
@@ -9,7 +9,6 @@
 #define MLIR_INTERFACES_FOLDINTERFACES_H_
 
 #include "mlir/IR/DialectInterface.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallVector.h"
 
diff --git a/mlir/include/mlir/Interfaces/FunctionInterfaces.td b/mlir/include/mlir/Interfaces/FunctionInterfaces.td
index 873853eba0b17..697f951748c67 100644
--- a/mlir/include/mlir/Interfaces/FunctionInterfaces.td
+++ b/mlir/include/mlir/Interfaces/FunctionInterfaces.td
@@ -83,7 +83,7 @@ def FunctionOpInterface : OpInterface<"FunctionOpInterface", [
       Note: The default implementation merely checks that if the entry block
       exists, it has the same number and type of arguments as the function type.
     }],
-    "::mlir::LogicalResult", "verifyBody", (ins),
+    "::llvm::LogicalResult", "verifyBody", (ins),
     /*methodBody=*/[{}], /*defaultImplementation=*/[{
       if ($_op.isExternal())
         return success();
@@ -114,7 +114,7 @@ def FunctionOpInterface : OpInterface<"FunctionOpInterface", [
       Verify the type attribute of the function for derived op-specific
       invariants.
     }],
-    "::mlir::LogicalResult", "verifyType", (ins),
+    "::llvm::LogicalResult", "verifyType", (ins),
     /*methodBody=*/[{}], /*defaultImplementation=*/[{
       return success();
     }]>,
diff --git a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td
index a009e21c61b49..92d4a99ecb7f5 100644
--- a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td
+++ b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td
@@ -38,7 +38,7 @@ def InferTypeOpInterface : OpInterface<"InferTypeOpInterface"> {
       called with valid arguments, e.g., operands are verified, or it may result
       in an undefined behavior.
       }],
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"inferReturnTypes",
       /*args=*/(ins "::mlir::MLIRContext *":$context,
                     "::std::optional<::mlir::Location>":$location,
@@ -72,7 +72,7 @@ def InferTypeOpInterface : OpInterface<"InferTypeOpInterface"> {
       represent fully valid IR and are responsible for checking inputs for
       validity to the degree necessary to perform the return type inference.
       }],
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"refineReturnTypes",
       /*args=*/(ins "::mlir::MLIRContext *":$context,
                     "::std::optional<::mlir::Location>":$location,
@@ -150,7 +150,7 @@ def InferShapedTypeOpInterface : OpInterface<"InferShapedTypeOpInterface"> {
       represent fully valid IR and are responsible for checking inputs for
       validity to the degree necessary to perform the return type inference.
       }],
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"inferReturnTypeComponents",
       /*args=*/(ins "::mlir::MLIRContext*":$context,
                     "::std::optional<::mlir::Location>":$location,
@@ -180,7 +180,7 @@ def InferShapedTypeOpInterface : OpInterface<"InferShapedTypeOpInterface"> {
       operands to avoid calling `getOperand` directly inside the interface
       implementation.
       }],
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"reifyReturnTypeShapes",
       /*args=*/(ins "::mlir::OpBuilder&":$builder,
           "::mlir::ValueRange":$operands,
@@ -201,14 +201,14 @@ class InferTypeOpAdaptorBase<code additionalDecls = [{}]> : TraitList<
       /*name=*/"InferTypeOpAdaptor",
       /*traits=*/[],
       /*extraOpDeclaration=*/[{
-        static ::mlir::LogicalResult
+        static ::llvm::LogicalResult
         inferReturnTypes(::mlir::MLIRContext *context,
                                 std::optional<::mlir::Location> location,
                                 Adaptor adaptor,
                                 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes);
       }] # additionalDecls,
       /*extraOpDefinition=*/[{
-        ::mlir::LogicalResult
+        ::llvm::LogicalResult
         $cppClass::inferReturnTypes(::mlir::MLIRContext *context,
                           std::optional<::mlir::Location> location,
                           ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
@@ -239,14 +239,14 @@ class InferShapedTypeOpAdaptorBase<list<string> overridenMethods = []> : TraitLi
       /*name=*/"InferShapedTypeOpAdaptor",
       /*traits=*/[],
       /*extraOpDeclaration=*/[{
-        static ::mlir::LogicalResult
+        static ::llvm::LogicalResult
         inferReturnTypeComponents(::mlir::MLIRContext *context,
                                 std::optional<::mlir::Location> location,
                                 Adaptor adaptor,
                                 ::llvm::SmallVectorImpl<::mlir::ShapedTypeComponents> &inferredReturnShapes);
       }],
       /*extraOpDefinition=*/[{
-        ::mlir::LogicalResult
+        ::llvm::LogicalResult
         $cppClass::inferReturnTypeComponents(::mlir::MLIRContext *context,
                           std::optional<::mlir::Location> location,
                           ::mlir::ValueShapeRange operands, ::mlir::DictionaryAttr attributes,
@@ -281,7 +281,7 @@ class InferTensorTypeBase<list<string> overridenMethods = []> : TraitList<
       /*traits=*/[],
       /*extraOpDeclaration=*/[{}],
       /*extraOpDefinition=*/[{
-        ::mlir::LogicalResult
+        ::llvm::LogicalResult
         $cppClass::inferReturnTypes(::mlir::MLIRContext *context,
                           std::optional<::mlir::Location> location,
                           ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
@@ -364,7 +364,7 @@ def ReifyRankedShapedTypeOpInterface :
 
         If the shape of a particular result cannot be computed it must be empty.
       }],
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"reifyResultShapes",
       /*args=*/(ins "::mlir::OpBuilder &":$builder,
         "::mlir::ReifiedRankedShapedTypeDims &":$reifiedReturnShapes)
diff --git a/mlir/include/mlir/Interfaces/LoopLikeInterface.td b/mlir/include/mlir/Interfaces/LoopLikeInterface.td
index 7db624ba43974..c6bffe347419e 100644
--- a/mlir/include/mlir/Interfaces/LoopLikeInterface.td
+++ b/mlir/include/mlir/Interfaces/LoopLikeInterface.td
@@ -84,7 +84,7 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
         have a single iteration. Returns "success" if the promotion was
         successful.
       }],
-      /*retTy=*/"::mlir::LogicalResult",
+      /*retTy=*/"::llvm::LogicalResult",
       /*methodName=*/"promoteIfSingleIteration",
       /*args=*/(ins "::mlir::RewriterBase &":$rewriter),
       /*methodBody=*/"",
diff --git a/mlir/include/mlir/Interfaces/MemorySlotInterfaces.td b/mlir/include/mlir/Interfaces/MemorySlotInterfaces.td
index 6f023f0c5263f..fbce2fa1d043d 100644
--- a/mlir/include/mlir/Interfaces/MemorySlotInterfaces.td
+++ b/mlir/include/mlir/Interfaces/MemorySlotInterfaces.td
@@ -75,7 +75,7 @@ def PromotableAllocationOpInterface
       "::std::optional<::mlir::PromotableAllocationOpInterface>",
         "handlePromotionComplete",
       (ins
-        "const ::mlir::MemorySlot &":$slot, 
+        "const ::mlir::MemorySlot &":$slot,
         "::mlir::Value":$defaultValue,
         "::mlir::OpBuilder &":$builder)
     >,
@@ -308,7 +308,7 @@ def DestructurableAllocationOpInterface
         This will only be called for slots declared by this operation.
 
         Must return a new destructurable allocation op if this hook creates
-        a new destructurable op, nullopt otherwise. 
+        a new destructurable op, nullopt otherwise.
       }],
       "::std::optional<::mlir::DestructurableAllocationOpInterface>",
       "handleDestructuringComplete",
@@ -338,7 +338,7 @@ def SafeMemorySlotAccessOpInterface
 
         No IR mutation is allowed in this method.
       }],
-      "::mlir::LogicalResult",
+      "::llvm::LogicalResult",
       "ensureOnlySafeAccesses",
       (ins "const ::mlir::MemorySlot &":$slot,
            "::mlir::SmallVectorImpl<::mlir::MemorySlot> &":$mustBeSafelyUsed,
diff --git a/mlir/include/mlir/Interfaces/TilingInterface.td b/mlir/include/mlir/Interfaces/TilingInterface.td
index ad0af0aaaab80..4868dad9e1be1 100644
--- a/mlir/include/mlir/Interfaces/TilingInterface.td
+++ b/mlir/include/mlir/Interfaces/TilingInterface.td
@@ -26,7 +26,7 @@ def TilingInterface : OpInterface<"TilingInterface"> {
     the tiling algorithm (like `scf::tileUsingSCF`) can generate the inter-tile
     loop structure, and call into the methods of the interface to be able to
     tile any operation that implements the interface.
-    
+
     This interface is also meant to help with "tile and fuse", i.e. the process
     of fusing a producer with a consumer by
       a) Tiling the consumer
@@ -50,7 +50,7 @@ def TilingInterface : OpInterface<"TilingInterface"> {
 
     For an operation to be "tiled and fused" with its (already tiled) consumer,
     an operation has to implement the following additional method (see
-    description below): 
+    description below):
       - `generateResultTileValue`
       - `getIterationDomainTileFromResultTile`
 
@@ -146,7 +146,7 @@ def TilingInterface : OpInterface<"TilingInterface"> {
           Note: It is undefined behaviour if there is overlap between the
           tiles of the result generated by the tiled implementation.
         }],
-        /*retType=*/"::mlir::LogicalResult",
+        /*retType=*/"::llvm::LogicalResult",
         /*methodName=*/"getResultTilePosition",
         /*args=*/(ins
           "OpBuilder &":$b,
@@ -289,7 +289,7 @@ def TilingInterface : OpInterface<"TilingInterface"> {
           implemented using `getIterationDomainTileFromOperandTile` +
           `getTiledImplementation` methods.
         }],
-        /*retType=*/"::mlir::LogicalResult",
+        /*retType=*/"::llvm::LogicalResult",
         /*methodName=*/"getIterationDomainTileFromOperandTile",
         /*args=*/(ins
           "OpBuilder &":$b,
@@ -317,14 +317,14 @@ def TilingInterface : OpInterface<"TilingInterface"> {
           - `sizes` is the size of the slice of the producer result used by the
             consumer.
           If fusion of the producer with the consumer is not legal for the
-          result, or if this mapping cannot be computed, the implementation 
+          result, or if this mapping cannot be computed, the implementation
           should return a failure.
-          
-          For most cases `generateResultTileValue` could be a implemented using 
-          `getIterationDomainTileFromResultTile` + `getTiledImplementation` 
+
+          For most cases `generateResultTileValue` could be a implemented using
+          `getIterationDomainTileFromResultTile` + `getTiledImplementation`
           methods.
         }],
-        /*retType=*/"::mlir::LogicalResult",
+        /*retType=*/"::llvm::LogicalResult",
         /*methodName=*/"getIterationDomainTileFromResultTile",
         /*args=*/(ins
           "OpBuilder &":$b,
@@ -349,7 +349,7 @@ def TilingInterface : OpInterface<"TilingInterface"> {
           transformations are done, this method can be used to lower to scalar
           code that can then be lowered to LLVM or SPIR-V dialects.
         }],
-        /*retType=*/"::mlir::LogicalResult",
+        /*retType=*/"::llvm::LogicalResult",
         /*methodName=*/"generateScalarImplementation",
         /*args=*/(ins
             "OpBuilder &":$b,
diff --git a/mlir/include/mlir/Pass/Pass.h b/mlir/include/mlir/Pass/Pass.h
index e71c49a1687fe..7725a3a2910bd 100644
--- a/mlir/include/mlir/Pass/Pass.h
+++ b/mlir/include/mlir/Pass/Pass.h
@@ -12,7 +12,6 @@
 #include "mlir/IR/Action.h"
 #include "mlir/Pass/AnalysisManager.h"
 #include "mlir/Pass/PassRegistry.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/PointerIntPair.h"
 #include "llvm/ADT/Statistic.h"
 #include <optional>
diff --git a/mlir/include/mlir/Pass/PassManager.h b/mlir/include/mlir/Pass/PassManager.h
index b3e427588173c..d9bab431e2e0c 100644
--- a/mlir/include/mlir/Pass/PassManager.h
+++ b/mlir/include/mlir/Pass/PassManager.h
@@ -11,7 +11,6 @@
 
 #include "mlir/IR/Dialect.h"
 #include "mlir/IR/OperationSupport.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Support/Timing.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/iterator.h"
diff --git a/mlir/include/mlir/Pass/PassOptions.h b/mlir/include/mlir/Pass/PassOptions.h
index 3a5e3224133e6..b99d91f07dd1c 100644
--- a/mlir/include/mlir/Pass/PassOptions.h
+++ b/mlir/include/mlir/Pass/PassOptions.h
@@ -15,7 +15,6 @@
 #define MLIR_PASS_PASSOPTIONS_H_
 
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/FunctionExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/CommandLine.h"
diff --git a/mlir/include/mlir/Query/Query.h b/mlir/include/mlir/Query/Query.h
index 447fc7ca21c8d..18f2172c9510a 100644
--- a/mlir/include/mlir/Query/Query.h
+++ b/mlir/include/mlir/Query/Query.h
@@ -10,7 +10,6 @@
 #define MLIR_TOOLS_MLIRQUERY_QUERY_H
 
 #include "Matcher/VariantValue.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/LineEditor/LineEditor.h"
@@ -27,7 +26,7 @@ struct Query : llvm::RefCountedBase<Query> {
   virtual ~Query();
 
   // Perform the query on qs and print output to os.
-  virtual mlir::LogicalResult run(llvm::raw_ostream &os,
+  virtual llvm::LogicalResult run(llvm::raw_ostream &os,
                                   QuerySession &qs) const = 0;
 
   llvm::StringRef remainingContent;
@@ -45,7 +44,7 @@ complete(llvm::StringRef line, size_t pos, const QuerySession &qs);
 struct InvalidQuery : Query {
   InvalidQuery(const llvm::Twine &errStr)
       : Query(QueryKind::Invalid), errStr(errStr.str()) {}
-  mlir::LogicalResult run(llvm::raw_ostream &os,
+  llvm::LogicalResult run(llvm::raw_ostream &os,
                           QuerySession &qs) const override;
 
   std::string errStr;
@@ -58,7 +57,7 @@ struct InvalidQuery : Query {
 // No-op query (i.e. a blank line).
 struct NoOpQuery : Query {
   NoOpQuery() : Query(QueryKind::NoOp) {}
-  mlir::LogicalResult run(llvm::raw_ostream &os,
+  llvm::LogicalResult run(llvm::raw_ostream &os,
                           QuerySession &qs) const override;
 
   static bool classof(const Query *query) {
@@ -69,7 +68,7 @@ struct NoOpQuery : Query {
 // Query for "help".
 struct HelpQuery : Query {
   HelpQuery() : Query(QueryKind::Help) {}
-  mlir::LogicalResult run(llvm::raw_ostream &os,
+  llvm::LogicalResult run(llvm::raw_ostream &os,
                           QuerySession &qs) const override;
 
   static bool classof(const Query *query) {
@@ -80,7 +79,7 @@ struct HelpQuery : Query {
 // Query for "quit".
 struct QuitQuery : Query {
   QuitQuery() : Query(QueryKind::Quit) {}
-  mlir::LogicalResult run(llvm::raw_ostream &os,
+  llvm::LogicalResult run(llvm::raw_ostream &os,
                           QuerySession &qs) const override;
 
   static bool classof(const Query *query) {
@@ -92,7 +91,7 @@ struct QuitQuery : Query {
 struct MatchQuery : Query {
   MatchQuery(llvm::StringRef source, const matcher::DynMatcher &matcher)
       : Query(QueryKind::Match), matcher(matcher), source(source) {}
-  mlir::LogicalResult run(llvm::raw_ostream &os,
+  llvm::LogicalResult run(llvm::raw_ostream &os,
                           QuerySession &qs) const override;
 
   const matcher::DynMatcher matcher;
diff --git a/mlir/include/mlir/Reducer/ReductionNode.h b/mlir/include/mlir/Reducer/ReductionNode.h
index 814c88533b447..6ca4e13d159ac 100644
--- a/mlir/include/mlir/Reducer/ReductionNode.h
+++ b/mlir/include/mlir/Reducer/ReductionNode.h
@@ -22,7 +22,6 @@
 
 #include "mlir/IR/OwningOpRef.h"
 #include "mlir/Reducer/Tester.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/ToolOutputFile.h"
diff --git a/mlir/include/mlir/Support/LLVM.h b/mlir/include/mlir/Support/LLVM.h
index 7baca03998f5b..020c0fba726c8 100644
--- a/mlir/include/mlir/Support/LLVM.h
+++ b/mlir/include/mlir/Support/LLVM.h
@@ -21,7 +21,10 @@
 // We include this header because it cannot be practically forward
 // declared, and are effectively language features.
 #include "llvm/Support/Casting.h"
-#include <vector>
+
+// We include this header because large portions of mlir would have to include
+// it anyway.
+#include "llvm/Support/LogicalResult.h"
 
 // Workaround for clang-5 (PR41549)
 #if defined(__clang_major__)
@@ -151,6 +154,15 @@ using llvm::iterator_range;
 using llvm::raw_ostream;
 using llvm::SMLoc;
 using llvm::SMRange;
+
+// LogicalResult.
+using llvm::failed;
+using llvm::failure;
+using llvm::FailureOr;
+using llvm::LogicalResult;
+using llvm::ParseResult;
+using llvm::succeeded;
+using llvm::success;
 } // namespace mlir
 
 #endif // MLIR_SUPPORT_LLVM_H
diff --git a/mlir/include/mlir/Support/StorageUniquer.h b/mlir/include/mlir/Support/StorageUniquer.h
index 2369d9cf90ff9..26bdf09abba21 100644
--- a/mlir/include/mlir/Support/StorageUniquer.h
+++ b/mlir/include/mlir/Support/StorageUniquer.h
@@ -10,7 +10,6 @@
 #define MLIR_SUPPORT_STORAGEUNIQUER_H
 
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Support/TypeID.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseSet.h"
diff --git a/mlir/include/mlir/Support/ToolUtilities.h b/mlir/include/mlir/Support/ToolUtilities.h
index 511cb118bb246..cb6ba299d28f1 100644
--- a/mlir/include/mlir/Support/ToolUtilities.h
+++ b/mlir/include/mlir/Support/ToolUtilities.h
@@ -24,8 +24,6 @@ class MemoryBuffer;
 } // namespace llvm
 
 namespace mlir {
-struct LogicalResult;
-
 using ChunkBufferHandler = function_ref<LogicalResult(
     std::unique_ptr<llvm::MemoryBuffer> chunkBuffer, raw_ostream &os)>;
 
diff --git a/mlir/include/mlir/Target/Cpp/CppEmitter.h b/mlir/include/mlir/Target/Cpp/CppEmitter.h
index d3c081061faa0..99d8696cc8e07 100644
--- a/mlir/include/mlir/Target/Cpp/CppEmitter.h
+++ b/mlir/include/mlir/Target/Cpp/CppEmitter.h
@@ -16,7 +16,6 @@
 #include "mlir/Support/LLVM.h"
 
 namespace mlir {
-struct LogicalResult;
 class Operation;
 namespace emitc {
 
diff --git a/mlir/include/mlir/Target/LLVM/ROCDL/Utils.h b/mlir/include/mlir/Target/LLVM/ROCDL/Utils.h
index 44c9ded317fa5..3c637a01b0e3b 100644
--- a/mlir/include/mlir/Target/LLVM/ROCDL/Utils.h
+++ b/mlir/include/mlir/Target/LLVM/ROCDL/Utils.h
@@ -15,6 +15,7 @@
 
 #include "mlir/Dialect/GPU/IR/CompilationInterfaces.h"
 #include "mlir/Dialect/LLVMIR/ROCDLDialect.h"
+#include "mlir/Support/LLVM.h"
 #include "mlir/Target/LLVM/ModuleToObject.h"
 
 namespace mlir {
diff --git a/mlir/include/mlir/Target/LLVMIR/LLVMImportInterface.h b/mlir/include/mlir/Target/LLVMIR/LLVMImportInterface.h
index 86bcd580c1b44..74b545490b045 100644
--- a/mlir/include/mlir/Target/LLVMIR/LLVMImportInterface.h
+++ b/mlir/include/mlir/Target/LLVMIR/LLVMImportInterface.h
@@ -19,7 +19,6 @@
 #include "mlir/IR/Diagnostics.h"
 #include "mlir/IR/DialectInterface.h"
 #include "mlir/IR/Location.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/IR/Instruction.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/Support/FormatVariadic.h"
diff --git a/mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h b/mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h
index 4a8ee06f5dcc7..11cb836183920 100644
--- a/mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h
+++ b/mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h
@@ -16,7 +16,6 @@
 #include "mlir/Dialect/LLVMIR/LLVMDialect.h"
 #include "mlir/IR/BuiltinAttributes.h"
 #include "mlir/IR/DialectInterface.h"
-#include "mlir/Support/LogicalResult.h"
 
 namespace llvm {
 class Instruction;
diff --git a/mlir/include/mlir/Target/SPIRV/Serialization.h b/mlir/include/mlir/Target/SPIRV/Serialization.h
index 498f390148793..613f0a423f9f8 100644
--- a/mlir/include/mlir/Target/SPIRV/Serialization.h
+++ b/mlir/include/mlir/Target/SPIRV/Serialization.h
@@ -16,7 +16,6 @@
 #include "mlir/Support/LLVM.h"
 
 namespace mlir {
-struct LogicalResult;
 class MLIRContext;
 
 namespace spirv {
diff --git a/mlir/include/mlir/Tools/PDLL/AST/Diagnostic.h b/mlir/include/mlir/Tools/PDLL/AST/Diagnostic.h
index a8bae327d2cdc..aaba8106b57d0 100644
--- a/mlir/include/mlir/Tools/PDLL/AST/Diagnostic.h
+++ b/mlir/include/mlir/Tools/PDLL/AST/Diagnostic.h
@@ -13,7 +13,6 @@
 #include <optional>
 
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/FunctionExtras.h"
 #include "llvm/Support/SourceMgr.h"
 
diff --git a/mlir/include/mlir/Tools/PDLL/CodeGen/MLIRGen.h b/mlir/include/mlir/Tools/PDLL/CodeGen/MLIRGen.h
index c691c39318c12..c106f6dcac91d 100644
--- a/mlir/include/mlir/Tools/PDLL/CodeGen/MLIRGen.h
+++ b/mlir/include/mlir/Tools/PDLL/CodeGen/MLIRGen.h
@@ -11,8 +11,6 @@
 
 #include <memory>
 
-#include "mlir/Support/LogicalResult.h"
-
 namespace llvm {
 class SourceMgr;
 } // namespace llvm
diff --git a/mlir/include/mlir/Tools/PDLL/Parser/Parser.h b/mlir/include/mlir/Tools/PDLL/Parser/Parser.h
index 1a43a3bbfd48c..6f62aaf904fc4 100644
--- a/mlir/include/mlir/Tools/PDLL/Parser/Parser.h
+++ b/mlir/include/mlir/Tools/PDLL/Parser/Parser.h
@@ -11,7 +11,7 @@
 
 #include <memory>
 
-#include "mlir/Support/LogicalResult.h"
+#include "mlir/Support/LLVM.h"
 
 namespace llvm {
 class SourceMgr;
diff --git a/mlir/include/mlir/Tools/lsp-server-support/CompilationDatabase.h b/mlir/include/mlir/Tools/lsp-server-support/CompilationDatabase.h
index 84807ec2002c1..588c136790743 100644
--- a/mlir/include/mlir/Tools/lsp-server-support/CompilationDatabase.h
+++ b/mlir/include/mlir/Tools/lsp-server-support/CompilationDatabase.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/StringMap.h"
 #include <memory>
 #include <string>
+#include <vector>
 
 namespace mlir {
 namespace lsp {
diff --git a/mlir/include/mlir/Tools/lsp-server-support/Protocol.h b/mlir/include/mlir/Tools/lsp-server-support/Protocol.h
index 1d22b8a667749..5d2eb01a523a7 100644
--- a/mlir/include/mlir/Tools/lsp-server-support/Protocol.h
+++ b/mlir/include/mlir/Tools/lsp-server-support/Protocol.h
@@ -28,15 +28,12 @@
 #include "llvm/Support/SourceMgr.h"
 #include "llvm/Support/raw_ostream.h"
 #include <bitset>
-#include <memory>
 #include <optional>
 #include <string>
 #include <utility>
 #include <vector>
 
 namespace mlir {
-struct LogicalResult;
-
 namespace lsp {
 
 enum class ErrorCode {
diff --git a/mlir/include/mlir/Tools/lsp-server-support/Transport.h b/mlir/include/mlir/Tools/lsp-server-support/Transport.h
index 83fff92e1b4bc..6843bc76ab9dc 100644
--- a/mlir/include/mlir/Tools/lsp-server-support/Transport.h
+++ b/mlir/include/mlir/Tools/lsp-server-support/Transport.h
@@ -17,7 +17,6 @@
 
 #include "mlir/Support/DebugStringHelper.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Tools/lsp-server-support/Logging.h"
 #include "mlir/Tools/lsp-server-support/Protocol.h"
 #include "llvm/ADT/FunctionExtras.h"
diff --git a/mlir/include/mlir/Tools/mlir-lsp-server/MlirLspServerMain.h b/mlir/include/mlir/Tools/mlir-lsp-server/MlirLspServerMain.h
index 5207106dcecc2..66d5d40a6d28d 100644
--- a/mlir/include/mlir/Tools/mlir-lsp-server/MlirLspServerMain.h
+++ b/mlir/include/mlir/Tools/mlir-lsp-server/MlirLspServerMain.h
@@ -13,15 +13,18 @@
 #ifndef MLIR_TOOLS_MLIR_LSP_SERVER_MLIRLSPSERVERMAIN_H
 #define MLIR_TOOLS_MLIR_LSP_SERVER_MLIRLSPSERVERMAIN_H
 
+namespace llvm {
+struct LogicalResult;
+} // namespace llvm
+
 namespace mlir {
 class DialectRegistry;
-struct LogicalResult;
 
 /// Implementation for tools like `mlir-lsp-server`.
 /// - registry should contain all the dialects that can be parsed in source IR
 /// passed to the server.
-LogicalResult MlirLspServerMain(int argc, char **argv,
-                                DialectRegistry &registry);
+llvm::LogicalResult MlirLspServerMain(int argc, char **argv,
+                                      DialectRegistry &registry);
 
 } // namespace mlir
 
diff --git a/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h b/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
index 4f7f83cdb4737..d0ca188abcc27 100644
--- a/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
+++ b/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
@@ -14,7 +14,6 @@
 #define MLIR_TOOLS_MLIROPT_MLIROPTMAIN_H
 
 #include "mlir/Debug/CLOptionsSetup.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Support/ToolUtilities.h"
 #include "llvm/ADT/StringRef.h"
 
diff --git a/mlir/include/mlir/Tools/mlir-pdll-lsp-server/MlirPdllLspServerMain.h b/mlir/include/mlir/Tools/mlir-pdll-lsp-server/MlirPdllLspServerMain.h
index a193732166c4a..c45ddb6e7da1d 100644
--- a/mlir/include/mlir/Tools/mlir-pdll-lsp-server/MlirPdllLspServerMain.h
+++ b/mlir/include/mlir/Tools/mlir-pdll-lsp-server/MlirPdllLspServerMain.h
@@ -14,11 +14,13 @@
 #ifndef MLIR_TOOLS_MLIR_PDLL_LSP_SERVER_MLIRPDLLLSPSERVERMAIN_H
 #define MLIR_TOOLS_MLIR_PDLL_LSP_SERVER_MLIRPDLLLSPSERVERMAIN_H
 
-namespace mlir {
+namespace llvm {
 struct LogicalResult;
+} // namespace llvm
 
+namespace mlir {
 /// Implementation for tools like `mlir-pdll-lsp-server`.
-LogicalResult MlirPdllLspServerMain(int argc, char **argv);
+llvm::LogicalResult MlirPdllLspServerMain(int argc, char **argv);
 
 } // namespace mlir
 
diff --git a/mlir/include/mlir/Tools/mlir-query/MlirQueryMain.h b/mlir/include/mlir/Tools/mlir-query/MlirQueryMain.h
index fa1cd5d8176ee..44d5c8d9a5fe8 100644
--- a/mlir/include/mlir/Tools/mlir-query/MlirQueryMain.h
+++ b/mlir/include/mlir/Tools/mlir-query/MlirQueryMain.h
@@ -15,7 +15,7 @@
 #define MLIR_TOOLS_MLIRQUERY_MLIRQUERYMAIN_H
 
 #include "mlir/Query/Matcher/Registry.h"
-#include "mlir/Support/LogicalResult.h"
+#include "mlir/Support/LLVM.h"
 
 namespace mlir {
 
diff --git a/mlir/include/mlir/Tools/mlir-reduce/MlirReduceMain.h b/mlir/include/mlir/Tools/mlir-reduce/MlirReduceMain.h
index fccff9ec56fa4..cb215b3ba3451 100644
--- a/mlir/include/mlir/Tools/mlir-reduce/MlirReduceMain.h
+++ b/mlir/include/mlir/Tools/mlir-reduce/MlirReduceMain.h
@@ -9,7 +9,7 @@
 #ifndef MLIR_TOOLS_MLIR_REDUCE_MLIRREDUCEMAIN_H
 #define MLIR_TOOLS_MLIR_REDUCE_MLIRREDUCEMAIN_H
 
-#include "mlir/Support/LogicalResult.h"
+#include "mlir/Support/LLVM.h"
 
 namespace mlir {
 
diff --git a/mlir/include/mlir/Tools/mlir-translate/MlirTranslateMain.h b/mlir/include/mlir/Tools/mlir-translate/MlirTranslateMain.h
index 47769873529e6..c9bc58bacdace 100644
--- a/mlir/include/mlir/Tools/mlir-translate/MlirTranslateMain.h
+++ b/mlir/include/mlir/Tools/mlir-translate/MlirTranslateMain.h
@@ -13,7 +13,7 @@
 #ifndef MLIR_TOOLS_MLIRTRANSLATE_MLIRTRANSLATEMAIN_H
 #define MLIR_TOOLS_MLIRTRANSLATE_MLIRTRANSLATEMAIN_H
 
-#include "mlir/Support/LogicalResult.h"
+#include "mlir/Support/LLVM.h"
 #include "llvm/ADT/StringRef.h"
 
 namespace mlir {
diff --git a/mlir/include/mlir/Tools/tblgen-lsp-server/TableGenLspServerMain.h b/mlir/include/mlir/Tools/tblgen-lsp-server/TableGenLspServerMain.h
index 6859300645f6a..f0799c5ec76db 100644
--- a/mlir/include/mlir/Tools/tblgen-lsp-server/TableGenLspServerMain.h
+++ b/mlir/include/mlir/Tools/tblgen-lsp-server/TableGenLspServerMain.h
@@ -13,12 +13,13 @@
 #ifndef MLIR_TOOLS_TBLGENLSPSERVER_TABLEGENLSPSERVERMAIN_H
 #define MLIR_TOOLS_TBLGENLSPSERVER_TABLEGENLSPSERVERMAIN_H
 
-namespace mlir {
+namespace llvm {
 struct LogicalResult;
+} // namespace llvm
 
+namespace mlir {
 /// Implementation for tools like `tblgen-lsp-server`.
-LogicalResult TableGenLspServerMain(int argc, char **argv);
-
+llvm::LogicalResult TableGenLspServerMain(int argc, char **argv);
 } // namespace mlir
 
 #endif // MLIR_TOOLS_TBLGENLSPSERVER_TABLEGENLSPSERVERMAIN_H
diff --git a/mlir/include/mlir/Transforms/HomomorphismSimplification.h b/mlir/include/mlir/Transforms/HomomorphismSimplification.h
index d2732602a0d8e..386a315b0e90a 100644
--- a/mlir/include/mlir/Transforms/HomomorphismSimplification.h
+++ b/mlir/include/mlir/Transforms/HomomorphismSimplification.h
@@ -13,7 +13,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/Value.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/Casting.h"
 #include <iterator>
diff --git a/mlir/include/mlir/Transforms/Inliner.h b/mlir/include/mlir/Transforms/Inliner.h
index 073b83f6f844c..ec77319d6ac88 100644
--- a/mlir/include/mlir/Transforms/Inliner.h
+++ b/mlir/include/mlir/Transforms/Inliner.h
@@ -17,7 +17,6 @@
 #include "mlir/Interfaces/CallInterfaces.h"
 #include "mlir/Pass/AnalysisManager.h"
 #include "mlir/Pass/PassManager.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/StringMap.h"
 
 namespace mlir {
diff --git a/mlir/include/mlir/Transforms/LocationSnapshot.h b/mlir/include/mlir/Transforms/LocationSnapshot.h
index a2b4200b0177c..ccfdbac007ac4 100644
--- a/mlir/include/mlir/Transforms/LocationSnapshot.h
+++ b/mlir/include/mlir/Transforms/LocationSnapshot.h
@@ -21,7 +21,6 @@
 
 namespace mlir {
 class Location;
-struct LogicalResult;
 class Operation;
 class OpPrintingFlags;
 class Pass;
diff --git a/mlir/include/mlir/Transforms/SROA.h b/mlir/include/mlir/Transforms/SROA.h
index d48f809d30766..88e4babd6b78a 100644
--- a/mlir/include/mlir/Transforms/SROA.h
+++ b/mlir/include/mlir/Transforms/SROA.h
@@ -10,7 +10,7 @@
 #define MLIR_TRANSFORMS_SROA_H
 
 #include "mlir/Interfaces/MemorySlotInterfaces.h"
-#include "mlir/Support/LogicalResult.h"
+#include "mlir/Support/LLVM.h"
 #include "llvm/ADT/Statistic.h"
 
 namespace mlir {
diff --git a/mlir/lib/Analysis/AliasAnalysis/LocalAliasAnalysis.cpp b/mlir/lib/Analysis/AliasAnalysis/LocalAliasAnalysis.cpp
index b22f3fdc9fb7a..6cece4630a0e5 100644
--- a/mlir/lib/Analysis/AliasAnalysis/LocalAliasAnalysis.cpp
+++ b/mlir/lib/Analysis/AliasAnalysis/LocalAliasAnalysis.cpp
@@ -22,7 +22,6 @@
 #include "mlir/Interfaces/SideEffectInterfaces.h"
 #include "mlir/Interfaces/ViewLikeInterface.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/Support/Casting.h"
 #include <cassert>
 #include <optional>
diff --git a/mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp b/mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp
index 99c041923c8c5..16799d3c82092 100644
--- a/mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp
@@ -13,7 +13,6 @@
 #include "mlir/IR/Operation.h"
 #include "mlir/IR/Value.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/Casting.h"
 #include "llvm/Support/Debug.h"
diff --git a/mlir/lib/Analysis/DataFlow/DeadCodeAnalysis.cpp b/mlir/lib/Analysis/DataFlow/DeadCodeAnalysis.cpp
index 64df74e78915f..fab2bd83888da 100644
--- a/mlir/lib/Analysis/DataFlow/DeadCodeAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/DeadCodeAnalysis.cpp
@@ -21,7 +21,6 @@
 #include "mlir/Interfaces/CallInterfaces.h"
 #include "mlir/Interfaces/ControlFlowInterfaces.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/Support/Casting.h"
 #include <cassert>
 #include <optional>
diff --git a/mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp b/mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp
index d4b9134ab9eea..9894810f0e04b 100644
--- a/mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp
@@ -16,7 +16,6 @@
 #include "mlir/Interfaces/CallInterfaces.h"
 #include "mlir/Interfaces/ControlFlowInterfaces.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/Casting.h"
 #include <cassert>
diff --git a/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp b/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp
index b47bba16fd902..ad956b73e4b1d 100644
--- a/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp
@@ -18,7 +18,6 @@
 #include "mlir/Interfaces/CallInterfaces.h"
 #include "mlir/Interfaces/ControlFlowInterfaces.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/Casting.h"
 #include <cassert>
diff --git a/mlir/lib/Analysis/DataFlowFramework.cpp b/mlir/lib/Analysis/DataFlowFramework.cpp
index 5ef24f201f8a6..d0e827aa1c2b6 100644
--- a/mlir/lib/Analysis/DataFlowFramework.cpp
+++ b/mlir/lib/Analysis/DataFlowFramework.cpp
@@ -10,7 +10,6 @@
 #include "mlir/IR/Location.h"
 #include "mlir/IR/Operation.h"
 #include "mlir/IR/Value.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/iterator.h"
 #include "llvm/Config/abi-breaking.h"
 #include "llvm/Support/Casting.h"
diff --git a/mlir/lib/Analysis/FlatLinearValueConstraints.cpp b/mlir/lib/Analysis/FlatLinearValueConstraints.cpp
index 18047a613c620..746cff525beb2 100644
--- a/mlir/lib/Analysis/FlatLinearValueConstraints.cpp
+++ b/mlir/lib/Analysis/FlatLinearValueConstraints.cpp
@@ -16,7 +16,6 @@
 #include "mlir/IR/Builders.h"
 #include "mlir/IR/IntegerSet.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallVector.h"
diff --git a/mlir/lib/AsmParser/AffineParser.cpp b/mlir/lib/AsmParser/AffineParser.cpp
index 54c2a1ff043da..1797611858c06 100644
--- a/mlir/lib/AsmParser/AffineParser.cpp
+++ b/mlir/lib/AsmParser/AffineParser.cpp
@@ -19,7 +19,6 @@
 #include "mlir/IR/IntegerSet.h"
 #include "mlir/IR/OpImplementation.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/SourceMgr.h"
diff --git a/mlir/lib/AsmParser/AsmParserState.cpp b/mlir/lib/AsmParser/AsmParserState.cpp
index 47cfb52886290..589bf6aae54d4 100644
--- a/mlir/lib/AsmParser/AsmParserState.cpp
+++ b/mlir/lib/AsmParser/AsmParserState.cpp
@@ -13,7 +13,6 @@
 #include "mlir/IR/Types.h"
 #include "mlir/IR/Value.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringExtras.h"
diff --git a/mlir/lib/AsmParser/DialectSymbolParser.cpp b/mlir/lib/AsmParser/DialectSymbolParser.cpp
index 80cce7e6ae43f..9f4a87a6a02de 100644
--- a/mlir/lib/AsmParser/DialectSymbolParser.cpp
+++ b/mlir/lib/AsmParser/DialectSymbolParser.cpp
@@ -23,7 +23,6 @@
 #include "mlir/IR/DialectImplementation.h"
 #include "mlir/IR/MLIRContext.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/SourceMgr.h"
 #include <cassert>
diff --git a/mlir/lib/AsmParser/LocationParser.cpp b/mlir/lib/AsmParser/LocationParser.cpp
index fed65c070121d..1365da03c7c3d 100644
--- a/mlir/lib/AsmParser/LocationParser.cpp
+++ b/mlir/lib/AsmParser/LocationParser.cpp
@@ -12,7 +12,6 @@
 #include "mlir/IR/BuiltinAttributes.h"
 #include "mlir/IR/Location.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 
 using namespace mlir;
 using namespace mlir::detail;
diff --git a/mlir/lib/AsmParser/Parser.cpp b/mlir/lib/AsmParser/Parser.cpp
index 1b8b4bac1821e..7181f13d3c8bb 100644
--- a/mlir/lib/AsmParser/Parser.cpp
+++ b/mlir/lib/AsmParser/Parser.cpp
@@ -34,7 +34,6 @@
 #include "mlir/IR/Verifier.h"
 #include "mlir/IR/Visitors.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Support/TypeID.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/DenseMap.h"
diff --git a/mlir/lib/AsmParser/TypeParser.cpp b/mlir/lib/AsmParser/TypeParser.cpp
index 5da931b77b3be..0b46c96bbc04d 100644
--- a/mlir/lib/AsmParser/TypeParser.cpp
+++ b/mlir/lib/AsmParser/TypeParser.cpp
@@ -19,7 +19,6 @@
 #include "mlir/IR/TensorEncoding.h"
 #include "mlir/IR/Types.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/STLExtras.h"
 #include <cassert>
 #include <cstdint>
diff --git a/mlir/lib/Bytecode/Reader/BytecodeReader.cpp b/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
index dd1e4abaea166..f767740a8d177 100644
--- a/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
+++ b/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
@@ -17,7 +17,6 @@
 #include "mlir/IR/Verifier.h"
 #include "mlir/IR/Visitors.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/ScopeExit.h"
 #include "llvm/ADT/StringExtras.h"
diff --git a/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp b/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
index 9493a6c19a106..449d7549eb724 100644
--- a/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
+++ b/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
@@ -14,7 +14,6 @@
 #include "mlir/IR/Attributes.h"
 #include "mlir/IR/Diagnostics.h"
 #include "mlir/IR/OpImplementation.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/CachedHashString.h"
 #include "llvm/ADT/MapVector.h"
diff --git a/mlir/lib/CAPI/IR/BuiltinTypes.cpp b/mlir/lib/CAPI/IR/BuiltinTypes.cpp
index c94c070144a7e..01bb71d9228b4 100644
--- a/mlir/lib/CAPI/IR/BuiltinTypes.cpp
+++ b/mlir/lib/CAPI/IR/BuiltinTypes.cpp
@@ -16,7 +16,6 @@
 #include "mlir/IR/AffineMap.h"
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/IR/Types.h"
-#include "mlir/Support/LogicalResult.h"
 
 #include <algorithm>
 
diff --git a/mlir/lib/Conversion/ArithToAMDGPU/ArithToAMDGPU.cpp b/mlir/lib/Conversion/ArithToAMDGPU/ArithToAMDGPU.cpp
index 3d3ff001c541b..58764ad38e34f 100644
--- a/mlir/lib/Conversion/ArithToAMDGPU/ArithToAMDGPU.cpp
+++ b/mlir/lib/Conversion/ArithToAMDGPU/ArithToAMDGPU.cpp
@@ -16,7 +16,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/TypeUtilities.h"
 #include "mlir/Pass/Pass.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 
 namespace mlir {
diff --git a/mlir/lib/Conversion/ArithToEmitC/ArithToEmitC.cpp b/mlir/lib/Conversion/ArithToEmitC/ArithToEmitC.cpp
index 93717e3b02ef0..7c6fdabccf15f 100644
--- a/mlir/lib/Conversion/ArithToEmitC/ArithToEmitC.cpp
+++ b/mlir/lib/Conversion/ArithToEmitC/ArithToEmitC.cpp
@@ -17,7 +17,6 @@
 #include "mlir/Dialect/EmitC/IR/EmitC.h"
 #include "mlir/IR/BuiltinAttributes.h"
 #include "mlir/IR/BuiltinTypes.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/DialectConversion.h"
 
 using namespace mlir;
diff --git a/mlir/lib/Conversion/BufferizationToMemRef/BufferizationToMemRef.cpp b/mlir/lib/Conversion/BufferizationToMemRef/BufferizationToMemRef.cpp
index 810f82f6442ea..2aae39f51b940 100644
--- a/mlir/lib/Conversion/BufferizationToMemRef/BufferizationToMemRef.cpp
+++ b/mlir/lib/Conversion/BufferizationToMemRef/BufferizationToMemRef.cpp
@@ -21,7 +21,6 @@
 #include "mlir/Dialect/SCF/IR/SCF.h"
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/Pass/Pass.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/DialectConversion.h"
 
 namespace mlir {
diff --git a/mlir/lib/Conversion/ControlFlowToSPIRV/ControlFlowToSPIRV.cpp b/mlir/lib/Conversion/ControlFlowToSPIRV/ControlFlowToSPIRV.cpp
index 995eecfc3e9c3..f96bfd6f788b9 100644
--- a/mlir/lib/Conversion/ControlFlowToSPIRV/ControlFlowToSPIRV.cpp
+++ b/mlir/lib/Conversion/ControlFlowToSPIRV/ControlFlowToSPIRV.cpp
@@ -19,7 +19,6 @@
 #include "mlir/Dialect/SPIRV/Utils/LayoutUtils.h"
 #include "mlir/IR/AffineMap.h"
 #include "mlir/IR/PatternMatch.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/DialectConversion.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/FormatVariadic.h"
diff --git a/mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp b/mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp
index efb80467369a2..059acb217709c 100644
--- a/mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp
+++ b/mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp
@@ -35,7 +35,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/SymbolTable.h"
 #include "mlir/IR/TypeUtilities.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/DialectConversion.h"
 #include "mlir/Transforms/Passes.h"
 #include "llvm/ADT/SmallVector.h"
diff --git a/mlir/lib/Conversion/FuncToSPIRV/FuncToSPIRV.cpp b/mlir/lib/Conversion/FuncToSPIRV/FuncToSPIRV.cpp
index a5755514b3e58..4740b7cc6c385 100644
--- a/mlir/lib/Conversion/FuncToSPIRV/FuncToSPIRV.cpp
+++ b/mlir/lib/Conversion/FuncToSPIRV/FuncToSPIRV.cpp
@@ -18,7 +18,6 @@
 #include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h"
 #include "mlir/Dialect/SPIRV/Utils/LayoutUtils.h"
 #include "mlir/IR/AffineMap.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/Support/Debug.h"
 
 #define DEBUG_TYPE "func-to-spirv-pattern"
diff --git a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
index d7885e0359592..98340bf653d61 100644
--- a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
+++ b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
@@ -21,7 +21,6 @@
 #include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h"
 #include "mlir/IR/BuiltinOps.h"
 #include "mlir/IR/Matchers.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/DialectConversion.h"
 #include <optional>
 
diff --git a/mlir/lib/Conversion/MemRefToSPIRV/MemRefToSPIRV.cpp b/mlir/lib/Conversion/MemRefToSPIRV/MemRefToSPIRV.cpp
index 81b9f55cac80f..90b0d727ddee7 100644
--- a/mlir/lib/Conversion/MemRefToSPIRV/MemRefToSPIRV.cpp
+++ b/mlir/lib/Conversion/MemRefToSPIRV/MemRefToSPIRV.cpp
@@ -21,7 +21,6 @@
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/IR/MLIRContext.h"
 #include "mlir/IR/Visitors.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/Support/Debug.h"
 #include <cassert>
 #include <optional>
diff --git a/mlir/lib/Conversion/NVVMToLLVM/NVVMToLLVM.cpp b/mlir/lib/Conversion/NVVMToLLVM/NVVMToLLVM.cpp
index d1d68e3c9c518..662ee9e483bc5 100644
--- a/mlir/lib/Conversion/NVVMToLLVM/NVVMToLLVM.cpp
+++ b/mlir/lib/Conversion/NVVMToLLVM/NVVMToLLVM.cpp
@@ -25,7 +25,6 @@
 #include "mlir/IR/Value.h"
 #include "mlir/Pass/Pass.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/Support/raw_ostream.h"
 
 #define DEBUG_TYPE "nvvm-to-llvm"
diff --git a/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp b/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
index 885bb5a3255b1..da09384bfbe89 100644
--- a/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
+++ b/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
@@ -20,7 +20,6 @@
 #include "mlir/Dialect/SPIRV/Utils/LayoutUtils.h"
 #include "mlir/IR/BuiltinOps.h"
 #include "mlir/IR/PatternMatch.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/DialectConversion.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/FormatVariadic.h"
diff --git a/mlir/lib/Conversion/TensorToLinalg/TensorToLinalg.cpp b/mlir/lib/Conversion/TensorToLinalg/TensorToLinalg.cpp
index 04580735e184c..5bb79d4bc84e2 100644
--- a/mlir/lib/Conversion/TensorToLinalg/TensorToLinalg.cpp
+++ b/mlir/lib/Conversion/TensorToLinalg/TensorToLinalg.cpp
@@ -14,7 +14,6 @@
 #include "mlir/Dialect/Linalg/Transforms/Transforms.h"
 #include "mlir/Dialect/Tensor/IR/Tensor.h"
 #include "mlir/IR/AffineMap.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/Support/Debug.h"
 
 #define DEBUG_TYPE "tensor-to-linalg-pattern"
diff --git a/mlir/lib/Conversion/TensorToSPIRV/TensorToSPIRV.cpp b/mlir/lib/Conversion/TensorToSPIRV/TensorToSPIRV.cpp
index 373952c5201b2..0fb58623bdafb 100644
--- a/mlir/lib/Conversion/TensorToSPIRV/TensorToSPIRV.cpp
+++ b/mlir/lib/Conversion/TensorToSPIRV/TensorToSPIRV.cpp
@@ -18,7 +18,6 @@
 #include "mlir/Dialect/SPIRV/Utils/LayoutUtils.h"
 #include "mlir/Dialect/Tensor/IR/Tensor.h"
 #include "mlir/IR/AffineMap.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/Support/Debug.h"
 
 #define DEBUG_TYPE "tensor-to-spirv-pattern"
diff --git a/mlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp b/mlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp
index 0fd91b27b7d21..0150ff667e4ef 100644
--- a/mlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp
+++ b/mlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp
@@ -31,7 +31,6 @@
 #include "mlir/IR/BuiltinOps.h"
 #include "mlir/IR/Region.h"
 #include "mlir/Pass/Pass.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 #include "mlir/Transforms/Passes.h"
 #include "llvm/ADT/STLExtras.h"
diff --git a/mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp b/mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp
index 8baa31a235950..c9363295ec32f 100644
--- a/mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp
+++ b/mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp
@@ -25,7 +25,6 @@
 #include "mlir/IR/Matchers.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/TypeUtilities.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/DialectConversion.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
diff --git a/mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp b/mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp
index 707bba2f1e6f9..16c0d3d8be3dc 100644
--- a/mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp
@@ -17,7 +17,6 @@
 #include "mlir/Dialect/Affine/Utils.h"
 #include "mlir/Dialect/Func/IR/FuncOps.h"
 #include "mlir/IR/Dominance.h"
-#include "mlir/Support/LogicalResult.h"
 #include <algorithm>
 
 namespace mlir {
diff --git a/mlir/lib/Dialect/Arith/IR/ArithOps.cpp b/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
index 0e7beffaf2f42..aa5eb95a3d22e 100644
--- a/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
+++ b/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
@@ -21,7 +21,6 @@
 #include "mlir/IR/OpImplementation.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/TypeUtilities.h"
-#include "mlir/Support/LogicalResult.h"
 
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APInt.h"
diff --git a/mlir/lib/Dialect/Arith/Transforms/EmulateNarrowType.cpp b/mlir/lib/Dialect/Arith/Transforms/EmulateNarrowType.cpp
index e0e1385b6bc17..1c1f65e580eb0 100644
--- a/mlir/lib/Dialect/Arith/Transforms/EmulateNarrowType.cpp
+++ b/mlir/lib/Dialect/Arith/Transforms/EmulateNarrowType.cpp
@@ -15,7 +15,6 @@
 #include "mlir/Dialect/Func/Transforms/FuncConversions.h"
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/IR/TypeUtilities.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/DialectConversion.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/Support/FormatVariadic.h"
diff --git a/mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp b/mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp
index 8a4080ea01970..9c91dd71b3e15 100644
--- a/mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp
+++ b/mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp
@@ -16,7 +16,6 @@
 #include "mlir/Dialect/Vector/IR/VectorOps.h"
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/IR/TypeUtilities.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/DialectConversion.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/Support/FormatVariadic.h"
diff --git a/mlir/lib/Dialect/Arith/Transforms/IntNarrowing.cpp b/mlir/lib/Dialect/Arith/Transforms/IntNarrowing.cpp
index f87f3d6350c02..e2d42e961c576 100644
--- a/mlir/lib/Dialect/Arith/Transforms/IntNarrowing.cpp
+++ b/mlir/lib/Dialect/Arith/Transforms/IntNarrowing.cpp
@@ -21,7 +21,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/TypeUtilities.h"
 #include "mlir/Interfaces/ValueBoundsOpInterface.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
diff --git a/mlir/lib/Dialect/ArmNeon/Transforms/LowerContractionToSMMLAPattern.cpp b/mlir/lib/Dialect/ArmNeon/Transforms/LowerContractionToSMMLAPattern.cpp
index 3635cd319a078..2c0c84d055f59 100644
--- a/mlir/lib/Dialect/ArmNeon/Transforms/LowerContractionToSMMLAPattern.cpp
+++ b/mlir/lib/Dialect/ArmNeon/Transforms/LowerContractionToSMMLAPattern.cpp
@@ -20,7 +20,6 @@
 #include "mlir/Dialect/Vector/IR/VectorOps.h"
 #include "mlir/IR/AffineMap.h"
 #include "mlir/IR/PatternMatch.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 
 #define DEBUG_TYPE "lower-contract-to-arm-neon"
diff --git a/mlir/lib/Dialect/Bufferization/Transforms/LowerDeallocations.cpp b/mlir/lib/Dialect/Bufferization/Transforms/LowerDeallocations.cpp
index 982d9558d3132..7fb46918ab1e8 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/LowerDeallocations.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/LowerDeallocations.cpp
@@ -19,7 +19,6 @@
 #include "mlir/Dialect/SCF/IR/SCF.h"
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/Pass/Pass.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/DialectConversion.h"
 
 namespace mlir {
diff --git a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
index 3abaa3b3a81dd..7bc2668310ddb 100644
--- a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
+++ b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
@@ -29,7 +29,6 @@
 #include "mlir/IR/TypeUtilities.h"
 #include "mlir/Interfaces/FunctionImplementation.h"
 #include "mlir/Interfaces/SideEffectInterfaces.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/InliningUtils.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/TypeSwitch.h"
diff --git a/mlir/lib/Dialect/GPU/Transforms/SubgroupReduceLowering.cpp b/mlir/lib/Dialect/GPU/Transforms/SubgroupReduceLowering.cpp
index b00c65c4c6248..561a7e569eb2f 100644
--- a/mlir/lib/Dialect/GPU/Transforms/SubgroupReduceLowering.cpp
+++ b/mlir/lib/Dialect/GPU/Transforms/SubgroupReduceLowering.cpp
@@ -19,7 +19,6 @@
 #include "mlir/IR/Location.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/TypeUtilities.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/MathExtras.h"
 #include <cassert>
diff --git a/mlir/lib/Dialect/IRDL/IR/IRDL.cpp b/mlir/lib/Dialect/IRDL/IR/IRDL.cpp
index 1f5584fa30c27..c5c44d97ce091 100644
--- a/mlir/lib/Dialect/IRDL/IR/IRDL.cpp
+++ b/mlir/lib/Dialect/IRDL/IR/IRDL.cpp
@@ -17,7 +17,6 @@
 #include "mlir/IR/OpImplementation.h"
 #include "mlir/IR/Operation.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/TypeSwitch.h"
 #include "llvm/IR/Metadata.h"
diff --git a/mlir/lib/Dialect/IRDL/IRDLLoading.cpp b/mlir/lib/Dialect/IRDL/IRDLLoading.cpp
index 5f623e8845d10..9a2754f45de0f 100644
--- a/mlir/lib/Dialect/IRDL/IRDLLoading.cpp
+++ b/mlir/lib/Dialect/IRDL/IRDLLoading.cpp
@@ -19,7 +19,6 @@
 #include "mlir/IR/BuiltinOps.h"
 #include "mlir/IR/ExtensibleDialect.h"
 #include "mlir/IR/OperationSupport.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/Support/SMLoc.h"
diff --git a/mlir/lib/Dialect/IRDL/IRDLVerifiers.cpp b/mlir/lib/Dialect/IRDL/IRDLVerifiers.cpp
index 05dc154eb5b4c..50f04d0c5e95e 100644
--- a/mlir/lib/Dialect/IRDL/IRDLVerifiers.cpp
+++ b/mlir/lib/Dialect/IRDL/IRDLVerifiers.cpp
@@ -19,7 +19,6 @@
 #include "mlir/IR/Location.h"
 #include "mlir/IR/Region.h"
 #include "mlir/IR/Value.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/Support/FormatVariadic.h"
 
 using namespace mlir;
diff --git a/mlir/lib/Dialect/LLVMIR/IR/BasicPtxBuilderInterface.cpp b/mlir/lib/Dialect/LLVMIR/IR/BasicPtxBuilderInterface.cpp
index 3dacc70838e3e..961944cd93b4d 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/BasicPtxBuilderInterface.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/BasicPtxBuilderInterface.cpp
@@ -12,7 +12,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "mlir/Dialect/LLVMIR/BasicPtxBuilderInterface.h"
-#include "mlir/Support/LogicalResult.h"
 
 #define DEBUG_TYPE "ptx-builder"
 #define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
diff --git a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
index 94197e473ce01..036a9a15af838 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
@@ -28,7 +28,6 @@
 #include "mlir/IR/Operation.h"
 #include "mlir/IR/OperationSupport.h"
 #include "mlir/IR/Types.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/TypeSwitch.h"
 #include "llvm/AsmParser/Parser.h"
diff --git a/mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp b/mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp
index 24001c543f35e..36b6088b83cc2 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp
@@ -30,7 +30,6 @@
 #include "mlir/IR/SymbolTable.h"
 #include "mlir/IR/Value.h"
 #include "mlir/Interfaces/TilingInterface.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
diff --git a/mlir/lib/Dialect/Linalg/Transforms/TransposeConv2D.cpp b/mlir/lib/Dialect/Linalg/Transforms/TransposeConv2D.cpp
index 9e0829ee67c01..1294043bf3837 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/TransposeConv2D.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/TransposeConv2D.cpp
@@ -13,7 +13,6 @@
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/ValueRange.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/DialectConversion.h"
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 #include "llvm/ADT/SmallVector.h"
diff --git a/mlir/lib/Dialect/MemRef/IR/MemRefMemorySlot.cpp b/mlir/lib/Dialect/MemRef/IR/MemRefMemorySlot.cpp
index 847c2f350f2bb..f630c48cdcaa1 100644
--- a/mlir/lib/Dialect/MemRef/IR/MemRefMemorySlot.cpp
+++ b/mlir/lib/Dialect/MemRef/IR/MemRefMemorySlot.cpp
@@ -20,7 +20,6 @@
 #include "mlir/IR/Value.h"
 #include "mlir/Interfaces/InferTypeOpInterface.h"
 #include "mlir/Interfaces/MemorySlotInterfaces.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/TypeSwitch.h"
 #include "llvm/Support/ErrorHandling.h"
diff --git a/mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp b/mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp
index f140c049f320f..20ce1b1da4c9b 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp
+++ b/mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp
@@ -19,7 +19,6 @@
 #include "mlir/IR/Builders.h"
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/IR/OpDefinition.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/DialectConversion.h"
 #include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/MathExtras.h"
diff --git a/mlir/lib/Dialect/Mesh/IR/MeshOps.cpp b/mlir/lib/Dialect/Mesh/IR/MeshOps.cpp
index ec1acbbb93498..75fceee14e123 100644
--- a/mlir/lib/Dialect/Mesh/IR/MeshOps.cpp
+++ b/mlir/lib/Dialect/Mesh/IR/MeshOps.cpp
@@ -23,7 +23,6 @@
 #include "mlir/IR/Value.h"
 #include "mlir/Interfaces/ViewLikeInterface.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallSet.h"
diff --git a/mlir/lib/Dialect/Mesh/Interfaces/ShardingInterface.cpp b/mlir/lib/Dialect/Mesh/Interfaces/ShardingInterface.cpp
index a2338476397a8..bcd0e15561320 100644
--- a/mlir/lib/Dialect/Mesh/Interfaces/ShardingInterface.cpp
+++ b/mlir/lib/Dialect/Mesh/Interfaces/ShardingInterface.cpp
@@ -13,7 +13,6 @@
 #include "mlir/IR/AffineMap.h"
 #include "mlir/IR/IRMapping.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallSet.h"
diff --git a/mlir/lib/Dialect/Mesh/Transforms/ShardingPropagation.cpp b/mlir/lib/Dialect/Mesh/Transforms/ShardingPropagation.cpp
index 870ac4a168082..511c9102fa303 100644
--- a/mlir/lib/Dialect/Mesh/Transforms/ShardingPropagation.cpp
+++ b/mlir/lib/Dialect/Mesh/Transforms/ShardingPropagation.cpp
@@ -15,7 +15,6 @@
 #include "mlir/IR/Verifier.h"
 #include "mlir/Interfaces/FunctionInterfaces.h"
 #include "mlir/Pass/Pass.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/iterator_range.h"
diff --git a/mlir/lib/Dialect/Mesh/Transforms/Simplifications.cpp b/mlir/lib/Dialect/Mesh/Transforms/Simplifications.cpp
index a29551a43cb84..4c14b1c0ea4bb 100644
--- a/mlir/lib/Dialect/Mesh/Transforms/Simplifications.cpp
+++ b/mlir/lib/Dialect/Mesh/Transforms/Simplifications.cpp
@@ -14,7 +14,6 @@
 #include "mlir/IR/ImplicitLocOpBuilder.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/SymbolTable.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
 #include <numeric>
diff --git a/mlir/lib/Dialect/Mesh/Transforms/Spmdization.cpp b/mlir/lib/Dialect/Mesh/Transforms/Spmdization.cpp
index 4ecc897103af7..1df3cf62c2b53 100644
--- a/mlir/lib/Dialect/Mesh/Transforms/Spmdization.cpp
+++ b/mlir/lib/Dialect/Mesh/Transforms/Spmdization.cpp
@@ -28,7 +28,6 @@
 #include "mlir/Interfaces/FunctionInterfaces.h"
 #include "mlir/Pass/Pass.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/STLExtras.h"
diff --git a/mlir/lib/Dialect/NVGPU/Transforms/MmaSyncTF32Transform.cpp b/mlir/lib/Dialect/NVGPU/Transforms/MmaSyncTF32Transform.cpp
index 8163f428683d8..6222cc7b646e2 100644
--- a/mlir/lib/Dialect/NVGPU/Transforms/MmaSyncTF32Transform.cpp
+++ b/mlir/lib/Dialect/NVGPU/Transforms/MmaSyncTF32Transform.cpp
@@ -19,7 +19,6 @@
 #include "mlir/Dialect/NVGPU/IR/NVGPUDialect.h"
 #include "mlir/Dialect/Vector/IR/VectorOps.h"
 #include "mlir/Interfaces/SideEffectInterfaces.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/MathExtras.h"
 
diff --git a/mlir/lib/Dialect/NVGPU/Transforms/OptimizeSharedMemory.cpp b/mlir/lib/Dialect/NVGPU/Transforms/OptimizeSharedMemory.cpp
index 693bb53cacff6..31ffacb29256f 100644
--- a/mlir/lib/Dialect/NVGPU/Transforms/OptimizeSharedMemory.cpp
+++ b/mlir/lib/Dialect/NVGPU/Transforms/OptimizeSharedMemory.cpp
@@ -20,7 +20,6 @@
 #include "mlir/Dialect/NVGPU/Transforms/Utils.h"
 #include "mlir/Dialect/Vector/IR/VectorOps.h"
 #include "mlir/Interfaces/SideEffectInterfaces.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/MathExtras.h"
 
@@ -146,7 +145,7 @@ getShmReadAndWriteOps(Operation *parentOp, Value shmMemRef,
   return success();
 }
 
-mlir::LogicalResult
+llvm::LogicalResult
 mlir::nvgpu::optimizeSharedMemoryReadsAndWrites(Operation *parentOp,
                                                 Value memrefValue) {
   auto memRefType = dyn_cast<MemRefType>(memrefValue.getType());
diff --git a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
index b13c8d1382fa8..abbd857dad67a 100644
--- a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+++ b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
@@ -38,7 +38,6 @@
 #include "mlir/Dialect/OpenMP/OpenMPOpsEnums.cpp.inc"
 #include "mlir/Dialect/OpenMP/OpenMPOpsInterfaces.cpp.inc"
 #include "mlir/Dialect/OpenMP/OpenMPTypeInterfaces.cpp.inc"
-#include "mlir/Support/LogicalResult.h"
 
 using namespace mlir;
 using namespace mlir::omp;
diff --git a/mlir/lib/Dialect/Polynomial/IR/Polynomial.cpp b/mlir/lib/Dialect/Polynomial/IR/Polynomial.cpp
index e85bced3cca7c..650a369a2abab 100644
--- a/mlir/lib/Dialect/Polynomial/IR/Polynomial.cpp
+++ b/mlir/lib/Dialect/Polynomial/IR/Polynomial.cpp
@@ -8,7 +8,6 @@
 
 #include "mlir/Dialect/Polynomial/IR/Polynomial.h"
 
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/SmallVector.h"
 
 namespace mlir {
diff --git a/mlir/lib/Dialect/Polynomial/IR/PolynomialAttributes.cpp b/mlir/lib/Dialect/Polynomial/IR/PolynomialAttributes.cpp
index cc7d3172b1a1d..93c7f9e687fc7 100644
--- a/mlir/lib/Dialect/Polynomial/IR/PolynomialAttributes.cpp
+++ b/mlir/lib/Dialect/Polynomial/IR/PolynomialAttributes.cpp
@@ -9,7 +9,6 @@
 
 #include "mlir/Dialect/Polynomial/IR/Polynomial.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringRef.h"
diff --git a/mlir/lib/Dialect/Polynomial/IR/PolynomialDialect.cpp b/mlir/lib/Dialect/Polynomial/IR/PolynomialDialect.cpp
index 825b80d70f803..7f8ba0670d65e 100644
--- a/mlir/lib/Dialect/Polynomial/IR/PolynomialDialect.cpp
+++ b/mlir/lib/Dialect/Polynomial/IR/PolynomialDialect.cpp
@@ -18,7 +18,6 @@
 #include "mlir/IR/Dialect.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/Interfaces/InferTypeOpInterface.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/TypeSwitch.h"
 
diff --git a/mlir/lib/Dialect/Polynomial/IR/PolynomialOps.cpp b/mlir/lib/Dialect/Polynomial/IR/PolynomialOps.cpp
index 40fa97dd2597e..2ba13bb7dab56 100644
--- a/mlir/lib/Dialect/Polynomial/IR/PolynomialOps.cpp
+++ b/mlir/lib/Dialect/Polynomial/IR/PolynomialOps.cpp
@@ -15,7 +15,6 @@
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/IR/Dialect.h"
 #include "mlir/IR/PatternMatch.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/APInt.h"
 
 using namespace mlir;
diff --git a/mlir/lib/Dialect/Quant/IR/QuantDialectBytecode.cpp b/mlir/lib/Dialect/Quant/IR/QuantDialectBytecode.cpp
index ee6be25541314..c0c00fb4893cb 100644
--- a/mlir/lib/Dialect/Quant/IR/QuantDialectBytecode.cpp
+++ b/mlir/lib/Dialect/Quant/IR/QuantDialectBytecode.cpp
@@ -12,7 +12,6 @@
 #include "mlir/Dialect/Quant/QuantOps.h"
 #include "mlir/Dialect/Quant/QuantTypes.h"
 #include "mlir/IR/Diagnostics.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/TypeSwitch.h"
diff --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
index 38415620fd4f9..d9bc05acddc82 100644
--- a/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
+++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
@@ -29,7 +29,6 @@
 #include "mlir/IR/Operation.h"
 #include "mlir/IR/TypeUtilities.h"
 #include "mlir/Interfaces/FunctionImplementation.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/ArrayRef.h"
diff --git a/mlir/lib/Dialect/SPIRV/Transforms/SPIRVWebGPUTransforms.cpp b/mlir/lib/Dialect/SPIRV/Transforms/SPIRVWebGPUTransforms.cpp
index 5d4dd5b3a1e01..d75c8552c9ad0 100644
--- a/mlir/lib/Dialect/SPIRV/Transforms/SPIRVWebGPUTransforms.cpp
+++ b/mlir/lib/Dialect/SPIRV/Transforms/SPIRVWebGPUTransforms.cpp
@@ -17,7 +17,6 @@
 #include "mlir/IR/Location.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/TypeUtilities.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
diff --git a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
index 288cbac7b7b80..4337787e4aead 100644
--- a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
+++ b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
@@ -955,7 +955,7 @@ LogicalResult tosa::ReshapeOp::inferReturnTypeComponents(
   return success();
 }
 
-mlir::LogicalResult tosa::ReshapeOp::verify() {
+llvm::LogicalResult tosa::ReshapeOp::verify() {
   TensorType inputType = getInput1().getType();
   RankedTensorType outputType = getType();
 
diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaFolders.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaFolders.cpp
index 6eef2c5018d6d..403ac48b91559 100644
--- a/mlir/lib/Dialect/Tosa/Transforms/TosaFolders.cpp
+++ b/mlir/lib/Dialect/Tosa/Transforms/TosaFolders.cpp
@@ -20,7 +20,6 @@
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/IR/Matchers.h"
 #include "mlir/Pass/Pass.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/FloatingPointMode.h"
 #include "llvm/ADT/SmallVector.h"
diff --git a/mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp b/mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp
index ff02cb2372b4e..e2b314f9db102 100644
--- a/mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp
+++ b/mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp
@@ -12,7 +12,6 @@
 #include "mlir/IR/Operation.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/Interfaces/CastInterfaces.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/ScopeExit.h"
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorBitCast.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorBitCast.cpp
index e5f11d82f277f..d8c4939dc742a 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorBitCast.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorBitCast.cpp
@@ -16,7 +16,6 @@
 #include "mlir/Dialect/Vector/Utils/VectorUtils.h"
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/IR/PatternMatch.h"
-#include "mlir/Support/LogicalResult.h"
 
 #define DEBUG_TYPE "vector-bitcast-lowering"
 
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorBroadcast.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorBroadcast.cpp
index 44e3f76112a7c..32e7eb27f5e29 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorBroadcast.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorBroadcast.cpp
@@ -32,7 +32,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/TypeUtilities.h"
 #include "mlir/Interfaces/VectorInterfaces.h"
-#include "mlir/Support/LogicalResult.h"
 
 #define DEBUG_TYPE "vector-broadcast-lowering"
 
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
index ba1c96805ff83..3a799ce8e0bce 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
@@ -31,7 +31,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/TypeUtilities.h"
 #include "mlir/Interfaces/VectorInterfaces.h"
-#include "mlir/Support/LogicalResult.h"
 
 #define DEBUG_TYPE "vector-contract-lowering"
 
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorGather.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorGather.cpp
index a0df03c7e808b..f1a5aa7664d2f 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorGather.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorGather.cpp
@@ -31,7 +31,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/TypeUtilities.h"
 #include "mlir/Interfaces/VectorInterfaces.h"
-#include "mlir/Support/LogicalResult.h"
 
 #define DEBUG_TYPE "vector-broadcast-lowering"
 
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp
index f7e01c7b12e4f..cab0f213b14a9 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp
@@ -16,7 +16,6 @@
 #include "mlir/Dialect/Vector/Utils/VectorUtils.h"
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/IR/PatternMatch.h"
-#include "mlir/Support/LogicalResult.h"
 
 #define DEBUG_TYPE "vector-interleave-lowering"
 
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorScan.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorScan.cpp
index c4e8ddcb13c34..92fddc13d6333 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorScan.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorScan.cpp
@@ -31,7 +31,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/TypeUtilities.h"
 #include "mlir/Interfaces/VectorInterfaces.h"
-#include "mlir/Support/LogicalResult.h"
 
 #define DEBUG_TYPE "vector-broadcast-lowering"
 
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorShapeCast.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorShapeCast.cpp
index 85c4c03d383f7..95ebd4e9fe3d9 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorShapeCast.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorShapeCast.cpp
@@ -32,7 +32,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/TypeUtilities.h"
 #include "mlir/Interfaces/VectorInterfaces.h"
-#include "mlir/Support/LogicalResult.h"
 
 #define DEBUG_TYPE "vector-shape-cast-lowering"
 
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorTranspose.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorTranspose.cpp
index ca8a6f6d82a6e..3c92b222e6bc8 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorTranspose.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorTranspose.cpp
@@ -31,7 +31,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/TypeUtilities.h"
 #include "mlir/Interfaces/VectorInterfaces.h"
-#include "mlir/Support/LogicalResult.h"
 
 #define DEBUG_TYPE "lower-vector-transpose"
 
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorLinearize.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorLinearize.cpp
index a1bb81e2d11b0..4a3ae1b850517 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorLinearize.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorLinearize.cpp
@@ -18,7 +18,6 @@
 #include "mlir/IR/Operation.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/TypeUtilities.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/DialectConversion.h"
 #include "llvm/ADT/ArrayRef.h"
 #include <cstdint>
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
index da3d9648cf283..c7d3022eff4d3 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
@@ -38,7 +38,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/IR/TypeUtilities.h"
 #include "mlir/Interfaces/VectorInterfaces.h"
-#include "mlir/Support/LogicalResult.h"
 
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/MapVector.h"
diff --git a/mlir/lib/IR/AffineMap.cpp b/mlir/lib/IR/AffineMap.cpp
index e5993eb08dc8b..62f595299afe2 100644
--- a/mlir/lib/IR/AffineMap.cpp
+++ b/mlir/lib/IR/AffineMap.cpp
@@ -12,7 +12,6 @@
 #include "mlir/IR/Builders.h"
 #include "mlir/IR/BuiltinAttributes.h"
 #include "mlir/IR/BuiltinTypes.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallBitVector.h"
 #include "llvm/ADT/SmallSet.h"
diff --git a/mlir/lib/IR/ExtensibleDialect.cpp b/mlir/lib/IR/ExtensibleDialect.cpp
index ca7b0e1cbb6b3..8a7d74700006c 100644
--- a/mlir/lib/IR/ExtensibleDialect.cpp
+++ b/mlir/lib/IR/ExtensibleDialect.cpp
@@ -11,7 +11,6 @@
 #include "mlir/IR/DialectImplementation.h"
 #include "mlir/IR/OperationSupport.h"
 #include "mlir/IR/StorageUniquerSupport.h"
-#include "mlir/Support/LogicalResult.h"
 
 using namespace mlir;
 
diff --git a/mlir/lib/Query/Query.cpp b/mlir/lib/Query/Query.cpp
index 7495e703f6303..7d9f360670051 100644
--- a/mlir/lib/Query/Query.cpp
+++ b/mlir/lib/Query/Query.cpp
@@ -12,7 +12,6 @@
 #include "mlir/IR/IRMapping.h"
 #include "mlir/Query/Matcher/MatchFinder.h"
 #include "mlir/Query/QuerySession.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/Support/SourceMgr.h"
 #include "llvm/Support/raw_ostream.h"
 
@@ -102,19 +101,16 @@ static Operation *extractFunction(std::vector<Operation *> &ops,
 
 Query::~Query() = default;
 
-mlir::LogicalResult InvalidQuery::run(llvm::raw_ostream &os,
-                                      QuerySession &qs) const {
+LogicalResult InvalidQuery::run(llvm::raw_ostream &os, QuerySession &qs) const {
   os << errStr << "\n";
   return mlir::failure();
 }
 
-mlir::LogicalResult NoOpQuery::run(llvm::raw_ostream &os,
-                                   QuerySession &qs) const {
+LogicalResult NoOpQuery::run(llvm::raw_ostream &os, QuerySession &qs) const {
   return mlir::success();
 }
 
-mlir::LogicalResult HelpQuery::run(llvm::raw_ostream &os,
-                                   QuerySession &qs) const {
+LogicalResult HelpQuery::run(llvm::raw_ostream &os, QuerySession &qs) const {
   os << "Available commands:\n\n"
         "  match MATCHER, m MATCHER      "
         "Match the mlir against the given matcher.\n"
@@ -123,14 +119,12 @@ mlir::LogicalResult HelpQuery::run(llvm::raw_ostream &os,
   return mlir::success();
 }
 
-mlir::LogicalResult QuitQuery::run(llvm::raw_ostream &os,
-                                   QuerySession &qs) const {
+LogicalResult QuitQuery::run(llvm::raw_ostream &os, QuerySession &qs) const {
   qs.terminate = true;
   return mlir::success();
 }
 
-mlir::LogicalResult MatchQuery::run(llvm::raw_ostream &os,
-                                    QuerySession &qs) const {
+LogicalResult MatchQuery::run(llvm::raw_ostream &os, QuerySession &qs) const {
   Operation *rootOp = qs.getRootOp();
   int matchCount = 0;
   std::vector<Operation *> matches =
diff --git a/mlir/lib/Support/ToolUtilities.cpp b/mlir/lib/Support/ToolUtilities.cpp
index f05b4f5c643d5..748f92847ac58 100644
--- a/mlir/lib/Support/ToolUtilities.cpp
+++ b/mlir/lib/Support/ToolUtilities.cpp
@@ -12,7 +12,6 @@
 
 #include "mlir/Support/ToolUtilities.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/Support/SourceMgr.h"
 #include "llvm/Support/raw_ostream.h"
 
diff --git a/mlir/lib/TableGen/CodeGenHelpers.cpp b/mlir/lib/TableGen/CodeGenHelpers.cpp
index 59865146e20bc..718a8136944bd 100644
--- a/mlir/lib/TableGen/CodeGenHelpers.cpp
+++ b/mlir/lib/TableGen/CodeGenHelpers.cpp
@@ -111,7 +111,7 @@ StringRef StaticVerifierFunctionEmitter::getRegionConstraintFn(
 /// Code for a type constraint. These may be called on the type of either
 /// operands or results.
 static const char *const typeConstraintCode = R"(
-static ::mlir::LogicalResult {0}(
+static ::llvm::LogicalResult {0}(
     ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
     unsigned valueIndex) {
   if (!({1})) {
@@ -129,14 +129,14 @@ static ::mlir::LogicalResult {0}(
 /// TODO: Unique constraints for adaptors. However, most Adaptor::verify
 /// functions are stripped anyways.
 static const char *const attrConstraintCode = R"(
-static ::mlir::LogicalResult {0}(
+static ::llvm::LogicalResult {0}(
     ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {{
   if (attr && !({1}))
     return emitError() << "attribute '" << attrName
         << "' failed to satisfy constraint: {2}";
   return ::mlir::success();
 }
-static ::mlir::LogicalResult {0}(
+static ::llvm::LogicalResult {0}(
     ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {{
   return {0}(attr, attrName, [op]() {{
     return op->emitOpError();
@@ -146,7 +146,7 @@ static ::mlir::LogicalResult {0}(
 
 /// Code for a successor constraint.
 static const char *const successorConstraintCode = R"(
-static ::mlir::LogicalResult {0}(
+static ::llvm::LogicalResult {0}(
     ::mlir::Operation *op, ::mlir::Block *successor,
     ::llvm::StringRef successorName, unsigned successorIndex) {
   if (!({1})) {
@@ -160,7 +160,7 @@ static ::mlir::LogicalResult {0}(
 /// Code for a region constraint. Callers will need to pass in the region's name
 /// for emitting an error message.
 static const char *const regionConstraintCode = R"(
-static ::mlir::LogicalResult {0}(
+static ::llvm::LogicalResult {0}(
     ::mlir::Operation *op, ::mlir::Region &region, ::llvm::StringRef regionName,
     unsigned regionIndex) {
   if (!({1})) {
@@ -176,7 +176,7 @@ static ::mlir::LogicalResult {0}(
 ///
 /// {3}: "Type type" or "Attribute attr".
 static const char *const patternAttrOrTypeConstraintCode = R"(
-static ::mlir::LogicalResult {0}(
+static ::llvm::LogicalResult {0}(
     ::mlir::PatternRewriter &rewriter, ::mlir::Operation *op, ::mlir::{3},
     ::llvm::StringRef failureStr) {
   if (!({1})) {
diff --git a/mlir/lib/Target/LLVMIR/Dialect/GPU/SelectObjectAttr.cpp b/mlir/lib/Target/LLVMIR/Dialect/GPU/SelectObjectAttr.cpp
index 0eb33287d608b..b023c4c126da3 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/GPU/SelectObjectAttr.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/GPU/SelectObjectAttr.cpp
@@ -167,7 +167,7 @@ class LaunchKernel {
   Value *createKernelArgArray(mlir::gpu::LaunchFuncOp op);
 
   // Create the full kernel launch.
-  mlir::LogicalResult createKernelLaunch(mlir::gpu::LaunchFuncOp op,
+  llvm::LogicalResult createKernelLaunch(mlir::gpu::LaunchFuncOp op,
                                          mlir::gpu::ObjectAttr object);
 
 private:
@@ -345,7 +345,7 @@ llvm::LaunchKernel::createKernelArgArray(mlir::gpu::LaunchFuncOp op) {
 // call %streamSynchronize(%4)
 // call %streamDestroy(%4)
 // call %moduleUnload(%1)
-mlir::LogicalResult
+llvm::LogicalResult
 llvm::LaunchKernel::createKernelLaunch(mlir::gpu::LaunchFuncOp op,
                                        mlir::gpu::ObjectAttr object) {
   auto llvmValue = [&](mlir::Value value) -> Value * {
diff --git a/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp
index ea9fe2635461f..a09c24dda82af 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp
@@ -15,7 +15,6 @@
 #include "mlir/Dialect/LLVMIR/NVVMDialect.h"
 #include "mlir/Dialect/Utils/StaticValueUtils.h"
 #include "mlir/IR/Operation.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Target/LLVMIR/ModuleTranslation.h"
 
 #include "llvm/IR/IRBuilder.h"
diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
index fe257a43aa579..35971fbacbf91 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
@@ -18,7 +18,6 @@
 #include "mlir/IR/IRMapping.h"
 #include "mlir/IR/Operation.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Target/LLVMIR/Dialect/OpenMPCommon.h"
 #include "mlir/Target/LLVMIR/ModuleTranslation.h"
 #include "mlir/Transforms/RegionUtils.h"
diff --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
index 6e8b2dec75b71..e0b1816e2dcfb 100644
--- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
@@ -31,7 +31,6 @@
 #include "mlir/IR/DialectResourceBlobManager.h"
 #include "mlir/IR/RegionGraphTraits.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Target/LLVMIR/LLVMTranslationInterface.h"
 #include "mlir/Target/LLVMIR/TypeToLLVM.h"
 
diff --git a/mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp b/mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp
index faaa42023a803..d7a308548cf4d 100644
--- a/mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp
+++ b/mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp
@@ -19,7 +19,6 @@
 #include "mlir/IR/Builders.h"
 #include "mlir/IR/IRMapping.h"
 #include "mlir/IR/Location.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Target/SPIRV/SPIRVBinaryUtils.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/Sequence.h"
diff --git a/mlir/lib/Target/SPIRV/Serialization/SerializeOps.cpp b/mlir/lib/Target/SPIRV/Serialization/SerializeOps.cpp
index c283e64fa185a..6c28c04fc1e08 100644
--- a/mlir/lib/Target/SPIRV/Serialization/SerializeOps.cpp
+++ b/mlir/lib/Target/SPIRV/Serialization/SerializeOps.cpp
@@ -15,7 +15,6 @@
 #include "mlir/Dialect/SPIRV/IR/SPIRVAttributes.h"
 #include "mlir/Dialect/SPIRV/IR/SPIRVEnums.h"
 #include "mlir/IR/RegionGraphTraits.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Target/SPIRV/SPIRVBinaryUtils.h"
 #include "llvm/ADT/DepthFirstIterator.h"
 #include "llvm/ADT/StringExtras.h"
diff --git a/mlir/lib/Target/SPIRV/Serialization/Serializer.cpp b/mlir/lib/Target/SPIRV/Serialization/Serializer.cpp
index 200abdf993ce8..4c4fef177317e 100644
--- a/mlir/lib/Target/SPIRV/Serialization/Serializer.cpp
+++ b/mlir/lib/Target/SPIRV/Serialization/Serializer.cpp
@@ -16,7 +16,6 @@
 #include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
 #include "mlir/Dialect/SPIRV/IR/SPIRVEnums.h"
 #include "mlir/Dialect/SPIRV/IR/SPIRVTypes.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Target/SPIRV/SPIRVBinaryUtils.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/Sequence.h"
diff --git a/mlir/lib/Tools/PDLL/CodeGen/CPPGen.cpp b/mlir/lib/Tools/PDLL/CodeGen/CPPGen.cpp
index b02edc6717510..611b734dc4b05 100644
--- a/mlir/lib/Tools/PDLL/CodeGen/CPPGen.cpp
+++ b/mlir/lib/Tools/PDLL/CodeGen/CPPGen.cpp
@@ -216,7 +216,7 @@ void CodeGen::generateConstraintOrRewrite(const ast::CallableDecl *decl,
   // TODO: This will need to change if we allow Constraints to return values as
   // well.
   if (isConstraint) {
-    os << "::mlir::LogicalResult";
+    os << "::llvm::LogicalResult";
   } else {
     // Otherwise, generate a type based on the results of the callable.
     // If the callable has explicit results, use those to build the result.
diff --git a/mlir/lib/Tools/PDLL/Parser/Lexer.cpp b/mlir/lib/Tools/PDLL/Parser/Lexer.cpp
index 4673a73b4efdc..cc111a095af5e 100644
--- a/mlir/lib/Tools/PDLL/Parser/Lexer.cpp
+++ b/mlir/lib/Tools/PDLL/Parser/Lexer.cpp
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "Lexer.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Tools/PDLL/AST/Diagnostic.h"
 #include "mlir/Tools/PDLL/Parser/CodeComplete.h"
 #include "llvm/ADT/StringExtras.h"
diff --git a/mlir/lib/Tools/PDLL/Parser/Lexer.h b/mlir/lib/Tools/PDLL/Parser/Lexer.h
index c80cb3693c4b1..cd9c2b770f69a 100644
--- a/mlir/lib/Tools/PDLL/Parser/Lexer.h
+++ b/mlir/lib/Tools/PDLL/Parser/Lexer.h
@@ -18,8 +18,6 @@ class SourceMgr;
 } // namespace llvm
 
 namespace mlir {
-struct LogicalResult;
-
 namespace pdll {
 class CodeCompleteContext;
 
diff --git a/mlir/lib/Tools/PDLL/Parser/Parser.cpp b/mlir/lib/Tools/PDLL/Parser/Parser.cpp
index 45f9e2f899a77..1f0df033d4339 100644
--- a/mlir/lib/Tools/PDLL/Parser/Parser.cpp
+++ b/mlir/lib/Tools/PDLL/Parser/Parser.cpp
@@ -9,7 +9,6 @@
 #include "mlir/Tools/PDLL/Parser/Parser.h"
 #include "Lexer.h"
 #include "mlir/Support/IndentedOstream.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/TableGen/Argument.h"
 #include "mlir/TableGen/Attribute.h"
 #include "mlir/TableGen/Constraint.h"
diff --git a/mlir/lib/Tools/lsp-server-support/Protocol.cpp b/mlir/lib/Tools/lsp-server-support/Protocol.cpp
index 188f5253c95c6..e4eb2518e079e 100644
--- a/mlir/lib/Tools/lsp-server-support/Protocol.cpp
+++ b/mlir/lib/Tools/lsp-server-support/Protocol.cpp
@@ -11,7 +11,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "mlir/Tools/lsp-server-support/Protocol.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Tools/lsp-server-support/Logging.h"
 #include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/SmallString.h"
diff --git a/mlir/lib/Tools/mlir-lsp-server/LSPServer.h b/mlir/lib/Tools/mlir-lsp-server/LSPServer.h
index faf5936012776..2c50c6b4ac6f5 100644
--- a/mlir/lib/Tools/mlir-lsp-server/LSPServer.h
+++ b/mlir/lib/Tools/mlir-lsp-server/LSPServer.h
@@ -11,16 +11,19 @@
 
 #include <memory>
 
-namespace mlir {
+namespace llvm {
 struct LogicalResult;
+} // namespace llvm
 
+namespace mlir {
 namespace lsp {
 class JSONTransport;
 class MLIRServer;
 
 /// Run the main loop of the LSP server using the given MLIR server and
 /// transport.
-LogicalResult runMlirLSPServer(MLIRServer &server, JSONTransport &transport);
+llvm::LogicalResult runMlirLSPServer(MLIRServer &server,
+                                     JSONTransport &transport);
 } // namespace lsp
 } // namespace mlir
 
diff --git a/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp b/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
index a1b2893a973b1..831e1e675a44a 100644
--- a/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
+++ b/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
@@ -31,7 +31,6 @@
 #include "mlir/Pass/Pass.h"
 #include "mlir/Pass/PassManager.h"
 #include "mlir/Support/FileUtilities.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Support/Timing.h"
 #include "mlir/Support/ToolUtilities.h"
 #include "mlir/Tools/ParseUtilities.h"
diff --git a/mlir/lib/Tools/mlir-pdll-lsp-server/LSPServer.h b/mlir/lib/Tools/mlir-pdll-lsp-server/LSPServer.h
index 5551c4e3d5c98..78c4c31100cbc 100644
--- a/mlir/lib/Tools/mlir-pdll-lsp-server/LSPServer.h
+++ b/mlir/lib/Tools/mlir-pdll-lsp-server/LSPServer.h
@@ -11,16 +11,19 @@
 
 #include <memory>
 
-namespace mlir {
+namespace llvm {
 struct LogicalResult;
+} // namespace llvm
 
+namespace mlir {
 namespace lsp {
 class JSONTransport;
 class PDLLServer;
 
 /// Run the main loop of the LSP server using the given PDLL server and
 /// transport.
-LogicalResult runPdllLSPServer(PDLLServer &server, JSONTransport &transport);
+llvm::LogicalResult runPdllLSPServer(PDLLServer &server,
+                                     JSONTransport &transport);
 
 } // namespace lsp
 } // namespace mlir
diff --git a/mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.h b/mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.h
index 682c7b5ed2e2a..134431fa63bf8 100644
--- a/mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.h
+++ b/mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.h
@@ -12,8 +12,9 @@
 #include "mlir/Support/LLVM.h"
 #include "llvm/ADT/StringRef.h"
 #include <memory>
-#include <string>
 #include <optional>
+#include <string>
+#include <vector>
 
 namespace mlir {
 namespace lsp {
diff --git a/mlir/lib/Tools/mlir-query/MlirQueryMain.cpp b/mlir/lib/Tools/mlir-query/MlirQueryMain.cpp
index 15de16a8774bc..99500508ef045 100644
--- a/mlir/lib/Tools/mlir-query/MlirQueryMain.cpp
+++ b/mlir/lib/Tools/mlir-query/MlirQueryMain.cpp
@@ -18,7 +18,6 @@
 #include "mlir/Query/Query.h"
 #include "mlir/Query/QuerySession.h"
 #include "mlir/Support/FileUtilities.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/LineEditor/LineEditor.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/InitLLVM.h"
@@ -28,7 +27,7 @@
 // Query Parser
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult
+llvm::LogicalResult
 mlir::mlirQueryMain(int argc, char **argv, MLIRContext &context,
                     const mlir::query::matcher::Registry &matcherRegistry) {
 
diff --git a/mlir/lib/Tools/mlir-reduce/MlirReduceMain.cpp b/mlir/lib/Tools/mlir-reduce/MlirReduceMain.cpp
index 2f0ab8aa1a4fe..a9cde4acf4ff8 100644
--- a/mlir/lib/Tools/mlir-reduce/MlirReduceMain.cpp
+++ b/mlir/lib/Tools/mlir-reduce/MlirReduceMain.cpp
@@ -21,7 +21,6 @@
 #include "mlir/Reducer/Passes.h"
 #include "mlir/Rewrite/FrozenRewritePatternSet.h"
 #include "mlir/Support/FileUtilities.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Tools/ParseUtilities.h"
 #include "llvm/Support/InitLLVM.h"
 #include "llvm/Support/SourceMgr.h"
diff --git a/mlir/lib/Tools/mlir-translate/MlirTranslateMain.cpp b/mlir/lib/Tools/mlir-translate/MlirTranslateMain.cpp
index bd9928950ecc7..56773f599d5ce 100644
--- a/mlir/lib/Tools/mlir-translate/MlirTranslateMain.cpp
+++ b/mlir/lib/Tools/mlir-translate/MlirTranslateMain.cpp
@@ -13,7 +13,6 @@
 #include "mlir/IR/Verifier.h"
 #include "mlir/Parser/Parser.h"
 #include "mlir/Support/FileUtilities.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Support/Timing.h"
 #include "mlir/Support/ToolUtilities.h"
 #include "mlir/Tools/mlir-translate/Translation.h"
diff --git a/mlir/lib/Tools/tblgen-lsp-server/LSPServer.h b/mlir/lib/Tools/tblgen-lsp-server/LSPServer.h
index bc85de13499b3..501a9dada8aab 100644
--- a/mlir/lib/Tools/tblgen-lsp-server/LSPServer.h
+++ b/mlir/lib/Tools/tblgen-lsp-server/LSPServer.h
@@ -11,17 +11,19 @@
 
 #include <memory>
 
-namespace mlir {
+namespace llvm {
 struct LogicalResult;
+} // namespace llvm
 
+namespace mlir {
 namespace lsp {
 class JSONTransport;
 class TableGenServer;
 
 /// Run the main loop of the LSP server using the given TableGen server and
 /// transport.
-LogicalResult runTableGenLSPServer(TableGenServer &server,
-                                   JSONTransport &transport);
+llvm::LogicalResult runTableGenLSPServer(TableGenServer &server,
+                                         JSONTransport &transport);
 
 } // namespace lsp
 } // namespace mlir
diff --git a/mlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp b/mlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp
index 5ea91a226c831..f7cf4de58a0e0 100644
--- a/mlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp
+++ b/mlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp
@@ -9,7 +9,6 @@
 #include "TableGenServer.h"
 
 #include "mlir/Support/IndentedOstream.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Tools/lsp-server-support/CompilationDatabase.h"
 #include "mlir/Tools/lsp-server-support/Logging.h"
 #include "mlir/Tools/lsp-server-support/Protocol.h"
@@ -17,9 +16,6 @@
 #include "llvm/ADT/IntervalMap.h"
 #include "llvm/ADT/PointerUnion.h"
 #include "llvm/ADT/StringMap.h"
-#include "llvm/ADT/StringSet.h"
-#include "llvm/ADT/TypeSwitch.h"
-#include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
 #include "llvm/TableGen/Parser.h"
 #include "llvm/TableGen/Record.h"
diff --git a/mlir/lib/Tools/tblgen-lsp-server/TableGenServer.h b/mlir/lib/Tools/tblgen-lsp-server/TableGenServer.h
index d749a4fcda2f9..bdc851024a818 100644
--- a/mlir/lib/Tools/tblgen-lsp-server/TableGenServer.h
+++ b/mlir/lib/Tools/tblgen-lsp-server/TableGenServer.h
@@ -12,8 +12,9 @@
 #include "mlir/Support/LLVM.h"
 #include "llvm/ADT/StringRef.h"
 #include <memory>
-#include <string>
 #include <optional>
+#include <string>
+#include <vector>
 
 namespace mlir {
 namespace lsp {
diff --git a/mlir/test/lib/Analysis/DataFlow/TestLivenessAnalysis.cpp b/mlir/test/lib/Analysis/DataFlow/TestLivenessAnalysis.cpp
index 6a67dddbc7201..43005e22584c2 100644
--- a/mlir/test/lib/Analysis/DataFlow/TestLivenessAnalysis.cpp
+++ b/mlir/test/lib/Analysis/DataFlow/TestLivenessAnalysis.cpp
@@ -18,7 +18,6 @@
 #include <mlir/Pass/Pass.h>
 #include <mlir/Pass/PassRegistry.h>
 #include <mlir/Support/LLVM.h>
-#include <mlir/Support/LogicalResult.h>
 #include <mlir/Support/TypeID.h>
 
 using namespace mlir;
diff --git a/mlir/test/lib/Dialect/ArmNeon/TestLowerToArmNeon.cpp b/mlir/test/lib/Dialect/ArmNeon/TestLowerToArmNeon.cpp
index 2e5a4a9888821..f6bfd9f858284 100644
--- a/mlir/test/lib/Dialect/ArmNeon/TestLowerToArmNeon.cpp
+++ b/mlir/test/lib/Dialect/ArmNeon/TestLowerToArmNeon.cpp
@@ -17,7 +17,6 @@
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/Pass/Pass.h"
 #include "mlir/Pass/PassManager.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 
 #define PASS_NAME "test-lower-to-arm-neon"
diff --git a/mlir/test/lib/Dialect/Mesh/TestOpLowering.cpp b/mlir/test/lib/Dialect/Mesh/TestOpLowering.cpp
index 321b6a42bf966..1f836be1ae7ac 100644
--- a/mlir/test/lib/Dialect/Mesh/TestOpLowering.cpp
+++ b/mlir/test/lib/Dialect/Mesh/TestOpLowering.cpp
@@ -11,7 +11,6 @@
 #include "mlir/Dialect/Utils/IndexingUtils.h"
 #include "mlir/IR/SymbolTable.h"
 #include "mlir/Pass/Pass.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 
 using namespace mlir;
diff --git a/mlir/test/lib/Dialect/Mesh/TestReshardingSpmdization.cpp b/mlir/test/lib/Dialect/Mesh/TestReshardingSpmdization.cpp
index 5e3918f79d184..f96410245f281 100644
--- a/mlir/test/lib/Dialect/Mesh/TestReshardingSpmdization.cpp
+++ b/mlir/test/lib/Dialect/Mesh/TestReshardingSpmdization.cpp
@@ -19,7 +19,6 @@
 #include "mlir/IR/SymbolTable.h"
 #include "mlir/IR/Value.h"
 #include "mlir/Pass/Pass.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 
 using namespace mlir;
diff --git a/mlir/test/lib/Dialect/Test/TestAttributes.cpp b/mlir/test/lib/Dialect/Test/TestAttributes.cpp
index d7e40d35238d9..b66dfbfcf0895 100644
--- a/mlir/test/lib/Dialect/Test/TestAttributes.cpp
+++ b/mlir/test/lib/Dialect/Test/TestAttributes.cpp
@@ -17,7 +17,6 @@
 #include "mlir/IR/DialectImplementation.h"
 #include "mlir/IR/ExtensibleDialect.h"
 #include "mlir/IR/Types.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/StringExtras.h"
diff --git a/mlir/test/lib/Dialect/Test/TestDialect.cpp b/mlir/test/lib/Dialect/Test/TestDialect.cpp
index bfb9592e63828..1bbf2cc7481d9 100644
--- a/mlir/test/lib/Dialect/Test/TestDialect.cpp
+++ b/mlir/test/lib/Dialect/Test/TestDialect.cpp
@@ -28,7 +28,6 @@
 #include "mlir/Interfaces/FunctionImplementation.h"
 #include "mlir/Interfaces/InferIntRangeInterface.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/Transforms/FoldUtils.h"
 #include "mlir/Transforms/InliningUtils.h"
 #include "llvm/ADT/STLFunctionalExtras.h"
diff --git a/mlir/test/lib/Dialect/Test/TestOpDefs.cpp b/mlir/test/lib/Dialect/Test/TestOpDefs.cpp
index b86f6922f5ea3..fbaa102d3e33c 100644
--- a/mlir/test/lib/Dialect/Test/TestOpDefs.cpp
+++ b/mlir/test/lib/Dialect/Test/TestOpDefs.cpp
@@ -1193,7 +1193,7 @@ void TestVersionedOpA::writeProperties(mlir::DialectBytecodeWriter &writer) {
 // TestOpWithVersionedProperties
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult TestOpWithVersionedProperties::readFromMlirBytecode(
+llvm::LogicalResult TestOpWithVersionedProperties::readFromMlirBytecode(
     mlir::DialectBytecodeReader &reader, test::VersionedProperties &prop) {
   uint64_t value1, value2 = 0;
   if (failed(reader.readVarInt(value1)))
diff --git a/mlir/test/lib/Dialect/Test/TestOps.h b/mlir/test/lib/Dialect/Test/TestOps.h
index 837ccca565926..f070c3bedd92c 100644
--- a/mlir/test/lib/Dialect/Test/TestOps.h
+++ b/mlir/test/lib/Dialect/Test/TestOps.h
@@ -70,7 +70,7 @@ struct PropertiesWithCustomPrint {
   }
 };
 
-mlir::LogicalResult setPropertiesFromAttribute(
+llvm::LogicalResult setPropertiesFromAttribute(
     PropertiesWithCustomPrint &prop, mlir::Attribute attr,
     llvm::function_ref<mlir::InFlightDiagnostic()> emitError);
 mlir::DictionaryAttr
@@ -92,7 +92,7 @@ class MyPropStruct {
   // These three methods are invoked through the  `MyStructProperty` wrapper
   // defined in TestOps.td
   mlir::Attribute asAttribute(mlir::MLIRContext *ctx) const;
-  static mlir::LogicalResult
+  static llvm::LogicalResult
   setFromAttr(MyPropStruct &prop, mlir::Attribute attr,
               llvm::function_ref<mlir::InFlightDiagnostic()> emitError);
   llvm::hash_code hash() const;
@@ -101,7 +101,7 @@ class MyPropStruct {
   }
 };
 
-mlir::LogicalResult readFromMlirBytecode(mlir::DialectBytecodeReader &reader,
+llvm::LogicalResult readFromMlirBytecode(mlir::DialectBytecodeReader &reader,
                                          MyPropStruct &prop);
 void writeToMlirBytecode(mlir::DialectBytecodeWriter &writer,
                          MyPropStruct &prop);
@@ -122,7 +122,7 @@ struct VersionedProperties {
   }
 };
 
-mlir::LogicalResult setPropertiesFromAttribute(
+llvm::LogicalResult setPropertiesFromAttribute(
     VersionedProperties &prop, mlir::Attribute attr,
     llvm::function_ref<mlir::InFlightDiagnostic()> emitError);
 mlir::DictionaryAttr getPropertiesAsAttribute(mlir::MLIRContext *ctx,
@@ -137,7 +137,7 @@ mlir::ParseResult customParseProperties(mlir::OpAsmParser &parser,
 // Bytecode Support
 //===----------------------------------------------------------------------===//
 
-mlir::LogicalResult readFromMlirBytecode(mlir::DialectBytecodeReader &reader,
+llvm::LogicalResult readFromMlirBytecode(mlir::DialectBytecodeReader &reader,
                                          llvm::MutableArrayRef<int64_t> prop);
 void writeToMlirBytecode(mlir::DialectBytecodeWriter &writer,
                          llvm::ArrayRef<int64_t> prop);
diff --git a/mlir/test/lib/Dialect/Test/TestOps.td b/mlir/test/lib/Dialect/Test/TestOps.td
index c77f76def1f06..e1ec1428ee6d6 100644
--- a/mlir/test/lib/Dialect/Test/TestOps.td
+++ b/mlir/test/lib/Dialect/Test/TestOps.td
@@ -462,7 +462,7 @@ def VariadicRegionInferredTypesOp : TEST_Op<"variadic_region_inferred",
   let results = (outs Variadic<AnyType>);
 
   let extraClassDeclaration = [{
-    static mlir::LogicalResult inferReturnTypes(mlir::MLIRContext *context,
+    static llvm::LogicalResult inferReturnTypes(mlir::MLIRContext *context,
           std::optional<::mlir::Location> location, mlir::ValueRange operands,
           mlir::DictionaryAttr attributes, mlir::OpaqueProperties properties, mlir::RegionRange regions,
           llvm::SmallVectorImpl<mlir::Type> &inferredReturnTypes) {
@@ -1368,7 +1368,7 @@ def TestOpInPlaceFoldSuccess : TEST_Op<"op_in_place_fold_success"> {
   let results = (outs Variadic<I1>);
   let hasFolder = 1;
   let extraClassDefinition = [{
-    ::mlir::LogicalResult $cppClass::fold(FoldAdaptor adaptor,
+    ::llvm::LogicalResult $cppClass::fold(FoldAdaptor adaptor,
         SmallVectorImpl<OpFoldResult> &results) {
       return success();
     }
@@ -2408,7 +2408,7 @@ class TableGenBuildInferReturnTypeBaseOp<string mnemonic,
   let results = (outs AnyType:$result);
 
   let extraClassDeclaration = [{
-    static ::mlir::LogicalResult inferReturnTypes(::mlir::MLIRContext *,
+    static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *,
           ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands,
           ::mlir::DictionaryAttr attributes, mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
           ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
@@ -3037,7 +3037,7 @@ def TestOpWithNiceProperties : TEST_Op<"with_nice_properties"> {
                          ::mlir::ArrayRef<::llvm::StringRef> elidedProps);
     static ::mlir::ParseResult  parseProperties(::mlir::OpAsmParser &parser,
                                      ::mlir::OperationState &result);
-    static ::mlir::LogicalResult readFromMlirBytecode(
+    static ::llvm::LogicalResult readFromMlirBytecode(
         ::mlir::DialectBytecodeReader &,
         test::PropertiesWithCustomPrint &prop);
     static void writeToMlirBytecode(
@@ -3045,7 +3045,7 @@ def TestOpWithNiceProperties : TEST_Op<"with_nice_properties"> {
         const test::PropertiesWithCustomPrint &prop);
   }];
   let extraClassDefinition = [{
-    ::mlir::LogicalResult TestOpWithNiceProperties::readFromMlirBytecode(
+    ::llvm::LogicalResult TestOpWithNiceProperties::readFromMlirBytecode(
         ::mlir::DialectBytecodeReader &reader,
         test::PropertiesWithCustomPrint &prop) {
       StringRef label;
@@ -3101,7 +3101,7 @@ def TestOpWithVersionedProperties : TEST_Op<"with_versioned_properties"> {
                          ::mlir::ArrayRef<::llvm::StringRef> elidedProps);
     static ::mlir::ParseResult  parseProperties(::mlir::OpAsmParser &parser,
                                      ::mlir::OperationState &result);
-    static ::mlir::LogicalResult readFromMlirBytecode(
+    static ::llvm::LogicalResult readFromMlirBytecode(
         ::mlir::DialectBytecodeReader &,
         test::VersionedProperties &prop);
     static void writeToMlirBytecode(
diff --git a/mlir/test/lib/Dialect/Test/TestOpsSyntax.cpp b/mlir/test/lib/Dialect/Test/TestOpsSyntax.cpp
index ebaced57a24a4..664951f2a11bb 100644
--- a/mlir/test/lib/Dialect/Test/TestOpsSyntax.cpp
+++ b/mlir/test/lib/Dialect/Test/TestOpsSyntax.cpp
@@ -280,7 +280,7 @@ void ParseB64BytesOp::print(OpAsmPrinter &p) {
   p << " \"" << llvm::encodeBase64(getB64()) << "\"";
 }
 
-::mlir::LogicalResult FormatInferType2Op::inferReturnTypes(
+::llvm::LogicalResult FormatInferType2Op::inferReturnTypes(
     ::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location,
     ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
     OpaqueProperties properties, ::mlir::RegionRange regions,
diff --git a/mlir/test/lib/Dialect/Test/TestOpsSyntax.td b/mlir/test/lib/Dialect/Test/TestOpsSyntax.td
index 9522a775e247d..3129085058fd9 100644
--- a/mlir/test/lib/Dialect/Test/TestOpsSyntax.td
+++ b/mlir/test/lib/Dialect/Test/TestOpsSyntax.td
@@ -632,7 +632,7 @@ def FormatInferTypeOp : TEST_Op<"format_infer_type", [InferTypeOpInterface]> {
   let assemblyFormat = "attr-dict";
 
   let extraClassDeclaration = [{
-    static ::mlir::LogicalResult inferReturnTypes(::mlir::MLIRContext *context,
+    static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context,
           ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands,
           ::mlir::DictionaryAttr attributes, mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
           ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
@@ -655,7 +655,7 @@ class FormatInferAllTypesBaseOp<string mnemonic, list<Trait> traits = []>
   let arguments = (ins Variadic<AnyType>:$args);
   let results = (outs Variadic<AnyType>:$outs);
   let extraClassDeclaration = [{
-    static ::mlir::LogicalResult inferReturnTypes(::mlir::MLIRContext *context,
+    static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context,
           ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands,
           ::mlir::DictionaryAttr attributes, mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
           ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
@@ -702,7 +702,7 @@ def FormatInferTypeRegionsOp
   let regions = (region AnyRegion:$region);
   let assemblyFormat = "$region attr-dict";
   let extraClassDeclaration = [{
-    static ::mlir::LogicalResult inferReturnTypes(::mlir::MLIRContext *context,
+    static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context,
           ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands,
           ::mlir::DictionaryAttr attributes, mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
           ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
@@ -723,7 +723,7 @@ def FormatInferTypeVariadicOperandsOp
   let results = (outs Variadic<AnyType>:$outs);
   let assemblyFormat = "`(` $a `:` type($a) `)` `(` $b `:` type($b) `)` attr-dict";
   let extraClassDeclaration = [{
-    static ::mlir::LogicalResult inferReturnTypes(::mlir::MLIRContext *context,
+    static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context,
           ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands,
           ::mlir::DictionaryAttr attributes, mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
           ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
diff --git a/mlir/test/lib/Dialect/Test/TestTypeDefs.td b/mlir/test/lib/Dialect/Test/TestTypeDefs.td
index 492642b711e09..d96152a0826f9 100644
--- a/mlir/test/lib/Dialect/Test/TestTypeDefs.td
+++ b/mlir/test/lib/Dialect/Test/TestTypeDefs.td
@@ -154,7 +154,7 @@ def TestTypeWithLayoutType : Test_Type<"TestTypeWithLayout", [
   let mnemonic = "test_type_with_layout";
   let parameters = (ins "unsigned":$key);
   let extraClassDeclaration = [{
-    ::mlir::LogicalResult verifyEntries(::mlir::DataLayoutEntryListRef params,
+    ::llvm::LogicalResult verifyEntries(::mlir::DataLayoutEntryListRef params,
                                 ::mlir::Location loc) const;
 
   private:
diff --git a/mlir/test/lib/Dialect/Test/TestTypes.h b/mlir/test/lib/Dialect/Test/TestTypes.h
index da5604944d5a3..cef3f056a7986 100644
--- a/mlir/test/lib/Dialect/Test/TestTypes.h
+++ b/mlir/test/lib/Dialect/Test/TestTypes.h
@@ -108,7 +108,7 @@ struct TestRecursiveTypeStorage : public ::mlir::TypeStorage {
         TestRecursiveTypeStorage(allocator.copyInto(key));
   }
 
-  ::mlir::LogicalResult mutate(::mlir::TypeStorageAllocator &allocator,
+  ::llvm::LogicalResult mutate(::mlir::TypeStorageAllocator &allocator,
                                ::mlir::Type newBody) {
     // Cannot set a different body than before.
     if (body && body != newBody)
@@ -140,7 +140,7 @@ class TestRecursiveType
   }
 
   /// Body getter and setter.
-  ::mlir::LogicalResult setBody(Type body) { return Base::mutate(body); }
+  ::llvm::LogicalResult setBody(Type body) { return Base::mutate(body); }
   ::mlir::Type getBody() const { return getImpl()->body; }
 
   /// Name/key getter.
diff --git a/mlir/test/mlir-pdll/CodeGen/CPP/general.pdll b/mlir/test/mlir-pdll/CodeGen/CPP/general.pdll
index 21a89661708f7..4e869e5dbcebe 100644
--- a/mlir/test/mlir-pdll/CodeGen/CPP/general.pdll
+++ b/mlir/test/mlir-pdll/CodeGen/CPP/general.pdll
@@ -46,7 +46,7 @@ Pattern => erase op<test.op3>;
 
 #include "include/ods.td"
 
-// CHECK:      static ::mlir::LogicalResult TestCstPDLFn(::mlir::PatternRewriter &rewriter,
+// CHECK:      static ::llvm::LogicalResult TestCstPDLFn(::mlir::PatternRewriter &rewriter,
 // CHECK-SAME:     ::mlir::Attribute attr, ::mlir::Operation * op, ::mlir::Type type,
 // CHECK-SAME:     ::mlir::Value value, ::mlir::TypeRange typeRange, ::mlir::ValueRange valueRange) {
 // CHECK-NEXT:   return success();
diff --git a/mlir/test/mlir-tblgen/attrdefs.td b/mlir/test/mlir-tblgen/attrdefs.td
index 5683f343c6bbc..35d2c49619ee6 100644
--- a/mlir/test/mlir-tblgen/attrdefs.td
+++ b/mlir/test/mlir-tblgen/attrdefs.td
@@ -86,7 +86,7 @@ def B_CompoundAttrA : TestAttr<"CompoundA"> {
 
 // DECL-LABEL: class CompoundAAttr : public ::mlir::Attribute
 // DECL: static CompoundAAttr getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, int widthOfSomething, ::test::SimpleTypeA exampleTdType, ::llvm::APFloat apFloat, ::llvm::ArrayRef<int> dims, ::mlir::Type inner);
-// DECL: static ::mlir::LogicalResult verify(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, int widthOfSomething, ::test::SimpleTypeA exampleTdType, ::llvm::APFloat apFloat, ::llvm::ArrayRef<int> dims, ::mlir::Type inner);
+// DECL: static ::llvm::LogicalResult verify(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, int widthOfSomething, ::test::SimpleTypeA exampleTdType, ::llvm::APFloat apFloat, ::llvm::ArrayRef<int> dims, ::mlir::Type inner);
 // DECL: static constexpr ::llvm::StringLiteral getMnemonic() {
 // DECL:   return {"cmpnd_a"};
 // DECL: }
diff --git a/mlir/test/mlir-tblgen/constraint-unique.td b/mlir/test/mlir-tblgen/constraint-unique.td
index cd41efa63be43..214cd6cc8e550 100644
--- a/mlir/test/mlir-tblgen/constraint-unique.td
+++ b/mlir/test/mlir-tblgen/constraint-unique.td
@@ -54,7 +54,7 @@ def OpC : NS_Op<"op_c"> {
 }
 
 /// Test that a type contraint was generated.
-// CHECK:    static ::mlir::LogicalResult [[$A_TYPE_CONSTRAINT:__mlir_ods_local_type_constraint.*]](
+// CHECK:    static ::llvm::LogicalResult [[$A_TYPE_CONSTRAINT:__mlir_ods_local_type_constraint.*]](
 // CHECK:      if (!((typePred(type, *op)))) {
 // CHECK-NEXT:   return op->emitOpError(valueKind) << " #" << valueIndex
 // CHECK-NEXT:       << " must be a type, but got " << type;
@@ -63,13 +63,13 @@ def OpC : NS_Op<"op_c"> {
 // CHECK-NOT:        << " must be a type, but got " << type;
 
 /// Test that a type constraint with a different description was generated.
-// CHECK:    static ::mlir::LogicalResult [[$O_TYPE_CONSTRAINT:__mlir_ods_local_type_constraint.*]](
+// CHECK:    static ::llvm::LogicalResult [[$O_TYPE_CONSTRAINT:__mlir_ods_local_type_constraint.*]](
 // CHECK:      if (!((typePred(type, *op)))) {
 // CHECK-NEXT:   return op->emitOpError(valueKind) << " #" << valueIndex
 // CHECK-NEXT:       << " must be another type, but got " << type;
 
 /// Test that an attribute contraint was generated.
-// CHECK:    static ::mlir::LogicalResult [[$A_ATTR_CONSTRAINT:__mlir_ods_local_attr_constraint.*]](
+// CHECK:    static ::llvm::LogicalResult [[$A_ATTR_CONSTRAINT:__mlir_ods_local_attr_constraint.*]](
 // CHECK:      if (attr && !((attrPred(attr, *op))))
 // CHECK-NEXT:   return emitError() << "attribute '" << attrName
 // CHECK-NEXT:       << "' failed to satisfy constraint: an attribute";
@@ -78,14 +78,14 @@ def OpC : NS_Op<"op_c"> {
 // CHECK-NOT:        << "' failed to satisfy constraint: an attribute";
 
 /// Test that a attribute constraint with a different description was generated.
-// CHECK:    static ::mlir::LogicalResult [[$O_ATTR_CONSTRAINT:__mlir_ods_local_attr_constraint.*]](
-// CHECK:    static ::mlir::LogicalResult [[$O_ATTR_CONSTRAINT:__mlir_ods_local_attr_constraint.*]](
+// CHECK:    static ::llvm::LogicalResult [[$O_ATTR_CONSTRAINT:__mlir_ods_local_attr_constraint.*]](
+// CHECK:    static ::llvm::LogicalResult [[$O_ATTR_CONSTRAINT:__mlir_ods_local_attr_constraint.*]](
 // CHECK:      if (attr && !((attrPred(attr, *op))))
 // CHECK-NEXT:   return emitError() << "attribute '" << attrName
 // CHECK-NEXT:       << "' failed to satisfy constraint: another attribute";
 
 /// Test that a successor contraint was generated.
-// CHECK:    static ::mlir::LogicalResult [[$A_SUCCESSOR_CONSTRAINT:__mlir_ods_local_successor_constraint.*]](
+// CHECK:    static ::llvm::LogicalResult [[$A_SUCCESSOR_CONSTRAINT:__mlir_ods_local_successor_constraint.*]](
 // CHECK:      if (!((successorPred(successor, *op)))) {
 // CHECK-NEXT:   return op->emitOpError("successor #") << successorIndex << " ('"
 // CHECK-NEXT:       << successorName << ")' failed to verify constraint: a successor";
@@ -94,13 +94,13 @@ def OpC : NS_Op<"op_c"> {
 // CHECK-NOT:        << successorName << ")' failed to verify constraint: a successor";
 
 /// Test that a successor constraint with a different description was generated.
-// CHECK:    static ::mlir::LogicalResult [[$O_SUCCESSOR_CONSTRAINT:__mlir_ods_local_successor_constraint.*]](
+// CHECK:    static ::llvm::LogicalResult [[$O_SUCCESSOR_CONSTRAINT:__mlir_ods_local_successor_constraint.*]](
 // CHECK:      if (!((successorPred(successor, *op)))) {
 // CHECK-NEXT:   return op->emitOpError("successor #") << successorIndex << " ('"
 // CHECK-NEXT:       << successorName << ")' failed to verify constraint: another successor";
 
 /// Test that a region contraint was generated.
-// CHECK:    static ::mlir::LogicalResult [[$A_REGION_CONSTRAINT:__mlir_ods_local_region_constraint.*]](
+// CHECK:    static ::llvm::LogicalResult [[$A_REGION_CONSTRAINT:__mlir_ods_local_region_constraint.*]](
 // CHECK:      if (!((regionPred(region, *op)))) {
 // CHECK-NEXT:   return op->emitOpError("region #") << regionIndex
 // CHECK-NEXT:       << (regionName.empty() ? " " : " ('" + regionName + "') ")
@@ -110,7 +110,7 @@ def OpC : NS_Op<"op_c"> {
 // CHECK-NOT:        << "failed to verify constraint: a region";
 
 /// Test that a region constraint with a different description was generated.
-// CHECK:    static ::mlir::LogicalResult [[$O_REGION_CONSTRAINT:__mlir_ods_local_region_constraint.*]](
+// CHECK:    static ::llvm::LogicalResult [[$O_REGION_CONSTRAINT:__mlir_ods_local_region_constraint.*]](
 // CHECK:      if (!((regionPred(region, *op)))) {
 // CHECK-NEXT:   return op->emitOpError("region #") << regionIndex
 // CHECK-NEXT:       << (regionName.empty() ? " " : " ('" + regionName + "') ")
diff --git a/mlir/test/mlir-tblgen/interfaces-as-constraints.td b/mlir/test/mlir-tblgen/interfaces-as-constraints.td
index 109bf078caed1..b0438c2dfffe1 100644
--- a/mlir/test/mlir-tblgen/interfaces-as-constraints.td
+++ b/mlir/test/mlir-tblgen/interfaces-as-constraints.td
@@ -23,22 +23,22 @@ def OpUsingAllOfThose : Op<Test_Dialect, "OpUsingAllOfThose"> {
 	let results = (outs TopLevelTypeInterface:$res1, TypeInterfaceInNamespace:$res2);
 }
 
-// CHECK: static ::mlir::LogicalResult {{__mlir_ods_local_type_constraint.*}}(
+// CHECK: static ::llvm::LogicalResult {{__mlir_ods_local_type_constraint.*}}(
 // CHECK:   if (!((::llvm::isa<TopLevelTypeInterface>(type)))) {
 // CHECK-NEXT:    return op->emitOpError(valueKind) << " #" << valueIndex
 // CHECK-NEXT:        << " must be TopLevelTypeInterface instance, but got " << type;
 
-// CHECK: static ::mlir::LogicalResult {{__mlir_ods_local_type_constraint.*}}(
+// CHECK: static ::llvm::LogicalResult {{__mlir_ods_local_type_constraint.*}}(
 // CHECK:   if (!((::llvm::isa<test::TypeInterfaceInNamespace>(type)))) {
 // CHECK-NEXT:    return op->emitOpError(valueKind) << " #" << valueIndex
 // CHECK-NEXT:        << " must be TypeInterfaceInNamespace instance, but got " << type;
 
-// CHECK: static ::mlir::LogicalResult {{__mlir_ods_local_attr_constraint.*}}(
+// CHECK: static ::llvm::LogicalResult {{__mlir_ods_local_attr_constraint.*}}(
 // CHECK:   if (attr && !((::llvm::isa<TopLevelAttrInterface>(attr))))
 // CHECK-NEXT:     return emitError() << "attribute '" << attrName
 // CHECK-NEXT:        << "' failed to satisfy constraint: TopLevelAttrInterface instance";
 
-// CHECK: static ::mlir::LogicalResult {{__mlir_ods_local_attr_constraint.*}}(
+// CHECK: static ::llvm::LogicalResult {{__mlir_ods_local_attr_constraint.*}}(
 // CHECK:   if (attr && !((::llvm::isa<test::AttrInterfaceInNamespace>(attr))))
 // CHECK-NEXT:    return emitError() << "attribute '" << attrName
 // CHECK-NEXT:        << "' failed to satisfy constraint: AttrInterfaceInNamespace instance";
diff --git a/mlir/test/mlir-tblgen/op-attribute.td b/mlir/test/mlir-tblgen/op-attribute.td
index 6f2d430fb6db6..a82cd2eadcaed 100644
--- a/mlir/test/mlir-tblgen/op-attribute.td
+++ b/mlir/test/mlir-tblgen/op-attribute.td
@@ -68,7 +68,7 @@ def AOp : NS_Op<"a_op", []> {
 // Test verify method
 // ---
 
-// DEF:      ::mlir::LogicalResult AOpAdaptor::verify
+// DEF:      ::llvm::LogicalResult AOpAdaptor::verify
 // DEF:      ::mlir::Attribute tblgen_aAttr;
 // DEF: while (true) {
 // DEF-NEXT:   if (namedAttrIt == namedAttrRange.end())
@@ -220,7 +220,7 @@ def AgetOp : Op<Test2_Dialect, "a_get_op", []> {
 // Test verify method
 // ---
 
-// DEF:      ::mlir::LogicalResult AgetOpAdaptor::verify
+// DEF:      ::llvm::LogicalResult AgetOpAdaptor::verify
 // DEF:      ::mlir::Attribute tblgen_aAttr;
 // DEF: while (true)
 // DEF:      ::mlir::Attribute tblgen_bAttr;
diff --git a/mlir/test/mlir-tblgen/op-decl-and-defs.td b/mlir/test/mlir-tblgen/op-decl-and-defs.td
index 836ddca5eb845..f6fe45007d9e0 100644
--- a/mlir/test/mlir-tblgen/op-decl-and-defs.td
+++ b/mlir/test/mlir-tblgen/op-decl-and-defs.td
@@ -84,7 +84,7 @@ def NS_AOp : NS_Op<"a_op", [IsolatedFromAbove, IsolatedFromAbove]> {
 // CHECK: class AOpAdaptor : public AOpGenericAdaptor<::mlir::ValueRange> {
 // CHECK: public:
 // CHECK:   AOpAdaptor(AOp
-// CHECK:   ::mlir::LogicalResult verify(
+// CHECK:   ::llvm::LogicalResult verify(
 // CHECK: };
 
 // CHECK: class AOp : public ::mlir::Op<AOp, ::mlir::OpTrait::AtLeastNRegions<1>::Impl, ::mlir::OpTrait::AtLeastNResults<1>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::AtLeastNOperands<1>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::OpTrait::IsIsolatedFromAbove
@@ -120,9 +120,9 @@ def NS_AOp : NS_Op<"a_op", [IsolatedFromAbove, IsolatedFromAbove]> {
 // CHECK:   static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes, unsigned numRegions)
 // CHECK:   static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
 // CHECK:   void print(::mlir::OpAsmPrinter &p);
-// CHECK:   ::mlir::LogicalResult verifyInvariants();
+// CHECK:   ::llvm::LogicalResult verifyInvariants();
 // CHECK:   static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context);
-// CHECK:   ::mlir::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
+// CHECK:   ::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
 // CHECK:   // Display a graph for debugging purposes.
 // CHECK:   void displayGraph();
 // CHECK: };
@@ -205,7 +205,7 @@ def NS_FOp : NS_Op<"op_with_all_types_constraint",
 }
 
 // CHECK-LABEL: class FOp :
-// CHECK: static ::mlir::LogicalResult inferReturnTypes
+// CHECK: static ::llvm::LogicalResult inferReturnTypes
 
 def NS_GOp : NS_Op<"op_with_fixed_return_type", []> {
   let arguments = (ins AnyType:$a);
@@ -213,7 +213,7 @@ def NS_GOp : NS_Op<"op_with_fixed_return_type", []> {
 }
 
 // CHECK-LABEL: class GOp :
-// CHECK: static ::mlir::LogicalResult inferReturnTypes
+// CHECK: static ::llvm::LogicalResult inferReturnTypes
 
 // Check default value for collective params builder. Check that other builders
 // are generated as well.
diff --git a/mlir/test/mlir-tblgen/predicate.td b/mlir/test/mlir-tblgen/predicate.td
index 44f395d5dc60c..c1fcd3fa76089 100644
--- a/mlir/test/mlir-tblgen/predicate.td
+++ b/mlir/test/mlir-tblgen/predicate.td
@@ -16,7 +16,7 @@ def OpA : NS_Op<"op_for_CPred_containing_multiple_same_placeholder", []> {
   let results = (outs Variadic<I32OrF32>:$y);
 }
 
-// CHECK: static ::mlir::LogicalResult [[$INTEGER_FLOAT_CONSTRAINT:__mlir_ods_local_type_constraint.*]](
+// CHECK: static ::llvm::LogicalResult [[$INTEGER_FLOAT_CONSTRAINT:__mlir_ods_local_type_constraint.*]](
 // CHECK:      if (!((type.isInteger(32) || type.isF32()))) {
 // CHECK-NEXT:   return op->emitOpError(valueKind) << " #" << valueIndex
 // CHECK-NEXT:       << " must be 32-bit integer or floating-point type, but got " << type;
@@ -26,12 +26,12 @@ def OpA : NS_Op<"op_for_CPred_containing_multiple_same_placeholder", []> {
 // CHECK-NOT:    return op->emitOpError(valueKind) << " #" << valueIndex
 // CHECK-NOT.        << " must be 32-bit integer or floating-point type, but got " << type;
 
-// CHECK: static ::mlir::LogicalResult [[$TENSOR_CONSTRAINT:__mlir_ods_local_type_constraint.*]](
+// CHECK: static ::llvm::LogicalResult [[$TENSOR_CONSTRAINT:__mlir_ods_local_type_constraint.*]](
 // CHECK:       if (!(((::llvm::isa<::mlir::TensorType>(type))) && ([](::mlir::Type elementType) { return (true); }(::llvm::cast<::mlir::ShapedType>(type).getElementType())))) {
 // CHECK-NEXT:    return op->emitOpError(valueKind) << " #" << valueIndex
 // CHECK-NEXT:        << " must be tensor of any type values, but got " << type;
 
-// CHECK: static ::mlir::LogicalResult [[$TENSOR_INTEGER_FLOAT_CONSTRAINT:__mlir_ods_local_type_constraint.*]](
+// CHECK: static ::llvm::LogicalResult [[$TENSOR_INTEGER_FLOAT_CONSTRAINT:__mlir_ods_local_type_constraint.*]](
 // CHECK:       if (!(((::llvm::isa<::mlir::TensorType>(type))) && ([](::mlir::Type elementType) { return ((elementType.isF32())) || ((elementType.isSignlessInteger(32))); }(::llvm::cast<::mlir::ShapedType>(type).getElementType())))) {
 // CHECK-NEXT:    return op->emitOpError(valueKind) << " #" << valueIndex
 // CHECK-NEXT:        << " must be tensor of 32-bit float or 32-bit signless integer values, but got " << type;
diff --git a/mlir/test/mlir-tblgen/rewriter-static-matcher.td b/mlir/test/mlir-tblgen/rewriter-static-matcher.td
index 7a84dfd5706b1..c5debf5104bbb 100644
--- a/mlir/test/mlir-tblgen/rewriter-static-matcher.td
+++ b/mlir/test/mlir-tblgen/rewriter-static-matcher.td
@@ -48,11 +48,11 @@ def Foo : NativeCodeCall<"foo($_builder, $0)">;
 // Test static matcher for duplicate DagNode
 // ---
 
-// CHECK: static ::mlir::LogicalResult [[$TYPE_CONSTRAINT:__mlir_ods_local_type_constraint.*]](
+// CHECK: static ::llvm::LogicalResult [[$TYPE_CONSTRAINT:__mlir_ods_local_type_constraint.*]](
 // CHECK-NEXT: {{.*::mlir::Type type}}
-// CHECK: static ::mlir::LogicalResult [[$ATTR_CONSTRAINT:__mlir_ods_local_attr_constraint.*]](
+// CHECK: static ::llvm::LogicalResult [[$ATTR_CONSTRAINT:__mlir_ods_local_attr_constraint.*]](
 // CHECK-NEXT: {{.*::mlir::Attribute attr}}
-// CHECK: static ::mlir::LogicalResult [[$DAG_MATCHER:static_dag_matcher.*]](
+// CHECK: static ::llvm::LogicalResult [[$DAG_MATCHER:static_dag_matcher.*]](
 // CHECK: if(::mlir::failed([[$ATTR_CONSTRAINT]]
 // CHECK: if(::mlir::failed([[$TYPE_CONSTRAINT]]
 
diff --git a/mlir/test/mlir-tblgen/typedefs.td b/mlir/test/mlir-tblgen/typedefs.td
index 705da4e41b78b..b9e3a7954e361 100644
--- a/mlir/test/mlir-tblgen/typedefs.td
+++ b/mlir/test/mlir-tblgen/typedefs.td
@@ -70,7 +70,7 @@ def B_CompoundTypeA : TestType<"CompoundA"> {
 
 // DECL-LABEL: class CompoundAType : public ::mlir::Type
 // DECL: static CompoundAType getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, int widthOfSomething, ::test::SimpleTypeA exampleTdType, SomeCppStruct exampleCppType, ::llvm::ArrayRef<int> dims, ::mlir::Type inner);
-// DECL: static ::mlir::LogicalResult verify(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, int widthOfSomething, ::test::SimpleTypeA exampleTdType, SomeCppStruct exampleCppType, ::llvm::ArrayRef<int> dims, ::mlir::Type inner);
+// DECL: static ::llvm::LogicalResult verify(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, int widthOfSomething, ::test::SimpleTypeA exampleTdType, SomeCppStruct exampleCppType, ::llvm::ArrayRef<int> dims, ::mlir::Type inner);
 // DECL: static constexpr ::llvm::StringLiteral getMnemonic() {
 // DECL:   return {"cmpnd_a"};
 // DECL: }
diff --git a/mlir/test/python/python_test_ops.td b/mlir/test/python/python_test_ops.td
index 95301985e3fde..c0bc18448610a 100644
--- a/mlir/test/python/python_test_ops.td
+++ b/mlir/test/python/python_test_ops.td
@@ -128,7 +128,7 @@ def InferResultsOp : TestOp<"infer_results_op", [InferTypeOpInterface]> {
   let results = (outs AnyInteger:$single, AnyInteger:$doubled);
 
   let extraClassDeclaration = [{
-    static ::mlir::LogicalResult inferReturnTypes(
+    static ::llvm::LogicalResult inferReturnTypes(
       ::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location,
       ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
       ::mlir::OpaqueProperties,
@@ -151,7 +151,7 @@ def InferResultsVariadicInputsOp : TestOp<"infer_results_variadic_inputs_op",
   let results = (outs I32OrF32:$res);
 
   let extraClassDeclaration = [{
-    static ::mlir::LogicalResult inferReturnTypes(
+    static ::llvm::LogicalResult inferReturnTypes(
       ::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location,
       ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
       ::mlir::OpaqueProperties,
@@ -180,7 +180,7 @@ def InferShapedTypeComponentsOp : TestOp<"infer_shaped_type_components_op",
   let results = (outs AnyTensor:$result);
 
   let extraClassDefinition = [{
-    ::mlir::LogicalResult $cppClass::inferReturnTypeComponents(
+    ::llvm::LogicalResult $cppClass::inferReturnTypeComponents(
       ::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location,
       ::mlir::ValueShapeRange operands, ::mlir::DictionaryAttr attributes,
       ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
diff --git a/mlir/tools/mlir-pdll-lsp-server/mlir-pdll-lsp-server.cpp b/mlir/tools/mlir-pdll-lsp-server/mlir-pdll-lsp-server.cpp
index de50fd3d33817..ffda7c8a194a8 100644
--- a/mlir/tools/mlir-pdll-lsp-server/mlir-pdll-lsp-server.cpp
+++ b/mlir/tools/mlir-pdll-lsp-server/mlir-pdll-lsp-server.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "mlir/Support/LogicalResult.h"
+#include "mlir/Support/LLVM.h"
 #include "mlir/Tools/mlir-pdll-lsp-server/MlirPdllLspServerMain.h"
 
 using namespace mlir;
diff --git a/mlir/tools/mlir-src-sharder/mlir-src-sharder.cpp b/mlir/tools/mlir-src-sharder/mlir-src-sharder.cpp
index b15f2ce54405a..2f92ff2b26c15 100644
--- a/mlir/tools/mlir-src-sharder/mlir-src-sharder.cpp
+++ b/mlir/tools/mlir-src-sharder/mlir-src-sharder.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "mlir/Support/FileUtilities.h"
-#include "mlir/Support/LogicalResult.h"
+#include "mlir/Support/LLVM.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/InitLLVM.h"
 #include "llvm/Support/MemoryBuffer.h"
diff --git a/mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp b/mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
index 55bc0714c20ec..ea0d152cc94d4 100644
--- a/mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
+++ b/mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
@@ -297,7 +297,7 @@ void DefGen::emitBuilders() {
 void DefGen::emitVerifier() {
   defCls.declare<UsingDeclaration>("Base::getChecked");
   defCls.declareStaticMethod(
-      "::mlir::LogicalResult", "verify",
+      "::llvm::LogicalResult", "verify",
       getBuilderParams({{"::llvm::function_ref<::mlir::InFlightDiagnostic()>",
                          "emitError"}}));
 }
@@ -819,7 +819,7 @@ void DefGenerator::emitParsePrintDispatch(ArrayRef<AttrOrTypeDef> defs) {
                strfmt("generated{0}Parser", valueType), Method::StaticInline,
                std::move(params));
   // Declare the printer.
-  Method printer("::mlir::LogicalResult",
+  Method printer("::llvm::LogicalResult",
                  strfmt("generated{0}Printer", valueType), Method::StaticInline,
                  {{strfmt("::mlir::{0}", valueType), "def"},
                   {"::mlir::AsmPrinter &", "printer"}});
@@ -839,7 +839,7 @@ void DefGenerator::emitParsePrintDispatch(ArrayRef<AttrOrTypeDef> defs) {
   // The printer dispatch uses llvm::TypeSwitch to find and call the correct
   // printer.
   printer.body() << "  return ::llvm::TypeSwitch<::mlir::" << valueType
-                 << ", ::mlir::LogicalResult>(def)";
+                 << ", ::llvm::LogicalResult>(def)";
   const char *const printValue = R"(    .Case<{0}>([&](auto t) {{
       printer << {0}::getMnemonic();{1}
       return ::mlir::success();
diff --git a/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp b/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp
index 50378feeb14ed..ffd5a3913cf18 100644
--- a/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp
+++ b/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp
@@ -9,7 +9,6 @@
 #include "AttrOrTypeFormatGen.h"
 #include "FormatGen.h"
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/TableGen/AttrOrTypeDef.h"
 #include "mlir/TableGen/Format.h"
 #include "mlir/TableGen/GenInfo.h"
diff --git a/mlir/tools/mlir-tblgen/DialectGen.cpp b/mlir/tools/mlir-tblgen/DialectGen.cpp
index 46e585a351a2b..2412876958a0c 100644
--- a/mlir/tools/mlir-tblgen/DialectGen.cpp
+++ b/mlir/tools/mlir-tblgen/DialectGen.cpp
@@ -166,7 +166,7 @@ static const char *const constantMaterializerDecl = R"(
 static const char *const opAttrVerifierDecl = R"(
     /// Provides a hook for verifying dialect attributes attached to the given
     /// op.
-    ::mlir::LogicalResult verifyOperationAttribute(
+    ::llvm::LogicalResult verifyOperationAttribute(
         ::mlir::Operation *op, ::mlir::NamedAttribute attribute) override;
 )";
 
@@ -174,7 +174,7 @@ static const char *const opAttrVerifierDecl = R"(
 static const char *const regionArgAttrVerifierDecl = R"(
     /// Provides a hook for verifying dialect attributes attached to the given
     /// op's region argument.
-    ::mlir::LogicalResult verifyRegionArgAttribute(
+    ::llvm::LogicalResult verifyRegionArgAttribute(
         ::mlir::Operation *op, unsigned regionIndex, unsigned argIndex,
         ::mlir::NamedAttribute attribute) override;
 )";
@@ -183,7 +183,7 @@ static const char *const regionArgAttrVerifierDecl = R"(
 static const char *const regionResultAttrVerifierDecl = R"(
     /// Provides a hook for verifying dialect attributes attached to the given
     /// op's region result.
-    ::mlir::LogicalResult verifyRegionResultAttribute(
+    ::llvm::LogicalResult verifyRegionResultAttribute(
         ::mlir::Operation *op, unsigned regionIndex, unsigned resultIndex,
         ::mlir::NamedAttribute attribute) override;
 )";
diff --git a/mlir/tools/mlir-tblgen/FormatGen.h b/mlir/tools/mlir-tblgen/FormatGen.h
index b061d4d8ea7f0..1dc2cb3eaa88a 100644
--- a/mlir/tools/mlir-tblgen/FormatGen.h
+++ b/mlir/tools/mlir-tblgen/FormatGen.h
@@ -15,7 +15,6 @@
 #define MLIR_TOOLS_MLIRTBLGEN_FORMATGEN_H_
 
 #include "mlir/Support/LLVM.h"
-#include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSet.h"
 #include "llvm/Support/Allocator.h"
diff --git a/mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp b/mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp
index 2c7acec3b1b85..ebadfe4499a54 100644
--- a/mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp
+++ b/mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp
@@ -11,7 +11,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "mlir/Support/LogicalResult.h"
 #include "mlir/TableGen/Argument.h"
 #include "mlir/TableGen/Attribute.h"
 #include "mlir/TableGen/GenInfo.h"
diff --git a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
index 3146e65a1d961..0fc750c7bbc88 100644
--- a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
@@ -1250,7 +1250,7 @@ void OpEmitter::genPropertiesSupport() {
   auto &setPropMethod =
       opClass
           .addStaticMethod(
-              "::mlir::LogicalResult", "setPropertiesFromAttr",
+              "::llvm::LogicalResult", "setPropertiesFromAttr",
               MethodParameter("Properties &", "prop"),
               MethodParameter("::mlir::Attribute", "attr"),
               MethodParameter(
@@ -1292,7 +1292,7 @@ void OpEmitter::genPropertiesSupport() {
   auto &verifyInherentAttrsMethod =
       opClass
           .addStaticMethod(
-              "::mlir::LogicalResult", "verifyInherentAttrs",
+              "::llvm::LogicalResult", "verifyInherentAttrs",
               MethodParameter("::mlir::OperationName", "opName"),
               MethodParameter("::mlir::NamedAttrList &", "attrs"),
               MethodParameter(
@@ -1597,7 +1597,7 @@ void OpEmitter::genPropertiesSupportForBytecode(
     ArrayRef<ConstArgument> attrOrProperties) {
   if (op.useCustomPropertiesEncoding()) {
     opClass.declareStaticMethod(
-        "::mlir::LogicalResult", "readProperties",
+        "::llvm::LogicalResult", "readProperties",
         MethodParameter("::mlir::DialectBytecodeReader &", "reader"),
         MethodParameter("::mlir::OperationState &", "state"));
     opClass.declareMethod(
@@ -1609,7 +1609,7 @@ void OpEmitter::genPropertiesSupportForBytecode(
   auto &readPropertiesMethod =
       opClass
           .addStaticMethod(
-              "::mlir::LogicalResult", "readProperties",
+              "::llvm::LogicalResult", "readProperties",
               MethodParameter("::mlir::DialectBytecodeReader &", "reader"),
               MethodParameter("::mlir::OperationState &", "state"))
           ->body();
@@ -3226,7 +3226,7 @@ void OpEmitter::genCanonicalizerDecls() {
     SmallVector<MethodParameter> paramList;
     paramList.emplace_back(op.getCppClassName(), "op");
     paramList.emplace_back("::mlir::PatternRewriter &", "rewriter");
-    auto *m = opClass.declareStaticMethod("::mlir::LogicalResult",
+    auto *m = opClass.declareStaticMethod("::llvm::LogicalResult",
                                           "canonicalize", std::move(paramList));
     ERROR_IF_PRUNED(m, "canonicalize", op);
   }
@@ -3272,7 +3272,7 @@ void OpEmitter::genFolderDecls() {
   } else {
     paramList.emplace_back("::llvm::SmallVectorImpl<::mlir::OpFoldResult> &",
                            "results");
-    retType = "::mlir::LogicalResult";
+    retType = "::llvm::LogicalResult";
   }
 
   auto *m = opClass.declareMethod(retType, "fold", std::move(paramList));
@@ -3563,7 +3563,7 @@ void OpEmitter::genPrinter() {
 
 void OpEmitter::genVerifier() {
   auto *implMethod =
-      opClass.addMethod("::mlir::LogicalResult", "verifyInvariantsImpl");
+      opClass.addMethod("::llvm::LogicalResult", "verifyInvariantsImpl");
   ERROR_IF_PRUNED(implMethod, "verifyInvariantsImpl", op);
   auto &implBody = implMethod->body();
   bool useProperties = emitHelper.hasProperties();
@@ -3592,7 +3592,7 @@ void OpEmitter::genVerifier() {
   // This may not act as their expectation because this doesn't call any
   // verifiers of native/interface traits. Needs to review those use cases and
   // see if we should use the mlir::verify() instead.
-  auto *method = opClass.addMethod("::mlir::LogicalResult", "verifyInvariants");
+  auto *method = opClass.addMethod("::llvm::LogicalResult", "verifyInvariants");
   ERROR_IF_PRUNED(method, "verifyInvariants", op);
   auto &body = method->body();
   if (def.getValueAsBit("hasVerifier")) {
@@ -3607,13 +3607,13 @@ void OpEmitter::genVerifier() {
 
 void OpEmitter::genCustomVerifier() {
   if (def.getValueAsBit("hasVerifier")) {
-    auto *method = opClass.declareMethod("::mlir::LogicalResult", "verify");
+    auto *method = opClass.declareMethod("::llvm::LogicalResult", "verify");
     ERROR_IF_PRUNED(method, "verify", op);
   }
 
   if (def.getValueAsBit("hasRegionVerifier")) {
     auto *method =
-        opClass.declareMethod("::mlir::LogicalResult", "verifyRegions");
+        opClass.declareMethod("::llvm::LogicalResult", "verifyRegions");
     ERROR_IF_PRUNED(method, "verifyRegions", op);
   }
 }
@@ -4334,7 +4334,7 @@ OpOperandAdaptorEmitter::OpOperandAdaptorEmitter(
 }
 
 void OpOperandAdaptorEmitter::addVerification() {
-  auto *method = adaptor.addMethod("::mlir::LogicalResult", "verify",
+  auto *method = adaptor.addMethod("::llvm::LogicalResult", "verify",
                                    MethodParameter("::mlir::Location", "loc"));
   ERROR_IF_PRUNED(method, "verify", op);
   auto &body = method->body();
diff --git a/mlir/tools/mlir-tblgen/OpFormatGen.cpp b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
index f7cc0a292b8c5..a97d8760842a9 100644
--- a/mlir/tools/mlir-tblgen/OpFormatGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
@@ -1200,7 +1200,7 @@ static void genParsedAttrPropertiesSetter(OperationFormat &fmt, Operator &op,
   paramList.emplace_back("::llvm::function_ref<::mlir::InFlightDiagnostic()>",
                          "emitError");
 
-  Method *method = opClass.addStaticMethod("::mlir::LogicalResult",
+  Method *method = opClass.addStaticMethod("::llvm::LogicalResult",
                                            "setPropertiesFromParsedAttr",
                                            std::move(paramList));
   MethodBody &body = method->body().indent();
diff --git a/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp b/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
index 2a7406f42f34b..4b06b92fbc8a8 100644
--- a/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
@@ -480,7 +480,7 @@ void InterfaceGenerator::emitTraitDecl(const Interface &interface,
     tblgen::FmtContext verifyCtx;
     verifyCtx.addSubst("_op", "op");
     os << llvm::formatv(
-              "    static ::mlir::LogicalResult {0}(::mlir::Operation *op) ",
+              "    static ::llvm::LogicalResult {0}(::mlir::Operation *op) ",
               (interface.verifyWithRegions() ? "verifyRegionTrait"
                                              : "verifyTrait"))
        << "{\n      " << tblgen::tgfmt(verify->trim(), &verifyCtx)
diff --git a/mlir/tools/mlir-tblgen/RewriterGen.cpp b/mlir/tools/mlir-tblgen/RewriterGen.cpp
index 0d3b29cc94e84..2c79ba2cd6353 100644
--- a/mlir/tools/mlir-tblgen/RewriterGen.cpp
+++ b/mlir/tools/mlir-tblgen/RewriterGen.cpp
@@ -366,7 +366,7 @@ std::string PatternEmitter::handleConstantAttr(Attribute attr,
 
 void PatternEmitter::emitStaticMatcher(DagNode tree, std::string funcName) {
   os << formatv(
-      "static ::mlir::LogicalResult {0}(::mlir::PatternRewriter &rewriter, "
+      "static ::llvm::LogicalResult {0}(::mlir::PatternRewriter &rewriter, "
       "::mlir::Operation *op0, ::llvm::SmallVector<::mlir::Operation "
       "*, 4> &tblgen_ops",
       funcName);
@@ -1081,7 +1081,7 @@ void PatternEmitter::emit(StringRef rewriteName) {
   {
     auto classScope = os.scope();
     os.printReindented(R"(
-    ::mlir::LogicalResult matchAndRewrite(::mlir::Operation *op0,
+    ::llvm::LogicalResult matchAndRewrite(::mlir::Operation *op0,
         ::mlir::PatternRewriter &rewriter) const override {)")
         << '\n';
     {
diff --git a/mlir/tools/mlir-translate/mlir-translate.cpp b/mlir/tools/mlir-translate/mlir-translate.cpp
index 309def888a073..9d2dd88d94883 100644
--- a/mlir/tools/mlir-translate/mlir-translate.cpp
+++ b/mlir/tools/mlir-translate/mlir-translate.cpp
@@ -12,7 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "mlir/InitAllTranslations.h"
-#include "mlir/Support/LogicalResult.h"
+#include "mlir/Support/LLVM.h"
 #include "mlir/Tools/mlir-translate/MlirTranslateMain.h"
 
 using namespace mlir;
diff --git a/mlir/tools/mlir-vulkan-runner/VulkanRuntime.h b/mlir/tools/mlir-vulkan-runner/VulkanRuntime.h
index 9fa52b00a0ac9..17db8d0620f79 100644
--- a/mlir/tools/mlir-vulkan-runner/VulkanRuntime.h
+++ b/mlir/tools/mlir-vulkan-runner/VulkanRuntime.h
@@ -13,7 +13,7 @@
 #ifndef VULKAN_RUNTIME_H
 #define VULKAN_RUNTIME_H
 
-#include "mlir/Support/LogicalResult.h"
+#include "mlir/Support/LLVM.h"
 
 #include <unordered_map>
 #include <vector>
diff --git a/mlir/tools/tblgen-lsp-server/tblgen-lsp-server.cpp b/mlir/tools/tblgen-lsp-server/tblgen-lsp-server.cpp
index 90b2d986e737f..e8fdbfcc0fb1b 100644
--- a/mlir/tools/tblgen-lsp-server/tblgen-lsp-server.cpp
+++ b/mlir/tools/tblgen-lsp-server/tblgen-lsp-server.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "mlir/Support/LogicalResult.h"
+#include "mlir/Support/LLVM.h"
 #include "mlir/Tools/tblgen-lsp-server/TableGenLspServerMain.h"
 
 using namespace mlir;
diff --git a/mlir/unittests/Rewrite/PatternBenefit.cpp b/mlir/unittests/Rewrite/PatternBenefit.cpp
index 79552f06025be..65ea4ee6683db 100644
--- a/mlir/unittests/Rewrite/PatternBenefit.cpp
+++ b/mlir/unittests/Rewrite/PatternBenefit.cpp
@@ -27,7 +27,7 @@ TEST(PatternBenefitTest, BenefitOrder) {
     Pattern1(mlir::MLIRContext *context, bool *called)
         : OpRewritePattern<ModuleOp>(context, /*benefit*/ 1), called(called) {}
 
-    mlir::LogicalResult
+    llvm::LogicalResult
     matchAndRewrite(ModuleOp /*op*/,
                     mlir::PatternRewriter & /*rewriter*/) const override {
       *called = true;
@@ -43,7 +43,7 @@ TEST(PatternBenefitTest, BenefitOrder) {
         : RewritePattern(MatchAnyOpTypeTag(), /*benefit=*/2, context),
           called(called) {}
 
-    mlir::LogicalResult
+    llvm::LogicalResult
     matchAndRewrite(Operation * /*op*/,
                     mlir::PatternRewriter & /*rewriter*/) const override {
       *called = true;



More information about the flang-commits mailing list