[PATCH] D142872: Honor the fwrapv option when generating the inbounds GEP .

Umesh Kalappa via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 30 05:31:31 PST 2023


umesh.kalappa0 added a comment.

In D142872#4090304 <https://reviews.llvm.org/D142872#4090304>, @nikic wrote:

> CreateConstArrayGEP currently always creates an inbounds GEP. You need to modify it make inbounds optional or use a different method, not suppress it in the constant folding infrastructure.

Thank you very much for the feedback and

We tried calling other overload like "CreateConstGEP" ,but that didn't help due to  below call from "ConstantFoldGetElementPtr" ,that was recursive call from   "ConstantExpr::getGetElementPtr" .

>> return ConstantExpr::getGetElementPtr(PointeeTy, C, Idxs, /*InBounds=*/true, InRangeIndex);

So we thought of disabling the call like "ConstantExpr::getGetElementPtr"  with InBounds=true  for wrapv and changes  has its consensus so we end up changes that is shared  for review.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142872/new/

https://reviews.llvm.org/D142872



More information about the cfe-commits mailing list