[PATCH] D35332: [GISel]: More flexibility while building I/FCmps with MachineIRBuilder
Aditya Nandakumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 12 15:02:39 PDT 2017
aditya_nandakumar created this revision.
Repository:
rL LLVM
https://reviews.llvm.org/D35332
Files:
include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
Index: include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
===================================================================
--- include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
+++ include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
@@ -620,6 +620,11 @@
/// \return a MachineInstrBuilder for the newly created instruction.
MachineInstrBuilder buildICmp(CmpInst::Predicate Pred,
unsigned Res, unsigned Op0, unsigned Op1);
+ template <typename DstTy, typename... UseArgsTy>
+ MachineInstrBuilder buildICmp(CmpInst::Predicate Pred, DstTy &&Ty,
+ UseArgsTy &&... UseArgs) {
+ return buildICmp(Pred, getDestFromArg(Ty), (getRegFromArg(UseArgs))...);
+ }
/// Build and insert a \p Res = G_FCMP \p Pred\p Op0, \p Op1
///
@@ -635,6 +640,11 @@
/// \return a MachineInstrBuilder for the newly created instruction.
MachineInstrBuilder buildFCmp(CmpInst::Predicate Pred,
unsigned Res, unsigned Op0, unsigned Op1);
+ template <typename DstTy, typename... UseArgsTy>
+ MachineInstrBuilder buildFCmp(CmpInst::Predicate Pred, DstTy &&Ty,
+ UseArgsTy &&... UseArgs) {
+ return buildFCmp(Pred, getDestFromArg(Ty), (getRegFromArg(UseArgs))...);
+ }
/// Build and insert a \p Res = G_SELECT \p Tst, \p Op0, \p Op1
///
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35332.106324.patch
Type: text/x-patch
Size: 1369 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170712/e5759056/attachment.bin>
More information about the llvm-commits
mailing list