diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-09-03 19:20:37 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-09-03 19:20:37 +0000 |
commit | 3626a8c136a5d87d301aaab2534b77361bac37ae (patch) | |
tree | e7674bef38528defddf62d7f7d1a884e4efeb825 /llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | |
parent | 54512bd6c9bed0a7ed0e0d6d957442dd4c40fee3 (diff) | |
download | bcm5719-llvm-3626a8c136a5d87d301aaab2534b77361bac37ae.tar.gz bcm5719-llvm-3626a8c136a5d87d301aaab2534b77361bac37ae.zip |
Add a missing check when legalizing a vector extending load. This doesn't
solve the root problem, but it corrects the bug in the code I added to
support legalizing in the case where the non-extended type is also legal.
llvm-svn: 112997
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 433ba6524a4..2981cd3f1ca 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -1313,9 +1313,7 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) { } break; case TargetLowering::Expand: - if (!TLI.isLoadExtLegal(ISD::EXTLOAD, SrcVT)) { - // FIXME: If SrcVT isn't legal, then this introduces an illegal - // type. + if (!TLI.isLoadExtLegal(ISD::EXTLOAD, SrcVT) && isTypeLegal(SrcVT)) { SDValue Load = DAG.getLoad(SrcVT, dl, Tmp1, Tmp2, LD->getSrcValue(), LD->getSrcValueOffset(), LD->isVolatile(), LD->isNonTemporal(), @@ -1335,6 +1333,10 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) { Tmp2 = LegalizeOp(Load.getValue(1)); break; } + // FIXME: This does not work for vectors on most targets. Sign- and + // zero-extend operations are currently folded into extending loads, + // whether they are legal or not, and then we end up here without any + // support for legalizing them. assert(ExtType != ISD::EXTLOAD && "EXTLOAD should always be supported!"); // Turn the unsupported load into an EXTLOAD followed by an explicit |