aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorThorsten Schütt <schuett@gmail.com>2024-10-30 16:34:01 +0100
committerGitHub <noreply@github.com>2024-10-30 16:34:01 +0100
commit72b115301d1c0d56f40f5030bb8d16f422ac211b (patch)
tree92c6cc67c1485b1da10ceed1e637e38ac83e287c /llvm/lib/CodeGen/MachineInstr.cpp
parent475e736bb5eeea8ec70aca51d1a3d98179c69530 (diff)
downloadllvm-72b115301d1c0d56f40f5030bb8d16f422ac211b.zip
llvm-72b115301d1c0d56f40f5030bb8d16f422ac211b.tar.gz
llvm-72b115301d1c0d56f40f5030bb8d16f422ac211b.tar.bz2
[GlobalISel] Import samesign flag (#113090)
Credits: https://github.com/llvm/llvm-project/pull/111419
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp7
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)