diff options
author | Tim Northover <tnorthover@apple.com> | 2016-08-17 20:25:25 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2016-08-17 20:25:25 +0000 |
commit | de3aea04129bcde27b025e4619519b4ff01be226 (patch) | |
tree | f0e860c5864339bac8d6a3cb34586b19bd44191d /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | e4d8225e72da7a002848dd016c40fee65faf3cd2 (diff) | |
download | bcm5719-llvm-de3aea04129bcde27b025e4619519b4ff01be226.tar.gz bcm5719-llvm-de3aea04129bcde27b025e4619519b4ff01be226.zip |
GlobalISel: support irtranslation of icmp instructions.
llvm-svn: 278969
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 84823071993..f860bac2169 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -260,6 +260,8 @@ bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const { return getMetadata() == Other.getMetadata(); case MachineOperand::MO_IntrinsicID: return getIntrinsicID() == Other.getIntrinsicID(); + case MachineOperand::MO_Predicate: + return getPredicate() == Other.getPredicate(); } llvm_unreachable("Invalid machine operand type"); } @@ -306,6 +308,8 @@ hash_code llvm::hash_value(const MachineOperand &MO) { return hash_combine(MO.getType(), MO.getTargetFlags(), MO.getCFIIndex()); case MachineOperand::MO_IntrinsicID: return hash_combine(MO.getType(), MO.getTargetFlags(), MO.getIntrinsicID()); + case MachineOperand::MO_Predicate: + return hash_combine(MO.getType(), MO.getTargetFlags(), MO.getPredicate()); } llvm_unreachable("Invalid machine operand type"); } @@ -471,8 +475,12 @@ void MachineOperand::print(raw_ostream &OS, ModuleSlotTracker &MST, OS << "<intrinsic:" << ID << '>'; break; } + case MachineOperand::MO_Predicate: { + auto Pred = static_cast<CmpInst::Predicate>(getPredicate()); + OS << '<' << (CmpInst::isIntPredicate(Pred) ? "intpred" : "floatpred") + << CmpInst::getPredicateName(Pred) << '>'; + } } - if (unsigned TF = getTargetFlags()) OS << "[TF=" << TF << ']'; } |