summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2017-03-03 23:05:47 +0000
committerTim Northover <tnorthover@apple.com>2017-03-03 23:05:47 +0000
commit3e6a7afd8195d5d8ac28fb1b7e1c28f763d73a2e (patch)
tree3f7fa9ab5b9610ab6d07e28d1f2477c11f6ed53f /llvm/lib/CodeGen
parent5ba962706f6ccd36fce7660314f34809685eee9c (diff)
downloadbcm5719-llvm-3e6a7afd8195d5d8ac28fb1b7e1c28f763d73a2e.tar.gz
bcm5719-llvm-3e6a7afd8195d5d8ac28fb1b7e1c28f763d73a2e.zip
GlobalISel: constrain G_INSERT to inserting just one value per instruction.
It's much easier to reason about single-value inserts and no-one was actually using the variadic variants before. llvm-svn: 296923
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp b/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
index 41985e3a328..5eea7268c5e 100644
--- a/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
@@ -456,6 +456,15 @@ MachineInstrBuilder MachineIRBuilder::buildUnmerge(ArrayRef<unsigned> Res,
return MIB;
}
+MachineInstrBuilder MachineIRBuilder::buildInsert(unsigned Res, unsigned Src,
+ unsigned Op, unsigned Index) {
+ return buildInstr(TargetOpcode::G_INSERT)
+ .addDef(Res)
+ .addUse(Src)
+ .addUse(Op)
+ .addImm(Index);
+}
+
MachineInstrBuilder MachineIRBuilder::buildIntrinsic(Intrinsic::ID ID,
unsigned Res,
bool HasSideEffects) {
OpenPOWER on IntegriCloud