diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-15 04:37:18 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-15 04:37:18 +0800 |
| commit | bb7990a58f56f8fb9bae4d5eb01fbbe3c36fca77 (patch) | |
| tree | 5666b572b19341d45395afb613ccbfe385b000ab /backend/lib/CodeGen/MachineIRBuilder.cpp | |
| parent | 6f67b5ba63e0993d6aa9002c8c59fcf13148b869 (diff) | |
| download | rcc-project-bb7990a58f56f8fb9bae4d5eb01fbbe3c36fca77.tar.gz rcc-project-bb7990a58f56f8fb9bae4d5eb01fbbe3c36fca77.tar.xz | |
[GlobalISel] Legalize scalar PHI operations
Diffstat (limited to 'backend/lib/CodeGen/MachineIRBuilder.cpp')
| -rw-r--r-- | backend/lib/CodeGen/MachineIRBuilder.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/backend/lib/CodeGen/MachineIRBuilder.cpp b/backend/lib/CodeGen/MachineIRBuilder.cpp index 8536490..d2ac7cc 100644 --- a/backend/lib/CodeGen/MachineIRBuilder.cpp +++ b/backend/lib/CodeGen/MachineIRBuilder.cpp @@ -831,6 +831,18 @@ Expected<MachineInstr *> MachineIRBuilder::buildSExt(MachineIRBuilderResult Dest return buildUnary(opcode(GenericOpcode::G_SEXT), Destination, Source); } +GenericOpcode MachineIRBuilder::getBoolExtOp(bool IsVector, bool IsFloatingPoint) const noexcept { + switch (Target->getBooleanContents(IsVector, IsFloatingPoint)) { + case BooleanContent::ZeroOrNegativeOne: + return GenericOpcode::G_SEXT; + case BooleanContent::ZeroOrOne: + return GenericOpcode::G_ZEXT; + case BooleanContent::Undefined: + return GenericOpcode::G_ANYEXT; + } + return GenericOpcode::G_ANYEXT; +} + Expected<MachineInstr *> MachineIRBuilder::buildUndef(MachineIRBuilderResult Destination) const { return buildImplicitDef(Destination); } |
