[ConstantFold] Fix inbounds inference on mismatching source element type
When inferring that a GEP of a global variable is inbounds because there is no notional overindexing, we need to check that the global value type and the GEP source element type match. This was not necessary with typed pointers (because we would have a bitcast in between), but is necessary with opaque pointers. We should be able to recover some of the safe cases by performing an offset based inbounds inference in DL-aware ConstantFolding.
Loading
Please sign in to comment