<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 24, 2011, at 3:00 PM, Frits van Bommel wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Thu, Feb 24, 2011 at 11:46 PM, Benjamin Kramer<br><<a href="mailto:benny.kra@googlemail.com">benny.kra@googlemail.com</a>> wrote:<br><blockquote type="cite">SimplifyCFG: GEPs with constant indices are cheap enough to be executed unconditionally.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">+  case Instruction::GetElementPtr:<br></blockquote><blockquote type="cite">+    // GEPs are cheap if all indices are constant.<br></blockquote><blockquote type="cite">+    if (!cast<GetElementPtrInst>(I)->hasAllConstantIndices())<br></blockquote><blockquote type="cite">+      return false;<br></blockquote><blockquote type="cite">+    break;<br></blockquote><blockquote type="cite">  case Instruction::Add:<br></blockquote><blockquote type="cite">  case Instruction::Sub:<br></blockquote><blockquote type="cite">  case Instruction::And:<br></blockquote><br>Since it also allows add/sub/etc., it should maybe also allow GEPs<br>with one non-constant index?<br></div></blockquote></div><br><div>A gep with one non-constant index is a multiply and an add. How</div><div>speculative are you feeling? ;-)</div><div><br></div><div>Dan</div><div><br></div></body></html>