diff options
author | Thorsten Schütt <schuett@gmail.com> | 2024-10-30 19:56:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-30 19:56:25 +0100 |
commit | b3bb6f18bb5b2b8756b585b80d46d13ab3636a18 (patch) | |
tree | 3b6996c8e6763573ceb979aa586c8e756320c41c /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 408c84f35b8b0338b630a6ee313c14238e62b5e6 (diff) | |
download | llvm-b3bb6f18bb5b2b8756b585b80d46d13ab3636a18.zip llvm-b3bb6f18bb5b2b8756b585b80d46d13ab3636a18.tar.gz llvm-b3bb6f18bb5b2b8756b585b80d46d13ab3636a18.tar.bz2 |
[GlobalISel] Import samesign flag (#114267)
Credits: https://github.com/llvm/llvm-project/pull/111419
Fixes icmp-flags.mir
First attempt: https://github.com/llvm/llvm-project/pull/113090
Revert: https://github.com/llvm/llvm-project/pull/114256
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index c1bd0bb..941861d 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -596,6 +596,11 @@ uint32_t MachineInstr::copyFlagsFromInstruction(const Instruction &I) { MIFlags |= MachineInstr::MIFlag::Disjoint; } + // Copy the samesign flag. + if (const ICmpInst *ICmp = dyn_cast<ICmpInst>(&I)) + if (ICmp->hasSameSign()) + MIFlags |= MachineInstr::MIFlag::SameSign; + // Copy the exact flag. if (const PossiblyExactOperator *PE = dyn_cast<PossiblyExactOperator>(&I)) if (PE->isExact()) @@ -1770,6 +1775,8 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST, OS << "nneg "; if (getFlag(MachineInstr::Disjoint)) OS << "disjoint "; + if (getFlag(MachineInstr::SameSign)) + OS << "samesign "; // Print the opcode name. if (TII) |