diff options
author | Chris Lattner <sabre@nondot.org> | 2003-02-22 22:20:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-02-22 22:20:19 +0000 |
commit | 96d20c57f3617af218e8aab6f0d69279e63ab9c1 (patch) | |
tree | 61f4f88676e441e8d876025904d9e4056facc497 /test/Transforms/LICM/scalar_promote.ll | |
parent | 420df9bc781eb4d37e95f6394ccebf5952b15878 (diff) | |
download | external_llvm-96d20c57f3617af218e8aab6f0d69279e63ab9c1.zip external_llvm-96d20c57f3617af218e8aab6f0d69279e63ab9c1.tar.gz external_llvm-96d20c57f3617af218e8aab6f0d69279e63ab9c1.tar.bz2 |
New testcase to check to see if LICM is performing scalar promotion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LICM/scalar_promote.ll')
-rw-r--r-- | test/Transforms/LICM/scalar_promote.ll | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Transforms/LICM/scalar_promote.ll b/test/Transforms/LICM/scalar_promote.ll new file mode 100644 index 0000000..817492e --- /dev/null +++ b/test/Transforms/LICM/scalar_promote.ll @@ -0,0 +1,21 @@ +; RUN: as < %s | opt -licm -stats 2>&1 | grep "memory locations promoted to register" + +%X = global int 7 + +void %testfunc(int %i) { + br label %Loop + +Loop: + %j = phi uint [0, %0], [%Next, %Loop] + + %x = load int* %X ; Should promote this to a register inside of loop! + %x2 = add int %x, 1 + store int %x2, int* %X + + %Next = add uint %j, 1 + %cond = seteq uint %Next, 0 + br bool %cond, label %Out, label %Loop + +Out: + ret void +} |