diff options
author | Chris Lattner <sabre@nondot.org> | 2004-09-19 18:45:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-09-19 18:45:45 +0000 |
commit | 1fb6e41822b37dc54f57a6ea81593a508e52f5a3 (patch) | |
tree | 3bdf0280b970b499db755f8ef660993ddd9ea3c7 | |
parent | c10acedb2d1758742099cc19e476b9562c4e6aac (diff) | |
download | external_llvm-1fb6e41822b37dc54f57a6ea81593a508e52f5a3.zip external_llvm-1fb6e41822b37dc54f57a6ea81593a508e52f5a3.tar.gz external_llvm-1fb6e41822b37dc54f57a6ea81593a508e52f5a3.tar.bz2 |
Instcombine now helps out with these
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16405 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Transforms/ScalarRepl/phinodepromote.ll | 6 | ||||
-rw-r--r-- | test/Transforms/ScalarRepl/select_promote.ll | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/test/Transforms/ScalarRepl/phinodepromote.ll b/test/Transforms/ScalarRepl/phinodepromote.ll index b0a3990..eca8903 100644 --- a/test/Transforms/ScalarRepl/phinodepromote.ll +++ b/test/Transforms/ScalarRepl/phinodepromote.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep alloca +; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | not grep alloca ; ; This tests to see if mem2reg can promote alloca instructions whose addresses ; are used by PHI nodes that are immediately loaded. The LLVM C++ front-end @@ -6,12 +6,14 @@ ; lvalues), so handling this simple extension is quite useful. ; ; This testcase is what the following program looks like when it reaches -; mem2reg: +; instcombine: ; ; template<typename T> ; const T& max(const T& a1, const T& a2) { return a1 < a2 ? a1 : a2; } ; int main() { return max(0, 1); } ; +; This test checks to make sure the combination of instcombine and mem2reg +; perform the transformation. int %main() { entry: diff --git a/test/Transforms/ScalarRepl/select_promote.ll b/test/Transforms/ScalarRepl/select_promote.ll index 18b55a8..11902cf 100644 --- a/test/Transforms/ScalarRepl/select_promote.ll +++ b/test/Transforms/ScalarRepl/select_promote.ll @@ -1,6 +1,7 @@ -; Test promotion of loads that use the result of a select instruction. +; Test promotion of loads that use the result of a select instruction. This +; should be simplified by the instcombine pass. -; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep alloca +; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | not grep alloca int %main() { %mem_tmp.0 = alloca int ; <int*> [#uses=3] |