forked from OSchip/llvm-project
Add a helper to build Copy instructions in MachineIRBuilder
llvm-svn: 315239
This commit is contained in:
parent
f12e3b848a
commit
4d62ca3ae9
|
@ -543,6 +543,10 @@ public:
|
|||
///
|
||||
/// \return a MachineInstrBuilder for the newly created instruction.
|
||||
MachineInstrBuilder buildCopy(unsigned Res, unsigned Op);
|
||||
template <typename DstType, typename SrcType>
|
||||
MachineInstrBuilder buildCopy(DstType &&Res, SrcType &&Src) {
|
||||
return buildCopy(getDestFromArg(Res), getRegFromArg(Src));
|
||||
}
|
||||
|
||||
/// Build and insert `Res<def> = G_LOAD Addr, MMO`.
|
||||
///
|
||||
|
@ -660,6 +664,10 @@ public:
|
|||
///
|
||||
/// \return The newly created instruction.
|
||||
MachineInstrBuilder buildTrunc(unsigned Res, unsigned Op);
|
||||
template <typename DstType, typename SrcType>
|
||||
MachineInstrBuilder buildTrunc(DstType &&Res, SrcType &&Src) {
|
||||
return buildTrunc(getDestFromArg(Res), getRegFromArg(Src));
|
||||
}
|
||||
|
||||
/// Build and insert a \p Res = G_ICMP \p Pred, \p Op0, \p Op1
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue