[PATCH] D111691: [instcombine] propagate single use freeze(gep inbounds X)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 13 09:07:03 PDT 2021


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LG



================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:5059
+    // inbounds is handled above
+    // TODO: what about inrange on constexpr?
+    return false;
----------------
reames wrote:
> For context here, inrange on a GEP operand is specified in a way which talks about UB triggered by uses.  It doesn't explicitly state that poison is produced, but that appears to be the most consistent reading (we probably need to change LangRef).  
> 
> inrange is only valid on constantexprs not instructions.  However, this routine is written in terms of Operator, so in theory a constant expr could reach this point.  
> 
> This issue exists in the previous code, I'm just adding the TODO since I reorganized it and was thinking about it.  
Yeah, this should be checking for inrange. Do you plan to follow up with that?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111691



More information about the llvm-commits mailing list