<html><head><base href="x-msg://4261/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 10, 2011, at 4:56 PM, Jin Gu Kang wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div ocsi="x"><div dir="ltr"><font color="#000000" size="2" face="Tahoma">Hi llvm-commits members</font></div><div dir="ltr"><font size="2" face="tahoma"></font> </div><div dir="ltr"><font size="2" face="tahoma"><div dir="ltr"><font size="2" face="Tahoma">when making replacement for GetElementPtr, I think inbounds factor is missed</font></div><div dir="ltr"><font size="2" face="Tahoma">so, I made a patch to consider inbounds factor as follows:</font></div></font></div></div></span></blockquote><div><br></div>Great catch.  I reworked the constantexpr interfaces to make this a bit easier (125365) and then fixed the bug in (125366).  Thanks!</div><div><br></div><div>-Chris</div><div><br></div><div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div ocsi="x"><div dir="ltr"><font size="2" face="tahoma"><div dir="ltr"><font face="tahoma"></font> </div><div dir="ltr">Index: lib/VMCore/Constants.cpp<br>===================================================================<br>--- lib/VMCore/Constants.cpp  (revision 125324)<br>+++ lib/VMCore/Constants.cpp  (working copy)<br>@@ -2106,8 +2106,12 @@<br>       if (Val == From) Val = To;<br>       Indices.push_back(Val);<br>     }<br>-    Replacement = ConstantExpr::getGetElementPtr(Pointer,<br>-                                                 &Indices[0], Indices.size());<br>+    if(cast<GEPOperator>(this)->isInBounds())<br>+      Replacement = ConstantExpr::getInBoundsGetElementPtr(Pointer,<br>+                                                  &Indices[0], Indices.size());<br>+    else<br>+      Replacement = ConstantExpr::getGetElementPtr(Pointer,<br>+                                                  &Indices[0], Indices.size());<br>   } else if (getOpcode() == Instruction::ExtractValue) {<br>     Constant *Agg = getOperand(0);<br>     if (Agg == From) Agg = To;<br></div><div dir="ltr">Please review the attached patch.<br></div><div dir="ltr"><font face="tahoma">Thank you,</font></div><div dir="ltr"><font face="tahoma">Jin-Gu Kang</font></div></font></div><span><patch.txt></span>_______________________________________________<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><br></div></span></blockquote></div><br></body></html>