diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-02-17 06:07:47 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-02-17 06:07:47 +0000 |
| commit | 3f482154800eadef5d52cd85da093a701715b6a9 (patch) | |
| tree | e64e651e26e7443b064b92ac92d1ef346eb1c7ea | |
| parent | b0a588f038eba2feb3eb76fa1534ac738b468d88 (diff) | |
| download | bcm5719-llvm-3f482154800eadef5d52cd85da093a701715b6a9.tar.gz bcm5719-llvm-3f482154800eadef5d52cd85da093a701715b6a9.zip | |
rename and document some arguments so I don't have to keep
reverse engineering what they are.
llvm-svn: 96456
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp index 65f6d27744e..6dcc497240e 100644 --- a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -213,7 +213,8 @@ namespace { SDValue &Base, SDValue &Scale, SDValue &Index, SDValue &Disp, SDValue &Segment, - SDValue &InChain, SDValue &OutChain); + SDValue &PatternChainResult, + SDValue &PatternInputChain); bool TryFoldLoad(SDNode *P, SDValue N, SDValue &Base, SDValue &Scale, SDValue &Index, SDValue &Disp, @@ -1317,22 +1318,28 @@ bool X86DAGToDAGISel::SelectAddr(SDNode *Op, SDValue N, SDValue &Base, /// SelectScalarSSELoad - Match a scalar SSE load. In particular, we want to /// match a load whose top elements are either undef or zeros. The load flavor /// is derived from the type of N, which is either v4f32 or v2f64. +/// +/// We also return: +/// PatternInputChain: this is the chain node input to the pattern that the +/// newly selected instruction should use. +/// PatternChainResult: this is chain result matched by the pattern which +/// should be replaced with the chain result of the matched node. bool X86DAGToDAGISel::SelectScalarSSELoad(SDNode *Root, SDValue N, SDValue &Base, SDValue &Scale, SDValue &Index, SDValue &Disp, SDValue &Segment, - SDValue &InChain, - SDValue &OutChain) { + SDValue &PatternChainResult, + SDValue &PatternInputChain) { if (N.getOpcode() == ISD::SCALAR_TO_VECTOR) { - InChain = N.getOperand(0).getValue(1); - if (ISD::isNON_EXTLoad(InChain.getNode()) && - InChain.getValue(0).hasOneUse() && - IsProfitableToFold(N.getOperand(0), InChain.getNode(), Root) && + PatternChainResult = N.getOperand(0).getValue(1); + if (ISD::isNON_EXTLoad(PatternChainResult.getNode()) && + PatternChainResult.getValue(0).hasOneUse() && + IsProfitableToFold(N.getOperand(0),PatternChainResult.getNode(),Root) && IsLegalToFold(N.getOperand(0), N.getNode(), Root)) { - LoadSDNode *LD = cast<LoadSDNode>(InChain); + LoadSDNode *LD = cast<LoadSDNode>(PatternChainResult); if (!SelectAddr(Root, LD->getBasePtr(), Base, Scale, Index, Disp,Segment)) return false; - OutChain = LD->getChain(); + PatternInputChain = LD->getChain(); return true; } } @@ -1351,8 +1358,8 @@ bool X86DAGToDAGISel::SelectScalarSSELoad(SDNode *Root, LoadSDNode *LD = cast<LoadSDNode>(N.getOperand(0).getOperand(0)); if (!SelectAddr(Root, LD->getBasePtr(), Base, Scale, Index, Disp, Segment)) return false; - OutChain = LD->getChain(); - InChain = SDValue(LD, 1); + PatternInputChain = LD->getChain(); + PatternChainResult = SDValue(LD, 1); return true; } return false; |

