This is an archive of the discontinued LLVM Phabricator instance.

!invariant.loads with potentially clobbering calls
ClosedPublic

Authored by reames on Mar 24 2015, 3:07 PM.

Details

Summary

A load from an invariant location is assumed to not alias any otherwise potentially aliasing stores. Our implementation only applied this rule to store instructions themselves whereas they it should apply for any memory accessing instruction. This results in both FRE and PRE becoming more effective at eliminating invariant loads.

Note that as a follow on change I will likely move this into AliasAnalysis itself. That's where the TBAA constant flag is handled and the semantics are essentially the same. I'd like to separate the semantic change from the refactoring and thus have extended the hack that's already in MemoryDependenceAnalysis for this change.

Diff Detail

Event Timeline

reames updated this revision to Diff 22604.Mar 24 2015, 3:07 PM
reames retitled this revision from to !invariant.loads with potentially clobbering calls.
reames updated this object.
reames edited the test plan for this revision. (Show Details)
reames added a subscriber: Unknown Object (MLST).
dberlin edited edge metadata.Mar 24 2015, 3:30 PM

Looks right to me

This revision was automatically updated to reflect the committed changes.