diff options
author | Chris Lattner <sabre@nondot.org> | 2011-04-28 07:29:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-04-28 07:29:08 +0000 |
commit | 4034e14985af013f71f7884fa275415a3be27778 (patch) | |
tree | 1dce84546a8e65b2b9e6e3f2ec863eb41dc15984 /include | |
parent | 8f232d307ace42180961856f69541b95b3278295 (diff) | |
download | external_llvm-4034e14985af013f71f7884fa275415a3be27778.zip external_llvm-4034e14985af013f71f7884fa275415a3be27778.tar.gz external_llvm-4034e14985af013f71f7884fa275415a3be27778.tar.bz2 |
teach GVN to widen integer loads when they are overaligned, when doing an
wider load would allow elimination of subsequent loads, and when the wider
load is still a native integer type. This eliminates a ton of loads on
various benchmarks involving struct fields, though it is somewhat hobbled
by clang not being very aggressive about field alignment.
This is yet another step along the way towards resolving PR6627.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130390 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/MemoryDependenceAnalysis.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/Analysis/MemoryDependenceAnalysis.h b/include/llvm/Analysis/MemoryDependenceAnalysis.h index f2e3353..b56fe08 100644 --- a/include/llvm/Analysis/MemoryDependenceAnalysis.h +++ b/include/llvm/Analysis/MemoryDependenceAnalysis.h @@ -355,6 +355,20 @@ namespace llvm { BasicBlock::iterator ScanIt, BasicBlock *BB); + + /// getLoadLoadClobberFullWidthSize - This is a little bit of analysis that + /// looks at a memory location for a load (specified by MemLocBase, Offs, + /// and Size) and compares it against a load. If the specified load could + /// be safely widened to a larger integer load that is 1) still efficient, + /// 2) safe for the target, and 3) would provide the specified memory + /// location value, then this function returns the size in bytes of the + /// load width to use. If not, this returns zero. + static unsigned getLoadLoadClobberFullWidthSize(const Value *MemLocBase, + int64_t MemLocOffs, + unsigned MemLocSize, + const LoadInst *LI, + const TargetData &TD); + private: MemDepResult getCallSiteDependencyFrom(CallSite C, bool isReadOnlyCall, BasicBlock::iterator ScanIt, |