llvm-project
ef844525 - [DAGCombiner] Be more careful about looking through extends and truncates in mergeTruncStores. (#91375)

Commit
1 year ago
[DAGCombiner] Be more careful about looking through extends and truncates in mergeTruncStores. (#91375) Previously we recursively looked through extends and truncates on both SourceValue and WideVal. SourceValue is the largest source found for each of the stores we are combining. WideVal is the source for the current store. Previously we could incorrectly look through a (zext (trunc X)) pair and incorrectly believe X to be a good source. I think we could also look through a zext on one store and a sext on another store and arbitrarily pick one of the extends as the final source. With this patch we only look through one level of extend or truncate. And we don't look through extends/truncs on both SourceValue and WideVal at the same time. This may lose some optimization cases, but keeps everything we had tests for. Fixes #90936.
Author
Parents
Loading