!invariant.load semantics with potentially clobbering calls
authorPhilip Reames <listmail@philipreames.com>
Tue, 24 Mar 2015 23:54:54 +0000 (23:54 +0000)
committerPhilip Reames <listmail@philipreames.com>
Tue, 24 Mar 2015 23:54:54 +0000 (23:54 +0000)
commitc50bf46a2290d5131e9379a7499f5451b2fbe584
treec762415aa9688eeffc08cb170eecd29edc955747
parent4e86f54fdbcc375e14fdfc61ded8a97e8e030996
!invariant.load semantics with potentially clobbering calls

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.

Differential Revision: http://reviews.llvm.org/D8591

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233140 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/MemoryDependenceAnalysis.cpp
test/Transforms/GVN/invariant-load.ll