summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-11-22 05:17:44 +0000
committerBill Wendling <isanbard@gmail.com>2013-11-22 05:17:44 +0000
commitee287ca22abcce9f769618c107ff3f46aa2d0cba (patch)
tree549523fd9fad10dcb34fae49fecd3780ec78dee5 /include
parent54075bbea7e70fea6cdb9e5e89b066118c1d314b (diff)
downloadexternal_llvm-ee287ca22abcce9f769618c107ff3f46aa2d0cba.zip
external_llvm-ee287ca22abcce9f769618c107ff3f46aa2d0cba.tar.gz
external_llvm-ee287ca22abcce9f769618c107ff3f46aa2d0cba.tar.bz2
Merging r195156:
------------------------------------------------------------------------ r195156 | ributzka | 2013-11-19 13:20:17 -0800 (Tue, 19 Nov 2013) | 3 lines [DAG] Refactor vector splitting code in SelectionDAG. No functional change intended. Reviewed by Tom ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@195412 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/SelectionDAG.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h
index 9a9bb99..4b3f904 100644
--- a/include/llvm/CodeGen/SelectionDAG.h
+++ b/include/llvm/CodeGen/SelectionDAG.h
@@ -170,6 +170,7 @@ class SelectionDAG {
const TargetMachine &TM;
const TargetSelectionDAGInfo &TSI;
const TargetTransformInfo *TTI;
+ const TargetLowering *TLI;
MachineFunction *MF;
LLVMContext *Context;
CodeGenOpt::Level OptLevel;
@@ -268,7 +269,8 @@ public:
/// init - Prepare this SelectionDAG to process code in the given
/// MachineFunction.
///
- void init(MachineFunction &mf, const TargetTransformInfo *TTI);
+ void init(MachineFunction &mf, const TargetTransformInfo *TTI,
+ const TargetLowering *TLI);
/// clear - Clear state and free memory necessary to make this
/// SelectionDAG ready to process a new block.
@@ -277,9 +279,7 @@ public:
MachineFunction &getMachineFunction() const { return *MF; }
const TargetMachine &getTarget() const { return TM; }
- const TargetLowering &getTargetLoweringInfo() const {
- return *TM.getTargetLowering();
- }
+ const TargetLowering &getTargetLoweringInfo() const { return *TLI; }
const TargetSelectionDAGInfo &getSelectionDAGInfo() const { return TSI; }
const TargetTransformInfo *getTargetTransformInfo() const { return TTI; }
LLVMContext *getContext() const {return Context; }
@@ -1130,6 +1130,29 @@ public:
/// it cannot be inferred.
unsigned InferPtrAlignment(SDValue Ptr) const;
+ /// GetSplitDestVTs - Compute the VTs needed for the low/hi parts of a type
+ /// which is split (or expanded) into two not necessarily identical pieces.
+ std::pair<EVT, EVT> GetSplitDestVTs(const EVT &VT) const;
+
+ /// SplitVector - Split the vector with EXTRACT_SUBVECTOR using the provides
+ /// VTs and return the low/high part.
+ std::pair<SDValue, SDValue> SplitVector(const SDValue &N, const SDLoc &DL,
+ const EVT &LoVT, const EVT &HiVT);
+
+ /// SplitVector - Split the vector with EXTRACT_SUBVECTOR and return the
+ /// low/high part.
+ std::pair<SDValue, SDValue> SplitVector(const SDValue &N, const SDLoc &DL) {
+ EVT LoVT, HiVT;
+ llvm::tie(LoVT, HiVT) = GetSplitDestVTs(N.getValueType());
+ return SplitVector(N, DL, LoVT, HiVT);
+ }
+
+ /// SplitVectorOperand - Split the node's operand with EXTRACT_SUBVECTOR and
+ /// return the low/high part.
+ std::pair<SDValue, SDValue> SplitVectorOperand(SDNode *N, unsigned OpNo) {
+ return SplitVector(N->getOperand(OpNo), SDLoc(N));
+ }
+
private:
bool RemoveNodeFromCSEMaps(SDNode *N);
void AddModifiedNodeToCSEMaps(SDNode *N);