<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On Nov 18, 2006, at 11:24 AM, Reid Spencer wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Chris,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Here's the CAST patch. This passes 100% of llvm/test and llvm-test. The</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">order of the files in the patch has been set up for logical review. Some</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">of this you've already seen, but its changed so much that those things</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">should probably be reviewed again.</DIV></BLOCKQUOTE></DIV><BR><DIV><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+++ lib/Transforms/ExprTypeConvert.cpp</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">18 Nov 2006 19:22:12 -0000</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">@@ -51,14 +51,26 @@ bool llvm::ExpressionConvertibleToType(V</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">   </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Instruction *I = dyn_cast<Instruction>(V);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">   </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (I == 0) return false;</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">              </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Otherwise, we can't convert!</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">   </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">switch (I->getOpcode()) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::Cast:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::Trunc:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::ZExt:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::SExt:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::FPTrunc:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::FPExt:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::UIToFP:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::SIToFP:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::FPToUI:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::FPToSI:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::PtrToInt:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::IntToPtr:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::BitCast:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// We can convert the expr if the cast destination type is losslessly</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// convertible to the requested type.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (!Ty->isLosslesslyConvertibleTo(I->getType())) return false;</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (!Ty->isLosslesslyConvertibleTo(I->getType()))</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">      </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">return false;</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// We also do not allow conversion of a cast that casts from a ptr to array</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// of X to a *X.</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">For example: cast [4 x %List *] * %val to %List * *</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">//</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (const PointerType *SPT =</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Many of these casts can't pass the <FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">isLosslesslyConvertibleTo predicate, don't include them.  This also happens in OperandConvertibleToType.  Note that isLosslesslyConvertibleTo would never accept int<->ptr before, these should just check bitcast.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">@@ -226,13 +238,24 @@ Value *llvm::ConvertExpressionToType(Val</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">   </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">ValueHandle IHandle(VMC, I);</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Prevent I from being removed!</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">   </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Constant *Dummy = Constant::getNullValue(Ty);</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">   </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">switch (I->getOpcode()) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::Cast:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::Trunc:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::ZExt:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::SExt:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::FPTrunc:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::FPExt:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::UIToFP:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::SIToFP:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::FPToUI:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::FPToSI:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::PtrToInt:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::IntToPtr:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">case Instruction::BitCast:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">assert(VMC.NewCasts.count(ValueHandle(VMC, I)) == 0);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Res = new CastInst(I->getOperand(0), Ty, Name);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Res = CastInst::getCast(I->getOperand(0), Ty, Name);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">VMC.NewCasts.insert(ValueHandle(VMC, Res));</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">break;</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Likewise, since they can't be accepted above, they will never reach this.  Similar thing happens in ConvertOperandToType.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Do not allow a 'cast ushort %V to uint' to have it's first operand be</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Do not allow a 'zext ushort %V to uint' to have it's first operand be</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// converted to a 'short' type.</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Doing so changes the way sign promotion</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// happens, and breaks things.</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Only allow the cast to take place if the</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// signedness doesn't change... or if the current cast is not a lossy</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// conversion.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">//</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (!I->getType()->isLosslesslyConvertibleTo(I->getOperand(0)->getType()) &&</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">I->getOperand(0)->getType()->isSigned() != Ty->isSigned())</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (!I->getType()->isLosslesslyConvertibleTo(V->getType()) &&</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">V->getType()->isSigned() != Ty->isSigned())</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">return false;</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// We also do not allow conversion of a cast that casts from a ptr to array</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// of X to a *X.</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">For example: cast [4 x %List *] * %val to %List * *</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">//</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">This if-check can be completely eliminated if you just handle bitcast.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">--- lib/Transforms/LevelRaise.cpp</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">27 Aug 2006 22:42:51 -0000</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">1.111</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+++ lib/Transforms/LevelRaise.cpp</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">      </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">18 Nov 2006 19:22:12 -0000</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">@@ -128,11 +119,11 @@ bool RPR::PeepholeOptimize(BasicBlock *B</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">return true;</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">}</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Check to see if it's a cast of an instruction that does not depend on the</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// specific type of the operands to do it's job.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (!isReinterpretingCast(CI)) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (CI->isNoopCast(TD.getIntPtrType())) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">ValueTypeCache ConvertedTypes;</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Check to see if we can convert the source of the cast to match the</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// destination type of the cast...</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">//</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Plz use isa<BitCast>.  There is no reason to make this code more general.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">@@ -289,16 +294,17 @@ bool RPR::PeepholeOptimize(BasicBlock *B</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">//</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (CastInst *CI = dyn_cast<CastInst>(Pointer))</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (Value *CastSrc = CI->getOperand(0)) // CSPT = CastSrcPointerType</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (const PointerType *CSPT = dyn_cast<PointerType>(CastSrc->getType()))</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">           </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// convertible types?</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">          </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (Val->getType()->isLosslesslyConvertibleTo(CSPT->getElementType())) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">          </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (Val->getType()->isLosslesslyConvertibleTo(CSPT->getElementType()))</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">          </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">{</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">             </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">PRINT_PEEPHOLE3("st-src-cast:in ", *Pointer, *Val, *SI);</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">             </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Insert the new T cast instruction... stealing old T's name</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">             </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">std::string Name(CI->getName()); CI->setName("");</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">            </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">CastInst *NCI = new CastInst(Val, CSPT->getElementType(),</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">            </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">CastInst *NCI = CastInst::getCast(Val, CSPT->getElementType(),</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">                                          </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Name, BI);</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">             </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Replace the old store with a new one!</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">             </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">ReplaceInstWithInst(BB->getInstList(), BI,</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">                                 </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">SI = new StoreInst(NCI, CastSrc));</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">isa<BitCast>, please create a new bitcast instead of using getCast.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">@@ -334,11 +340,12 @@ bool RPR::PeepholeOptimize(BasicBlock *B</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">             </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Create the new load instruction... loading the pre-casted value</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">             </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">LoadInst *NewLI = new LoadInst(CastSrc, LI->getName(), BI);</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">             </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Insert the new T cast instruction... stealing old T's name</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">            </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">CastInst *NCI = new CastInst(NewLI, LI->getType(), CI->getName());</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">            </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">CastInst *NCI =</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">              </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">CastInst::getCast(NewLI, LI->getType(), CI->getName());</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">@@ -373,11 +380,11 @@ bool RPR::PeepholeOptimize(BasicBlock *B</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">else</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">NewCast = new CastInst(CI->getCalledValue(), NewPFunTy,</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">NewCast = CastInst::getCast(CI->getCalledValue(), NewPFunTy,</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">                                </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">CI->getCalledValue()->getName()+"_c",CI);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">These should create bitcast's explicitly.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">===================================================================</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">RCS file: /var/cvs/llvm/llvm/lib/Transforms/IPO/GlobalOpt.cpp,v</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">retrieving revision 1.71</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">diff -t -d -u -p -5 -r1.71 GlobalOpt.cpp</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">--- lib/Transforms/IPO/GlobalOpt.cpp</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">       </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">2 Nov 2006 20:25:50 -0000</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">     </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">1.71</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+++ lib/Transforms/IPO/GlobalOpt.cpp</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">18 Nov 2006 19:22:13 -0000</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">@@ -328,12 +328,11 @@ static bool CleanupConstantGlobalUsers(V</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (CE->getOpcode() == Instruction::GetElementPtr) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Constant *SubInit = 0;</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (Init)</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">           </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">SubInit = ConstantFoldLoadThroughGEPConstantExpr(Init, CE);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Changed |= CleanupConstantGlobalUsers(CE, SubInit);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">      </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">} else if (CE->getOpcode() == Instruction::Cast &&</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">- </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">                </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">isa<PointerType>(CE->getType())) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">      </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">} else if (CE->isCast() && isa<PointerType>(CE->getType())) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Pointer cast, delete any stores and memsets to the global.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Changed |= CleanupConstantGlobalUsers(CE, 0);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">}</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (CE->use_empty()) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">This only accepts bitcasts, please only check for bitcast.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">@@ -1173,11 +1172,11 @@ static void ShrinkGlobalToBoolean(Global</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">std::string Name = LI->getName(); LI->setName("");</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">LoadInst *NLI = new LoadInst(NewGV, Name+".b", LI);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Value *NSI;</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (IsOneZero)</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">NSI = new CastInst(NLI, LI->getType(), Name, LI);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">NSI = CastInst::getCast(NLI, LI->getType(), Name, LI);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">else</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">NSI = new SelectInst(NLI, OtherVal, InitVal, Name, LI);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">This cast is always a zext, please be explicit.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">--- lib/Transforms/IPO/InlineSimple.cpp</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">2 Nov 2006 20:25:50 -0000</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">     </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">1.75</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+++ lib/Transforms/IPO/InlineSimple.cpp</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">18 Nov 2006 19:22:13 -0000</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">@@ -141,16 +141,14 @@ void FunctionInfo::analyzeFunction(Funct</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">          </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">II != E; ++II) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (isa<DbgInfoIntrinsic>(II)) continue;</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Debug intrinsics don't count.</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Noop casts don't count.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (const CastInst *CI = dyn_cast<CastInst>(II)) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">const Type *OpTy = CI->getOperand(0)->getType();</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (CI->getType()->isLosslesslyConvertibleTo(OpTy))</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// FIXME: isNoopCast parameter should be TD->getIntPtrType()</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// to make accurate decisions about Ptr->Int and Int->Ptr casts.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (CI->isNoopCast(Type::ULongTy))</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">           </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">continue;</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if ((isa<PointerType>(CI->getType()) && OpTy->isInteger()) ||</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">            </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">(isa<PointerType>(OpTy) && CI->getType()->isInteger()))</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">          </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">continue;</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// ptr <-> int is *probably* noop cast.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">This is a heuristic check, please just use 'isa<BitCast> || isa<IntToPtr> || isa<PtrToInt>' for simplicity.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">--- lib/Transforms/Scalar/IndVarSimplify.cpp</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">21 Sep 2006 05:12:20 -0000</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">1.95</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+++ lib/Transforms/Scalar/IndVarSimplify.cpp</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">18 Nov 2006 19:22:15 -0000</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">@@ -521,13 +521,13 @@ void IndVarSimplify::runOnLoop(Loop *L)</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">InsertedSizes[LargestType->getPrimitiveSize()] = true;</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">for (unsigned i = 0, e = IndVars.size(); i != e; ++i)</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (!InsertedSizes[IndVars[i].first->getType()->getPrimitiveSize()]) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">PHINode *PN = IndVars[i].first;</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">InsertedSizes[PN->getType()->getPrimitiveSize()] = true;</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Instruction *New = new CastInst(IndVar,</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">                                        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">PN->getType()->getUnsignedVersion(),</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">                                        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">"indvar", InsertPt);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Instruction *New =</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">          </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">CastInst::getCast(IndVar, PN->getType()->getUnsignedVersion(),</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+ </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">                              </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">"indvar", InsertPt);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Rewriter.addInsertedValue(New, SE->getSCEV(New));</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">}</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">   </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">}</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px">These casts are always truncates.</P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">--- lib/Transforms/Scalar/LoopStrengthReduce.cpp</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">17 Nov 2006 06:17:33 -0000</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">1.94</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+++ lib/Transforms/Scalar/LoopStrengthReduce.cpp</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">18 Nov 2006 19:22:20 -0000</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">@@ -626,11 +626,11 @@ static bool isTargetConstant(const SCEVH</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">return (V > -(1 << 16) && V < (1 << 16)-1);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">   </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">}</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">   </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (SCEVUnknown *SU = dyn_cast<SCEVUnknown>(V))</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (ConstantExpr *CE = dyn_cast<ConstantExpr>(SU->getValue()))</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">      </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (CE->getOpcode() == Instruction::Cast) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">      </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (CE->isCast()) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Constant *Op0 = CE->getOperand(0);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (isa<GlobalValue>(Op0) &&</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">             </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">TLI &&</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">             </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">TLI->isLegalAddressImmediate(cast<GlobalValue>(Op0)))</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">           </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">return true;</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px">This should only be ptrtoint.</P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">--- lib/Transforms/Scalar/ScalarReplAggregates.cpp</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">       </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">8 Nov 2006 06:47:33 -0000</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">     </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">1.49</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+++ lib/Transforms/Scalar/ScalarReplAggregates.cpp</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">      </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">18 Nov 2006 19:22:21 -0000</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">@@ -649,13 +649,13 @@ void SROA::ConvertUsesToScalar(Value *Pt</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">                                      </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">"tmp", SI);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">} else {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">           </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// If SV is signed, convert it to unsigned, so that the next cast zero</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">           </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// extends the value.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">           </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (SV->getType()->isSigned())</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">            </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">SV = new CastInst(SV, SV->getType()->getUnsignedVersion(),</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">            </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">SV = CastInst::getCast(SV, SV->getType()->getUnsignedVersion(),</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">                               </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">SV->getName(), SI);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">          </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">SV = new CastInst(SV, Old->getType(), SV->getName(), SI);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">          </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">SV = CastInst::getCast(SV, Old->getType(), SV->getName(), SI);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">           </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (Offset && Offset < TD.getTypeSize(SV->getType())*8)</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">             </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">SV = new ShiftInst(Instruction::Shl, SV,</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">                                </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">ConstantInt::get(Type::UByteTy, Offset),</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">                                </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">SV->getName()+".adj", SI);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">           </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Mask out the bits we are about to insert from the old value.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">These two casts should just be:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">           </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Always zero extend the value.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"></SPAN></FONT>                     if (different size)<DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">   <SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN>         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">SV = new ZExtInst(SV, Old->getType(), SV->getName(), SI);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><SPAN class="Apple-tab-span" style="white-space:pre">            </SPAN>   else</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><SPAN class="Apple-tab-span" style="white-space:pre">                   </SPAN> SV = new BitCast(..)</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">           </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if (Offset && Offset < TD.getTypeSize(SV->getType())*8)</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">             </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">SV = new ShiftInst(Instruction::Shl, SV,</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">                                </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">ConstantInt::get(Type::UByteTy, Offset),</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">                                </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">SV->getName()+".adj", SI);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">           </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Mask out the bits we are about to insert from the old value.</SPAN></FONT></DIV><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">--- lib/Transforms/Utils/SimplifyCFG.cpp</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">       </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">8 Nov 2006 06:47:33 -0000</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">     </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">1.104</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+++ lib/Transforms/Utils/SimplifyCFG.cpp</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">       </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">18 Nov 2006 19:22:22 -0000</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">@@ -424,11 +424,11 @@ static Value *GatherConstantSetNEs(Value</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">return Inst->getOperand(0);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">} else if (ConstantInt *C = dyn_cast<ConstantInt>(Inst->getOperand(0))) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Values.push_back(C);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">         </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">return Inst->getOperand(1);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">}</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">} else if (Inst->getOpcode() == Instruction::Cast) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">+</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">} else if (Inst->isCast()) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Cast of X to bool is really a comparison against zero.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">assert(Inst->getType() == Type::BoolTy && "Can only handle bool values!");</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Values.push_back(ConstantInt::get(Inst->getOperand(0)->getType(), 0));</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">       </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">return Inst->getOperand(0);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">     </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">} else if (Inst->getOpcode() == Instruction::And) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">This is a serious bug.  Just remove this code entirely:</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">} </SPAN></FONT><FONT class="Apple-style-span" color="#760F50" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">else</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> </SPAN></FONT><FONT class="Apple-style-span" color="#760F50" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> (Inst->getOpcode() == Instruction::Cast) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">      </SPAN></FONT><FONT class="Apple-style-span" color="#236E25" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">// Cast of X to bool is really a comparison against zero.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">      </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">assert(Inst->getType() == Type::BoolTy && </SPAN></FONT><FONT class="Apple-style-span" color="#891315" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">"Can only handle bool values!"</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">      </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">Values.push_back(ConstantInt::get(Inst->getOperand(</SPAN></FONT><FONT class="Apple-style-span" color="#0000FF" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">0</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">)->getType(), </SPAN></FONT><FONT class="Apple-style-span" color="#0000FF" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">0</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">));</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">      </SPAN></FONT><FONT class="Apple-style-span" color="#760F50" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">return</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> Inst->getOperand(</SPAN></FONT><FONT class="Apple-style-span" color="#0000FF" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">0</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Comparisons against zero are now always setcc's.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">-Chris</DIV></BODY></HTML>