diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-12-15 21:38:30 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-12-15 21:38:30 +0000 |
commit | f6c4ccfaab372081e021c9b02415f3db4190b37d (patch) | |
tree | 2210981c6f699b22321b3a8494437280353c6803 /lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | a52035a062edf9bfbf95c92c615219b647042c17 (diff) |
This code was usurping the sextload expand in teh legalizer. Just make
sure the right conditions are checked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32611 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 146d579d6e..04f21b9557 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -1943,13 +1943,15 @@ SDOperand DAGCombiner::visitSIGN_EXTEND(SDNode *N) { if ((ISD::isSEXTLoad(N0.Val) || ISD::isEXTLoad(N0.Val)) && N0.hasOneUse()) { LoadSDNode *LN0 = cast<LoadSDNode>(N0); MVT::ValueType EVT = LN0->getLoadedVT(); - SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(), - LN0->getBasePtr(), LN0->getSrcValue(), - LN0->getSrcValueOffset(), EVT); - CombineTo(N, ExtLoad); - CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), - ExtLoad.getValue(1)); - return SDOperand(N, 0); // Return N so it doesn't get rechecked! + if (!AfterLegalize || TLI.isLoadXLegal(ISD::SEXTLOAD, EVT)) { + SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(), + LN0->getBasePtr(), LN0->getSrcValue(), + LN0->getSrcValueOffset(), EVT); + CombineTo(N, ExtLoad); + CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), + ExtLoad.getValue(1)); + return SDOperand(N, 0); // Return N so it doesn't get rechecked! + } } return SDOperand(); |