This is a follow on for D111675 which implements the gep case. I'd originally left it out because I was hoping to actually implement the inrange todo, but after a bit of staring at the code, decided to leave it as is since it doesn't effect this use case (i.e. instcombine requires the op to freeze to be an instruction).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
5059 | 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. |
LG
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
5059 | Yeah, this should be checking for inrange. Do you plan to follow up with that? |
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
5059 | If you're happy with a change without a test, sure. I haven't figured out how to exercise this yet. I'm not signing up for the langref change though. :) |
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.