summaryrefslogtreecommitdiff
path: root/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
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
commitce6504cc936f2496e32bea7dffa0dac7eba33375 (patch)
treeddc75e8a9534e179de52cbdd5ca5506f3f2417bb /lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
parentf4d294cc96f5c891a589c1fd2ec7717d461900f3 (diff)
downloadllvm-ce6504cc936f2496e32bea7dffa0dac7eba33375.tar.gz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296923 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/GlobalISel/MachineIRBuilder.cpp')
-rw-r--r--lib/CodeGen/GlobalISel/MachineIRBuilder.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp b/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
index 41985e3a3281..5eea7268c5e7 100644
--- a/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
+++ b/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) {