diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-13 19:38:37 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-13 19:38:37 +0800 |
| commit | 98cae0e8835a1eb8fcb0e43870c04ed934cc51ac (patch) | |
| tree | 3c5b198778900ed13e2bb429b32ae91bff540548 /backend/utils/TableGen/Common/CodeGenInstruction.cpp | |
| parent | 9d1485c0dd4d071e590c18fb8aa02095de3cc830 (diff) | |
| download | rcc-project-98cae0e8835a1eb8fcb0e43870c04ed934cc51ac.tar.gz rcc-project-98cae0e8835a1eb8fcb0e43870c04ed934cc51ac.tar.xz | |
[CodeGen] Match LLVM branch relaxation semantics
Diffstat (limited to 'backend/utils/TableGen/Common/CodeGenInstruction.cpp')
| -rw-r--r-- | backend/utils/TableGen/Common/CodeGenInstruction.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/backend/utils/TableGen/Common/CodeGenInstruction.cpp b/backend/utils/TableGen/Common/CodeGenInstruction.cpp index fc6b400..d06fbfc 100644 --- a/backend/utils/TableGen/Common/CodeGenInstruction.cpp +++ b/backend/utils/TableGen/Common/CodeGenInstruction.cpp @@ -428,6 +428,7 @@ CodeGenTarget::normalizeImplicitRegisters(const std::vector<SourceImplicitRegist .Flags = {}, .SchedulingClass = HasSchedulingClass ? SchedulingClass->second : 0, .EncodingCategory = HasEncodingCategory ? EncodingCategory->second : 0, + .SizeInBytes = Instruction.SizeInBytes, .AssemblyFormat = HasAssemblyFormat ? AssemblyFormat->second : 0, .RequiresMemoryOperands = Instruction.RequiresMemoryOperands, .Owner = std::string(*Owner), @@ -547,6 +548,10 @@ CodeGenTarget::normalizeImplicitRegisters(const std::vector<SourceImplicitRegist fail(Instruction.Range, "instruction pseudo flags, owner, and deadline are inconsistent"); return false; } + if (Normalized.SizeInBytes != 0 && !HasFlag("ProducesCode")) { + fail(Instruction.Range, "only code-producing instructions can declare a byte size"); + return false; + } if (Normalized.RequiresMemoryOperands && !HasFlag("MayLoad") && !HasFlag("MayStore")) { fail(Instruction.Range, "memory operand requirements need a load or store instruction flag"); return false; |
