diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-02-20 20:41:44 +0000 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-02-20 20:41:44 +0000 |
commit | c3b496de7abf7d43c870d092a56969a4fee5fa96 (patch) | |
tree | e02385eb18f6ddb933962c2a2b7944782520b5f2 /llvm/include | |
parent | 1e25464fc9b21129dbea14006f07e8611942fe99 (diff) | |
download | bcm5719-llvm-c3b496de7abf7d43c870d092a56969a4fee5fa96.tar.gz bcm5719-llvm-c3b496de7abf7d43c870d092a56969a4fee5fa96.zip |
[SDAG] Support vector UMULO/SMULO
Second part of https://bugs.llvm.org/show_bug.cgi?id=40442.
This adds an extra UnrollVectorOverflowOp() method to SDAG, because
the general UnrollOverflowOp() method can't deal with multiple results.
Additionally we need to expand UMULO/SMULO during vector op
legalization, as it may result in unrolling, which may need additional
type legalization.
Differential Revision: https://reviews.llvm.org/D57997
llvm-svn: 354513
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/CodeGen/SelectionDAG.h | 5 | ||||
-rw-r--r-- | llvm/include/llvm/CodeGen/TargetLowering.h | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/llvm/include/llvm/CodeGen/SelectionDAG.h b/llvm/include/llvm/CodeGen/SelectionDAG.h index c4755995526..b76f7315013 100644 --- a/llvm/include/llvm/CodeGen/SelectionDAG.h +++ b/llvm/include/llvm/CodeGen/SelectionDAG.h @@ -1535,6 +1535,11 @@ public: /// vector op and fill the end of the resulting vector with UNDEFS. SDValue UnrollVectorOp(SDNode *N, unsigned ResNE = 0); + /// Like UnrollVectorOp(), but for the [US](ADD|SUB|MUL)O family of opcodes. + /// This is a separate function because those opcodes have two results. + std::pair<SDValue, SDValue> UnrollVectorOverflowOp(SDNode *N, + unsigned ResNE = 0); + /// Return true if loads are next to each other and can be /// merged. Check that both are nonvolatile and if LD is loading /// 'Bytes' bytes from a location that is 'Dist' units away from the diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h index 5e633fbb589..ed3b204d9cc 100644 --- a/llvm/include/llvm/CodeGen/TargetLowering.h +++ b/llvm/include/llvm/CodeGen/TargetLowering.h @@ -3888,9 +3888,10 @@ public: /// integers as its arguments. SDValue expandFixedPointMul(SDNode *Node, SelectionDAG &DAG) const; - /// Method for building the DAG expansion of ISD::[US]MULO, returning the two - /// result values as a pair. - std::pair<SDValue, SDValue> expandMULO(SDNode *Node, SelectionDAG &DAG) const; + /// Method for building the DAG expansion of ISD::[US]MULO. Returns whether + /// expansion was successful and populates the Result and Overflow arguments. + bool expandMULO(SDNode *Node, SDValue &Result, SDValue &Overflow, + SelectionDAG &DAG) const; //===--------------------------------------------------------------------===// // Instruction Emitting Hooks |