llvm-project
9df1c81f - [SelectionDAG] Combine range metadata when loads are CSEd. (#146026)

Commit
169 days ago
[SelectionDAG] Combine range metadata when loads are CSEd. (#146026) When CSEing a load with an existing load with different range metadata, clear the range metadata on the existing load. This is conservative, alternatively we could calculate new range metadata using MDNode::getMostGenericRange. Without a test case I wasn't sure it was worth it. MDnode::getMostGenericRange takes a non-const MDNode*, but all of SelectionDAG uses const MDNode*. A const_cast will need to be used somewhere or we need to make the codebase consistent about whether MDNode pointers should be const or not. I'm sure this isn't the only place that needs to be updated to handle the CSE. Fixes #145363.
Author
Parents
Loading