projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ebc3a3a
)
Evan pointed out that folding sext to zext may not be correct
author
Dan Gohman
<gohman@apple.com>
Mon, 28 Apr 2008 18:47:17 +0000
(18:47 +0000)
committer
Dan Gohman
<gohman@apple.com>
Mon, 28 Apr 2008 18:47:17 +0000
(18:47 +0000)
if the zext is not legal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50368
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
patch
|
blob
|
history
diff --git
a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index dc59006fcfbe54ffd32315add3901b955b83d834..28f32d3d3b967deb4ee38aacc9c7e87669217b7f 100644
(file)
--- a/
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@
-2888,7
+2888,8
@@
SDOperand DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
}
// fold (sext x) -> (zext x) if the sign bit is known zero.
- if (DAG.SignBitIsZero(N0))
+ if ((!AfterLegalize || TLI.isOperationLegal(ISD::ZERO_EXTEND, VT)) &&
+ DAG.SignBitIsZero(N0))
return DAG.getNode(ISD::ZERO_EXTEND, VT, N0);
return SDOperand();