diff options
author | Richard Osborne <richard@xmos.com> | 2011-01-31 17:41:44 +0000 |
---|---|---|
committer | Richard Osborne <richard@xmos.com> | 2011-01-31 17:41:44 +0000 |
commit | 272e084bca2f151c7af390ae1acc45b18b495a91 (patch) | |
tree | 4b0368ee97f7c90b2e1ef381cfbb7e9f076b49b1 /llvm/lib/CodeGen/SelectionDAG | |
parent | 1475d4fa369539771cbcaf11b325748709026e59 (diff) | |
download | bcm5719-llvm-272e084bca2f151c7af390ae1acc45b18b495a91.tar.gz bcm5719-llvm-272e084bca2f151c7af390ae1acc45b18b495a91.zip |
Fix bug where ReduceLoadWidth was creating illegal ZEXTLOAD instructions.
llvm-svn: 124587
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 94487d40414..e91592b2429 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -4244,8 +4244,6 @@ SDValue DAGCombiner::ReduceLoadWidth(SDNode *N) { if (Opc == ISD::SIGN_EXTEND_INREG) { ExtType = ISD::SEXTLOAD; ExtVT = cast<VTSDNode>(N->getOperand(1))->getVT(); - if (LegalOperations && !TLI.isLoadExtLegal(ISD::SEXTLOAD, ExtVT)) - return SDValue(); } else if (Opc == ISD::SRL) { // Another special-case: SRL is basically zero-extending a narrower value. ExtType = ISD::ZEXTLOAD; @@ -4255,6 +4253,8 @@ SDValue DAGCombiner::ReduceLoadWidth(SDNode *N) { ExtVT = EVT::getIntegerVT(*DAG.getContext(), VT.getSizeInBits() - N01->getZExtValue()); } + if (LegalOperations && !TLI.isLoadExtLegal(ExtType, ExtVT)) + return SDValue(); unsigned EVTBits = ExtVT.getSizeInBits(); |