aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/CodeGen/InstructionDescriptor.cpp
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-08 04:14:34 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-08 04:14:34 +0800
commit77884c967d1cbc48afcbaef7e5a35adcb3c5da1b (patch)
tree8cc31c1c5115ed909ec9f8751964bfdc96fbd4ad /backend/lib/CodeGen/InstructionDescriptor.cpp
parent10b7e69448f866bcd6893b21d7f78d766252eb11 (diff)
downloadrcc-project-77884c967d1cbc48afcbaef7e5a35adcb3c5da1b.tar.gz
rcc-project-77884c967d1cbc48afcbaef7e5a35adcb3c5da1b.tar.xz
[CodeGen] Implement machine SSA exit
Diffstat (limited to 'backend/lib/CodeGen/InstructionDescriptor.cpp')
-rw-r--r--backend/lib/CodeGen/InstructionDescriptor.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/backend/lib/CodeGen/InstructionDescriptor.cpp b/backend/lib/CodeGen/InstructionDescriptor.cpp
index 57400d6..5aec744 100644
--- a/backend/lib/CodeGen/InstructionDescriptor.cpp
+++ b/backend/lib/CodeGen/InstructionDescriptor.cpp
@@ -420,11 +420,12 @@ Expected<void> InstructionSet::validateExplicitOperands(const InstructionDescrip
auto Info = RegInfo.virtualRegisterInfo(*Reg);
if (!Info)
return std::unexpected(Info.error());
- if (!Info->get().Type) {
+ const std::optional<LLT> &RegisterType = Info->get().Type;
+ if (!RegisterType) {
return makeUnexpected(ErrorCode::VerificationError,
"typed instruction operand virtual register has no LLT");
}
- const LLT Type = *Info->get().Type;
+ const LLT Type = RegisterType.value();
if (!OperandDesc.TypeConstraint->Kinds.contains(Type.kind())) {
return makeUnexpected(ErrorCode::VerificationError,
"instruction operand LLT kind is not permitted by its descriptor");
@@ -587,7 +588,8 @@ Expected<void> InstructionSet::validateOperand(const OperandDescriptor &Descript
return makeUnexpected(ErrorCode::VerificationError,
"instruction operand kind does not match its descriptor");
}
- if ((Operand.targetFlags() & ~Descriptor.AllowedTargetFlags) != 0) {
+ if (!Descriptor.AllowAnyTargetFlags &&
+ (Operand.targetFlags() & ~Descriptor.AllowedTargetFlags) != 0) {
return makeUnexpected(ErrorCode::VerificationError,
"instruction operand uses unregistered target flags");
}