Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[llvm] Move CodeGenTypes library to its own directory #79444

Merged
merged 4 commits into from
Jan 25, 2024
Merged

Conversation

nico
Copy link
Contributor

@nico nico commented Jan 25, 2024

Finally addresses https://reviews.llvm.org/D148769#4311232 :)

No behavior change.

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 25, 2024

@llvm/pr-subscribers-llvm-regalloc
@llvm/pr-subscribers-backend-m68k
@llvm/pr-subscribers-mlir
@llvm/pr-subscribers-backend-aarch64
@llvm/pr-subscribers-mlir-llvm
@llvm/pr-subscribers-llvm-selectiondag
@llvm/pr-subscribers-backend-amdgpu
@llvm/pr-subscribers-backend-x86
@llvm/pr-subscribers-backend-webassembly

@llvm/pr-subscribers-backend-arm

Author: Nico Weber (nico)

Changes

Finally addresses https://reviews.llvm.org/D148769#4311232 :)

No behavior change.


Patch is 55.42 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/79444.diff

92 Files Affected:

  • (modified) llvm/include/llvm/CodeGen/BasicTTIImpl.h (+1-1)
  • (modified) llvm/include/llvm/CodeGen/CostTable.h (+1-1)
  • (modified) llvm/include/llvm/CodeGen/FastISel.h (+1-1)
  • (modified) llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h (+2-2)
  • (modified) llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h (+1-1)
  • (modified) llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h (+1-1)
  • (modified) llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h (+1-1)
  • (modified) llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h (+1-1)
  • (modified) llvm/include/llvm/CodeGen/GlobalISel/Utils.h (+1-1)
  • (modified) llvm/include/llvm/CodeGen/LowLevelTypeUtils.h (+1-1)
  • (modified) llvm/include/llvm/CodeGen/MachineMemOperand.h (+1-1)
  • (modified) llvm/include/llvm/CodeGen/RegisterBankInfo.h (+1-1)
  • (modified) llvm/include/llvm/CodeGen/SelectionDAG.h (+1-1)
  • (modified) llvm/include/llvm/CodeGen/SelectionDAGNodes.h (+1-1)
  • (modified) llvm/include/llvm/CodeGen/TargetCallingConv.h (+1-1)
  • (modified) llvm/include/llvm/CodeGen/TargetLowering.h (+1-1)
  • (modified) llvm/include/llvm/CodeGen/ValueTypes.h (+1-1)
  • (renamed) llvm/include/llvm/CodeGenTypes/LowLevelType.h (+2-2)
  • (renamed) llvm/include/llvm/CodeGenTypes/MachineValueType.h (+1-1)
  • (modified) llvm/include/module.modulemap (+2-2)
  • (modified) llvm/lib/CMakeLists.txt (+1)
  • (modified) llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/CMakeLists.txt (-13)
  • (modified) llvm/lib/CodeGen/CodeGenPrepare.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/MIRParser/MIParser.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/MIRPrinter.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/MachineInstr.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/MachineScheduler.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/MachineVerifier.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/SelectionDAG/FastISel.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.h (+1-1)
  • (modified) llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h (+1-1)
  • (modified) llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/TargetLoweringBase.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/TargetRegisterInfo.cpp (+1-1)
  • (renamed) llvm/lib/CodeGenTypes/LowLevelType.cpp (+2-2)
  • (modified) llvm/lib/Target/AArch64/AArch64FastISel.cpp (+1-1)
  • (modified) llvm/lib/Target/AArch64/AArch64ISelLowering.cpp (+1-1)
  • (modified) llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp (+1-1)
  • (modified) llvm/lib/Target/AMDGPU/AMDGPUGlobalISelUtils.cpp (+1-1)
  • (modified) llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp (+1-1)
  • (modified) llvm/lib/Target/ARM/ARMCallLowering.cpp (+2-2)
  • (modified) llvm/lib/Target/ARM/ARMFastISel.cpp (+1-1)
  • (modified) llvm/lib/Target/ARM/ARMISelLowering.cpp (+1-1)
  • (modified) llvm/lib/Target/ARM/ARMISelLowering.h (+1-1)
  • (modified) llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp (+1-1)
  • (modified) llvm/lib/Target/Hexagon/HexagonISelLowering.h (+1-1)
  • (modified) llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp (+1-1)
  • (modified) llvm/lib/Target/Hexagon/HexagonInstrInfo.h (+1-1)
  • (modified) llvm/lib/Target/Lanai/LanaiISelLowering.cpp (+1-1)
  • (modified) llvm/lib/Target/M68k/M68kMachineFunction.h (+1-1)
  • (modified) llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp (+1-1)
  • (modified) llvm/lib/Target/Mips/MipsFastISel.cpp (+1-1)
  • (modified) llvm/lib/Target/Mips/MipsISelLowering.cpp (+1-1)
  • (modified) llvm/lib/Target/Mips/MipsISelLowering.h (+1-1)
  • (modified) llvm/lib/Target/Mips/MipsOptimizePICCall.cpp (+1-1)
  • (modified) llvm/lib/Target/Mips/MipsSEISelLowering.cpp (+1-1)
  • (modified) llvm/lib/Target/Mips/MipsSEISelLowering.h (+1-1)
  • (modified) llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp (+1-1)
  • (modified) llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp (+1-1)
  • (modified) llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp (+1-1)
  • (modified) llvm/lib/Target/PowerPC/PPCISelLowering.cpp (+1-1)
  • (modified) llvm/lib/Target/PowerPC/PPCISelLowering.h (+1-1)
  • (modified) llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.h (+1-1)
  • (modified) llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h (+1-1)
  • (modified) llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.h (+1-1)
  • (modified) llvm/lib/Target/X86/GISel/X86CallLowering.cpp (+2-2)
  • (modified) llvm/lib/Target/X86/GISel/X86InstructionSelector.cpp (+1-1)
  • (modified) llvm/lib/Target/X86/X86AsmPrinter.cpp (+1-1)
  • (modified) llvm/lib/Target/X86/X86InterleavedAccess.cpp (+1-1)
  • (modified) llvm/unittests/CodeGen/MachineOperandTest.cpp (+1-1)
  • (modified) llvm/unittests/CodeGen/ScalableVectorMVTsTest.cpp (+1-1)
  • (modified) llvm/utils/TableGen/CodeGenInstruction.h (+1-1)
  • (modified) llvm/utils/TableGen/CodeGenTarget.h (+1-1)
  • (modified) llvm/utils/TableGen/DAGISelMatcher.h (+1-1)
  • (modified) llvm/utils/TableGen/GlobalISelEmitter.cpp (+2-2)
  • (modified) llvm/utils/TableGen/GlobalISelMatchTable.h (+1-1)
  • (modified) llvm/utils/TableGen/InfoByHwMode.h (+1-1)
  • (modified) llvm/utils/TableGen/RegisterInfoEmitter.cpp (+1-1)
  • (modified) llvm/utils/gn/secondary/llvm/lib/CodeGen/BUILD.gn (+1-14)
  • (modified) llvm/utils/gn/secondary/llvm/utils/TableGen/BUILD.gn (+1-1)
  • (modified) llvm/utils/gn/secondary/llvm/utils/TableGen/GlobalISel/BUILD.gn (+1-1)
  • (modified) mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp (+1-1)
diff --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
index 5e7bdcdf72a49f8..e9bf1659b696940 100644
--- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h
+++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
@@ -26,7 +26,7 @@
 #include "llvm/Analysis/TargetTransformInfo.h"
 #include "llvm/Analysis/TargetTransformInfoImpl.h"
 #include "llvm/CodeGen/ISDOpcodes.h"
-#include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/CodeGenTypes/MachineValueType.h"
 #include "llvm/CodeGen/TargetLowering.h"
 #include "llvm/CodeGen/TargetSubtargetInfo.h"
 #include "llvm/CodeGen/ValueTypes.h"
diff --git a/llvm/include/llvm/CodeGen/CostTable.h b/llvm/include/llvm/CodeGen/CostTable.h
index ca0cbdda3b11489..490de79d18997cc 100644
--- a/llvm/include/llvm/CodeGen/CostTable.h
+++ b/llvm/include/llvm/CodeGen/CostTable.h
@@ -16,7 +16,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
-#include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/CodeGenTypes/MachineValueType.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/FastISel.h b/llvm/include/llvm/CodeGen/FastISel.h
index 0f17e51f0b7a70a..df4775bdd3c48e0 100644
--- a/llvm/include/llvm/CodeGen/FastISel.h
+++ b/llvm/include/llvm/CodeGen/FastISel.h
@@ -19,7 +19,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/CodeGenTypes/MachineValueType.h"
 #include "llvm/CodeGen/TargetLowering.h"
 #include "llvm/IR/Attributes.h"
 #include "llvm/IR/CallingConv.h"
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h b/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
index d123ab7d8e46edb..8c780f7f5c65c9e 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
@@ -17,9 +17,9 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/CodeGen/CallingConvLower.h"
-#include "llvm/CodeGen/LowLevelType.h"
+#include "llvm/CodeGenTypes/LowLevelType.h"
 #include "llvm/CodeGen/MachineOperand.h"
-#include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/CodeGenTypes/MachineValueType.h"
 #include "llvm/CodeGen/TargetCallingConv.h"
 #include "llvm/IR/CallingConv.h"
 #include "llvm/IR/Type.h"
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h b/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
index a6e9406bed06a2b..8b79bc72d39bead 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
@@ -20,7 +20,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/CodeGen/GlobalISel/GenericMachineInstrs.h"
-#include "llvm/CodeGen/LowLevelType.h"
+#include "llvm/CodeGenTypes/LowLevelType.h"
 #include "llvm/CodeGen/Register.h"
 #include "llvm/IR/InstrTypes.h"
 #include <functional>
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h b/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h
index 694d3d8004afff1..f0d211d6e834807 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h
@@ -19,7 +19,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/CodeGen/GlobalISel/Utils.h"
-#include "llvm/CodeGen/LowLevelType.h"
+#include "llvm/CodeGenTypes/LowLevelType.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/IR/Function.h"
 #include <bitset>
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h
index e423e48fd31ea35..0ecb6dcb529e2b6 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h
@@ -16,7 +16,7 @@
 #define LLVM_CODEGEN_GLOBALISEL_LEGACYLEGALIZERINFO_H
 
 #include "llvm/ADT/DenseMap.h"
-#include "llvm/CodeGen/LowLevelType.h"
+#include "llvm/CodeGenTypes/LowLevelType.h"
 #include "llvm/CodeGen/TargetOpcodes.h"
 #include <unordered_map>
 #include <vector>
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
index d09100b28f3e8d8..202f18fbf5ce4d0 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
@@ -17,7 +17,7 @@
 #include "llvm/ADT/SmallBitVector.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h"
-#include "llvm/CodeGen/LowLevelType.h"
+#include "llvm/CodeGenTypes/LowLevelType.h"
 #include "llvm/CodeGen/MachineMemOperand.h"
 #include "llvm/CodeGen/TargetOpcodes.h"
 #include "llvm/MC/MCInstrDesc.h"
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/Utils.h b/llvm/include/llvm/CodeGen/GlobalISel/Utils.h
index 57c037b55187bd1..8ace02ad738c351 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/Utils.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/Utils.h
@@ -17,7 +17,7 @@
 #include "GISelWorkList.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/StringRef.h"
-#include "llvm/CodeGen/LowLevelType.h"
+#include "llvm/CodeGenTypes/LowLevelType.h"
 #include "llvm/CodeGen/Register.h"
 #include "llvm/IR/DebugLoc.h"
 #include "llvm/Support/Alignment.h"
diff --git a/llvm/include/llvm/CodeGen/LowLevelTypeUtils.h b/llvm/include/llvm/CodeGen/LowLevelTypeUtils.h
index 5cd8e5412df2604..834b009e7b5b33e 100644
--- a/llvm/include/llvm/CodeGen/LowLevelTypeUtils.h
+++ b/llvm/include/llvm/CodeGen/LowLevelTypeUtils.h
@@ -16,7 +16,7 @@
 #ifndef LLVM_CODEGEN_LOWLEVELTYPEUTILS_H
 #define LLVM_CODEGEN_LOWLEVELTYPEUTILS_H
 
-#include "llvm/CodeGen/LowLevelType.h"
+#include "llvm/CodeGenTypes/LowLevelType.h"
 #include "llvm/CodeGen/ValueTypes.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/MachineMemOperand.h b/llvm/include/llvm/CodeGen/MachineMemOperand.h
index 5bfa7ffa65d5191..c8224c490ffba28 100644
--- a/llvm/include/llvm/CodeGen/MachineMemOperand.h
+++ b/llvm/include/llvm/CodeGen/MachineMemOperand.h
@@ -17,7 +17,7 @@
 
 #include "llvm/ADT/BitmaskEnum.h"
 #include "llvm/ADT/PointerUnion.h"
-#include "llvm/CodeGen/LowLevelType.h"
+#include "llvm/CodeGenTypes/LowLevelType.h"
 #include "llvm/CodeGen/PseudoSourceValue.h"
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/LLVMContext.h"
diff --git a/llvm/include/llvm/CodeGen/RegisterBankInfo.h b/llvm/include/llvm/CodeGen/RegisterBankInfo.h
index 459a31d962ef306..39fe8c91f313285 100644
--- a/llvm/include/llvm/CodeGen/RegisterBankInfo.h
+++ b/llvm/include/llvm/CodeGen/RegisterBankInfo.h
@@ -18,7 +18,7 @@
 #include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/iterator_range.h"
-#include "llvm/CodeGen/LowLevelType.h"
+#include "llvm/CodeGenTypes/LowLevelType.h"
 #include "llvm/CodeGen/Register.h"
 #include "llvm/CodeGen/RegisterBank.h"
 #include "llvm/Support/ErrorHandling.h"
diff --git a/llvm/include/llvm/CodeGen/SelectionDAG.h b/llvm/include/llvm/CodeGen/SelectionDAG.h
index e867448b9d55124..e424b7c73308830 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAG.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAG.h
@@ -29,7 +29,7 @@
 #include "llvm/CodeGen/ISDOpcodes.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineMemOperand.h"
-#include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/CodeGenTypes/MachineValueType.h"
 #include "llvm/CodeGen/SelectionDAGNodes.h"
 #include "llvm/CodeGen/ValueTypes.h"
 #include "llvm/IR/DebugLoc.h"
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
index 65b06d0f457912b..c4ce3ae4fdd4854 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -30,7 +30,7 @@
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/CodeGen/ISDOpcodes.h"
 #include "llvm/CodeGen/MachineMemOperand.h"
-#include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/CodeGenTypes/MachineValueType.h"
 #include "llvm/CodeGen/Register.h"
 #include "llvm/CodeGen/ValueTypes.h"
 #include "llvm/IR/Constants.h"
diff --git a/llvm/include/llvm/CodeGen/TargetCallingConv.h b/llvm/include/llvm/CodeGen/TargetCallingConv.h
index 89ea9bcb2a408d8..487651a16fc842c 100644
--- a/llvm/include/llvm/CodeGen/TargetCallingConv.h
+++ b/llvm/include/llvm/CodeGen/TargetCallingConv.h
@@ -13,7 +13,7 @@
 #ifndef LLVM_CODEGEN_TARGETCALLINGCONV_H
 #define LLVM_CODEGEN_TARGETCALLINGCONV_H
 
-#include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/CodeGenTypes/MachineValueType.h"
 #include "llvm/CodeGen/ValueTypes.h"
 #include "llvm/Support/Alignment.h"
 #include "llvm/Support/MathExtras.h"
diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h
index c9492b4cf778b65..704c007a89a236c 100644
--- a/llvm/include/llvm/CodeGen/TargetLowering.h
+++ b/llvm/include/llvm/CodeGen/TargetLowering.h
@@ -31,7 +31,7 @@
 #include "llvm/CodeGen/ISDOpcodes.h"
 #include "llvm/CodeGen/LowLevelTypeUtils.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/CodeGenTypes/MachineValueType.h"
 #include "llvm/CodeGen/RuntimeLibcalls.h"
 #include "llvm/CodeGen/SelectionDAG.h"
 #include "llvm/CodeGen/SelectionDAGNodes.h"
diff --git a/llvm/include/llvm/CodeGen/ValueTypes.h b/llvm/include/llvm/CodeGen/ValueTypes.h
index c4cd332d101cd75..1e0356ee69ff521 100644
--- a/llvm/include/llvm/CodeGen/ValueTypes.h
+++ b/llvm/include/llvm/CodeGen/ValueTypes.h
@@ -15,7 +15,7 @@
 #ifndef LLVM_CODEGEN_VALUETYPES_H
 #define LLVM_CODEGEN_VALUETYPES_H
 
-#include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/CodeGenTypes/MachineValueType.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/TypeSize.h"
diff --git a/llvm/include/llvm/CodeGen/LowLevelType.h b/llvm/include/llvm/CodeGenTypes/LowLevelType.h
similarity index 99%
rename from llvm/include/llvm/CodeGen/LowLevelType.h
rename to llvm/include/llvm/CodeGenTypes/LowLevelType.h
index 81559c1bac55c71..cc33152e06f4db3 100644
--- a/llvm/include/llvm/CodeGen/LowLevelType.h
+++ b/llvm/include/llvm/CodeGenTypes/LowLevelType.h
@@ -1,4 +1,4 @@
-//== llvm/CodeGen/LowLevelType.h ------------------------------- -*- C++ -*-==//
+//== llvm/CodeGenTypes/LowLevelType.h -------------------------- -*- C++ -*-==//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -27,7 +27,7 @@
 #define LLVM_CODEGEN_LOWLEVELTYPE_H
 
 #include "llvm/ADT/DenseMapInfo.h"
-#include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/CodeGenTypes/MachineValueType.h"
 #include "llvm/Support/Debug.h"
 #include <cassert>
 
diff --git a/llvm/include/llvm/CodeGen/MachineValueType.h b/llvm/include/llvm/CodeGenTypes/MachineValueType.h
similarity index 99%
rename from llvm/include/llvm/CodeGen/MachineValueType.h
rename to llvm/include/llvm/CodeGenTypes/MachineValueType.h
index f0d380fa9cda20f..9aceb9896021c57 100644
--- a/llvm/include/llvm/CodeGen/MachineValueType.h
+++ b/llvm/include/llvm/CodeGenTypes/MachineValueType.h
@@ -1,4 +1,4 @@
-//===- CodeGen/MachineValueType.h - Machine-Level types ---------*- C++ -*-===//
+//===- CodeGenTypes/MachineValueType.h - Machine-Level types ----*- C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/llvm/include/module.modulemap b/llvm/include/module.modulemap
index b19929fb9adfd4d..619f5237d05d2af 100644
--- a/llvm/include/module.modulemap
+++ b/llvm/include/module.modulemap
@@ -24,10 +24,10 @@ module LLVM_CodeGenTypes {
   requires cplusplus
 
   module LLT {
-    header "llvm/CodeGen/LowLevelType.h" export *
+    header "llvm/CodeGenTypes/LowLevelType.h" export *
   }
   module MVT {
-    header "llvm/CodeGen/MachineValueType.h" export *
+    header "llvm/CodeGenTypes/MachineValueType.h" export *
     extern module LLVM_Extern_CodeGenTypes_Gen "module.extern.modulemap"
   }
 }
diff --git a/llvm/lib/CMakeLists.txt b/llvm/lib/CMakeLists.txt
index ea22ff21820a983..74e2d03c07953db 100644
--- a/llvm/lib/CMakeLists.txt
+++ b/llvm/lib/CMakeLists.txt
@@ -10,6 +10,7 @@ add_subdirectory(InterfaceStub)
 add_subdirectory(IRPrinter)
 add_subdirectory(IRReader)
 add_subdirectory(CodeGen)
+add_subdirectory(CodeGenTypes)
 add_subdirectory(BinaryFormat)
 add_subdirectory(Bitcode)
 add_subdirectory(Bitstream)
diff --git a/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp b/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
index c5367221cae7a72..a13b320ec433000 100644
--- a/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
+++ b/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
@@ -23,7 +23,7 @@
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/CodeGen/MachineOperand.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/CodeGenTypes/MachineValueType.h"
 #include "llvm/CodeGen/RegisterClassInfo.h"
 #include "llvm/CodeGen/ScheduleDAG.h"
 #include "llvm/CodeGen/TargetInstrInfo.h"
diff --git a/llvm/lib/CodeGen/CMakeLists.txt b/llvm/lib/CodeGen/CMakeLists.txt
index 8d1c22d327df660..d49bcf8a0c8ee23 100644
--- a/llvm/lib/CodeGen/CMakeLists.txt
+++ b/llvm/lib/CodeGen/CMakeLists.txt
@@ -22,19 +22,6 @@ if (DEFINED LLVM_HAVE_TF_AOT OR LLVM_HAVE_TFLITE)
   endif()
 endif()
 
-# This provides the implementation of MVT and LLT.
-# Be careful to append deps on this, since Targets' tablegens depend on this.
-add_llvm_component_library(LLVMCodeGenTypes
-  LowLevelType.cpp
-  PARTIAL_SOURCES_INTENDED
-
-  DEPENDS
-  vt_gen
-
-  LINK_COMPONENTS
-  Support
-  )
-
 add_llvm_component_library(LLVMCodeGen
   AggressiveAntiDepBreaker.cpp
   AllocationOrder.cpp
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 2d18eba235b0f69..6148d0b6afcc656 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -34,7 +34,7 @@
 #include "llvm/CodeGen/Analysis.h"
 #include "llvm/CodeGen/BasicBlockSectionsProfileReader.h"
 #include "llvm/CodeGen/ISDOpcodes.h"
-#include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/CodeGenTypes/MachineValueType.h"
 #include "llvm/CodeGen/SelectionDAGNodes.h"
 #include "llvm/CodeGen/TargetLowering.h"
 #include "llvm/CodeGen/TargetPassConfig.h"
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
index 1a71c1232c7063f..4497da7d68db9cd 100644
--- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -28,7 +28,7 @@
 #include "llvm/CodeGen/GlobalISel/GISelChangeObserver.h"
 #include "llvm/CodeGen/GlobalISel/InlineAsmLowering.h"
 #include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
-#include "llvm/CodeGen/LowLevelType.h"
+#include "llvm/CodeGenTypes/LowLevelType.h"
 #include "llvm/CodeGen/LowLevelTypeUtils.h"
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/MachineFrameInfo.h"
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
index de9931d1c240f1b..989e6b0ac140bea 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
@@ -13,7 +13,7 @@
 
 #include "llvm/CodeGen/GlobalISel/LegalizerInfo.h"
 #include "llvm/ADT/SmallBitVector.h"
-#include "llvm/CodeGen/LowLevelType.h"
+#include "llvm/CodeGenTypes/LowLevelType.h"
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/CodeGen/MachineOperand.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
index ede4291fe26dc95..d6f88485f710472 100644
--- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
@@ -24,7 +24,7 @@
 #include "llvm/Analysis/MemoryLocation.h"
 #include "llvm/AsmParser/Parser.h"
 #include "llvm/AsmParser/SlotMapping.h"
-#include "llvm/CodeGen/LowLevelType.h"
+#include "llvm/CodeGenTypes/LowLevelType.h"
 #include "llvm/CodeGen/MIRFormatter.h"
 #include "llvm/CodeGen/MIRPrinter.h"
 #include "llvm/CodeGen/MachineBasicBlock.h"
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp
index fee237104022e16..f046741d457392a 100644
--- a/llvm/lib/CodeGen/MIRPrinter.cpp
+++ b/llvm/lib/CodeGen/MIRPrinter.cpp
@@ -18,7 +18,7 @@
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
-#include "llvm/CodeGen/LowLevelType.h"
+#include "llvm/CodeGenTypes/LowLevelType.h"
 #include "llvm/CodeGen/MIRYamlMapping.h"
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/MachineConstantPool.h"
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 27eae372f8ad764..c542cc402d859c6 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -18,7 +18,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/Analysis/MemoryLocation.h"
-#include "llvm/CodeGen/LowLevelType.h"
+#include "llvm/CodeGenTypes/LowLevelType.h"
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/MachineFrameInfo.h"
 #include "llvm/CodeGen/MachineFunction.h"
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index 363dd3aca6fe43f..8a64e111a29240a 100644
--- a/llvm/lib/CodeGen/MachineScheduler.cpp
+++ b/llvm/lib/CodeGen/MachineScheduler.cpp
@@ -32,7 +32,7 @@
 #include "llvm/CodeGen/MachineOperand.h"
 #include "llvm/CodeGen/MachinePassRegistry.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/CodeGenTypes/MachineValueType.h"
 #include "llvm/CodeGen/RegisterClassInfo.h"
 #include "llvm/CodeGen/RegisterPressure.h"
 #include "llvm/CodeGen/ScheduleDAG.h"
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp
index a015d9bbd2d3f57..a793a1954dd7b24 100644
--- a/llvm/lib/CodeGen/MachineVerifier.cpp
+++ b/llvm/lib/CodeGen/MachineVerifier.cpp
@@ -38,7 +38,7 @@
 #include "llvm/CodeGen/LiveRangeCalc.h"
 #include "llvm/CodeGen/LiveStacks.h"
 #include "llvm/CodeGen/LiveVariables.h"
-#include "llvm/CodeGen/LowLevelType.h"
+#include "llvm/CodeGenTypes/LowLevelType.h"
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/MachineFrameInfo.h"
 #include "llvm/CodeGen/MachineFunction.h"
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 98d8a6d9409f252..3c409f718f6e2ee 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -37,7 +37,7 @@
 #include "llvm/CodeGen/ISDOpcodes.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineMemOperand.h"
-#include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/CodeGenTypes/MachineValueType.h"
 #include "llvm/CodeGen/RuntimeLibcalls.h"
 #include "llvm/CodeGen/SelectionDAG.h"
 #include "llvm/CodeGen/SelectionDAGAddressAnalysis.h"
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index d213ea89de13b63..527e3c43164a266 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -59,7 +59,7 @@
 #include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/CodeGen/MachineOperand.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/CodeGenTypes/MachineValueType.h"
 #include "llvm/CodeGen/StackMaps.h"
 #include "llvm/CodeGen/TargetInstrInfo.h"
 #include "llvm/CodeGen/TargetLowering.h"
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index adfeea073bff652..e724cf9105ab534 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -24,7 +24,7 @@
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineJumpTableInfo.h"
 #include "llvm/CodeGen/MachineMemOperand.h"
-#include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/CodeGenTypes/MachineValueType.h"
 #include "llvm/CodeGen/RuntimeLibcalls.h"
 #include "llvm/CodeGen/SelectionDAG.h"
 #include "llvm/CodeGen/SelectionDAGNodes.h"
diff --git a/llvm/lib/CodeGen/SelectionDAG/Legaliz...
[truncated]

    git grep -l 'llvm\/CodeGen\/MachineValueType' \
        '*.cpp' '*.h' '*.modulemap' \
        | xargs sed -i -c \
            's:llvm/CodeGen/MachineValueType:llvm/CodeGenTypes/MachineValueType:'
    git grep -l 'llvm\/CodeGen\/LowLevelType.h' '*.cpp' '*.h' '*.modulemap' \
      | xargs sed -i -c 's:llvm/CodeGen/LowLevelType.h:llvm/CodeGenTypes/LowLevelType.h:'
Copy link

github-actions bot commented Jan 25, 2024

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff e5e1a8931044fe384f222fe0af4a1de595b941a3 59d5889fb63a96b8d5215c75e6465967480b0871 -- llvm/include/llvm/CodeGen/BasicTTIImpl.h llvm/include/llvm/CodeGen/CostTable.h llvm/include/llvm/CodeGen/FastISel.h llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h llvm/include/llvm/CodeGen/GlobalISel/Utils.h llvm/include/llvm/CodeGen/LowLevelTypeUtils.h llvm/include/llvm/CodeGen/MachineMemOperand.h llvm/include/llvm/CodeGen/RegisterBankInfo.h llvm/include/llvm/CodeGen/SelectionDAG.h llvm/include/llvm/CodeGen/SelectionDAGNodes.h llvm/include/llvm/CodeGen/TargetCallingConv.h llvm/include/llvm/CodeGen/TargetLowering.h llvm/include/llvm/CodeGen/ValueTypes.h llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp llvm/lib/CodeGen/CodeGenPrepare.cpp llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp llvm/lib/CodeGen/MIRParser/MIParser.cpp llvm/lib/CodeGen/MIRPrinter.cpp llvm/lib/CodeGen/MachineInstr.cpp llvm/lib/CodeGen/MachineScheduler.cpp llvm/lib/CodeGen/MachineVerifier.cpp llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.h llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp llvm/lib/CodeGen/TargetLoweringBase.cpp llvm/lib/CodeGen/TargetRegisterInfo.cpp llvm/lib/Target/AArch64/AArch64FastISel.cpp llvm/lib/Target/AArch64/AArch64ISelLowering.cpp llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp llvm/lib/Target/AMDGPU/AMDGPUGlobalISelUtils.cpp llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp llvm/lib/Target/ARM/ARMCallLowering.cpp llvm/lib/Target/ARM/ARMFastISel.cpp llvm/lib/Target/ARM/ARMISelLowering.cpp llvm/lib/Target/ARM/ARMISelLowering.h llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp llvm/lib/Target/Hexagon/HexagonISelLowering.h llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp llvm/lib/Target/Hexagon/HexagonInstrInfo.h llvm/lib/Target/Lanai/LanaiISelLowering.cpp llvm/lib/Target/M68k/M68kMachineFunction.h llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp llvm/lib/Target/Mips/MipsFastISel.cpp llvm/lib/Target/Mips/MipsISelLowering.cpp llvm/lib/Target/Mips/MipsISelLowering.h llvm/lib/Target/Mips/MipsOptimizePICCall.cpp llvm/lib/Target/Mips/MipsSEISelLowering.cpp llvm/lib/Target/Mips/MipsSEISelLowering.h llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp llvm/lib/Target/PowerPC/PPCISelLowering.cpp llvm/lib/Target/PowerPC/PPCISelLowering.h llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.h llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.h llvm/lib/Target/X86/GISel/X86CallLowering.cpp llvm/lib/Target/X86/GISel/X86InstructionSelector.cpp llvm/lib/Target/X86/X86AsmPrinter.cpp llvm/lib/Target/X86/X86InterleavedAccess.cpp llvm/unittests/CodeGen/MachineOperandTest.cpp llvm/unittests/CodeGen/ScalableVectorMVTsTest.cpp llvm/utils/TableGen/CodeGenInstruction.h llvm/utils/TableGen/CodeGenTarget.h llvm/utils/TableGen/DAGISelMatcher.h llvm/utils/TableGen/GlobalISelEmitter.cpp llvm/utils/TableGen/GlobalISelMatchTable.h llvm/utils/TableGen/InfoByHwMode.h llvm/utils/TableGen/RegisterInfoEmitter.cpp mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp llvm/include/llvm/CodeGenTypes/LowLevelType.h llvm/include/llvm/CodeGenTypes/MachineValueType.h llvm/lib/CodeGenTypes/LowLevelType.cpp
View the diff from clang-format here.
diff --git a/llvm/include/llvm/CodeGenTypes/LowLevelType.h b/llvm/include/llvm/CodeGenTypes/LowLevelType.h
index cc33152e06..5da2a65791 100644
--- a/llvm/include/llvm/CodeGenTypes/LowLevelType.h
+++ b/llvm/include/llvm/CodeGenTypes/LowLevelType.h
@@ -40,23 +40,26 @@ class LLT {
 public:
   /// Get a low-level scalar or aggregate "bag of bits".
   static constexpr LLT scalar(unsigned SizeInBits) {
-    return LLT{/*isPointer=*/false, /*isVector=*/false, /*isScalar=*/true,
-               ElementCount::getFixed(0), SizeInBits,
+    return LLT{/*isPointer=*/false, /*isVector=*/false,
+               /*isScalar=*/true,   ElementCount::getFixed(0),
+               SizeInBits,
                /*AddressSpace=*/0};
   }
 
   /// Get a low-level pointer in the given address space.
   static constexpr LLT pointer(unsigned AddressSpace, unsigned SizeInBits) {
     assert(SizeInBits > 0 && "invalid pointer size");
-    return LLT{/*isPointer=*/true, /*isVector=*/false, /*isScalar=*/false,
-               ElementCount::getFixed(0), SizeInBits, AddressSpace};
+    return LLT{/*isPointer=*/true, /*isVector=*/false,
+               /*isScalar=*/false, ElementCount::getFixed(0),
+               SizeInBits,         AddressSpace};
   }
 
   /// Get a low-level vector of some number of elements and element width.
   static constexpr LLT vector(ElementCount EC, unsigned ScalarSizeInBits) {
     assert(!EC.isScalar() && "invalid number of vector elements");
-    return LLT{/*isPointer=*/false, /*isVector=*/true, /*isScalar=*/false,
-               EC, ScalarSizeInBits, /*AddressSpace=*/0};
+    return LLT{/*isPointer=*/false, /*isVector=*/true,
+               /*isScalar=*/false,  EC,
+               ScalarSizeInBits,    /*AddressSpace=*/0};
   }
 
   /// Get a low-level vector of some number of elements and element type.
@@ -72,20 +75,15 @@ public:
   }
 
   /// Get a 16-bit IEEE half value.
-  /// TODO: Add IEEE semantics to type - This currently returns a simple `scalar(16)`.
-  static constexpr LLT float16() {
-    return scalar(16);
-  }
+  /// TODO: Add IEEE semantics to type - This currently returns a simple
+  /// `scalar(16)`.
+  static constexpr LLT float16() { return scalar(16); }
 
   /// Get a 32-bit IEEE float value.
-  static constexpr LLT float32() {
-    return scalar(32);
-  }
+  static constexpr LLT float32() { return scalar(32); }
 
   /// Get a 64-bit IEEE double value.
-  static constexpr LLT float64() {
-    return scalar(64);
-  }
+  static constexpr LLT float64() { return scalar(64); }
 
   /// Get a low-level fixed-width vector of some number of elements and element
   /// width.
@@ -421,12 +419,12 @@ public:
   }
 };
 
-inline raw_ostream& operator<<(raw_ostream &OS, const LLT &Ty) {
+inline raw_ostream &operator<<(raw_ostream &OS, const LLT &Ty) {
   Ty.print(OS);
   return OS;
 }
 
-template<> struct DenseMapInfo<LLT> {
+template <> struct DenseMapInfo<LLT> {
   static inline LLT getEmptyKey() {
     LLT Invalid;
     Invalid.IsPointer = true;
@@ -441,11 +439,9 @@ template<> struct DenseMapInfo<LLT> {
     uint64_t Val = Ty.getUniqueRAWLLTData();
     return DenseMapInfo<uint64_t>::getHashValue(Val);
   }
-  static bool isEqual(const LLT &LHS, const LLT &RHS) {
-    return LHS == RHS;
-  }
+  static bool isEqual(const LLT &LHS, const LLT &RHS) { return LHS == RHS; }
 };
 
-}
+} // namespace llvm
 
 #endif // LLVM_CODEGEN_LOWLEVELTYPE_H
diff --git a/llvm/include/llvm/CodeGenTypes/MachineValueType.h b/llvm/include/llvm/CodeGenTypes/MachineValueType.h
index 9aceb98960..81f09d9d1c 100644
--- a/llvm/include/llvm/CodeGenTypes/MachineValueType.h
+++ b/llvm/include/llvm/CodeGenTypes/MachineValueType.h
@@ -25,18 +25,18 @@
 
 namespace llvm {
 
-  class Type;
-  class raw_ostream;
-
-  /// Machine Value Type. Every type that is supported natively by some
-  /// processor targeted by LLVM occurs here. This means that any legal value
-  /// type can be represented by an MVT.
-  class MVT {
-  public:
-    enum SimpleValueType : uint8_t {
-      // Simple value types that aren't explicitly part of this enumeration
-      // are considered extended value types.
-      INVALID_SIMPLE_VALUE_TYPE = 0,
+class Type;
+class raw_ostream;
+
+/// Machine Value Type. Every type that is supported natively by some
+/// processor targeted by LLVM occurs here. This means that any legal value
+/// type can be represented by an MVT.
+class MVT {
+public:
+  enum SimpleValueType : uint8_t {
+    // Simple value types that aren't explicitly part of this enumeration
+    // are considered extended value types.
+    INVALID_SIMPLE_VALUE_TYPE = 0,
 
 #define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc) Ty = n,
 #define GET_VT_RANGES
@@ -44,510 +44,506 @@ namespace llvm {
 #undef GET_VT_ATTR
 #undef GET_VT_RANGES
 
-      VALUETYPE_SIZE = LAST_VALUETYPE + 1,
+    VALUETYPE_SIZE = LAST_VALUETYPE + 1,
 
-      // This is the current maximum for LAST_VALUETYPE.
-      // MVT::MAX_ALLOWED_VALUETYPE is used for asserts and to size bit vectors
-      // This value must be a multiple of 32.
-      MAX_ALLOWED_VALUETYPE = 224,
-    };
+    // This is the current maximum for LAST_VALUETYPE.
+    // MVT::MAX_ALLOWED_VALUETYPE is used for asserts and to size bit vectors
+    // This value must be a multiple of 32.
+    MAX_ALLOWED_VALUETYPE = 224,
+  };
 
-    static_assert(FIRST_VALUETYPE > 0);
-    static_assert(LAST_VALUETYPE < MAX_ALLOWED_VALUETYPE);
+  static_assert(FIRST_VALUETYPE > 0);
+  static_assert(LAST_VALUETYPE < MAX_ALLOWED_VALUETYPE);
 
-    SimpleValueType SimpleTy = INVALID_SIMPLE_VALUE_TYPE;
+  SimpleValueType SimpleTy = INVALID_SIMPLE_VALUE_TYPE;
 
-    constexpr MVT() = default;
-    constexpr MVT(SimpleValueType SVT) : SimpleTy(SVT) {}
+  constexpr MVT() = default;
+  constexpr MVT(SimpleValueType SVT) : SimpleTy(SVT) {}
 
-    bool operator>(const MVT& S)  const { return SimpleTy >  S.SimpleTy; }
-    bool operator<(const MVT& S)  const { return SimpleTy <  S.SimpleTy; }
-    bool operator==(const MVT& S) const { return SimpleTy == S.SimpleTy; }
-    bool operator!=(const MVT& S) const { return SimpleTy != S.SimpleTy; }
-    bool operator>=(const MVT& S) const { return SimpleTy >= S.SimpleTy; }
-    bool operator<=(const MVT& S) const { return SimpleTy <= S.SimpleTy; }
+  bool operator>(const MVT &S) const { return SimpleTy > S.SimpleTy; }
+  bool operator<(const MVT &S) const { return SimpleTy < S.SimpleTy; }
+  bool operator==(const MVT &S) const { return SimpleTy == S.SimpleTy; }
+  bool operator!=(const MVT &S) const { return SimpleTy != S.SimpleTy; }
+  bool operator>=(const MVT &S) const { return SimpleTy >= S.SimpleTy; }
+  bool operator<=(const MVT &S) const { return SimpleTy <= S.SimpleTy; }
 
-    /// Support for debugging, callable in GDB: VT.dump()
-    void dump() const;
+  /// Support for debugging, callable in GDB: VT.dump()
+  void dump() const;
 
-    /// Implement operator<<.
-    void print(raw_ostream &OS) const;
+  /// Implement operator<<.
+  void print(raw_ostream &OS) const;
 
-    /// Return true if this is a valid simple valuetype.
-    bool isValid() const {
-      return (SimpleTy >= MVT::FIRST_VALUETYPE &&
-              SimpleTy <= MVT::LAST_VALUETYPE);
-    }
+  /// Return true if this is a valid simple valuetype.
+  bool isValid() const {
+    return (SimpleTy >= MVT::FIRST_VALUETYPE &&
+            SimpleTy <= MVT::LAST_VALUETYPE);
+  }
 
-    /// Return true if this is a FP or a vector FP type.
-    bool isFloatingPoint() const {
-      return ((SimpleTy >= MVT::FIRST_FP_VALUETYPE &&
-               SimpleTy <= MVT::LAST_FP_VALUETYPE) ||
-              (SimpleTy >= MVT::FIRST_FP_FIXEDLEN_VECTOR_VALUETYPE &&
-               SimpleTy <= MVT::LAST_FP_FIXEDLEN_VECTOR_VALUETYPE) ||
-              (SimpleTy >= MVT::FIRST_FP_SCALABLE_VECTOR_VALUETYPE &&
-               SimpleTy <= MVT::LAST_FP_SCALABLE_VECTOR_VALUETYPE));
-    }
+  /// Return true if this is a FP or a vector FP type.
+  bool isFloatingPoint() const {
+    return ((SimpleTy >= MVT::FIRST_FP_VALUETYPE &&
+             SimpleTy <= MVT::LAST_FP_VALUETYPE) ||
+            (SimpleTy >= MVT::FIRST_FP_FIXEDLEN_VECTOR_VALUETYPE &&
+             SimpleTy <= MVT::LAST_FP_FIXEDLEN_VECTOR_VALUETYPE) ||
+            (SimpleTy >= MVT::FIRST_FP_SCALABLE_VECTOR_VALUETYPE &&
+             SimpleTy <= MVT::LAST_FP_SCALABLE_VECTOR_VALUETYPE));
+  }
 
-    /// Return true if this is an integer or a vector integer type.
-    bool isInteger() const {
-      return ((SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
-               SimpleTy <= MVT::LAST_INTEGER_VALUETYPE) ||
-              (SimpleTy >= MVT::FIRST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE &&
-               SimpleTy <= MVT::LAST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE) ||
-              (SimpleTy >= MVT::FIRST_INTEGER_SCALABLE_VECTOR_VALUETYPE &&
-               SimpleTy <= MVT::LAST_INTEGER_SCALABLE_VECTOR_VALUETYPE));
-    }
+  /// Return true if this is an integer or a vector integer type.
+  bool isInteger() const {
+    return ((SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
+             SimpleTy <= MVT::LAST_INTEGER_VALUETYPE) ||
+            (SimpleTy >= MVT::FIRST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE &&
+             SimpleTy <= MVT::LAST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE) ||
+            (SimpleTy >= MVT::FIRST_INTEGER_SCALABLE_VECTOR_VALUETYPE &&
+             SimpleTy <= MVT::LAST_INTEGER_SCALABLE_VECTOR_VALUETYPE));
+  }
 
-    /// Return true if this is an integer, not including vectors.
-    bool isScalarInteger() const {
-      return (SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
-              SimpleTy <= MVT::LAST_INTEGER_VALUETYPE);
-    }
+  /// Return true if this is an integer, not including vectors.
+  bool isScalarInteger() const {
+    return (SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
+            SimpleTy <= MVT::LAST_INTEGER_VALUETYPE);
+  }
 
-    /// Return true if this is a vector value type.
-    bool isVector() const {
-      return (SimpleTy >= MVT::FIRST_VECTOR_VALUETYPE &&
-              SimpleTy <= MVT::LAST_VECTOR_VALUETYPE);
-    }
+  /// Return true if this is a vector value type.
+  bool isVector() const {
+    return (SimpleTy >= MVT::FIRST_VECTOR_VALUETYPE &&
+            SimpleTy <= MVT::LAST_VECTOR_VALUETYPE);
+  }
 
-    /// Return true if this is a vector value type where the
-    /// runtime length is machine dependent
-    bool isScalableVector() const {
-      return (SimpleTy >= MVT::FIRST_SCALABLE_VECTOR_VALUETYPE &&
-              SimpleTy <= MVT::LAST_SCALABLE_VECTOR_VALUETYPE);
-    }
+  /// Return true if this is a vector value type where the
+  /// runtime length is machine dependent
+  bool isScalableVector() const {
+    return (SimpleTy >= MVT::FIRST_SCALABLE_VECTOR_VALUETYPE &&
+            SimpleTy <= MVT::LAST_SCALABLE_VECTOR_VALUETYPE);
+  }
 
-    /// Return true if this is a custom target type that has a scalable size.
-    bool isScalableTargetExtVT() const {
-      return SimpleTy == MVT::aarch64svcount;
-    }
+  /// Return true if this is a custom target type that has a scalable size.
+  bool isScalableTargetExtVT() const { return SimpleTy == MVT::aarch64svcount; }
 
-    /// Return true if the type is a scalable type.
-    bool isScalableVT() const {
-      return isScalableVector() || isScalableTargetExtVT();
-    }
+  /// Return true if the type is a scalable type.
+  bool isScalableVT() const {
+    return isScalableVector() || isScalableTargetExtVT();
+  }
 
-    bool isFixedLengthVector() const {
-      return (SimpleTy >= MVT::FIRST_FIXEDLEN_VECTOR_VALUETYPE &&
-              SimpleTy <= MVT::LAST_FIXEDLEN_VECTOR_VALUETYPE);
-    }
+  bool isFixedLengthVector() const {
+    return (SimpleTy >= MVT::FIRST_FIXEDLEN_VECTOR_VALUETYPE &&
+            SimpleTy <= MVT::LAST_FIXEDLEN_VECTOR_VALUETYPE);
+  }
 
-    /// Return true if this is a 16-bit vector type.
-    bool is16BitVector() const {
-      return (isFixedLengthVector() && getFixedSizeInBits() == 16);
-    }
+  /// Return true if this is a 16-bit vector type.
+  bool is16BitVector() const {
+    return (isFixedLengthVector() && getFixedSizeInBits() == 16);
+  }
 
-    /// Return true if this is a 32-bit vector type.
-    bool is32BitVector() const {
-      return (isFixedLengthVector() && getFixedSizeInBits() == 32);
-    }
+  /// Return true if this is a 32-bit vector type.
+  bool is32BitVector() const {
+    return (isFixedLengthVector() && getFixedSizeInBits() == 32);
+  }
 
-    /// Return true if this is a 64-bit vector type.
-    bool is64BitVector() const {
-      return (isFixedLengthVector() && getFixedSizeInBits() == 64);
-    }
+  /// Return true if this is a 64-bit vector type.
+  bool is64BitVector() const {
+    return (isFixedLengthVector() && getFixedSizeInBits() == 64);
+  }
 
-    /// Return true if this is a 128-bit vector type.
-    bool is128BitVector() const {
-      return (isFixedLengthVector() && getFixedSizeInBits() == 128);
-    }
+  /// Return true if this is a 128-bit vector type.
+  bool is128BitVector() const {
+    return (isFixedLengthVector() && getFixedSizeInBits() == 128);
+  }
 
-    /// Return true if this is a 256-bit vector type.
-    bool is256BitVector() const {
-      return (isFixedLengthVector() && getFixedSizeInBits() == 256);
-    }
+  /// Return true if this is a 256-bit vector type.
+  bool is256BitVector() const {
+    return (isFixedLengthVector() && getFixedSizeInBits() == 256);
+  }
 
-    /// Return true if this is a 512-bit vector type.
-    bool is512BitVector() const {
-      return (isFixedLengthVector() && getFixedSizeInBits() == 512);
-    }
+  /// Return true if this is a 512-bit vector type.
+  bool is512BitVector() const {
+    return (isFixedLengthVector() && getFixedSizeInBits() == 512);
+  }
 
-    /// Return true if this is a 1024-bit vector type.
-    bool is1024BitVector() const {
-      return (isFixedLengthVector() && getFixedSizeInBits() == 1024);
-    }
+  /// Return true if this is a 1024-bit vector type.
+  bool is1024BitVector() const {
+    return (isFixedLengthVector() && getFixedSizeInBits() == 1024);
+  }
 
-    /// Return true if this is a 2048-bit vector type.
-    bool is2048BitVector() const {
-      return (isFixedLengthVector() && getFixedSizeInBits() == 2048);
-    }
+  /// Return true if this is a 2048-bit vector type.
+  bool is2048BitVector() const {
+    return (isFixedLengthVector() && getFixedSizeInBits() == 2048);
+  }
 
-    /// Return true if this is an overloaded type for TableGen.
-    bool isOverloaded() const {
-      switch (SimpleTy) {
+  /// Return true if this is an overloaded type for TableGen.
+  bool isOverloaded() const {
+    switch (SimpleTy) {
 #define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc)                          \
   case Ty:                                                                     \
     return Any;
 #include "llvm/CodeGen/GenVT.inc"
 #undef GET_VT_ATTR
-      default:
-        return false;
-      }
+    default:
+      return false;
     }
+  }
 
-    /// Return a vector with the same number of elements as this vector, but
-    /// with the element type converted to an integer type with the same
-    /// bitwidth.
-    MVT changeVectorElementTypeToInteger() const {
-      MVT EltTy = getVectorElementType();
-      MVT IntTy = MVT::getIntegerVT(EltTy.getSizeInBits());
-      MVT VecTy = MVT::getVectorVT(IntTy, getVectorElementCount());
-      assert(VecTy.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE &&
-             "Simple vector VT not representable by simple integer vector VT!");
-      return VecTy;
-    }
+  /// Return a vector with the same number of elements as this vector, but
+  /// with the element type converted to an integer type with the same
+  /// bitwidth.
+  MVT changeVectorElementTypeToInteger() const {
+    MVT EltTy = getVectorElementType();
+    MVT IntTy = MVT::getIntegerVT(EltTy.getSizeInBits());
+    MVT VecTy = MVT::getVectorVT(IntTy, getVectorElementCount());
+    assert(VecTy.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE &&
+           "Simple vector VT not representable by simple integer vector VT!");
+    return VecTy;
+  }
 
-    /// Return a VT for a vector type whose attributes match ourselves
-    /// with the exception of the element type that is chosen by the caller.
-    MVT changeVectorElementType(MVT EltVT) const {
-      MVT VecTy = MVT::getVectorVT(EltVT, getVectorElementCount());
-      assert(VecTy.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE &&
-             "Simple vector VT not representable by simple integer vector VT!");
-      return VecTy;
-    }
+  /// Return a VT for a vector type whose attributes match ourselves
+  /// with the exception of the element type that is chosen by the caller.
+  MVT changeVectorElementType(MVT EltVT) const {
+    MVT VecTy = MVT::getVectorVT(EltVT, getVectorElementCount());
+    assert(VecTy.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE &&
+           "Simple vector VT not representable by simple integer vector VT!");
+    return VecTy;
+  }
 
-    /// Return the type converted to an equivalently sized integer or vector
-    /// with integer element type. Similar to changeVectorElementTypeToInteger,
-    /// but also handles scalars.
-    MVT changeTypeToInteger() {
-      if (isVector())
-        return changeVectorElementTypeToInteger();
-      return MVT::getIntegerVT(getSizeInBits());
-    }
+  /// Return the type converted to an equivalently sized integer or vector
+  /// with integer element type. Similar to changeVectorElementTypeToInteger,
+  /// but also handles scalars.
+  MVT changeTypeToInteger() {
+    if (isVector())
+      return changeVectorElementTypeToInteger();
+    return MVT::getIntegerVT(getSizeInBits());
+  }
 
-    /// Return a VT for a vector type with the same element type but
-    /// half the number of elements.
-    MVT getHalfNumVectorElementsVT() const {
-      MVT EltVT = getVectorElementType();
-      auto EltCnt = getVectorElementCount();
-      assert(EltCnt.isKnownEven() && "Splitting vector, but not in half!");
-      return getVectorVT(EltVT, EltCnt.divideCoefficientBy(2));
-    }
+  /// Return a VT for a vector type with the same element type but
+  /// half the number of elements.
+  MVT getHalfNumVectorElementsVT() const {
+    MVT EltVT = getVectorElementType();
+    auto EltCnt = getVectorElementCount();
+    assert(EltCnt.isKnownEven() && "Splitting vector, but not in half!");
+    return getVectorVT(EltVT, EltCnt.divideCoefficientBy(2));
+  }
 
-    // Return a VT for a vector type with the same element type but
-    // double the number of elements.
-    MVT getDoubleNumVectorElementsVT() const {
-      MVT EltVT = getVectorElementType();
-      auto EltCnt = getVectorElementCount();
-      return MVT::getVectorVT(EltVT, EltCnt * 2);
-    }
+  // Return a VT for a vector type with the same element type but
+  // double the number of elements.
+  MVT getDoubleNumVectorElementsVT() const {
+    MVT EltVT = getVectorElementType();
+    auto EltCnt = getVectorElementCount();
+    return MVT::getVectorVT(EltVT, EltCnt * 2);
+  }
 
-    /// Returns true if the given vector is a power of 2.
-    bool isPow2VectorType() const {
-      unsigned NElts = getVectorMinNumElements();
-      return !(NElts & (NElts - 1));
-    }
+  /// Returns true if the given vector is a power of 2.
+  bool isPow2VectorType() const {
+    unsigned NElts = getVectorMinNumElements();
+    return !(NElts & (NElts - 1));
+  }
 
-    /// Widens the length of the given vector MVT up to the nearest power of 2
-    /// and returns that type.
-    MVT getPow2VectorType() const {
-      if (isPow2VectorType())
-        return *this;
+  /// Widens the length of the given vector MVT up to the nearest power of 2
+  /// and returns that type.
+  MVT getPow2VectorType() const {
+    if (isPow2VectorType())
+      return *this;
 
-      ElementCount NElts = getVectorElementCount();
-      unsigned NewMinCount = 1 << Log2_32_Ceil(NElts.getKnownMinValue());
-      NElts = ElementCount::get(NewMinCount, NElts.isScalable());
-      return MVT::getVectorVT(getVectorElementType(), NElts);
-    }
+    ElementCount NElts = getVectorElementCount();
+    unsigned NewMinCount = 1 << Log2_32_Ceil(NElts.getKnownMinValue());
+    NElts = ElementCount::get(NewMinCount, NElts.isScalable());
+    return MVT::getVectorVT(getVectorElementType(), NElts);
+  }
 
-    /// If this is a vector, return the element type, otherwise return this.
-    MVT getScalarType() const {
-      return isVector() ? getVectorElementType() : *this;
-    }
+  /// If this is a vector, return the element type, otherwise return this.
+  MVT getScalarType() const {
+    return isVector() ? getVectorElementType() : *this;
+  }
 
-    MVT getVectorElementType() const {
-      switch (SimpleTy) {
-      default:
-        llvm_unreachable("Not a vector MVT!");
+  MVT getVectorElementType() const {
+    switch (SimpleTy) {
+    default:
+      llvm_unreachable("Not a vector MVT!");
 
 #define GET_VT_VECATTR(Ty, Sc, nElem, ElTy, ElSz)                              \
   case Ty:                                                                     \
     return ElTy;
 #include "llvm/CodeGen/GenVT.inc"
 #undef GET_VT_VECATTR
-      }
     }
+  }
 
-    /// Given a vector type, return the minimum number of elements it contains.
-    unsigned getVectorMinNumElements() const {
-      switch (SimpleTy) {
-      default:
-        llvm_unreachable("Not a vector MVT!");
+  /// Given a vector type, return the minimum number of elements it contains.
+  unsigned getVectorMinNumElements() const {
+    switch (SimpleTy) {
+    default:
+      llvm_unreachable("Not a vector MVT!");
 
 #define GET_VT_VECATTR(Ty, Sc, nElem, ElTy, ElSz)                              \
   case Ty:                                                                     \
     return nElem;
 #include "llvm/CodeGen/GenVT.inc"
 #undef GET_VT_VECATTR
-      }
     }
+  }
 
-    ElementCount getVectorElementCount() const {
-      return ElementCount::get(getVectorMinNumElements(), isScalableVector());
-    }
+  ElementCount getVectorElementCount() const {
+    return ElementCount::get(getVectorMinNumElements(), isScalableVector());
+  }
 
-    unsigned getVectorNumElements() const {
-      if (isScalableVector())
-        llvm::reportInvalidSizeRequest(
-            "Possible incorrect use of MVT::getVectorNumElements() for "
-            "scalable vector. Scalable flag may be dropped, use "
-            "MVT::getVectorElementCount() instead");
-      return getVectorMinNumElements();
-    }
+  unsigned getVectorNumElements() const {
+    if (isScalableVector())
+      llvm::reportInvalidSizeRequest(
+          "Possible incorrect use of MVT::getVectorNumElements() for "
+          "scalable vector. Scalable flag may be dropped, use "
+          "MVT::getVectorElementCount() instead");
+    return getVectorMinNumElements();
+  }
 
-    /// Returns the size of the specified MVT in bits.
-    ///
-    /// If the value type is a scalable vector type, the scalable property will
-    /// be set and the runtime size will be a positive integer multiple of the
-    /// base size.
-    TypeSize getSizeInBits() const {
-      static constexpr TypeSize SizeTable[] = {
+  /// Returns the size of the specified MVT in bits.
+  ///
+  /// If the value type is a scalable vector type, the scalable property will
+  /// be set and the runtime size will be a positive integer multiple of the
+  /// base size.
+  TypeSize getSizeInBits() const {
+    static constexpr TypeSize SizeTable[] = {
 #define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc)                          \
   TypeSize(Sz, Sc || Ty == aarch64svcount /* FIXME: Not in the td. */),
 #include "llvm/CodeGen/GenVT.inc"
 #undef GET_VT_ATTR
-      };
-
-      switch (SimpleTy) {
-      case INVALID_SIMPLE_VALUE_TYPE:
-        llvm_unreachable("getSizeInBits called on extended MVT.");
-      case Other:
-        llvm_unreachable("Value type is non-standard value, Other.");
-      case iPTR:
-        llvm_unreachable("Value type size is target-dependent. Ask TLI.");
-      case iPTRAny:
-      case iAny:
-      case fAny:
-      case vAny:
-      case Any:
-        llvm_unreachable("Value type is overloaded.");
-      case token:
-        llvm_unreachable("Token type is a sentinel that cannot be used "
-                         "in codegen and has no size");
-      case Metadata:
-        llvm_unreachable("Value type is metadata.");
-      default:
-        assert(SimpleTy < VALUETYPE_SIZE && "Unexpected value type!");
-        return SizeTable[SimpleTy - FIRST_VALUETYPE];
-      }
-    }
-
-    /// Return the size of the specified fixed width value type in bits. The
-    /// function will assert if the type is scalable.
-    uint64_t getFixedSizeInBits() const {
-      return getSizeInBits().getFixedValue();
-    }
+    };
 
-    uint64_t getScalarSizeInBits() const {
-      return getScalarType().getSizeInBits().getFixedValue();
+    switch (SimpleTy) {
+    case INVALID_SIMPLE_VALUE_TYPE:
+      llvm_unreachable("getSizeInBits called on extended MVT.");
+    case Other:
+      llvm_unreachable("Value type is non-standard value, Other.");
+    case iPTR:
+      llvm_unreachable("Value type size is target-dependent. Ask TLI.");
+    case iPTRAny:
+    case iAny:
+    case fAny:
+    case vAny:
+    case Any:
+      llvm_unreachable("Value type is overloaded.");
+    case token:
+      llvm_unreachable("Token type is a sentinel that cannot be used "
+                       "in codegen and has no size");
+    case Metadata:
+      llvm_unreachable("Value type is metadata.");
+    default:
+      assert(SimpleTy < VALUETYPE_SIZE && "Unexpected value type!");
+      return SizeTable[SimpleTy - FIRST_VALUETYPE];
     }
+  }
 
-    /// Return the number of bytes overwritten by a store of the specified value
-    /// type.
-    ///
-    /// If the value type is a scalable vector type, the scalable property will
-    /// be set and the runtime size will be a positive integer multiple of the
-    /// base size.
-    TypeSize getStoreSize() const {
-      TypeSize BaseSize = getSizeInBits();
-      return {(BaseSize.getKnownMinValue() + 7) / 8, BaseSize.isScalable()};
-    }
+  /// Return the size of the specified fixed width value type in bits. The
+  /// function will assert if the type is scalable.
+  uint64_t getFixedSizeInBits() const {
+    return getSizeInBits().getFixedValue();
+  }
 
-    // Return the number of bytes overwritten by a store of this value type or
-    // this value type's element type in the case of a vector.
-    uint64_t getScalarStoreSize() const {
-      return getScalarType().getStoreSize().getFixedValue();
-    }
+  uint64_t getScalarSizeInBits() const {
+    return getScalarType().getSizeInBits().getFixedValue();
+  }
 
-    /// Return the number of bits overwritten by a store of the specified value
-    /// type.
-    ///
-    /// If the value type is a scalable vector type, the scalable property will
-    /// be set and the runtime size will be a positive integer multiple of the
-    /// base size.
-    TypeSize getStoreSizeInBits() const {
-      return getStoreSize() * 8;
-    }
+  /// Return the number of bytes overwritten by a store of the specified value
+  /// type.
+  ///
+  /// If the value type is a scalable vector type, the scalable property will
+  /// be set and the runtime size will be a positive integer multiple of the
+  /// base size.
+  TypeSize getStoreSize() const {
+    TypeSize BaseSize = getSizeInBits();
+    return {(BaseSize.getKnownMinValue() + 7) / 8, BaseSize.isScalable()};
+  }
 
-    /// Returns true if the number of bits for the type is a multiple of an
-    /// 8-bit byte.
-    bool isByteSized() const { return getSizeInBits().isKnownMultipleOf(8); }
+  // Return the number of bytes overwritten by a store of this value type or
+  // this value type's element type in the case of a vector.
+  uint64_t getScalarStoreSize() const {
+    return getScalarType().getStoreSize().getFixedValue();
+  }
 
-    /// Return true if we know at compile time this has more bits than VT.
-    bool knownBitsGT(MVT VT) const {
-      return TypeSize::isKnownGT(getSizeInBits(), VT.getSizeInBits());
-    }
+  /// Return the number of bits overwritten by a store of the specified value
+  /// type.
+  ///
+  /// If the value type is a scalable vector type, the scalable property will
+  /// be set and the runtime size will be a positive integer multiple of the
+  /// base size.
+  TypeSize getStoreSizeInBits() const { return getStoreSize() * 8; }
+
+  /// Returns true if the number of bits for the type is a multiple of an
+  /// 8-bit byte.
+  bool isByteSized() const { return getSizeInBits().isKnownMultipleOf(8); }
+
+  /// Return true if we know at compile time this has more bits than VT.
+  bool knownBitsGT(MVT VT) const {
+    return TypeSize::isKnownGT(getSizeInBits(), VT.getSizeInBits());
+  }
 
-    /// Return true if we know at compile time this has more than or the same
-    /// bits as VT.
-    bool knownBitsGE(MVT VT) const {
-      return TypeSize::isKnownGE(getSizeInBits(), VT.getSizeInBits());
-    }
+  /// Return true if we know at compile time this has more than or the same
+  /// bits as VT.
+  bool knownBitsGE(MVT VT) const {
+    return TypeSize::isKnownGE(getSizeInBits(), VT.getSizeInBits());
+  }
 
-    /// Return true if we know at compile time this has fewer bits than VT.
-    bool knownBitsLT(MVT VT) const {
-      return TypeSize::isKnownLT(getSizeInBits(), VT.getSizeInBits());
-    }
+  /// Return true if we know at compile time this has fewer bits than VT.
+  bool knownBitsLT(MVT VT) const {
+    return TypeSize::isKnownLT(getSizeInBits(), VT.getSizeInBits());
+  }
 
-    /// Return true if we know at compile time this has fewer than or the same
-    /// bits as VT.
-    bool knownBitsLE(MVT VT) const {
-      return TypeSize::isKnownLE(getSizeInBits(), VT.getSizeInBits());
-    }
+  /// Return true if we know at compile time this has fewer than or the same
+  /// bits as VT.
+  bool knownBitsLE(MVT VT) const {
+    return TypeSize::isKnownLE(getSizeInBits(), VT.getSizeInBits());
+  }
 
-    /// Return true if this has more bits than VT.
-    bool bitsGT(MVT VT) const {
-      assert(isScalableVector() == VT.isScalableVector() &&
-             "Comparison between scalable and fixed types");
-      return knownBitsGT(VT);
-    }
+  /// Return true if this has more bits than VT.
+  bool bitsGT(MVT VT) const {
+    assert(isScalableVector() == VT.isScalableVector() &&
+           "Comparison between scalable and fixed types");
+    return knownBitsGT(VT);
+  }
 
-    /// Return true if this has no less bits than VT.
-    bool bitsGE(MVT VT) const {
-      assert(isScalableVector() == VT.isScalableVector() &&
-             "Comparison between scalable and fixed types");
-      return knownBitsGE(VT);
-    }
+  /// Return true if this has no less bits than VT.
+  bool bitsGE(MVT VT) const {
+    assert(isScalableVector() == VT.isScalableVector() &&
+           "Comparison between scalable and fixed types");
+    return knownBitsGE(VT);
+  }
 
-    /// Return true if this has less bits than VT.
-    bool bitsLT(MVT VT) const {
-      assert(isScalableVector() == VT.isScalableVector() &&
-             "Comparison between scalable and fixed types");
-      return knownBitsLT(VT);
-    }
+  /// Return true if this has less bits than VT.
+  bool bitsLT(MVT VT) const {
+    assert(isScalableVector() == VT.isScalableVector() &&
+           "Comparison between scalable and fixed types");
+    return knownBitsLT(VT);
+  }
 
-    /// Return true if this has no more bits than VT.
-    bool bitsLE(MVT VT) const {
-      assert(isScalableVector() == VT.isScalableVector() &&
-             "Comparison between scalable and fixed types");
-      return knownBitsLE(VT);
-    }
+  /// Return true if this has no more bits than VT.
+  bool bitsLE(MVT VT) const {
+    assert(isScalableVector() == VT.isScalableVector() &&
+           "Comparison between scalable and fixed types");
+    return knownBitsLE(VT);
+  }
 
-    static MVT getFloatingPointVT(unsigned BitWidth) {
+  static MVT getFloatingPointVT(unsigned BitWidth) {
 #define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc)                          \
   if (FP == 3 && sz == BitWidth)                                               \
     return Ty;
 #include "llvm/CodeGen/GenVT.inc"
 #undef GET_VT_ATTR
 
-      llvm_unreachable("Bad bit width!");
-    }
+    llvm_unreachable("Bad bit width!");
+  }
 
-    static MVT getIntegerVT(unsigned BitWidth) {
+  static MVT getIntegerVT(unsigned BitWidth) {
 #define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc)                          \
   if (Int == 3 && sz == BitWidth)                                              \
     return Ty;
 #include "llvm/CodeGen/GenVT.inc"
 #undef GET_VT_ATTR
 
-      return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
-    }
+    return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
+  }
 
-    static MVT getVectorVT(MVT VT, unsigned NumElements) {
+  static MVT getVectorVT(MVT VT, unsigned NumElements) {
 #define GET_VT_VECATTR(Ty, Sc, nElem, ElTy, ElSz)                              \
   if (!Sc && VT.SimpleTy == ElTy && NumElements == nElem)                      \
     return Ty;
 #include "llvm/CodeGen/GenVT.inc"
 #undef GET_VT_VECATTR
 
-      return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
-    }
+    return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
+  }
 
-    static MVT getScalableVectorVT(MVT VT, unsigned NumElements) {
+  static MVT getScalableVectorVT(MVT VT, unsigned NumElements) {
 #define GET_VT_VECATTR(Ty, Sc, nElem, ElTy, ElSz)                              \
   if (Sc && VT.SimpleTy == ElTy && NumElements == nElem)                       \
     return Ty;
 #include "llvm/CodeGen/GenVT.inc"
 #undef GET_VT_VECATTR
 
-      return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
-    }
-
-    static MVT getVectorVT(MVT VT, unsigned NumElements, bool IsScalable) {
-      if (IsScalable)
-        return getScalableVectorVT(VT, NumElements);
-      return getVectorVT(VT, NumElements);
-    }
+    return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
+  }
 
-    static MVT getVectorVT(MVT VT, ElementCount EC) {
-      if (EC.isScalable())
-        return getScalableVectorVT(VT, EC.getKnownMinValue());
-      return getVectorVT(VT, EC.getKnownMinValue());
-    }
+  static MVT getVectorVT(MVT VT, unsigned NumElements, bool IsScalable) {
+    if (IsScalable)
+      return getScalableVectorVT(VT, NumElements);
+    return getVectorVT(VT, NumElements);
+  }
 
-    /// Return the value type corresponding to the specified type.  This returns
-    /// all pointers as iPTR.  If HandleUnknown is true, unknown types are
-    /// returned as Other, otherwise they are invalid.
-    static MVT getVT(Type *Ty, bool HandleUnknown = false);
-
-  public:
-    /// SimpleValueType Iteration
-    /// @{
-    static auto all_valuetypes() {
-      return enum_seq_inclusive(MVT::FIRST_VALUETYPE, MVT::LAST_VALUETYPE,
-                                force_iteration_on_noniterable_enum);
-    }
+  static MVT getVectorVT(MVT VT, ElementCount EC) {
+    if (EC.isScalable())
+      return getScalableVectorVT(VT, EC.getKnownMinValue());
+    return getVectorVT(VT, EC.getKnownMinValue());
+  }
 
-    static auto integer_valuetypes() {
-      return enum_seq_inclusive(MVT::FIRST_INTEGER_VALUETYPE,
-                                MVT::LAST_INTEGER_VALUETYPE,
-                                force_iteration_on_noniterable_enum);
-    }
+  /// Return the value type corresponding to the specified type.  This returns
+  /// all pointers as iPTR.  If HandleUnknown is true, unknown types are
+  /// returned as Other, otherwise they are invalid.
+  static MVT getVT(Type *Ty, bool HandleUnknown = false);
+
+public:
+  /// SimpleValueType Iteration
+  /// @{
+  static auto all_valuetypes() {
+    return enum_seq_inclusive(MVT::FIRST_VALUETYPE, MVT::LAST_VALUETYPE,
+                              force_iteration_on_noniterable_enum);
+  }
 
-    static auto fp_valuetypes() {
-      return enum_seq_inclusive(MVT::FIRST_FP_VALUETYPE, MVT::LAST_FP_VALUETYPE,
-                                force_iteration_on_noniterable_enum);
-    }
+  static auto integer_valuetypes() {
+    return enum_seq_inclusive(MVT::FIRST_INTEGER_VALUETYPE,
+                              MVT::LAST_INTEGER_VALUETYPE,
+                              force_iteration_on_noniterable_enum);
+  }
 
-    static auto vector_valuetypes() {
-      return enum_seq_inclusive(MVT::FIRST_VECTOR_VALUETYPE,
-                                MVT::LAST_VECTOR_VALUETYPE,
-                                force_iteration_on_noniterable_enum);
-    }
+  static auto fp_valuetypes() {
+    return enum_seq_inclusive(MVT::FIRST_FP_VALUETYPE, MVT::LAST_FP_VALUETYPE,
+                              force_iteration_on_noniterable_enum);
+  }
 
-    static auto fixedlen_vector_valuetypes() {
-      return enum_seq_inclusive(MVT::FIRST_FIXEDLEN_VECTOR_VALUETYPE,
-                                MVT::LAST_FIXEDLEN_VECTOR_VALUETYPE,
-                                force_iteration_on_noniterable_enum);
-    }
+  static auto vector_valuetypes() {
+    return enum_seq_inclusive(MVT::FIRST_VECTOR_VALUETYPE,
+                              MVT::LAST_VECTOR_VALUETYPE,
+                              force_iteration_on_noniterable_enum);
+  }
 
-    static auto scalable_vector_valuetypes() {
-      return enum_seq_inclusive(MVT::FIRST_SCALABLE_VECTOR_VALUETYPE,
-                                MVT::LAST_SCALABLE_VECTOR_VALUETYPE,
-                                force_iteration_on_noniterable_enum);
-    }
+  static auto fixedlen_vector_valuetypes() {
+    return enum_seq_inclusive(MVT::FIRST_FIXEDLEN_VECTOR_VALUETYPE,
+                              MVT::LAST_FIXEDLEN_VECTOR_VALUETYPE,
+                              force_iteration_on_noniterable_enum);
+  }
 
-    static auto integer_fixedlen_vector_valuetypes() {
-      return enum_seq_inclusive(MVT::FIRST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE,
-                                MVT::LAST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE,
-                                force_iteration_on_noniterable_enum);
-    }
+  static auto scalable_vector_valuetypes() {
+    return enum_seq_inclusive(MVT::FIRST_SCALABLE_VECTOR_VALUETYPE,
+                              MVT::LAST_SCALABLE_VECTOR_VALUETYPE,
+                              force_iteration_on_noniterable_enum);
+  }
 
-    static auto fp_fixedlen_vector_valuetypes() {
-      return enum_seq_inclusive(MVT::FIRST_FP_FIXEDLEN_VECTOR_VALUETYPE,
-                                MVT::LAST_FP_FIXEDLEN_VECTOR_VALUETYPE,
-                                force_iteration_on_noniterable_enum);
-    }
+  static auto integer_fixedlen_vector_valuetypes() {
+    return enum_seq_inclusive(MVT::FIRST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE,
+                              MVT::LAST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE,
+                              force_iteration_on_noniterable_enum);
+  }
 
-    static auto integer_scalable_vector_valuetypes() {
-      return enum_seq_inclusive(MVT::FIRST_INTEGER_SCALABLE_VECTOR_VALUETYPE,
-                                MVT::LAST_INTEGER_SCALABLE_VECTOR_VALUETYPE,
-                                force_iteration_on_noniterable_enum);
-    }
+  static auto fp_fixedlen_vector_valuetypes() {
+    return enum_seq_inclusive(MVT::FIRST_FP_FIXEDLEN_VECTOR_VALUETYPE,
+                              MVT::LAST_FP_FIXEDLEN_VECTOR_VALUETYPE,
+                              force_iteration_on_noniterable_enum);
+  }
 
-    static auto fp_scalable_vector_valuetypes() {
-      return enum_seq_inclusive(MVT::FIRST_FP_SCALABLE_VECTOR_VALUETYPE,
-                                MVT::LAST_FP_SCALABLE_VECTOR_VALUETYPE,
-                                force_iteration_on_noniterable_enum);
-    }
-    /// @}
-  };
+  static auto integer_scalable_vector_valuetypes() {
+    return enum_seq_inclusive(MVT::FIRST_INTEGER_SCALABLE_VECTOR_VALUETYPE,
+                              MVT::LAST_INTEGER_SCALABLE_VECTOR_VALUETYPE,
+                              force_iteration_on_noniterable_enum);
+  }
 
-  inline raw_ostream &operator<<(raw_ostream &OS, const MVT &VT) {
-    VT.print(OS);
-    return OS;
+  static auto fp_scalable_vector_valuetypes() {
+    return enum_seq_inclusive(MVT::FIRST_FP_SCALABLE_VECTOR_VALUETYPE,
+                              MVT::LAST_FP_SCALABLE_VECTOR_VALUETYPE,
+                              force_iteration_on_noniterable_enum);
   }
+  /// @}
+};
+
+inline raw_ostream &operator<<(raw_ostream &OS, const MVT &VT) {
+  VT.print(OS);
+  return OS;
+}
 
 } // end namespace llvm
 

    git clang-format main
    git checkout llvm/include/llvm/CodeGenTypes/MachineValueType.h
    llvm/include/llvm/CodeGenTypes/LowLevelType.h
@nico
Copy link
Contributor Author

nico commented Jan 25, 2024

(The code_formatter bot gets confused because it thinks I should reformat the moved files entirely. I did incorporate the parts about re-sorting includes.)

@nico nico requested a review from aeubanks January 25, 2024 13:36
@nico nico merged commit 184ca39 into llvm:main Jan 25, 2024
2 of 4 checks passed
@nico nico deleted the codegentypex branch January 25, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants