summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-04-04 17:39:18 +0000
committerChris Lattner <sabre@nondot.org>2006-04-04 17:39:18 +0000
commit4ea52cac01e7684df4ffbebba6457dcd61cd9742 (patch)
tree68f9c8065e0bde766549c371cb39bd35826a3f0b /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parentd5ed3789dd12354911e8b18f212df93396d8879c (diff)
downloadbcm5719-llvm-4ea52cac01e7684df4ffbebba6457dcd61cd9742.tar.gz
bcm5719-llvm-4ea52cac01e7684df4ffbebba6457dcd61cd9742.zip
Do not create ZEXTLOAD's unless we are before legalize or the operation is
legal. llvm-svn: 27402
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index c982e5be8fc..a5925ad69c6 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -1193,7 +1193,8 @@ SDOperand DAGCombiner::visitAND(SDNode *N) {
LoadedVT = N0.getOpcode() == ISD::LOAD ? VT :
cast<VTSDNode>(N0.getOperand(3))->getVT();
- if (EVT != MVT::Other && LoadedVT > EVT) {
+ if (EVT != MVT::Other && LoadedVT > EVT &&
+ (!AfterLegalize || TLI.isOperationLegal(ISD::ZEXTLOAD, EVT))) {
MVT::ValueType PtrType = N0.getOperand(1).getValueType();
// For big endian targets, we need to add an offset to the pointer to load
// the correct bytes. For little endian systems, we merely need to read
OpenPOWER on IntegriCloud