diff options
author | Chris Lattner <sabre@nondot.org> | 2005-12-15 19:02:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-12-15 19:02:38 +0000 |
commit | d0f6d18aa896a6c37f26e2d947d24d8ec95f1164 (patch) | |
tree | 973483d742b3207cc5adf85ecda22bdb8bbe1502 | |
parent | 502c5bb42839d8acfab10f1ef05da12ebbf76f9e (diff) |
Don't create SEXTLOAD/ZEXTLOAD instructions that the target doesn't support
if after legalize. This fixes IA64 failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24725 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 031bf61c74..ddd8549a09 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -1550,7 +1550,8 @@ SDOperand DAGCombiner::visitSIGN_EXTEND(SDNode *N) { return DAG.getNode(ISD::SIGN_EXTEND_INREG, VT, N0.getOperand(0), DAG.getValueType(N0.getValueType())); // fold (sext (load x)) -> (sext (truncate (sextload x))) - if (N0.getOpcode() == ISD::LOAD && N0.hasOneUse()) { + if (N0.getOpcode() == ISD::LOAD && N0.hasOneUse() && + (!AfterLegalize||TLI.isOperationLegal(ISD::SEXTLOAD, N0.getValueType()))){ SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, N0.getOperand(0), N0.getOperand(1), N0.getOperand(2), N0.getValueType()); @@ -1592,7 +1593,8 @@ SDOperand DAGCombiner::visitZERO_EXTEND(SDNode *N) { (!AfterLegalize || TLI.isOperationLegal(ISD::AND, N0.getValueType()))) return DAG.getZeroExtendInReg(N0.getOperand(0), N0.getValueType()); // fold (zext (load x)) -> (zext (truncate (zextload x))) - if (N0.getOpcode() == ISD::LOAD && N0.hasOneUse()) { + if (N0.getOpcode() == ISD::LOAD && N0.hasOneUse() && + (!AfterLegalize||TLI.isOperationLegal(ISD::ZEXTLOAD, N0.getValueType()))){ SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, N0.getOperand(0), N0.getOperand(1), N0.getOperand(2), N0.getValueType()); |