diff options
author | Chris Lattner <sabre@nondot.org> | 2008-12-02 08:16:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-12-02 08:16:11 +0000 |
commit | c89c6a964c6091e07a51a22ad8c1c38295eb8599 (patch) | |
tree | 25b7dadbca02585738e60166df68f32859d25d35 /test/Transforms/GVN/pre-load.ll | |
parent | 48dd644109d97a76288f0b5045f6aa6a3c075732 (diff) | |
download | external_llvm-c89c6a964c6091e07a51a22ad8c1c38295eb8599.zip external_llvm-c89c6a964c6091e07a51a22ad8c1c38295eb8599.tar.gz external_llvm-c89c6a964c6091e07a51a22ad8c1c38295eb8599.tar.bz2 |
Implement PRE of loads in the GVN pass with a pretty cheap and
straight-forward implementation. This does not require any extra
alias analysis queries beyond what we already do for non-local loads.
Some programs really really like load PRE. For example, SPASS triggers
this ~1000 times, ~300 times in 255.vortex, and ~1500 times on 403.gcc.
The biggest limitation to the implementation is that it does not split
critical edges. This is a huge killer on many programs and should be
addressed after the initial patch is enabled by default.
The implementation of this should incidentally speed up rejection of
non-local loads because it avoids creating the repl densemap in cases
when it won't be used for fully redundant loads.
This is currently disabled by default.
Before I turn this on, I need to fix a couple of miscompilations in
the testsuite, look at compile time performance numbers, and look at
perf impact. This is pretty close to ready though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/GVN/pre-load.ll')
-rw-r--r-- | test/Transforms/GVN/pre-load.ll | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Transforms/GVN/pre-load.ll b/test/Transforms/GVN/pre-load.ll new file mode 100644 index 0000000..bc3ec5b --- /dev/null +++ b/test/Transforms/GVN/pre-load.ll @@ -0,0 +1,18 @@ +; RUN: llvm-as < %s | opt -gvn -enable-load-pre | llvm-dis | grep {%PRE.rle = phi} + +define i32 @test(i32* %p, i1 %C) { +block1: + br i1 %C, label %block2, label %block3 + +block2: + br label %block4 + +block3: + %b = bitcast i32 0 to i32 + store i32 %b, i32* %p + br label %block4 + +block4: + %PRE = load i32* %p + ret i32 %PRE +} |