You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When instcombine replaces inttoptr(load intTy) to (load ptrTy) it drops the range information attached to the load.
More precisely, it replaces the range information with an inferior metadata.
The problem may lay into what the range information can represent, but we should fix that one way or another as this may result in suboptimal code.
The expected range seems to be preserved on trunk (16.0) so it this must have been fixed. It might be worth adding the test to the test suite if one doesn't cover this case yet.
Hi @msebor,
From what you shared it looks like the reason the range is correct is because no combine has been applied.
Maybe that was an intentional fix to preserve the range information or the reproducer is not enough to expose the issue anymore.
Those seem plausible. I don't have a way to track down the change that preserves the range. In traiging these old reports I've made the assumption that it's helpful to close those that are not reproducible. Please let me know if that's not so or feel free to reopen this report if you think it might still serve a purpose.
Extended Description
When instcombine replaces inttoptr(load intTy) to (load ptrTy) it drops the range information attached to the load.
More precisely, it replaces the range information with an inferior metadata.
The problem may lay into what the range information can represent, but we should fix that one way or another as this may result in suboptimal code.
Consider the following snippet:
The returned pointer is known to be between address 64 and address 65536.
After instcombine however, this information is lost and instead we have a less rich information that the pointer is non-null:
opt -S -instcombine ~/Downloads/instcombine_range.ll -o -
The text was updated successfully, but these errors were encountered: