summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-08-17 20:25:25 +0000
committerTim Northover <tnorthover@apple.com>2016-08-17 20:25:25 +0000
commitde3aea04129bcde27b025e4619519b4ff01be226 (patch)
treef0e860c5864339bac8d6a3cb34586b19bd44191d /llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
parente4d8225e72da7a002848dd016c40fee65faf3cd2 (diff)
downloadbcm5719-llvm-de3aea04129bcde27b025e4619519b4ff01be226.tar.gz
bcm5719-llvm-de3aea04129bcde27b025e4619519b4ff01be226.zip
GlobalISel: support irtranslation of icmp instructions.
llvm-svn: 278969
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp b/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
index 5abc652303e..70a24415f1d 100644
--- a/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
@@ -184,3 +184,14 @@ MachineInstrBuilder MachineIRBuilder::buildTrunc(LLT Ty, unsigned Res,
unsigned Op) {
return buildInstr(TargetOpcode::G_TRUNC, Ty).addDef(Res).addUse(Op);
}
+
+MachineInstrBuilder MachineIRBuilder::buildICmp(ArrayRef<LLT> Tys,
+ CmpInst::Predicate Pred,
+ unsigned Res, unsigned Op0,
+ unsigned Op1) {
+ return buildInstr(TargetOpcode::G_ICMP, Tys)
+ .addDef(Res)
+ .addPredicate(Pred)
+ .addUse(Op0)
+ .addUse(Op1);
+}
OpenPOWER on IntegriCloud