<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Please see below.<br><div><div>On Sep 10, 2014, at 11:33 PM, Gerolf Hoflehner <<a href="mailto:ghoflehner@apple.com">ghoflehner@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br>On Sep 10, 2014, at 8:36 PM, David Majnemer <<a href="mailto:david.majnemer@gmail.com">david.majnemer@gmail.com</a>> wrote:<br><br><blockquote type="cite">================<br>Comment at: lib/Transforms/InstCombine/InstCombineCompares.cpp:2459-2461<br>@@ +2458,5 @@<br>+  auto *IC = dyn_cast<ICmpInst>(BI->getCondition());<br>+  if (!IC || IC->getOperand(0) != SI)<br>+    return false;<br>+  return true;<br>+}<br>----------------<br>majnemer wrote:<br><blockquote type="cite">Gerolf wrote:<br><blockquote type="cite">majnemer wrote:<br><blockquote type="cite">You could make this `return IC && IC->getOperand(0) == SI;`<br><br>Are we interested in doing anything if the other operand to the `ICmpInst` is the `SelectInst`?<br></blockquote>No, rhs is expected to be a constant.<br></blockquote>Where do we check this?<br></blockquote></blockquote>Look at the condition that checks RHSC before we enter the select case.<br></div></blockquote><div>Looking at this again, it is better to handle the other operand also. It makes the function easier to read.</div><br><blockquote type="cite"><div style="font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br><blockquote type="cite">Thinking about this, isChainSelectCmpBranch is very specific to this transform; I think this makes more sense as a static function instead of a member function.<br></blockquote><br>That is true. It actually is very specific to the select-cmp pattern.<span class="Apple-converted-space"> </span><br><blockquote type="cite"><br><a href="http://reviews.llvm.org/D5258">http://reviews.llvm.org/D5258</a><br><br><br></blockquote><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a></div></blockquote></div><br></body></html>