diff options
| author | Daniel Berlin <dberlin@dberlin.org> | 2017-01-24 19:55:36 +0000 |
|---|---|---|
| committer | Daniel Berlin <dberlin@dberlin.org> | 2017-01-24 19:55:36 +0000 |
| commit | 390dfde0f37e696ed383d0bcf51dd12dbf49ca6b (patch) | |
| tree | 24fd839f78153348e426b248d2063ffbf7ecacd2 /llvm/test/Transforms | |
| parent | 47d2364a515d67c5d6fb26f4d844c56611e0e2db (diff) | |
| download | bcm5719-llvm-390dfde0f37e696ed383d0bcf51dd12dbf49ca6b.tar.gz bcm5719-llvm-390dfde0f37e696ed383d0bcf51dd12dbf49ca6b.zip | |
Remove the load hoisting code of MLSM, it is completely subsumed by GVNHoist
Summary:
GVNHoist performs all the optimizations that MLSM does to loads, in a
more general way, and in a faster time bound (MLSM is N^3 in most
cases, N^4 in a few edge cases).
This disables the load portion.
Note that the way ld_hoist_st_sink.ll is written makes one think that
the loads should be moved to the while.preheader block, but
1. Neither MLSM nor GVNHoist do it (they both move them to identical places).
2. MLSM couldn't possibly do it anyway, as the while.preheader block
is not the head of the diamond, while.body is. (GVNHoist could do it
if it was legal).
3. At a glance, it's not legal anyway because the in-loop load
conflict with the in-loop store, so the loads must stay in-loop.
I am happy to update the test to use update_test_checks so that
checking is tighter, just was going to do it as a followup.
Note that i can find no particular benefit to the store portion on any
real testcase/benchmark i have (even size-wise). If we really still
want it, i am happy to commit to writing a targeted store sinker, just
taking the code from the MemorySSA port of MergedLoadStoreMotion
(which is N^2 worst case, and N most of the time).
We can do what it does in a much better time bound.
We also should be both hoisting and sinking stores, not just sinking
them, anyway, since whether we should hoist or sink to merge depends
basically on luck of the draw of where the blockers are placed.
Nonetheless, i have left it alone for now.
Reviewers: chandlerc, davide
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D29079
llvm-svn: 292971
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/GVNHoist/ld_hoist1.ll (renamed from llvm/test/Transforms/InstMerge/ld_hoist1.ll) | 2 | ||||
| -rw-r--r-- | llvm/test/Transforms/GVNHoist/ld_hoist_st_sink.ll (renamed from llvm/test/Transforms/InstMerge/ld_hoist_st_sink.ll) | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/llvm/test/Transforms/InstMerge/ld_hoist1.ll b/llvm/test/Transforms/GVNHoist/ld_hoist1.ll index 74c8900b8ab..8d4698d87e6 100644 --- a/llvm/test/Transforms/InstMerge/ld_hoist1.ll +++ b/llvm/test/Transforms/GVNHoist/ld_hoist1.ll @@ -1,5 +1,5 @@ ; Test load hoist -; RUN: opt -basicaa -memdep -mldst-motion -S < %s | FileCheck %s +; RUN: opt -gvn-hoist -S < %s | FileCheck %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc_linux" diff --git a/llvm/test/Transforms/InstMerge/ld_hoist_st_sink.ll b/llvm/test/Transforms/GVNHoist/ld_hoist_st_sink.ll index 1d3f941882e..c85edc2d817 100644 --- a/llvm/test/Transforms/InstMerge/ld_hoist_st_sink.ll +++ b/llvm/test/Transforms/GVNHoist/ld_hoist_st_sink.ll @@ -1,6 +1,6 @@ ; Tests to make sure that loads and stores in a diamond get merged ; Loads are hoisted into the header. Stores sunks into the footer. -; RUN: opt -basicaa -memdep -mldst-motion -S < %s | FileCheck %s +; RUN: opt -gvn-hoist -S < %s | FileCheck %s target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" %struct.node = type { i64, %struct.node*, %struct.node*, %struct.node*, i64, %struct.arc*, i64, i64, i64 } @@ -41,7 +41,7 @@ if.then: ; preds = %while.body %4 = load i64, i64* %p, align 8 %add = add nsw i64 %4, %2 %p1 = getelementptr inbounds %struct.node, %struct.node* %node.020, i64 0, i32 6 -; CHECK-NOT: store i64 +; FIXME: store i64 store i64 %add, i64* %p1, align 8 br label %if.end @@ -61,13 +61,13 @@ if.else: ; preds = %while.body %8 = load i64, i64* %cost5, align 8 %sub = sub nsw i64 %6, %8 %p6 = getelementptr inbounds %struct.node, %struct.node* %node.020, i64 0, i32 6 -; CHECK-NOT: store i64 +; FIXME: store i64 store i64 %sub, i64* %p6, align 8 br label %if.end ; CHECK: if.end if.end: ; preds = %if.else, %if.then -; CHECK: store +; FIXME: store %inc = add nsw i64 %sum.019, 1 %node.0.in = getelementptr inbounds %struct.node, %struct.node* %node.020, i64 0, i32 2 %node.0 = load %struct.node*, %struct.node** %node.0.in, align 8 |

