diff options
author | Chris Lattner <sabre@nondot.org> | 2003-12-19 06:54:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-12-19 06:54:37 +0000 |
commit | bb8d661b2717e8af99f794397fdf890b5a6133e3 (patch) | |
tree | df4417ae4e67ab24cefd2c0f9850c73ae4d03c52 /test/Transforms/LICM | |
parent | 9e25906482a166be3356453285ce5f81027dc5a7 (diff) | |
download | llvm-bb8d661b2717e8af99f794397fdf890b5a6133e3.tar.gz llvm-bb8d661b2717e8af99f794397fdf890b5a6133e3.tar.bz2 llvm-bb8d661b2717e8af99f794397fdf890b5a6133e3.tar.xz |
New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10533 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LICM')
-rw-r--r-- | test/Transforms/LICM/sink_multiple.ll | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Transforms/LICM/sink_multiple.ll b/test/Transforms/LICM/sink_multiple.ll new file mode 100644 index 0000000000..888dfbe3a5 --- /dev/null +++ b/test/Transforms/LICM/sink_multiple.ll @@ -0,0 +1,19 @@ +; The loop sinker was running from the bottom of the loop to the top, causing +; it to miss opportunities to sink instructions that depended on sinking other +; instructions from the loop. Instead they got hoisted, which is better than +; leaving them in the loop, but increases register pressure pointlessly. + +; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -C1 getelementptr | grep Out: + +%Ty = type { int, int } +%X = external global %Ty + +int %test() { + br label %Loop +Loop: + %dead = getelementptr %Ty* %X, long 0, ubyte 0 + %sunk2 = load int* %dead + br bool false, label %Loop, label %Out +Out: + ret int %sunk2 +} |