aboutsummaryrefslogtreecommitdiff
path: root/backend/unittests/CodeGen
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-13 23:55:38 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-13 23:55:38 +0800
commitaa69e15c6909c3b162b15f5326f0a72ba9bb7163 (patch)
tree6428eb20e41bad1fc8ad2f5c259bc5537f54554d /backend/unittests/CodeGen
parentcd30fb546e389d1fb78ce8e579b3dba3a8fdb52a (diff)
downloadrcc-project-aa69e15c6909c3b162b15f5326f0a72ba9bb7163.tar.gz
rcc-project-aa69e15c6909c3b162b15f5326f0a72ba9bb7163.tar.xz
[CodeGen] Unify scalar low-level types
Diffstat (limited to 'backend/unittests/CodeGen')
-rw-r--r--backend/unittests/CodeGen/CoreTypesTest.cpp150
-rw-r--r--backend/unittests/CodeGen/GenericOpcodesTest.cpp60
-rw-r--r--backend/unittests/CodeGen/GlobalISel/GISelMITest.h8
-rw-r--r--backend/unittests/CodeGen/GlobalISel/InstructionSelectTest.cpp6
-rw-r--r--backend/unittests/CodeGen/InstructionDescriptorTest.cpp4
-rw-r--r--backend/unittests/CodeGen/LiveTestSupport.h2
-rw-r--r--backend/unittests/CodeGen/MachineAnalysesTest.cpp8
-rw-r--r--backend/unittests/CodeGen/MachineFunctionClonerTest.cpp2
-rw-r--r--backend/unittests/CodeGen/MachineIRBuilderTest.cpp6
-rw-r--r--backend/unittests/CodeGen/MachineIRCoreTest.cpp7
-rw-r--r--backend/unittests/CodeGen/MachineOptimizationTest.cpp6
-rw-r--r--backend/unittests/CodeGen/MachineSchedulingTest.cpp6
-rw-r--r--backend/unittests/CodeGen/MachineValueTypesTest.cpp4
-rw-r--r--backend/unittests/CodeGen/MachineVerifierTargetTest.cpp16
-rw-r--r--backend/unittests/CodeGen/MachineVerifierTest.cpp8
-rw-r--r--backend/unittests/CodeGen/PHIEliminationTest.cpp16
-rw-r--r--backend/unittests/CodeGen/RegisterAllocationTest.cpp2
-rw-r--r--backend/unittests/CodeGen/RegisterAllocationTestSupport.h2
-rw-r--r--backend/unittests/CodeGen/SSAExitTestSupport.h2
-rw-r--r--backend/unittests/CodeGen/TargetCallLoweringTest.cpp8
-rw-r--r--backend/unittests/CodeGen/TargetRegisterInfoTest.cpp4
-rw-r--r--backend/unittests/CodeGen/TwoAddressInstructionPassTest.cpp4
22 files changed, 142 insertions, 189 deletions
diff --git a/backend/unittests/CodeGen/CoreTypesTest.cpp b/backend/unittests/CodeGen/CoreTypesTest.cpp
index b19d6b4..8ad0ce6 100644
--- a/backend/unittests/CodeGen/CoreTypesTest.cpp
+++ b/backend/unittests/CodeGen/CoreTypesTest.cpp
@@ -5,12 +5,10 @@
#include "rcc/CodeGen/Register.h"
#include "rcc/CodeGen/StableID.h"
-#include <array>
#include <cstdint>
#include <iostream>
#include <string_view>
#include <type_traits>
-#include <unordered_set>
namespace {
@@ -32,126 +30,92 @@ private:
};
void testLowLevelTypes(TestContext &Context) {
- const rcc::LLT Invalid;
- Context.expect(!Invalid.isValid(), "default LLT must be invalid");
- Context.expect(Invalid.toString() == "LLT_invalid", "invalid LLT spelling must be stable");
-
- const rcc::LLT Token = rcc::LLT::token();
- Context.expect(Token.isToken(), "token LLT must preserve its kind");
- Context.expect(Token.scalarBitWidth() == 0, "token LLT must have no bit width");
- Context.expect(Token.toString() == "s0", "token LLT must use the MIR token spelling");
-
- auto Any = rcc::LLT::makeAnyScalar(3);
- auto Integer = rcc::LLT::makeInteger(3);
- Context.expect(Any && Integer, "arbitrary positive scalar widths must be accepted");
- if (Any && Integer) {
- Context.expect(Any->isAnyScalar(), "bag-of-bits LLT must preserve its kind");
- Context.expect(Integer->isInteger(), "integer LLT must preserve its kind");
- Context.expect(*Any != *Integer, "bag-of-bits and integer LLTs must remain distinct");
- Context.expect(Any->toString() == "s3", "bag-of-bits LLT spelling must include its width");
- Context.expect(Integer->toString() == "i3", "integer LLT spelling must include its width");
+ const rcc::LowLevelType Invalid;
+ Context.expect(!Invalid.isValid(), "default LowLevelType must be invalid");
+ Context.expect(Invalid.toString() == "LLT_invalid",
+ "invalid LowLevelType spelling must be stable");
+
+ const rcc::LowLevelType Token = rcc::LowLevelType::token();
+ Context.expect(Token.isToken(), "token LowLevelType must preserve its kind");
+ Context.expect(Token.scalarBitWidth() == 0, "token LowLevelType must have no bit width");
+ Context.expect(Token.toString() == "s0", "token LowLevelType must use the MIR token spelling");
+
+ auto Scalar = rcc::LowLevelType::makeCategoryNeutralScalar(3);
+ auto SameScalar = rcc::LowLevelType::makeCategoryNeutralScalar(3);
+ Context.expect(Scalar && SameScalar, "arbitrary positive scalar widths must be accepted");
+ if (Scalar && SameScalar) {
+ Context.expect(Scalar->isCategoryNeutralScalar(),
+ "scalar LowLevelType must preserve its category-neutral kind");
+ Context.expect(*Scalar == *SameScalar,
+ "equal-width scalars must have one canonical low-level type");
+ Context.expect(Scalar->toString() == "s3",
+ "scalar LowLevelType spelling must include its width");
}
- Context.expect(!rcc::LLT::makeInteger(0), "zero-width integer LLT must be rejected");
- Context.expect(!rcc::LLT::makeInteger(std::uint64_t{1} << 16),
- "integer LLT wider than the encoding must be rejected");
-
- constexpr std::array FloatCases{
- std::pair{rcc::FloatSemantics::IEEEHalf, std::uint32_t{16}},
- std::pair{rcc::FloatSemantics::BFloat, std::uint32_t{16}},
- std::pair{rcc::FloatSemantics::IEEESingle, std::uint32_t{32}},
- std::pair{rcc::FloatSemantics::IEEEDouble, std::uint32_t{64}},
- std::pair{rcc::FloatSemantics::IEEEQuad, std::uint32_t{128}},
- std::pair{rcc::FloatSemantics::PPCDoubleDouble, std::uint32_t{128}},
- std::pair{rcc::FloatSemantics::Float8E5M2, std::uint32_t{8}},
- std::pair{rcc::FloatSemantics::Float8E5M2FNUZ, std::uint32_t{8}},
- std::pair{rcc::FloatSemantics::Float8E4M3, std::uint32_t{8}},
- std::pair{rcc::FloatSemantics::Float8E4M3FN, std::uint32_t{8}},
- std::pair{rcc::FloatSemantics::Float8E4M3FNUZ, std::uint32_t{8}},
- std::pair{rcc::FloatSemantics::Float8E4M3B11FNUZ, std::uint32_t{8}},
- std::pair{rcc::FloatSemantics::Float8E3M4, std::uint32_t{8}},
- std::pair{rcc::FloatSemantics::FloatTF32, std::uint32_t{19}},
- std::pair{rcc::FloatSemantics::Float8E8M0FNU, std::uint32_t{8}},
- std::pair{rcc::FloatSemantics::Float6E3M2FN, std::uint32_t{6}},
- std::pair{rcc::FloatSemantics::Float6E2M3FN, std::uint32_t{6}},
- std::pair{rcc::FloatSemantics::Float4E2M1FN, std::uint32_t{4}},
- std::pair{rcc::FloatSemantics::X87DoubleExtended, std::uint32_t{80}},
- };
-
- std::unordered_set<rcc::LLT> FloatTypes;
- for (const auto &[Semantics, BitWidth] : FloatCases) {
- auto Type = rcc::LLT::makeFloat(Semantics);
- Context.expect(Type.has_value(), "known floating-point semantics must be accepted");
- if (!Type)
- continue;
- Context.expect(Type->scalarBitWidth() == BitWidth,
- "float LLT must preserve its semantics bit width");
- Context.expect(Type->floatSemantics() == Semantics,
- "float LLT must preserve exact floating-point semantics");
- FloatTypes.insert(*Type);
- }
- Context.expect(FloatTypes.size() == FloatCases.size(),
- "distinct floating-point semantics must produce distinct LLTs");
- Context.expect(!rcc::LLT::makeFloat(rcc::FloatSemantics::Count),
- "unknown floating-point semantics must be rejected");
+ Context.expect(!rcc::LowLevelType::makeCategoryNeutralScalar(0),
+ "zero-width scalar LowLevelType must be rejected");
+ Context.expect(!rcc::LowLevelType::makeCategoryNeutralScalar(std::uint64_t{1} << 16),
+ "scalar LowLevelType wider than the encoding must be rejected");
- auto Pointer = rcc::LLT::makePointer(rcc::LLT::MaxAddressSpace, 64);
+ auto Pointer = rcc::LowLevelType::makePointer(rcc::LowLevelType::MaxAddressSpace, 64);
Context.expect(Pointer.has_value(), "maximum encodable pointer address space must be accepted");
if (Pointer) {
- Context.expect(Pointer->isPointer(), "pointer LLT must preserve its kind");
- Context.expect(Pointer->addressSpace() == rcc::LLT::MaxAddressSpace,
- "pointer LLT must preserve its address space");
+ Context.expect(Pointer->isPointer(), "pointer LowLevelType must preserve its kind");
+ Context.expect(Pointer->addressSpace() == rcc::LowLevelType::MaxAddressSpace,
+ "pointer LowLevelType must preserve its address space");
Context.expect(Pointer->toString() == "p16777215:64",
- "pointer LLT spelling must preserve address space and width");
+ "pointer LowLevelType spelling must preserve address space and width");
}
- Context.expect(!rcc::LLT::makePointer(std::uint64_t{1} << 24, 64),
+ Context.expect(!rcc::LowLevelType::makePointer(std::uint64_t{1} << 24, 64),
"pointer address spaces wider than the encoding must be rejected");
- auto I33 = rcc::LLT::makeInteger(33);
+ auto I33 = rcc::LowLevelType::makeCategoryNeutralScalar(33);
if (!I33) {
Context.expect(false, "i33 construction must succeed before vector tests");
return;
}
- auto FixedVector = rcc::LLT::makeFixedVector(4, *I33);
- Context.expect(FixedVector.has_value(), "fixed integer vector LLT must be accepted");
+ auto FixedVector = rcc::LowLevelType::makeFixedVector(4, *I33);
+ Context.expect(FixedVector.has_value(), "fixed integer vector LowLevelType must be accepted");
if (FixedVector) {
- Context.expect(FixedVector->isVector(), "fixed vector LLT must preserve vector kind");
+ Context.expect(FixedVector->isVector(), "fixed vector LowLevelType must preserve vector kind");
Context.expect(!FixedVector->isScalableVector(),
- "fixed vector LLT must not be marked scalable");
+ "fixed vector LowLevelType must not be marked scalable");
Context.expect(FixedVector->minimumElementCount() == 4,
- "fixed vector LLT must preserve element count");
+ "fixed vector LowLevelType must preserve element count");
Context.expect(FixedVector->scalarElementType() == I33,
- "fixed vector LLT must preserve its scalar element type");
- Context.expect(FixedVector->toString() == "<4 x i33>",
- "fixed vector LLT spelling must be stable");
+ "fixed vector LowLevelType must preserve its scalar element type");
+ Context.expect(FixedVector->toString() == "<4 x s33>",
+ "fixed vector LowLevelType spelling must be stable");
}
- auto BFloat = rcc::LLT::makeFloat(rcc::FloatSemantics::BFloat);
- if (!BFloat) {
- Context.expect(false, "bfloat construction must succeed before vector tests");
+ auto S16 = rcc::LowLevelType::makeCategoryNeutralScalar(16);
+ if (!S16) {
+ Context.expect(false, "s16 construction must succeed before vector tests");
return;
}
- auto ScalableVector = rcc::LLT::makeScalableVector(1, *BFloat);
+ auto ScalableVector = rcc::LowLevelType::makeScalableVector(1, *S16);
Context.expect(ScalableVector.has_value(), "scalable vector with one minimum lane must work");
if (ScalableVector) {
Context.expect(ScalableVector->isScalableVector(),
- "scalable vector LLT must preserve scalability");
- Context.expect(ScalableVector->isFloatVector() && !ScalableVector->isFloat(),
- "float vectors must not be classified as scalar floats");
- Context.expect(ScalableVector->floatSemantics() == rcc::FloatSemantics::BFloat,
- "float vectors must preserve exact floating-point semantics");
- Context.expect(ScalableVector->toString() == "<vscale x 1 x bf16>",
- "scalable float vector spelling must preserve exact semantics");
+ "scalable vector LowLevelType must preserve scalability");
+ Context.expect(ScalableVector->isVectorValue(),
+ "category-neutral vectors must preserve their value kind");
+ Context.expect(ScalableVector->scalarElementType() == S16,
+ "scalable vectors must preserve their element type");
+ Context.expect(ScalableVector->toString() == "<vscale x 1 x s16>",
+ "scalable vector spelling must preserve its shape");
}
- Context.expect(!rcc::LLT::makeFixedVector(1, *I33), "single-lane fixed vectors must be rejected");
- Context.expect(!rcc::LLT::makeScalableVector(0, *I33),
+ Context.expect(!rcc::LowLevelType::makeFixedVector(1, *I33),
+ "single-lane fixed vectors must be rejected");
+ Context.expect(!rcc::LowLevelType::makeScalableVector(0, *I33),
"zero-lane scalable vectors must be rejected");
- Context.expect(!rcc::LLT::makeFixedVector(4, Token), "token vector elements must be rejected");
+ Context.expect(!rcc::LowLevelType::makeFixedVector(4, Token),
+ "token vector elements must be rejected");
if (FixedVector) {
- Context.expect(!rcc::LLT::makeFixedVector(4, *FixedVector),
- "nested LLT vectors must be rejected");
+ Context.expect(!rcc::LowLevelType::makeFixedVector(4, *FixedVector),
+ "nested LowLevelType vectors must be rejected");
}
}
diff --git a/backend/unittests/CodeGen/GenericOpcodesTest.cpp b/backend/unittests/CodeGen/GenericOpcodesTest.cpp
index 73c1c36..f946c90 100644
--- a/backend/unittests/CodeGen/GenericOpcodesTest.cpp
+++ b/backend/unittests/CodeGen/GenericOpcodesTest.cpp
@@ -53,7 +53,8 @@ private:
return std::move(*Operand);
}
-[[nodiscard]] rcc::Register createVirtualRegister(rcc::MachineFunction &Function, rcc::LLT Type) {
+[[nodiscard]] rcc::Register createVirtualRegister(rcc::MachineFunction &Function,
+ rcc::LowLevelType Type) {
auto Reg = Function.registerInfo().createVirtualRegister(Type);
if (!Reg)
std::terminate();
@@ -284,16 +285,19 @@ void testShapesAndTypes(TestContext &Context) {
if (!Set || !Function)
return;
- auto I32 = rcc::LLT::makeInteger(32);
- auto I64 = rcc::LLT::makeInteger(64);
- auto I1 = rcc::LLT::makeInteger(1);
- auto S16 = rcc::LLT::makeAnyScalar(16);
- auto F32 = rcc::LLT::makeFloat(rcc::FloatSemantics::IEEESingle);
- auto F64 = rcc::LLT::makeFloat(rcc::FloatSemantics::IEEEDouble);
- auto P64 = rcc::LLT::makePointer(0, 64);
- auto V2I32 = I32 ? rcc::LLT::makeFixedVector(2, *I32) : rcc::Expected<rcc::LLT>{};
- auto V4I32 = I32 ? rcc::LLT::makeFixedVector(4, *I32) : rcc::Expected<rcc::LLT>{};
- auto V2P64 = P64 ? rcc::LLT::makeFixedVector(2, *P64) : rcc::Expected<rcc::LLT>{};
+ auto I32 = rcc::LowLevelType::makeCategoryNeutralScalar(32);
+ auto I64 = rcc::LowLevelType::makeCategoryNeutralScalar(64);
+ auto I1 = rcc::LowLevelType::makeCategoryNeutralScalar(1);
+ auto S16 = rcc::LowLevelType::makeCategoryNeutralScalar(16);
+ auto F32 = rcc::LowLevelType::makeCategoryNeutralScalar(32);
+ auto F64 = rcc::LowLevelType::makeCategoryNeutralScalar(64);
+ auto P64 = rcc::LowLevelType::makePointer(0, 64);
+ auto V2I32 =
+ I32 ? rcc::LowLevelType::makeFixedVector(2, *I32) : rcc::Expected<rcc::LowLevelType>{};
+ auto V4I32 =
+ I32 ? rcc::LowLevelType::makeFixedVector(4, *I32) : rcc::Expected<rcc::LowLevelType>{};
+ auto V2P64 =
+ P64 ? rcc::LowLevelType::makeFixedVector(2, *P64) : rcc::Expected<rcc::LowLevelType>{};
if (!I1 || !I32 || !I64 || !S16 || !F32 || !F64 || !P64 || !V2I32 || !V4I32 || !V2P64)
std::terminate();
auto Dst32 = (*Function)->registerInfo().createVirtualRegister(*I32);
@@ -324,7 +328,7 @@ void testShapesAndTypes(TestContext &Context) {
AddOperands.back() = registerOperand(*Wide, false);
Context.expect(!Set->validateExplicitOperands(rcc::opcode(rcc::GenericOpcode::G_ADD), AddOperands,
(*Function)->registerInfo()),
- "G_ADD must reject a source from a different LLT equality group");
+ "G_ADD must reject a source from a different LowLevelType equality group");
auto ZeroImmediate = rcc::APInt::fromUnsigned(64, 0);
std::vector<rcc::MachineOperand> PointerConstant;
@@ -483,10 +487,6 @@ void testShapesAndTypes(TestContext &Context) {
FloatingLoad, (*Function)->registerInfo())
.has_value(),
"G_FPEXTLOAD must accept a scalar floating result and pointer address");
- FloatingLoad[0] = registerOperand(*Wide, true);
- Context.expect(!Set->validateExplicitOperands(rcc::opcode(rcc::GenericOpcode::G_FPEXTLOAD),
- FloatingLoad, (*Function)->registerInfo()),
- "G_FPEXTLOAD must reject an integer result");
const std::array<std::uint64_t, 1> FloatWords{0};
auto FloatBits = rcc::APFloat::create(rcc::FloatSemantics::IEEESingle, FloatWords);
@@ -513,7 +513,7 @@ void testShapesAndTypes(TestContext &Context) {
Context.expect(Set->validateExplicitOperands(rcc::opcode(rcc::GenericOpcode::G_FCONSTANT),
FConstantOperands, (*Function)->registerInfo())
.has_value(),
- "G_FCONSTANT must accept a bit-width-compatible LLVM scalar LLT");
+ "G_FCONSTANT must accept a bit-width-compatible LLVM scalar LowLevelType");
}
void testInstructionMemorySemantics(TestContext &Context) {
@@ -524,12 +524,12 @@ void testInstructionMemorySemantics(TestContext &Context) {
if (!Set || !Function)
return;
- const rcc::LLT I1 = *rcc::LLT::makeInteger(1);
- const rcc::LLT I32 = *rcc::LLT::makeInteger(32);
- const rcc::LLT I64 = *rcc::LLT::makeInteger(64);
- const rcc::LLT F64 = *rcc::LLT::makeFloat(rcc::FloatSemantics::IEEEDouble);
- const rcc::LLT P0 = *rcc::LLT::makePointer(0, 64);
- const rcc::LLT P1 = *rcc::LLT::makePointer(1, 64);
+ const rcc::LowLevelType I1 = *rcc::LowLevelType::makeCategoryNeutralScalar(1);
+ const rcc::LowLevelType I32 = *rcc::LowLevelType::makeCategoryNeutralScalar(32);
+ const rcc::LowLevelType I64 = *rcc::LowLevelType::makeCategoryNeutralScalar(64);
+ const rcc::LowLevelType F64 = *rcc::LowLevelType::makeCategoryNeutralScalar(64);
+ const rcc::LowLevelType P0 = *rcc::LowLevelType::makePointer(0, 64);
+ const rcc::LowLevelType P1 = *rcc::LowLevelType::makePointer(1, 64);
const rcc::Register Dst32 = createVirtualRegister(**Function, I32);
const rcc::Register Dst64 = createVirtualRegister(**Function, I64);
const rcc::Register Src32 = createVirtualRegister(**Function, I32);
@@ -555,7 +555,7 @@ void testInstructionMemorySemantics(TestContext &Context) {
createInstruction(**Function, rcc::GenericOpcode::G_LOAD, std::move(OversizedLoadOperands));
addMemOperand(**Function, OversizedLoad, memoryDescription({rcc::MemoryAccessFlag::Load}, 8));
Context.expect(!Set->validateInstruction(OversizedLoad, (*Function)->registerInfo()),
- "G_LOAD must reject an MMO larger than its result LLT");
+ "G_LOAD must reject an MMO larger than its result LowLevelType");
std::vector<rcc::MachineOperand> WrongAddressSpaceOperands;
WrongAddressSpaceOperands.push_back(registerOperand(Dst64, true));
@@ -648,18 +648,6 @@ void testInstructionMemorySemantics(TestContext &Context) {
Context.expect(Set->validateInstruction(FloatingAtomic, (*Function)->registerInfo()).has_value(),
"floating atomic RMW must accept a scalar floating value and RMW MMO");
- std::vector<rcc::MachineOperand> WrongFloatingAtomicOperands;
- WrongFloatingAtomicOperands.push_back(registerOperand(Dst64, true));
- WrongFloatingAtomicOperands.push_back(registerOperand(Address0, false));
- WrongFloatingAtomicOperands.push_back(registerOperand(Src64, false));
- rcc::MachineInstr &WrongFloatingAtomic = createInstruction(
- **Function, rcc::GenericOpcode::G_ATOMICRMW_FADD, std::move(WrongFloatingAtomicOperands));
- addMemOperand(**Function, WrongFloatingAtomic,
- memoryDescription({rcc::MemoryAccessFlag::Load, rcc::MemoryAccessFlag::Store}, 8, 0,
- rcc::AtomicOperation::ReadModifyWrite));
- Context.expect(!Set->validateInstruction(WrongFloatingAtomic, (*Function)->registerInfo()),
- "floating atomic RMW must reject integer value registers");
-
std::vector<rcc::MachineOperand> PrefetchOperands;
PrefetchOperands.push_back(registerOperand(Address0, false));
PrefetchOperands.push_back(rcc::MachineOperand::immediate(0));
diff --git a/backend/unittests/CodeGen/GlobalISel/GISelMITest.h b/backend/unittests/CodeGen/GlobalISel/GISelMITest.h
index 5b16535..20e8854 100644
--- a/backend/unittests/CodeGen/GlobalISel/GISelMITest.h
+++ b/backend/unittests/CodeGen/GlobalISel/GISelMITest.h
@@ -58,8 +58,8 @@ struct FunctionFixture final {
[[nodiscard]] inline rcc::Register
createRegister(TestContext &Context, rcc::MachineFunction &Function, std::uint32_t Bits) {
- auto Type = rcc::LLT::makeInteger(Bits);
- Context.expect(Type.has_value(), "integer LLT construction must succeed");
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(Bits);
+ Context.expect(Type.has_value(), "integer LowLevelType construction must succeed");
if (!Type)
return {};
auto Reg = Function.registerInfo().createVirtualRegister(*Type);
@@ -69,8 +69,8 @@ createRegister(TestContext &Context, rcc::MachineFunction &Function, std::uint32
[[nodiscard]] inline rcc::Register createFloatRegister(TestContext &Context,
rcc::MachineFunction &Function) {
- auto Type = rcc::LLT::makeFloat(rcc::FloatSemantics::IEEEDouble);
- Context.expect(Type.has_value(), "floating LLT construction must succeed");
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
+ Context.expect(Type.has_value(), "floating LowLevelType construction must succeed");
if (!Type)
return {};
auto Reg = Function.registerInfo().createVirtualRegister(*Type);
diff --git a/backend/unittests/CodeGen/GlobalISel/InstructionSelectTest.cpp b/backend/unittests/CodeGen/GlobalISel/InstructionSelectTest.cpp
index 30c2b89..6d9fa3c 100644
--- a/backend/unittests/CodeGen/GlobalISel/InstructionSelectTest.cpp
+++ b/backend/unittests/CodeGen/GlobalISel/InstructionSelectTest.cpp
@@ -252,9 +252,9 @@ void testExtendedRV64GCPipeline(TestContext &Context) {
"extended pipeline fixture must be complete");
if (!Target || !Fixture.Function || Fixture.Entry == nullptr)
return;
- auto I1 = rcc::LLT::makeInteger(1);
- auto I64 = rcc::LLT::makeInteger(64);
- auto Pointer = rcc::LLT::makePointer(0, 64);
+ auto I1 = rcc::LowLevelType::makeCategoryNeutralScalar(1);
+ auto I64 = rcc::LowLevelType::makeCategoryNeutralScalar(64);
+ auto Pointer = rcc::LowLevelType::makePointer(0, 64);
if (!I1 || !I64 || !Pointer)
return;
const rcc::Register Left = createRegister(Context, *Fixture.Function, 64);
diff --git a/backend/unittests/CodeGen/InstructionDescriptorTest.cpp b/backend/unittests/CodeGen/InstructionDescriptorTest.cpp
index 687e723..d263725 100644
--- a/backend/unittests/CodeGen/InstructionDescriptorTest.cpp
+++ b/backend/unittests/CodeGen/InstructionDescriptorTest.cpp
@@ -197,7 +197,7 @@ void testOperandValidation(TestContext &Context) {
if (!Function)
return;
- auto I64 = rcc::LLT::makeInteger(64);
+ auto I64 = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Destination = (*Function)->registerInfo().createVirtualRegister(*I64);
auto Source = (*Function)->registerInfo().createVirtualRegister(*I64);
Context.expect(Destination && Source, "descriptor test virtual registers must be allocated");
@@ -261,7 +261,7 @@ void testInstructionValidation(TestContext &Context) {
if (!InstructionSet || !Function)
return;
- auto I64 = rcc::LLT::makeInteger(64);
+ auto I64 = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Reg = (*Function)->registerInfo().createVirtualRegister(*I64);
Context.expect(Reg.has_value(), "instruction validation register must be allocated");
if (!Reg)
diff --git a/backend/unittests/CodeGen/LiveTestSupport.h b/backend/unittests/CodeGen/LiveTestSupport.h
index 071e572..f6a3566 100644
--- a/backend/unittests/CodeGen/LiveTestSupport.h
+++ b/backend/unittests/CodeGen/LiveTestSupport.h
@@ -152,7 +152,7 @@ createFunction(std::string Name, std::uint64_t ID, std::size_t BlockCount) {
}
[[nodiscard]] inline rcc::Expected<rcc::Register> createVReg(rcc::MachineFunction &Function) {
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
if (!Type)
return std::unexpected(Type.error());
auto Reg = Function.registerInfo().createVirtualRegister(*Type);
diff --git a/backend/unittests/CodeGen/MachineAnalysesTest.cpp b/backend/unittests/CodeGen/MachineAnalysesTest.cpp
index 997d031..53cd847 100644
--- a/backend/unittests/CodeGen/MachineAnalysesTest.cpp
+++ b/backend/unittests/CodeGen/MachineAnalysesTest.cpp
@@ -228,8 +228,8 @@ void testMemoryDependence(TestContext &Context, const rcc::TargetDescription &Ta
}
auto Block = appendBlock(**Function);
auto OtherBlock = appendBlock(**Function);
- auto I64 = rcc::LLT::makeInteger(64);
- auto Pointer = rcc::LLT::makePointer(0, 64);
+ auto I64 = rcc::LowLevelType::makeCategoryNeutralScalar(64);
+ auto Pointer = rcc::LowLevelType::makePointer(0, 64);
auto Value = I64 ? (*Function)->registerInfo().createVirtualRegister(*I64)
: rcc::Expected<rcc::Register>{std::unexpected(I64.error())};
auto Address = Pointer ? (*Function)->registerInfo().createVirtualRegister(*Pointer)
@@ -397,7 +397,7 @@ void testCFGUpdaterPHIs(TestContext &Context, const rcc::TargetDescription &Targ
return;
}
- auto I64 = rcc::LLT::makeInteger(64);
+ auto I64 = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Destination = I64 ? (*Function)->registerInfo().createVirtualRegister(*I64)
: rcc::Expected<rcc::Register>{std::unexpected(I64.error())};
auto SourceValue = I64 ? (*Function)->registerInfo().createVirtualRegister(*I64)
@@ -475,7 +475,7 @@ void testCFGUpdaterFailureAtomicity(TestContext &Context, const rcc::TargetDescr
if (!SplitUpdater.addSuccessor(**Source, **Merge, rcc::BranchProbability::one()))
return;
- auto I64 = rcc::LLT::makeInteger(64);
+ auto I64 = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Destination = I64 ? (*SplitFunction)->registerInfo().createVirtualRegister(*I64)
: rcc::Expected<rcc::Register>{std::unexpected(I64.error())};
auto Value = I64 ? (*SplitFunction)->registerInfo().createVirtualRegister(*I64)
diff --git a/backend/unittests/CodeGen/MachineFunctionClonerTest.cpp b/backend/unittests/CodeGen/MachineFunctionClonerTest.cpp
index e5acc04..82bcce1 100644
--- a/backend/unittests/CodeGen/MachineFunctionClonerTest.cpp
+++ b/backend/unittests/CodeGen/MachineFunctionClonerTest.cpp
@@ -305,7 +305,7 @@ struct SourceFixture final {
auto HistoricalInstruction = Function.createInstruction(rcc::Opcode::fromValue(NopOpcode));
Context.expect(HistoricalBlock && HistoricalInstruction, "source arena history must be created");
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Tombstone = Function.registerInfo().createVirtualRegister(*Type);
Context.expect(Tombstone && Function.registerInfo().eraseVirtualRegister(*Tombstone).has_value(),
"source vreg history must contain a tombstone");
diff --git a/backend/unittests/CodeGen/MachineIRBuilderTest.cpp b/backend/unittests/CodeGen/MachineIRBuilderTest.cpp
index 44a0e32..17e9874 100644
--- a/backend/unittests/CodeGen/MachineIRBuilderTest.cpp
+++ b/backend/unittests/CodeGen/MachineIRBuilderTest.cpp
@@ -186,7 +186,7 @@ void testTransactionalBuild(TestContext &Context) {
if (Block == nullptr)
return;
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Destination = Function->registerInfo().createVirtualRegister(*Type);
auto Source = Function->registerInfo().createVirtualRegister(*Type);
Context.expect(Destination && Source, "builder virtual registers must be allocated");
@@ -331,7 +331,7 @@ void testImplicitAndMemoryValidation(TestContext &Context) {
if (Block == nullptr || OtherBlock == nullptr)
return;
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Destination = Function->registerInfo().createVirtualRegister(*Type);
auto Source = Function->registerInfo().createVirtualRegister(*Type);
Context.expect(Destination && Source, "implicit test virtual registers must be allocated");
@@ -497,7 +497,7 @@ void testStaleCursorsAndOwnedOperands(TestContext &Context) {
if (Block == nullptr)
return;
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Destination = Function->registerInfo().createVirtualRegister(*Type);
auto Source = Function->registerInfo().createVirtualRegister(*Type);
if (!Destination || !Source)
diff --git a/backend/unittests/CodeGen/MachineIRCoreTest.cpp b/backend/unittests/CodeGen/MachineIRCoreTest.cpp
index 6365e59..875eeb8 100644
--- a/backend/unittests/CodeGen/MachineIRCoreTest.cpp
+++ b/backend/unittests/CodeGen/MachineIRCoreTest.cpp
@@ -116,7 +116,8 @@ void testOperandKinds(TestContext &Context) {
Context.expect(!rcc::APFloat::create(rcc::FloatSemantics::IEEEHalf, TooManyHalfWords),
"floating immediate word-count mismatch must be rejected");
- auto Virtual = Function->registerInfo().createVirtualRegister(*rcc::LLT::makeInteger(32));
+ auto Virtual = Function->registerInfo().createVirtualRegister(
+ *rcc::LowLevelType::makeCategoryNeutralScalar(32));
Context.expect(Virtual.has_value(), "operand test virtual register must be created");
if (!Virtual)
return;
@@ -205,7 +206,7 @@ void testRegisterInfoAndOperandMovement(TestContext &Context) {
if (Block == nullptr)
return;
- auto I32 = rcc::LLT::makeInteger(32);
+ auto I32 = rcc::LowLevelType::makeCategoryNeutralScalar(32);
Context.expect(I32.has_value(), "i32 construction for MRI test must succeed");
if (!I32)
return;
@@ -317,7 +318,7 @@ void testRegisterInfoAndOperandMovement(TestContext &Context) {
Context.expect(V0Info && V0Info->get().Type == I32 &&
V0Info->get().Bank == rcc::RegisterBankID::fromValue(3) &&
V0Info->get().RegClass == rcc::RegisterClassID::fromValue(4),
- "MRI virtual register properties must evolve without losing LLT");
+ "MRI virtual register properties must evolve without losing LowLevelType");
Context.expect(MRI.addLiveIn(*PhysReg, *V0).has_value(),
"MRI must record function physical live-ins");
diff --git a/backend/unittests/CodeGen/MachineOptimizationTest.cpp b/backend/unittests/CodeGen/MachineOptimizationTest.cpp
index bb2c0e1..cffd4e1 100644
--- a/backend/unittests/CodeGen/MachineOptimizationTest.cpp
+++ b/backend/unittests/CodeGen/MachineOptimizationTest.cpp
@@ -169,10 +169,10 @@ void setPostRAProperties(rcc::MachineFunction &Function) {
}
[[nodiscard]] rcc::Register makeGPR(TestContext &Context, rcc::MachineFunction &Function) {
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Reg = Type ? Function.registerInfo().createVirtualRegister(*Type)
- : rcc::Expected<rcc::Register>(std::unexpected(
- rcc::Error(rcc::ErrorCode::InternalError, "test LLT creation failed")));
+ : rcc::Expected<rcc::Register>(std::unexpected(rcc::Error(
+ rcc::ErrorCode::InternalError, "test LowLevelType creation failed")));
Context.expect(Reg.has_value(), "optimization virtual register creation must succeed");
if (!Reg)
return {};
diff --git a/backend/unittests/CodeGen/MachineSchedulingTest.cpp b/backend/unittests/CodeGen/MachineSchedulingTest.cpp
index 5162fb8..a3d1de9 100644
--- a/backend/unittests/CodeGen/MachineSchedulingTest.cpp
+++ b/backend/unittests/CodeGen/MachineSchedulingTest.cpp
@@ -178,10 +178,10 @@ makeSchedulingModel(const rcc::TargetSchedulingHooks *Hooks = nullptr) {
}
[[nodiscard]] rcc::Register makeGPR(TestContext &Context, rcc::MachineFunction &Function) {
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Reg = Type ? Function.registerInfo().createVirtualRegister(*Type)
- : rcc::Expected<rcc::Register>(std::unexpected(
- rcc::Error(rcc::ErrorCode::InternalError, "test LLT creation failed")));
+ : rcc::Expected<rcc::Register>(std::unexpected(rcc::Error(
+ rcc::ErrorCode::InternalError, "test LowLevelType creation failed")));
Context.expect(Reg.has_value(), "scheduler virtual register creation must succeed");
if (!Reg)
return {};
diff --git a/backend/unittests/CodeGen/MachineValueTypesTest.cpp b/backend/unittests/CodeGen/MachineValueTypesTest.cpp
index 819d6cb..315d56e 100644
--- a/backend/unittests/CodeGen/MachineValueTypesTest.cpp
+++ b/backend/unittests/CodeGen/MachineValueTypesTest.cpp
@@ -184,9 +184,9 @@ void testMachineMemOperand(TestContext &Context) {
"failure ordering stronger than success must be rejected");
auto BadAddressSpace = makeBasicLoadDescription();
- BadAddressSpace.AddressSpace = rcc::LLT::MaxAddressSpace + 1;
+ BadAddressSpace.AddressSpace = rcc::LowLevelType::MaxAddressSpace + 1;
Context.expect(!rcc::MachineMemOperand::create(BadAddressSpace),
- "MMO address space wider than LLT encoding must be rejected");
+ "MMO address space wider than LowLevelType encoding must be rejected");
auto EmptySymbol = makeBasicLoadDescription();
EmptySymbol.Base = rcc::MemoryBase::externalSymbol("");
diff --git a/backend/unittests/CodeGen/MachineVerifierTargetTest.cpp b/backend/unittests/CodeGen/MachineVerifierTargetTest.cpp
index 3eb926d..3cc2b56 100644
--- a/backend/unittests/CodeGen/MachineVerifierTargetTest.cpp
+++ b/backend/unittests/CodeGen/MachineVerifierTargetTest.cpp
@@ -186,7 +186,7 @@ void testValidTargetFacts(TestContext &Context, const rcc::TargetDescription &Ta
if (!Fixture.Function)
return;
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Reg = Fixture.Function->registerInfo().createVirtualRegister(*Type);
if (!Reg)
return;
@@ -233,7 +233,7 @@ void testSubRegisterProjection(TestContext &Context, const rcc::TargetDescriptio
if (!Fixture.Function)
return;
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Reg = Fixture.Function->registerInfo().createVirtualRegister(*Type);
if (!Reg)
return;
@@ -282,7 +282,7 @@ void testUnknownAndMalformedTargetFacts(TestContext &Context,
}
{
auto Fixture = createFunction(Context, "unknown_bank", 5);
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
if (!Fixture.Function || !Type)
return;
auto Reg = Fixture.Function->registerInfo().createVirtualRegister(*Type);
@@ -295,7 +295,7 @@ void testUnknownAndMalformedTargetFacts(TestContext &Context,
}
{
auto Fixture = createFunction(Context, "wide_bank_value", 6);
- auto Type = rcc::LLT::makeInteger(128);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(128);
if (!Fixture.Function || !Type)
return;
auto Reg = Fixture.Function->registerInfo().createVirtualRegister(*Type);
@@ -325,7 +325,7 @@ void testUnknownAndMalformedTargetFacts(TestContext &Context,
}
{
auto Fixture = createFunction(Context, "bad_allocation_hint", 9);
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Reg = Fixture.Function->registerInfo().createVirtualRegister(*Type);
Context.expect(Reg &&
classify(Fixture.Function->registerInfo(), *Reg,
@@ -340,7 +340,7 @@ void testUnknownAndMalformedTargetFacts(TestContext &Context,
}
{
auto Fixture = createFunction(Context, "reserved_allocation_hint", 14);
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Reg = Fixture.Function->registerInfo().createVirtualRegister(*Type);
const auto G0 = phys(rcc::test::TestRegister::G0);
Context.expect(Reg &&
@@ -355,7 +355,7 @@ void testUnknownAndMalformedTargetFacts(TestContext &Context,
}
{
auto Fixture = createFunction(Context, "incompatible_function_livein", 15);
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Reg = Fixture.Function->registerInfo().createVirtualRegister(*Type);
Context.expect(
Reg &&
@@ -416,7 +416,7 @@ void testRegMaskEarlyClobberAndTies(TestContext &Context, const rcc::TargetDescr
}
{
auto Fixture = createFunction(Context, "incompatible_tie", 12);
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto GPR = Fixture.Function->registerInfo().createVirtualRegister(*Type);
auto FPR = Fixture.Function->registerInfo().createVirtualRegister(*Type);
if (!GPR || !FPR)
diff --git a/backend/unittests/CodeGen/MachineVerifierTest.cpp b/backend/unittests/CodeGen/MachineVerifierTest.cpp
index c8c512f..5327148 100644
--- a/backend/unittests/CodeGen/MachineVerifierTest.cpp
+++ b/backend/unittests/CodeGen/MachineVerifierTest.cpp
@@ -196,7 +196,7 @@ buildNoOperand(TestContext &Context, rcc::MachineIRBuilder &Builder, std::uint32
if (Entry == nullptr || Exit == nullptr)
return false;
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Value = Function.registerInfo().createVirtualRegister(*Type);
Context.expect(Value.has_value(), "typed verifier virtual register must be allocated");
if (!Value)
@@ -338,7 +338,7 @@ createPhiTestFunction(TestContext &Context, const rcc::TargetDescription &Target
return nullptr;
}
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto Destination = Type ? Function->registerInfo().createVirtualRegister(*Type)
: rcc::Expected<rcc::Register>{std::unexpected(Type.error())};
auto LeftValue = Type ? Function->registerInfo().createVirtualRegister(*Type)
@@ -411,7 +411,7 @@ void testPropertyFailures(TestContext &Context) {
auto Target = createTarget();
if (!Target)
return;
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
auto SSA = createFunction(Context, "ssa", 6);
rcc::MachineBasicBlock *SSABlock = SSA ? createBlock(Context, *SSA) : nullptr;
@@ -503,7 +503,7 @@ void testPropertyFailures(TestContext &Context) {
void testSelectedStateAndPseudoDeadline(TestContext &Context) {
auto Target = createTarget();
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
if (!Target)
return;
diff --git a/backend/unittests/CodeGen/PHIEliminationTest.cpp b/backend/unittests/CodeGen/PHIEliminationTest.cpp
index 9bc9a57..bbc834f 100644
--- a/backend/unittests/CodeGen/PHIEliminationTest.cpp
+++ b/backend/unittests/CodeGen/PHIEliminationTest.cpp
@@ -90,7 +90,7 @@ void testParallelPHIsAndPlacement(TestContext &Context, const rcc::TargetDescrip
auto Fixture = createFunction(Context, "parallel_phis", 1, 3);
if (!Fixture.Function || Fixture.Blocks.size() != 3)
return;
- auto I64 = rcc::LLT::makeInteger(64);
+ auto I64 = rcc::LowLevelType::makeCategoryNeutralScalar(64);
if (!I64)
return;
auto &Function = *Fixture.Function;
@@ -209,7 +209,7 @@ void testParallelPHIsAndPlacement(TestContext &Context, const rcc::TargetDescrip
Context.expect(FreshInfo.has_value(), "fresh PHI vreg must remain registered");
if (!FreshInfo)
return;
- Context.expect(FreshInfo->get().Type == I64, "fresh PHI vreg must clone its LLT");
+ Context.expect(FreshInfo->get().Type == I64, "fresh PHI vreg must clone its LowLevelType");
Context.expect(FreshInfo->get().Bank == rcc::test::TestRegisterBank::GPR,
"fresh PHI vreg must clone its register bank");
Context.expect(FreshInfo->get().RegClass == rcc::test::TestRegisterClass::GPR64,
@@ -241,7 +241,7 @@ void testCriticalEdgeAndPhysicalLiveIn(TestContext &Context, const rcc::TargetDe
auto Fixture = createFunction(Context, "critical_edge", 2, 4);
if (!Fixture.Function || Fixture.Blocks.size() != 4)
return;
- auto I64 = rcc::LLT::makeInteger(64);
+ auto I64 = rcc::LowLevelType::makeCategoryNeutralScalar(64);
if (!I64)
return;
auto &Function = *Fixture.Function;
@@ -343,7 +343,7 @@ void testUndefAndFailureAtomicity(TestContext &Context, const rcc::TargetDescrip
auto Fixture = createFunction(Context, "undef_phi", ID, 2);
if (!Fixture.Function || Fixture.Blocks.size() != 2)
return Fixture;
- auto I64 = rcc::LLT::makeInteger(64);
+ auto I64 = rcc::LowLevelType::makeCategoryNeutralScalar(64);
if (!I64)
return Fixture;
auto Source = createVReg(*Fixture.Function, *I64, rcc::test::TestRegisterBank::GPR,
@@ -406,9 +406,9 @@ void testUndefAndFailureAtomicity(TestContext &Context, const rcc::TargetDescrip
}
void testMalformedPHIs(TestContext &Context, const rcc::TargetDescription &Target) {
- auto BuildBadPhi = [&](std::uint64_t ID, rcc::LLT DestinationType,
+ auto BuildBadPhi = [&](std::uint64_t ID, rcc::LowLevelType DestinationType,
rcc::RegisterBankID DestinationBank, rcc::RegisterClassID DestinationClass,
- rcc::LLT SourceType, rcc::RegisterBankID SourceBank,
+ rcc::LowLevelType SourceType, rcc::RegisterBankID SourceBank,
rcc::RegisterClassID SourceClass, rcc::SubRegIndex SourceSubReg = {}) {
auto Fixture = createFunction(Context, "bad_phi", ID, 2);
if (!Fixture.Function || Fixture.Blocks.size() != 2)
@@ -438,8 +438,8 @@ void testMalformedPHIs(TestContext &Context, const rcc::TargetDescription &Targe
return Fixture;
};
- auto I64 = rcc::LLT::makeInteger(64);
- auto I32 = rcc::LLT::makeInteger(32);
+ auto I64 = rcc::LowLevelType::makeCategoryNeutralScalar(64);
+ auto I32 = rcc::LowLevelType::makeCategoryNeutralScalar(32);
if (!I64 || !I32)
return;
auto BadType =
diff --git a/backend/unittests/CodeGen/RegisterAllocationTest.cpp b/backend/unittests/CodeGen/RegisterAllocationTest.cpp
index 7dd0dd0..443d00a 100644
--- a/backend/unittests/CodeGen/RegisterAllocationTest.cpp
+++ b/backend/unittests/CodeGen/RegisterAllocationTest.cpp
@@ -352,7 +352,7 @@ struct FunctionFixture final {
[[nodiscard]] rcc::Expected<rcc::Register>
createVReg(rcc::MachineFunction &Function,
rcc::RegisterClassID Class = rcc::test::TestRegisterClass::GPR64) {
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
if (!Type)
return std::unexpected(Type.error());
auto Reg = Function.registerInfo().createVirtualRegister(*Type);
diff --git a/backend/unittests/CodeGen/RegisterAllocationTestSupport.h b/backend/unittests/CodeGen/RegisterAllocationTestSupport.h
index d93b14e..7f0a641 100644
--- a/backend/unittests/CodeGen/RegisterAllocationTestSupport.h
+++ b/backend/unittests/CodeGen/RegisterAllocationTestSupport.h
@@ -201,7 +201,7 @@ struct FunctionFixture final {
[[nodiscard]] inline Expected<Register>
createVReg(MachineFunction &Function, RegisterClassID Class = TestRegisterClass::GPR64) {
- auto Type = LLT::makeInteger(64);
+ auto Type = LowLevelType::makeCategoryNeutralScalar(64);
if (!Type)
return std::unexpected(Type.error());
auto Reg = Function.registerInfo().createVirtualRegister(*Type);
diff --git a/backend/unittests/CodeGen/SSAExitTestSupport.h b/backend/unittests/CodeGen/SSAExitTestSupport.h
index 5729293..cf77d36 100644
--- a/backend/unittests/CodeGen/SSAExitTestSupport.h
+++ b/backend/unittests/CodeGen/SSAExitTestSupport.h
@@ -360,7 +360,7 @@ struct FunctionFixture final {
}
[[nodiscard]] inline rcc::Expected<rcc::Register>
-createVReg(rcc::MachineFunction &Function, rcc::LLT Type, rcc::RegisterBankID Bank,
+createVReg(rcc::MachineFunction &Function, rcc::LowLevelType Type, rcc::RegisterBankID Bank,
rcc::RegisterClassID Class, std::uint8_t TargetFlags = 0,
std::optional<rcc::PhysicalRegister> Hint = std::nullopt) {
auto Reg = Function.registerInfo().createVirtualRegister(Type);
diff --git a/backend/unittests/CodeGen/TargetCallLoweringTest.cpp b/backend/unittests/CodeGen/TargetCallLoweringTest.cpp
index c5170d0..22a2b0c 100644
--- a/backend/unittests/CodeGen/TargetCallLoweringTest.cpp
+++ b/backend/unittests/CodeGen/TargetCallLoweringTest.cpp
@@ -42,8 +42,8 @@ private:
return *Value;
}
-[[nodiscard]] rcc::LLT integer(std::uint32_t Bits) {
- const auto Type = rcc::LLT::makeInteger(Bits);
+[[nodiscard]] rcc::LowLevelType integer(std::uint32_t Bits) {
+ const auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(Bits);
if (!Type)
std::terminate();
return *Type;
@@ -207,7 +207,7 @@ void testPlanValidation(TestContext &Context) {
auto BadByVal = emptyPlanDescription(rcc::CallLoweringPlanKind::Call);
auto ByValAssignment = registerAssignment();
- ByValAssignment.ValueType = *rcc::LLT::makePointer(0, 64);
+ ByValAssignment.ValueType = *rcc::LowLevelType::makePointer(0, 64);
ByValAssignment.LocationType = ByValAssignment.ValueType;
ByValAssignment.CustomFlags.set(rcc::CCAssignmentFlag::ByVal);
BadByVal.ArgumentAssignments.push_back(ByValAssignment);
@@ -219,7 +219,7 @@ void testPlanValidation(TestContext &Context) {
auto OverlappingByVal = emptyPlanDescription(rcc::CallLoweringPlanKind::Call);
OverlappingByVal.CallFrame.SizeBytes = 32;
auto FirstByVal = registerAssignment();
- FirstByVal.ValueType = *rcc::LLT::makePointer(0, 64);
+ FirstByVal.ValueType = *rcc::LowLevelType::makePointer(0, 64);
FirstByVal.LocationType = FirstByVal.ValueType;
FirstByVal.CustomFlags.set(rcc::CCAssignmentFlag::ByVal);
auto SecondByVal = FirstByVal;
diff --git a/backend/unittests/CodeGen/TargetRegisterInfoTest.cpp b/backend/unittests/CodeGen/TargetRegisterInfoTest.cpp
index 2c44237..bb9a0fc 100644
--- a/backend/unittests/CodeGen/TargetRegisterInfoTest.cpp
+++ b/backend/unittests/CodeGen/TargetRegisterInfoTest.cpp
@@ -250,7 +250,7 @@ void testTargetDescriptionConstraints(TestContext &Context) {
rcc::test::TestRegisterBank::GPR));
auto Function =
rcc::MachineFunction::create("constraints", rcc::MachineFunctionStableID::fromValue(1));
- auto Type = rcc::LLT::makeInteger(64);
+ auto Type = rcc::LowLevelType::makeCategoryNeutralScalar(64);
if (!SubclassTarget || !Function || !Type)
return;
@@ -301,7 +301,7 @@ void testTargetDescriptionConstraints(TestContext &Context) {
(*Function)->registerInfo()),
"physical register operands must reject nonzero subregister indices");
- auto WideType = rcc::LLT::makeInteger(128);
+ auto WideType = rcc::LowLevelType::makeCategoryNeutralScalar(128);
if (!WideType)
return;
auto WideReg = (*Function)->registerInfo().createVirtualRegister(*WideType);
diff --git a/backend/unittests/CodeGen/TwoAddressInstructionPassTest.cpp b/backend/unittests/CodeGen/TwoAddressInstructionPassTest.cpp
index e3ad4eb..d23a2eb 100644
--- a/backend/unittests/CodeGen/TwoAddressInstructionPassTest.cpp
+++ b/backend/unittests/CodeGen/TwoAddressInstructionPassTest.cpp
@@ -19,8 +19,8 @@ void testTwoAddressAndSubregisterPseudos(TestContext &Context, const rcc::Target
auto Fixture = createFunction(Context, "two_address", 5, 1);
if (!Fixture.Function || Fixture.Blocks.empty())
return;
- auto I64 = rcc::LLT::makeInteger(64);
- auto I32 = rcc::LLT::makeInteger(32);
+ auto I64 = rcc::LowLevelType::makeCategoryNeutralScalar(64);
+ auto I32 = rcc::LowLevelType::makeCategoryNeutralScalar(32);
if (!I64 || !I32)
return;
auto &Function = *Fixture.Function;