diff options
author | Nadav Rotem <nadav.rotem@intel.com> | 2011-02-20 12:37:50 +0000 |
---|---|---|
committer | Nadav Rotem <nadav.rotem@intel.com> | 2011-02-20 12:37:50 +0000 |
commit | 25f2ac948bef1d0035eaa983d2ff2c8744c569fe (patch) | |
tree | 888525115ab23a311ce608d8a08e20a7b0d9eef5 /llvm/lib/CodeGen | |
parent | 7ee0d5664e4a9259ddf5b98d509f9333df7c3ef7 (diff) | |
download | bcm5719-llvm-25f2ac948bef1d0035eaa983d2ff2c8744c569fe.tar.gz bcm5719-llvm-25f2ac948bef1d0035eaa983d2ff2c8744c569fe.zip |
Fix 9267; Add vector zext support.
The DAGCombiner folds the zext into complex load instructions. This patch
prevents this optimization on vectors since none of the supported targets
knows how to perform load+vector_zext in one instruction.
llvm-svn: 126080
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 90356021f60..c5f0324ac41 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -3887,7 +3887,9 @@ SDValue DAGCombiner::visitZERO_EXTEND(SDNode *N) { } // fold (zext (load x)) -> (zext (truncate (zextload x))) - if (ISD::isNON_EXTLoad(N0.getNode()) && + // None of the supported targets knows how to perform load and vector_zext + // in one instruction. We only perform this transformation on scalar zext. + if (ISD::isNON_EXTLoad(N0.getNode()) && !VT.isVector() && ((!LegalOperations && !cast<LoadSDNode>(N0)->isVolatile()) || TLI.isLoadExtLegal(ISD::ZEXTLOAD, N0.getValueType()))) { bool DoXform = true; |