summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-04-10 01:13:15 +0000
committerChris Lattner <sabre@nondot.org>2005-04-10 01:13:15 +0000
commitd8cbfe82ba170fe3283d0a4725f1c77c443b45d7 (patch)
treec1e3723a4d80f156edfb3f10c71249427005c27e /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent9ff4b4190f0c1e6745c0c886649cbecaf64f63c9 (diff)
downloadbcm5719-llvm-d8cbfe82ba170fe3283d0a4725f1c77c443b45d7.tar.gz
bcm5719-llvm-d8cbfe82ba170fe3283d0a4725f1c77c443b45d7.zip
Fix a thinko. If the operand is promoted, pass the promoted value into
the new zero extend, not the original operand. This fixes cast bool -> long on ppc. Add an unrelated fixme llvm-svn: 21196
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 74e807ca826..f33ecd72239 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -767,6 +767,10 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
if (N2C->isAllOnesValue())
return N1; // X and -1 -> X
+ // FIXME: Should add a corresponding version of this for
+ // ZERO_EXTEND/SIGN_EXTEND by converting them to an ANY_EXTEND node which
+ // we don't have yet.
+
// and (zero_extend_inreg x:16:32), 1 -> and x, 1
if (N1.getOpcode() == ISD::ZERO_EXTEND_INREG ||
N1.getOpcode() == ISD::SIGN_EXTEND_INREG) {
OpenPOWER on IntegriCloud