<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>This patch includes two changes I'm not entirely certain of.</DIV><DIV><BR></DIV><DIV><SPAN class="Apple-style-span">First, in <I>PatternMatch.h</I>, the <FONT class="Apple-style-span" face="Andale Mono">m_Neg</FONT> matcher is incorrect for VP vectors. It matches <FONT class="Apple-style-span" face="Andale Mono">sub <<SPAN class="Apple-style-span" style="text-decoration: underline;">+</SPAN>0.0, <SPAN class="Apple-style-span" style="text-decoration: underline;">+</SPAN>0.0, ...>, %x</FONT> but the correct pattern is <FONT class="Apple-style-span" face="Andale Mono">sub <<SPAN class="Apple-style-span" style="text-decoration: underline;">-</SPAN>0.0, <SPAN class="Apple-style-span" style="text-decoration: underline;">-</SPAN>0.0, ...>, %x</FONT>. Since this matcher is dead, I simply commented it out with a note that it was broken. It would be simple to delete or fix it instead. (In fact, patch 4 includes just such a fix.)</SPAN></DIV><DIV><BR></DIV><DIV><SPAN class="Apple-style-span">Second, in <I>GlobalOpt.cpp</I>, the <FONT class="Apple-style-span" face="Andale Mono">ShrinkGlobalToBoolean</FONT> transformation excludes FP, but allows vectors. It doesn't explain why. FP exclusion was added last November to fix a crash, it looks like. I made it exclude vectors, too, but there's no overwhelming reason why.</SPAN></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-style-span">In addition to these, in <I>LowerSelect.cpp</I>:</SPAN></DIV><DIV><BR></DIV><DIV><FONT class="Apple-style-span" face="Andale Mono">bool LowerSelect::runOnFunction(Function &F) {</FONT></DIV><DIV><FONT class="Apple-style-span" face="Andale Mono">  bool Changed = false;</FONT></DIV><DIV><FONT class="Apple-style-span" face="Andale Mono">  for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)</FONT></DIV><DIV><FONT class="Apple-style-span" face="Andale Mono">    for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {</FONT></DIV><DIV><FONT class="Apple-style-span" face="Andale Mono">      if (SelectInst *SI = dyn_cast<SelectInst>(I))</FONT></DIV><DIV><FONT class="Apple-style-span" face="Andale Mono">        if (<SPAN class="Apple-style-span" style="text-decoration: underline;">!OnlyFP || SI->getType()->isFloatingPoint()</SPAN>) {</FONT></DIV><DIV><FONT class="Apple-style-span" face="Andale Mono">          // Split this basic block in half right before the select instruction.</FONT></DIV><DIV><BR></DIV><DIV><SPAN class="Apple-style-span">This pass is dead except for <FONT class="Apple-style-span" face="Andale Mono">opt -lowerselect</FONT>, so there's no client to say which (<FONT class="Apple-style-span" face="Andale Mono">isFloatingPoint</FONT> or <FONT class="Apple-style-span" face="Andale Mono">isFPOrFPVector</FONT>) is the correct behavior for the <FONT class="Apple-style-span" face="Andale Mono">OnlyFP</FONT> option. The pass could be deleted, the <FONT class="Apple-style-span" face="Andale Mono">OnlyFP</FONT> option deleted, the test switched to <FONT class="Apple-style-span" face="Andale Mono">!OnlyFP || SI->getType()->isFPOrFPVector()</FONT>, or the pass extended to lower any combination of FP and integer scalars and vectors. Or, of course, it could be left alone!</SPAN></DIV><DIV><DIV><BR class="khtml-block-placeholder"></DIV>— Gordon<BR class="Apple-interchange-newline"> </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV></BODY></HTML>