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:
edeecfc
)
Fold zext_inreg(zextload), likewise for sext's
author
Chris Lattner
<sabre@nondot.org>
Sun, 10 Apr 2005 04:33:08 +0000
(
04:33
+0000)
committer
Chris Lattner
<sabre@nondot.org>
Sun, 10 Apr 2005 04:33:08 +0000
(
04:33
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21204
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
patch
|
blob
|
history
diff --git
a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 7cf89144c3b51bdb166a3dd8072bb12c731b06cb..6b94adf1d8edebbd4a39e4ec1fcb06ea7403bc09 100644
(file)
--- a/
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@
-1101,6
+1101,12
@@
SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,SDOperand N1,
return N1;
}
+ // If we are (zero|sign) extending a [zs]extload, return just the load.
+ if ((N1.getOpcode() == ISD::ZEXTLOAD && Opcode == ISD::ZERO_EXTEND_INREG) ||
+ (N1.getOpcode() == ISD::SEXTLOAD && Opcode == ISD::SIGN_EXTEND_INREG))
+ if (cast<MVTSDNode>(N1)->getExtraValueType() <= EVT)
+ return N1;
+
// If we are extending the result of a setcc, and we already know the
// contents of the top bits, eliminate the extension.
if (N1.getOpcode() == ISD::SETCC)