From e8b42dc96d54f1f40fae5fd453d1841f31d16528 Mon Sep 17 00:00:00 2001 From: Duraid Madina Date: Fri, 13 Jan 2006 10:28:25 +0000 Subject: [PATCH] don't be a doofus - this fixes storing bools llvm-svn: 25274 --- lib/Target/IA64/IA64ISelDAGToDAG.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Target/IA64/IA64ISelDAGToDAG.cpp b/lib/Target/IA64/IA64ISelDAGToDAG.cpp index 41ae9935573..f8827ea06b8 100644 --- a/lib/Target/IA64/IA64ISelDAGToDAG.cpp +++ b/lib/Target/IA64/IA64ISelDAGToDAG.cpp @@ -571,9 +571,12 @@ SDOperand IA64DAGToDAGISel::Select(SDOperand Op) { default: assert(0 && "unknown type in store"); case MVT::i1: { // this is a bool Opc = IA64::ST1; // we store either 0 or 1 as a byte + // first load zero! + SDOperand Initial = CurDAG->getCopyFromReg(Chain, IA64::r0, MVT::i64); + Chain = Initial.getValue(1); + // then load 1 iff the predicate to store is 1 SDOperand Tmp = - CurDAG->getTargetNode(IA64::PADDS, MVT::i64, - CurDAG->getRegister(IA64::r0, MVT::i64), + CurDAG->getTargetNode(IA64::PADDS, MVT::i64, Initial, CurDAG->getConstant(1, MVT::i64), Select(N->getOperand(1))); return CurDAG->SelectNodeTo(N, Opc, MVT::Other, Address, Tmp, Chain);