A branch condition could be guarding an out of bounds access of the vector.
Details
- Reviewers
- None
Diff Detail
Event Timeline
It's not clear this is the right model for this. I agree we have to consider out of bounds indices (as specified by the LangRef), but perhaps we'd be better off treating the result as undef/poison as we do for other bits of undefined behaviour? I'm not really the right person to help debate this; you might want to get Sanjoy or David Majnemer involved. They tend to be really good with this family of issues.
LangRef says "If idx exceeds the length of val, the results are undefined." That implies that the operation itself isn't undefined behavior, and therefore it's safe to speculate.
That said, the current implementation of DAGTypeLegalizer::GetVectorElementPointer can lead to undefined behavior... so we need to either fix that to mask the index, or change LangRef. I would lean towards fixing GetVectorElementPointer.
lib/Analysis/ValueTracking.cpp | ||
---|---|---|
3239 | isa<Constant> doesn't prove anything useful. |
isa<Constant> doesn't prove anything useful.